[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-886-g4261cae

Jeremy Allison jra at samba.org
Sat Feb 14 01:23:16 GMT 2009


The branch, master has been updated
       via  4261cae2eb8779df1b8940f044fff4215d45358f (commit)
      from  bcdf345df98ed356d94588f4617280450ff6e890 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4261cae2eb8779df1b8940f044fff4215d45358f
Author: Holger Hetterich <hhetter at novell.com>
Date:   Wed Feb 4 15:31:24 2009 +0100

    Enable total anonymization in vfs_smb_traffic_analyzer, by mapping any user names to the one given by anonymize_prefix, without generating a hash number. This setting is optional and is compatible with the module configuration format of Samba 3.3.

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml |   11 ++++++++++
 source3/modules/vfs_smb_traffic_analyzer.c         |   21 +++++++++++++++----
 2 files changed, 27 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml b/docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml
index 556fa3e..3a16b61 100644
--- a/docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml
+++ b/docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml
@@ -117,6 +117,17 @@
 		</listitem>
 		</varlistentry>
 
+		<varlistentry>
+		<term>smb_traffic_analyzer:total_anonymization = STRING</term>
+		<listitem>
+		<para>If STRING matches to 'yes', the module will replace
+		any user name with the string given by the option 
+		smb_traffic_analyzer:anonymize_prefix, without generating
+		an additional hash number. This means that any transfer data
+		will be mapped to a single user, leading to a total 
+		anonymization of user related data.</para>
+		</listitem>
+		</varlistentry>
 
 	</variablelist>
 </refsect1>
diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c
index 3ac5a49..a7fbead 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -165,6 +165,7 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
 	char *str = NULL;
 	char *username = NULL;
 	const char *anon_prefix = NULL;
+	const char *total_anonymization = NULL;
 	size_t len;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, rf_sock, struct refcounted_sock, return);
@@ -185,14 +186,24 @@ static void smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
 
 	/* check if anonymization is required */
 
+	total_anonymization=lp_parm_const_string(SNUM(handle->conn),"smb_traffic_analyzer",
+					"total_anonymization", NULL);
+
 	anon_prefix=lp_parm_const_string(SNUM(handle->conn),"smb_traffic_analyzer",\
 					"anonymize_prefix", NULL );
 	if (anon_prefix!=NULL) {
-		username = talloc_asprintf(talloc_tos(),
-			"%s%i",
-			anon_prefix,
-			str_checksum(
-				handle->conn->server_info->sanitized_username )	); 
+		if (total_anonymization!=NULL) {
+			username = talloc_asprintf(talloc_tos(),
+				"%s",
+				anon_prefix);
+		} else {
+			username = talloc_asprintf(talloc_tos(),
+				"%s%i",
+				anon_prefix,
+				str_checksum(
+					handle->conn->server_info->sanitized_username )	); 
+		}
+
 	} else {
 		username = handle->conn->server_info->sanitized_username;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list