summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2008-11-23 14:37:37 -0800
committerTim Prouty <tprouty@samba.org>2008-12-03 17:50:57 -0800
commit61b4597e3c9016b3fdd540857abf3b72963ad4b2 (patch)
treee5735c648f322841962db553e4d0f20ca7ad6b68
parentf995a7af2a06ccff29f23f1b099e0a84bc948f6e (diff)
downloadsamba-61b4597e3c9016b3fdd540857abf3b72963ad4b2.tar.gz
samba-61b4597e3c9016b3fdd540857abf3b72963ad4b2.tar.bz2
samba-61b4597e3c9016b3fdd540857abf3b72963ad4b2.zip
s3: Add SMB_VFS_CREATE_FILE to vfs_full_audit module
-rw-r--r--source3/modules/vfs_full_audit.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 6342c4a14e..fd97a4ccff 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -109,6 +109,23 @@ static int smb_full_audit_closedir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp);
static int smb_full_audit_open(vfs_handle_struct *handle,
const char *fname, files_struct *fsp, int flags, mode_t mode);
+static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
+ struct smb_request *req,
+ uint16_t root_dir_fid,
+ const char *fname,
+ bool is_dos_path,
+ uint32_t access_mask,
+ uint32_t share_access,
+ uint32_t create_disposition,
+ uint32_t create_options,
+ uint32_t file_attributes,
+ uint32_t oplock_request,
+ uint64_t allocation_size,
+ struct security_descriptor *sd,
+ struct ea_list *ea_list,
+ files_struct **result,
+ int *pinfo,
+ SMB_STRUCT_STAT *psbuf);
static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp);
static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
void *data, size_t n);
@@ -353,6 +370,8 @@ static vfs_op_tuple audit_op_tuples[] = {
{SMB_VFS_OP(smb_full_audit_open), SMB_VFS_OP_OPEN,
SMB_VFS_LAYER_LOGGER},
+ {SMB_VFS_OP(smb_full_audit_create_file),SMB_VFS_OP_CREATE_FILE,
+ SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_close), SMB_VFS_OP_CLOSE,
SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_read), SMB_VFS_OP_READ,
@@ -1087,6 +1106,51 @@ static int smb_full_audit_open(vfs_handle_struct *handle,
return result;
}
+static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
+ struct smb_request *req,
+ uint16_t root_dir_fid,
+ const char *fname,
+ bool is_dos_path,
+ uint32_t access_mask,
+ uint32_t share_access,
+ uint32_t create_disposition,
+ uint32_t create_options,
+ uint32_t file_attributes,
+ uint32_t oplock_request,
+ uint64_t allocation_size,
+ struct security_descriptor *sd,
+ struct ea_list *ea_list,
+ files_struct **result_fsp,
+ int *pinfo,
+ SMB_STRUCT_STAT *psbuf)
+{
+ NTSTATUS result;
+
+ result = SMB_VFS_NEXT_CREATE_FILE(
+ handle, /* handle */
+ req, /* req */
+ root_dir_fid, /* root_dir_fid */
+ fname, /* fname */
+ is_dos_path, /* is_dos_path */
+ access_mask, /* access_mask */
+ share_access, /* share_access */
+ create_disposition, /* create_disposition*/
+ create_options, /* create_options */
+ file_attributes, /* file_attributes */
+ oplock_request, /* oplock_request */
+ allocation_size, /* allocation_size */
+ sd, /* sd */
+ ea_list, /* ea_list */
+ result_fsp, /* result */
+ pinfo, /* pinfo */
+ psbuf); /* psbuf */
+
+ do_log(SMB_VFS_OP_CREATE_FILE, (NT_STATUS_IS_OK(result)), handle, "0x%x|%s",
+ access_mask, fname);
+
+ return result;
+}
+
static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp)
{
int result;