]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_full_audit. Implement mknodat().
authorJeremy Allison <jra@samba.org>
Wed, 21 Aug 2019 18:36:48 +0000 (11:36 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 22 Aug 2019 18:00:34 +0000 (18:00 +0000)
Currently identical to mknod().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/modules/vfs_full_audit.c

index 9ea9c01a306f1a30c41cd7f36fab14513eb188ae..3086296af166c0444a20a56308eca48c0760f198 100644 (file)
@@ -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,