summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorHolger Hetterich <hhetter@novell.com>2009-02-04 15:31:24 +0100
committerKarolin Seeger <kseeger@samba.org>2009-02-16 09:57:05 +0100
commitb2faf96cf737a3169e90d90939248d74f1fb3fc9 (patch)
treec37c409eb265bd01db0795cb2c70f825319f3041 /source
parente88029414fddb77c30c5efa2ca6c1c6e5c8d2e81 (diff)
downloadsamba-b2faf96cf737a3169e90d90939248d74f1fb3fc9.tar.gz
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.
(cherry picked from commit 31d854fff40799f056748333c35df81466c3614c)
Diffstat (limited to 'source')
-rw-r--r--source/modules/vfs_smb_traffic_analyzer.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source/modules/vfs_smb_traffic_analyzer.c b/source/modules/vfs_smb_traffic_analyzer.c
index 63cc904bed1..a5599baa12c 100644
--- a/source/modules/vfs_smb_traffic_analyzer.c
+++ b/source/modules/vfs_smb_traffic_analyzer.c
@@ -164,6 +164,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);
@@ -184,14 +185,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;
}