From: Jeremy Allison Date: Wed, 17 Mar 2021 04:50:08 +0000 (-0700) Subject: s3: VFS: time_audit: Log full pathname as smb_time_audit_create_dfs_pathat() isn... X-Git-Tag: tevent-0.11.0~1436 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f38f886ffa0845626de4d94e45685376f790d46;p=thirdparty%2Fsamba.git s3: VFS: time_audit: Log full pathname as smb_time_audit_create_dfs_pathat() isn't restricted to dirfsp->conn->cwd_fsp anymore. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power --- diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 4c7f65020b1..175da80ff84 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -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; }