From: Jeremy Allison Date: Mon, 25 Jan 2021 20:48:28 +0000 (-0800) Subject: VFS: time_audit: Fixup smb_time_audit_symlinkat() to log the dirfsp path. X-Git-Tag: tevent-0.11.0~1950 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e9bb2d760a3bde81a1bd2ffcb052381e72c6635;p=thirdparty%2Fsamba.git VFS: time_audit: Fixup smb_time_audit_symlinkat() to log the dirfsp path. Missed in my original fixes. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index cc5039fed7c..fe22197f429 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -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; }