]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_full_audit. Implement symlinkat().
authorJeremy Allison <jra@samba.org>
Fri, 30 Aug 2019 20:48:03 +0000 (13:48 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 3 Sep 2019 21:15:42 +0000 (21:15 +0000)
Currently identical to symlink().

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

index 2f74c4ccc4aea7b88f6212c33ab3d688c3cbae11..702f05ed792529a40671cf130296b7c14aa9b3d6 100644 (file)
@@ -152,6 +152,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_LINUX_SETLEASE,
        SMB_VFS_OP_GETLOCK,
        SMB_VFS_OP_SYMLINK,
+       SMB_VFS_OP_SYMLINKAT,
        SMB_VFS_OP_READLINKAT,
        SMB_VFS_OP_LINKAT,
        SMB_VFS_OP_MKNODAT,
@@ -295,6 +296,7 @@ static struct {
        { SMB_VFS_OP_LINUX_SETLEASE, "linux_setlease" },
        { SMB_VFS_OP_GETLOCK,   "getlock" },
        { SMB_VFS_OP_SYMLINK,   "symlink" },
+       { SMB_VFS_OP_SYMLINKAT, "symlinkat" },
        { SMB_VFS_OP_READLINKAT,"readlinkat" },
        { SMB_VFS_OP_LINKAT,    "linkat" },
        { SMB_VFS_OP_MKNODAT,   "mknodat" },
@@ -1739,6 +1741,24 @@ static int smb_full_audit_symlink(vfs_handle_struct *handle,
        return result;
 }
 
+static int smb_full_audit_symlinkat(vfs_handle_struct *handle,
+                       const char *link_contents,
+                       struct files_struct *dirfsp,
+                       const struct smb_filename *new_smb_fname)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_SYMLINKAT(handle,
+                               link_contents,
+                               dirfsp,
+                               new_smb_fname);
+
+       do_log(SMB_VFS_OP_SYMLINKAT, (result >= 0), handle,
+              "%s|%s", link_contents, new_smb_fname->base_name);
+
+       return result;
+}
+
 static int smb_full_audit_readlinkat(vfs_handle_struct *handle,
                        files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -2893,6 +2913,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .linux_setlease_fn = smb_full_audit_linux_setlease,
        .getlock_fn = smb_full_audit_getlock,
        .symlink_fn = smb_full_audit_symlink,
+       .symlinkat_fn = smb_full_audit_symlinkat,
        .readlinkat_fn = smb_full_audit_readlinkat,
        .linkat_fn = smb_full_audit_linkat,
        .mknodat_fn = smb_full_audit_mknodat,