samba-cvs.cvs
[Top] [All Lists]

[SCM] Samba Shared Repository - branch master updated - 3e1d6c60201a2514

Subject: [SCM] Samba Shared Repository - branch master updated - 3e1d6c60201a2514dc54b4992b034a954b330c65
From: Jeremy Allison
Date: Mon, 13 Oct 2008 16:10:07 -0500 CDT
The branch, master has been updated
       via  3e1d6c60201a2514dc54b4992b034a954b330c65 (commit)
      from  2b1bef7e87e62ff4cb744b1f4564a8fc425f34e2 (commit)

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


- Log -----------------------------------------------------------------
commit 3e1d6c60201a2514dc54b4992b034a954b330c65
Author: Holger Hetterich <hhetter@xxxxxxxxxx>
Date:   Mon Oct 13 14:08:49 2008 -0700

    Enable optional anonymization of user names,
    if the configuration parameter anonymization_prefix is defined in
    smb.conf, and use the prefix given there.

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

Summary of changes:
 source3/modules/vfs_smb_traffic_analyzer.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_smb_traffic_analyzer.c 
b/source3/modules/vfs_smb_traffic_analyzer.c
index 9b4c1b3..be77fc4 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -42,6 +42,7 @@ static enum sock_type 
smb_traffic_analyzer_connMode(vfs_handle_struct *handle)
        }
 }
 
+
 /* Connect to an internet socket */
 
 static int smb_traffic_analyzer_connect_inet_socket(vfs_handle_struct *handle,
@@ -160,6 +161,8 @@ static void 
smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
        struct tm *tm = NULL;
        int seconds;
        char *str = NULL;
+       char *username = NULL;
+       const char *anon_prefix = NULL;
        size_t len;
 
        SMB_VFS_HANDLE_GET_DATA(handle, rf_sock, struct refcounted_sock, 
return);
@@ -178,11 +181,31 @@ static void 
smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
        }
        seconds=(float) (tv.tv_usec / 1000);
 
+       /* check if anonymization is required */
+       
+       
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 ) 
); 
+       } else {
+               username = talloc_asprintf(talloc_tos(),
+                       "%s",
+                       handle->conn->server_info->sanitized_username);
+       }               
+
+       if (!username) {
+               return;
+       }                                       
+
        str = talloc_asprintf(talloc_tos(),
                        "V1,%u,\"%s\",\"%s\",\"%c\",\"%s\",\"%s\","
                        "\"%04d-%02d-%02d %02d:%02d:%02d.%03d\"\n",
                        (unsigned int)result,
-                       handle->conn->server_info->sanitized_username,
+                       username,
                        pdb_get_domain(handle->conn->server_info->sam_account),
                        Write ? 'W' : 'R',
                        handle->conn->connectpath,


-- 
Samba Shared Repository

<Prev in Thread] Current Thread [Next in Thread>
  • [SCM] Samba Shared Repository - branch master updated - 3e1d6c60201a2514dc54b4992b034a954b330c65, Jeremy Allison <=