From: Jeremy Allison Date: Wed, 21 Aug 2019 18:36:48 +0000 (-0700) Subject: s3: VFS: vfs_full_audit. Implement mknodat(). X-Git-Tag: tevent-0.10.1~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6db33e35a868511fc4f9c602978b71fc115aae0c;p=thirdparty%2Fsamba.git s3: VFS: vfs_full_audit. Implement mknodat(). Currently identical to mknod(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 9ea9c01a306..3086296af16 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -155,6 +155,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_READLINK, SMB_VFS_OP_LINKAT, SMB_VFS_OP_MKNOD, + SMB_VFS_OP_MKNODAT, SMB_VFS_OP_REALPATH, SMB_VFS_OP_CHFLAGS, SMB_VFS_OP_FILE_ID_CREATE, @@ -298,6 +299,7 @@ static struct { { SMB_VFS_OP_READLINK, "readlink" }, { SMB_VFS_OP_LINKAT, "linkat" }, { SMB_VFS_OP_MKNOD, "mknod" }, + { SMB_VFS_OP_MKNODAT, "mknodat" }, { SMB_VFS_OP_REALPATH, "realpath" }, { SMB_VFS_OP_CHFLAGS, "chflags" }, { SMB_VFS_OP_FILE_ID_CREATE, "file_id_create" }, @@ -1791,6 +1793,26 @@ static int smb_full_audit_mknod(vfs_handle_struct *handle, return result; } +static int smb_full_audit_mknodat(vfs_handle_struct *handle, + files_struct *dirfsp, + const struct smb_filename *smb_fname, + mode_t mode, + SMB_DEV_T dev) +{ + int result; + + result = SMB_VFS_NEXT_MKNODAT(handle, + dirfsp, + smb_fname, + mode, + dev); + + do_log(SMB_VFS_OP_MKNODAT, (result >= 0), handle, "%s", + smb_fname->base_name); + + return result; +} + static struct smb_filename *smb_full_audit_realpath(vfs_handle_struct *handle, TALLOC_CTX *ctx, const struct smb_filename *smb_fname) @@ -2886,6 +2908,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .readlink_fn = smb_full_audit_readlink, .linkat_fn = smb_full_audit_linkat, .mknod_fn = smb_full_audit_mknod, + .mknodat_fn = smb_full_audit_mknodat, .realpath_fn = smb_full_audit_realpath, .chflags_fn = smb_full_audit_chflags, .file_id_create_fn = smb_full_audit_file_id_create,