From 99fc004e409ba5e535f1662e92370952777e55ff Mon Sep 17 00:00:00 2001 From: Holger Hetterich Date: Thu, 18 Feb 2010 15:13:59 +0100 Subject: s3: vfs_full_audit.c: implement negated vfs_ops in the success/failure list Supports negated arguments in configuration like: full_audit:success = all !readdir !telldir !closedir Update the manpage accordingly. Part of BSO#4025 --- source3/modules/vfs_full_audit.c | 55 ++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 24 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 19ac7adaed..8a40f6712c 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -433,56 +433,65 @@ static bool log_failure(vfs_handle_struct *handle, vfs_op_type op) static void init_bitmap(struct bitmap **bm, const char **ops) { - bool log_all = False; + if (*bm != NULL) { + return; + } - if (*bm != NULL) + if (ops == NULL) { + *bm = NULL; return; + } *bm = bitmap_allocate(SMB_VFS_OP_LAST); - if (*bm == NULL) { DEBUG(0, ("Could not alloc bitmap -- " "defaulting to logging everything\n")); return; } - while (*ops != NULL) { + for (; *ops != NULL; ops += 1) { int i; - bool found = False; + bool neg = false; + const char *op; if (strequal(*ops, "all")) { - log_all = True; - break; + for (i=0; isuccess_ops, lp_parm_string_list(SNUM(handle->conn), "full_audit", "success", - none)); + NULL)); init_bitmap(&pd->failure_ops, lp_parm_string_list(SNUM(handle->conn), "full_audit", "failure", - all)); + NULL)); /* Store the private data. */ SMB_VFS_HANDLE_SET_DATA(handle, pd, free_private_data, -- cgit