Enable total anonymization in vfs_smb_traffic_analyzer, by mapping any user names...
authorHolger Hetterich <hhetter@novell.com>
Wed, 4 Feb 2009 14:31:24 +0000 (15:31 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 14 Feb 2009 01:22:25 +0000 (17:22 -0800)
docs-xml/manpages-3/vfs_smb_traffic_analyzer.8.xml
source3/modules/vfs_smb_traffic_analyzer.c

index 556fa3e86ea084a212f329121d532f92bebb1b82..3a16b612100d7f228d69e77832ce305f0d79023e 100644 (file)
                </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>
index 3ac5a4971b7cb5153ac9ffdbd0beeb30a380df01..a7fbeadbbe09c06dd8edcf0764b1881949285185 100644 (file)
@@ -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;
        }