[PATCH] vfs_smb_traffic_analyzer shall also transfer the clients IP address.

Holger Hetterich hhetter at novell.com
Sun Feb 13 10:20:00 MST 2011


---
 source3/modules/vfs_smb_traffic_analyzer.c |   10 +++++++---
 source3/modules/vfs_smb_traffic_analyzer.h |    2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c
index 6b41aff..f58990c 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -20,6 +20,7 @@
  */
 
 #include "includes.h"
+#include "../smbd/globals.h"
 #include "../lib/crypto/crypto.h"
 #include "vfs_smb_traffic_analyzer.h"
 #include "../libcli/security/security.h"
@@ -299,6 +300,7 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx,
 	char *timestr = NULL;
 	char *sidstr = NULL;
 	char *usersid = NULL;
+	char *ip = NULL;
 	char *buf = NULL;
 	char *vfs_operation_str = NULL;
 	const char *service_name = lp_const_servicename(handle->conn->params->service);
@@ -313,6 +315,7 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx,
 	 * 4.affected share
 	 * 5.domain
 	 * 6.timestamp
+	 * 7.IP Addresss of client
 	 */
 
 	/*
@@ -348,10 +351,9 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx,
 		tm->tm_sec, \
 		(int)seconds);
 	len = strlen( timestr );
-
 	/* create the string of common data */
 	buf = talloc_asprintf(ctx,
-		"%s%04u%s%04u%s%04u%s%04u%s%04u%s%04u%s",
+		"%s%04u%s%04u%s%04u%s%04u%s%04u%s%04u%s%04u%s",
 		common_data_count_str,
 		(unsigned int) strlen(vfs_operation_str),
 		vfs_operation_str,
@@ -365,7 +367,9 @@ static char *smb_traffic_analyzer_create_string( TALLOC_CTX *ctx,
 		strlen(handle->conn->server_info->info3->base.domain.string),
 		handle->conn->server_info->info3->base.domain.string,
 		(unsigned int) strlen(timestr),
-		timestr);
+		timestr,
+		(unsigned int) strlen(handle->conn->sconn->client_id.addr),
+		handle->conn->sconn->client_id.addr);
 
 	talloc_free(common_data_count_str);
 
diff --git a/source3/modules/vfs_smb_traffic_analyzer.h b/source3/modules/vfs_smb_traffic_analyzer.h
index 3f47ea5..bfc0614 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.h
+++ b/source3/modules/vfs_smb_traffic_analyzer.h
@@ -85,7 +85,7 @@
  * so that if the receiver is using an older version of the protocol
  * it knows which blocks it can ignore.
  */
-#define SMBTA_COMMON_DATA_COUNT "00016"
+#define SMBTA_COMMON_DATA_COUNT "00017"
 
 /*
  * VFS Functions identifier table. In protocol version 2, every vfs
-- 
1.7.1


--=-Oqd7TEP19k3aLO6guzS/
Content-Disposition: attachment; filename*0=v3-6-test-0001-vfs_smb_traffic_analyzer-shall-also-transfer-t; filename*1=he-cli.patch
Content-Type: text/x-patch; name*0=v3-6-test-0001-vfs_smb_traffic_analyzer-shall-also-transfer-the-c; name*1=li.patch; charset="UTF-8"
Content-Transfer-Encoding: 7bit



More information about the samba-technical mailing list