]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: time_audit: Log full pathname as smb_time_audit_create_dfs_pathat() isn...
authorJeremy Allison <jra@samba.org>
Wed, 17 Mar 2021 04:50:08 +0000 (21:50 -0700)
committerNoel Power <npower@samba.org>
Mon, 22 Mar 2021 18:37:34 +0000 (18:37 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power<npower@samba.org>
source3/modules/vfs_time_audit.c

index 4c7f65020b1c57738c24a3af785bdd497448dbea..175da80ff84cc6ff2a9164feb080e6c2592758e9 100644 (file)
@@ -332,6 +332,14 @@ static NTSTATUS smb_time_audit_create_dfs_pathat(struct vfs_handle_struct *handl
        NTSTATUS result;
        struct timespec ts1,ts2;
        double timediff;
+       struct smb_filename *full_fname = NULL;
+
+       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
+                                                 dirfsp,
+                                                 smb_fname);
+       if (full_fname == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
 
        clock_gettime_mono(&ts1);
        result = SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
@@ -343,9 +351,11 @@ static NTSTATUS smb_time_audit_create_dfs_pathat(struct vfs_handle_struct *handl
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
        if (timediff > audit_timeout) {
-               smb_time_audit_log("get_dfs_referrals", timediff);
+               smb_time_audit_log_smb_fname("create_dfs_pathat",
+                       timediff,
+                       full_fname);
        }
-
+       TALLOC_FREE(full_fname);
        return result;
 }