]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_full_audit: support real dirfsps in smb_full_audit_mkdirat()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 14:55:04 +0000 (15:55 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:29 +0000 (18:56 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_full_audit.c

index 0350df868a574a2c67d5a19422ca06e7044def09..5c601b2c66b3280f40f10e2e024a6461d513b9a0 100644 (file)
@@ -1051,8 +1051,17 @@ static int smb_full_audit_mkdirat(vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        mode_t mode)
 {
+       struct smb_filename *full_fname = NULL;
        int result;
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                                 dirfsp,
+                                                 smb_fname);
+       if (full_fname == NULL) {
+               errno = ENOMEM;
+               return -1;
+       }
+
        result = SMB_VFS_NEXT_MKDIRAT(handle,
                        dirfsp,
                        smb_fname,
@@ -1062,7 +1071,9 @@ static int smb_full_audit_mkdirat(vfs_handle_struct *handle,
               (result >= 0),
               handle,
               "%s",
-              smb_fname_str_do_log(handle->conn, smb_fname));
+              smb_fname_str_do_log(handle->conn, full_fname));
+
+       TALLOC_FREE(full_fname);
 
        return result;
 }