]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
VFS: time_audit: Fixup smb_time_audit_symlinkat() to log the dirfsp path.
authorJeremy Allison <jra@samba.org>
Mon, 25 Jan 2021 20:48:28 +0000 (12:48 -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_time_audit.c

index cc5039fed7c7c03386da1c017858731c275b86a2..fe22197f429bacae02b9a49c838a123d8fa56a2d 100644 (file)
@@ -1424,10 +1424,19 @@ static int smb_time_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;
        struct timespec ts1,ts2;
        double timediff;
 
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                               dirfsp,
+                                               new_smb_fname);
+       if (full_fname == NULL) {
+               errno = ENOMEM;
+               return -1;
+       }
+
        clock_gettime_mono(&ts1);
        result = SMB_VFS_NEXT_SYMLINKAT(handle,
                                link_contents,
@@ -1438,9 +1447,10 @@ static int smb_time_audit_symlinkat(vfs_handle_struct *handle,
 
        if (timediff > audit_timeout) {
                smb_time_audit_log_fname("symlinkat", timediff,
-                       new_smb_fname->base_name);
+                       full_fname->base_name);
        }
 
+       TALLOC_FREE(full_fname);
        return result;
 }