From: Jeremy Allison Date: Wed, 3 Feb 2021 21:59:00 +0000 (-0800) Subject: s3: VFS: time_audit: Fix smb_time_audit_linkat() to cope with real directory fsps. X-Git-Tag: tevent-0.11.0~1791 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=005cbeae174a94d981c56b73ec616e9598a7efc5;p=thirdparty%2Fsamba.git s3: VFS: time_audit: Fix smb_time_audit_linkat() to cope with real directory fsps. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index a56839c77ad..db9e9d3cf12 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -1497,10 +1497,19 @@ static int smb_time_audit_linkat(vfs_handle_struct *handle, const struct smb_filename *new_smb_fname, int flags) { + struct smb_filename *new_full_fname = NULL; int result; struct timespec ts1,ts2; double timediff; + new_full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dstfsp, + new_smb_fname); + if (new_full_fname == NULL) { + errno = ENOMEM; + return -1; + } + clock_gettime_mono(&ts1); result = SMB_VFS_NEXT_LINKAT(handle, srcfsp, @@ -1513,9 +1522,10 @@ static int smb_time_audit_linkat(vfs_handle_struct *handle, if (timediff > audit_timeout) { smb_time_audit_log_fname("linkat", timediff, - new_smb_fname->base_name); + new_full_fname->base_name); } + TALLOC_FREE(new_full_fname); return result; }