summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-16 23:02:29 +0100
committerGünther Deschner <gd@samba.org>2010-03-16 23:03:51 +0100
commitf48fb0d908dec53e407c9cd0f843ee7d83e31580 (patch)
tree44a094099932ebffaa739ba243854c89c6d8ee30
parent2b4ce9a73f6b041f3cc69125e45b9f61e0155ff5 (diff)
downloadsamba-f48fb0d908dec53e407c9cd0f843ee7d83e31580.tar.gz
samba-f48fb0d908dec53e407c9cd0f843ee7d83e31580.tar.bz2
samba-f48fb0d908dec53e407c9cd0f843ee7d83e31580.zip
s3-vfs: fix some buildwarnings in traffic analyzer, there are many more.
Holger, please check. Guenther
-rw-r--r--source3/modules/vfs_smb_traffic_analyzer.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c
index 0db3848783..35a0ccbd87 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -198,7 +198,7 @@ static char *smb_traffic_analyzer_create_header( TALLOC_CTX *ctx,
char *header = talloc_asprintf( ctx, "V2.%s%017u",
state_flags, data_len);
DEBUG(10, ("smb_traffic_analyzer_send_data_socket: created Header:\n"));
- dump_data(10, header, strlen(header));
+ dump_data(10, (uint8_t *)header, strlen(header));
return header;
}
@@ -211,18 +211,18 @@ static char *smb_traffic_analyzer_create_header( TALLOC_CTX *ctx,
* int socket
*/
static void smb_traffic_analyzer_write_data( char *header, char *data,
- int dlength, int socket)
+ int dlength, int _socket)
{
int len = strlen(header);
- if (write_data( socket, header, len) != len) {
+ if (write_data( _socket, header, len) != len) {
DEBUG(1, ("smb_traffic_analyzer_send_data_socket: "
"error sending the header"
" over the socket!\n"));
}
DEBUG(10,("smb_traffic_analyzer_write_data: sending data:\n"));
- dump_data( 10, data, dlength);
+ dump_data( 10, (uint8_t *)data, dlength);
- if (write_data( socket, data, dlength) != dlength) {
+ if (write_data( _socket, data, dlength) != dlength) {
DEBUG(1, ("smb_traffic_analyzer_write_data: "
"error sending crypted data to socket!\n"));
}
@@ -292,7 +292,6 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx,
va_list ap;
char *arg = NULL;
int len;
- char *header = NULL;
char *common_data_count_str = NULL;
char *timestr = NULL;
char *sidstr = NULL;
@@ -395,6 +394,8 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
const char *protocol_version = NULL;
bool Write = false;
size_t len;
+ size_t size;
+ char *akey, *output;
/*
* The state flags are part of the header
@@ -559,15 +560,14 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
* If configured, optain the key and run AES encryption
* over the data.
*/
- size_t size;
become_root();
- char *akey = (char *) secrets_fetch("smb_traffic_analyzer_key", &size);
+ akey = (char *) secrets_fetch("smb_traffic_analyzer_key", &size);
unbecome_root();
if ( akey != NULL ) {
state_flags[2] = 'E';
DEBUG(10, ("smb_traffic_analyzer_send_data_socket: a key was"
" found, encrypting data!\n"));
- char *output = smb_traffic_analyzer_encrypt( talloc_tos(),
+ output = smb_traffic_analyzer_encrypt( talloc_tos(),
akey, str, &len);
header = smb_traffic_analyzer_create_header( talloc_tos(),
state_flags, len);
@@ -708,6 +708,7 @@ static int smb_traffic_analyzer_rename(vfs_handle_struct *handle, \
return s_data.result;
}
+#if 0
static int smb_traffic_analyzer_rmdir(vfs_handle_struct *handle, \
const char *path)
{
@@ -718,6 +719,7 @@ static int smb_traffic_analyzer_rmdir(vfs_handle_struct *handle, \
smb_traffic_analyzer_send_data(handle, &s_data, vfs_id_rmdir);
return s_data.result;
}
+#endif
static int smb_traffic_analyzer_mkdir(vfs_handle_struct *handle, \
const char *path, mode_t mode)