From 4489b4cee448e5ed6816e6a0587e5194455d35ae Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 4 Apr 2016 16:27:05 -0700 Subject: [PATCH] s3: vfs: full_audit. Add audit_file_fn(). Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source3/modules/vfs_full_audit.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 7bceff555fb..dd1593923b8 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -187,7 +187,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_OP_GET_NT_ACL, SMB_VFS_OP_FSET_NT_ACL, - /* Missing audit_file */ + SMB_VFS_OP_AUDIT_FILE, /* POSIX ACL operations. */ @@ -326,7 +326,7 @@ static struct { { SMB_VFS_OP_FGET_NT_ACL, "fget_nt_acl" }, { SMB_VFS_OP_GET_NT_ACL, "get_nt_acl" }, { SMB_VFS_OP_FSET_NT_ACL, "fset_nt_acl" }, - /* Missing audit_file */ + { SMB_VFS_OP_AUDIT_FILE, "audit_file" }, { SMB_VFS_OP_CHMOD_ACL, "chmod_acl" }, { SMB_VFS_OP_FCHMOD_ACL, "fchmod_acl" }, { SMB_VFS_OP_SYS_ACL_GET_FILE, "sys_acl_get_file" }, @@ -2106,6 +2106,26 @@ static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_stru return result; } +static NTSTATUS smb_full_audit_audit_file(struct vfs_handle_struct *handle, + struct smb_filename *file, + struct security_acl *sacl, + uint32_t access_requested, + uint32_t access_denied) +{ + NTSTATUS result; + + result = SMB_VFS_NEXT_AUDIT_FILE(handle, + file, + sacl, + access_requested, + access_denied); + + do_log(SMB_VFS_OP_AUDIT_FILE, NT_STATUS_IS_OK(result), handle, + "%s", smb_fname_str_do_log(file)); + + return result; +} + static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode) @@ -2474,9 +2494,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .fget_nt_acl_fn = smb_full_audit_fget_nt_acl, .get_nt_acl_fn = smb_full_audit_get_nt_acl, .fset_nt_acl_fn = smb_full_audit_fset_nt_acl, - - /* Missing audit_file_fn */ - + .audit_file_fn = smb_full_audit_audit_file, .chmod_acl_fn = smb_full_audit_chmod_acl, .fchmod_acl_fn = smb_full_audit_fchmod_acl, .sys_acl_get_file_fn = smb_full_audit_sys_acl_get_file, -- 2.47.3