VFS: full_audit: Fixup smb_full_audit_mknodat() to log the dirfsp path.
authorJeremy Allison <jra@samba.org>
Wed, 20 Jan 2021 19:51:16 +0000 (11:51 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 21 Jan 2021 21:48:30 +0000 (21:48 +0000)
Missed in my original fixes.

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

index 5e1572bcb47f29b09a9cc8a113874eec582d5e01..9e1df7354682cdbfb3df0b6e80d4d8b02d79050b 100644 (file)
@@ -1876,8 +1876,16 @@ static int smb_full_audit_mknodat(vfs_handle_struct *handle,
                        mode_t mode,
                        SMB_DEV_T dev)
 {
+       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_MKNODAT(handle,
                                dirfsp,
                                smb_fname,
@@ -1888,7 +1896,9 @@ static int smb_full_audit_mknodat(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;
 }