s3: VFS: full_audit. In smb_full_audit_read_dfs_pathat(), cope with relative pathnames.
authorJeremy Allison <jra@samba.org>
Tue, 13 Jul 2021 00:01:34 +0000 (17:01 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 14 Jul 2021 08:09:31 +0000 (08:09 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_full_audit.c

index 5dbfb19f4c0b9fa528d42ff1cc8f1d6990b63aaf..ceda99d4568ab316baeea4c5669f5556d40309d3 100644 (file)
@@ -919,8 +919,16 @@ static NTSTATUS smb_full_audit_read_dfs_pathat(struct vfs_handle_struct *handle,
                        struct referral **ppreflist,
                        size_t *preferral_count)
 {
+       struct smb_filename *full_fname = NULL;
        NTSTATUS status;
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                                 dirfsp,
+                                                 smb_fname);
+       if (full_fname == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
        status = SMB_VFS_NEXT_READ_DFS_PATHAT(handle,
                        mem_ctx,
                        dirfsp,
@@ -932,8 +940,9 @@ static NTSTATUS smb_full_audit_read_dfs_pathat(struct vfs_handle_struct *handle,
                NT_STATUS_IS_OK(status),
                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 status;
 }