summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortprouty <tprouty@b72e2a10-2d34-0410-9a71-d3beadf02b57>2009-08-26 01:38:07 +0000
committerTim Prouty <tprouty@samba.org>2009-08-26 10:41:54 -0700
commit22ee1cd7dbcd07470c915343872ee83ae90e3511 (patch)
tree8a2c4a16c549e715b5c99a20bf5d1f39a4fdf285
parentd49ab9226f849d1f08f7cf83956d35cf4950906e (diff)
downloadsamba-22ee1cd7dbcd07470c915343872ee83ae90e3511.tar.gz
samba-22ee1cd7dbcd07470c915343872ee83ae90e3511.tar.bz2
samba-22ee1cd7dbcd07470c915343872ee83ae90e3511.zip
s3 audit: Change create_file in full_audit to print whether a directory or file was requested
full_audit will now print out whether the createfile was requested for a file or directory. The create disposition is also printed out.
-rw-r--r--source3/modules/vfs_full_audit.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 6930a5573f..667db7a4bd 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -855,6 +855,30 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
int *pinfo)
{
NTSTATUS result;
+ const char* str_create_disposition;
+
+ switch (create_disposition) {
+ case FILE_SUPERSEDE:
+ str_create_disposition = "supersede";
+ break;
+ case FILE_OVERWRITE_IF:
+ str_create_disposition = "overwrite_if";
+ break;
+ case FILE_OPEN:
+ str_create_disposition = "open";
+ break;
+ case FILE_OVERWRITE:
+ str_create_disposition = "overwrite";
+ break;
+ case FILE_CREATE:
+ str_create_disposition = "create";
+ break;
+ case FILE_OPEN_IF:
+ str_create_disposition = "open_if";
+ break;
+ default:
+ str_create_disposition = "unknown";
+ }
result = SMB_VFS_NEXT_CREATE_FILE(
handle, /* handle */
@@ -873,8 +897,10 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
result_fsp, /* result */
pinfo); /* pinfo */
- do_log(SMB_VFS_OP_CREATE_FILE, (NT_STATUS_IS_OK(result)), handle, "0x%x|%s",
- access_mask, smb_fname_str_do_log(smb_fname));
+ do_log(SMB_VFS_OP_CREATE_FILE, (NT_STATUS_IS_OK(result)), handle,
+ "0x%x|%s|%s|%s", access_mask,
+ create_options & FILE_DIRECTORY_FILE ? "dir" : "file",
+ str_create_disposition, smb_fname_str_do_log(smb_fname));
return result;
}