From: Jeremy Allison Date: Thu, 11 Feb 2021 19:49:24 +0000 (-0800) Subject: s3: VFS: time_audit: Fix smb_time_audit_readlinkat() to cope with real directory... X-Git-Tag: tevent-0.11.0~1754 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9077983ff9114bac227350b60c388bc19cf22bd0;p=thirdparty%2Fsamba.git s3: VFS: time_audit: Fix smb_time_audit_readlinkat() to cope with real directory fsps. 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 db9e9d3cf12..4e2aa404fa9 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -1469,10 +1469,19 @@ static int smb_time_audit_readlinkat(vfs_handle_struct *handle, char *buf, size_t bufsiz) { + struct smb_filename *full_fname = NULL; int result; struct timespec ts1,ts2; double timediff; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + errno = ENOMEM; + return -1; + } + clock_gettime_mono(&ts1); result = SMB_VFS_NEXT_READLINKAT(handle, dirfsp, @@ -1484,9 +1493,10 @@ static int smb_time_audit_readlinkat(vfs_handle_struct *handle, if (timediff > audit_timeout) { smb_time_audit_log_fname("readlinkat", timediff, - smb_fname->base_name); + full_fname->base_name); } + TALLOC_FREE(full_fname); return result; }