VFS: full_audit: Fixup smb_full_audit_symlinkat() to log the dirfsp path.
authorJeremy Allison <jra@samba.org>
Mon, 25 Jan 2021 20:02:48 +0000 (12:02 -0800)
committerRalph Boehme <slow@samba.org>
Thu, 28 Jan 2021 07:03:30 +0000 (07:03 +0000)
Missed in my original fixes.

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

index 9e1df7354682cdbfb3df0b6e80d4d8b02d79050b..82ad6368a49f74b2b3e78bd22c008d43a0a87562 100644 (file)
@@ -1804,8 +1804,16 @@ static int smb_full_audit_symlinkat(vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *new_smb_fname)
 {
+       struct smb_filename *full_fname = NULL;
        int result;
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                               dirfsp,
+                                               new_smb_fname);
+       if (full_fname == NULL) {
+               return -1;
+       }
+
        result = SMB_VFS_NEXT_SYMLINKAT(handle,
                                link_contents,
                                dirfsp,
@@ -1816,7 +1824,9 @@ static int smb_full_audit_symlinkat(vfs_handle_struct *handle,
               handle,
               "%s|%s",
               link_contents->base_name,
-              smb_fname_str_do_log(handle->conn, new_smb_fname));
+              smb_fname_str_do_log(handle->conn, full_fname));
+
+       TALLOC_FREE(full_fname);
 
        return result;
 }