vfs_full_audit: support real dirfsps in smb_full_audit_unlinkat()
authorRalph Boehme <slow@samba.org>
Wed, 20 Jan 2021 14:02:03 +0000 (15:02 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 28 Jan 2021 08:11:49 +0000 (08:11 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_full_audit.c

index 82ad6368a49f74b2b3e78bd22c008d43a0a87562..71577c8aaeb62fa24eb0a4f5c2f87d884076f36e 100644 (file)
@@ -1551,16 +1551,25 @@ static int smb_full_audit_unlinkat(vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        int flags)
 {
+       struct smb_filename *full_fname = NULL;
        int result;
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                                 dirfsp,
+                                                 smb_fname);
+       if (full_fname == NULL) {
+               return -1;
+       }
+
        result = SMB_VFS_NEXT_UNLINKAT(handle,
                        dirfsp,
                        smb_fname,
                        flags);
 
        do_log(SMB_VFS_OP_UNLINKAT, (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;
 }