From 4e9bb2d760a3bde81a1bd2ffcb052381e72c6635 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 25 Jan 2021 12:48:28 -0800 Subject: [PATCH] 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 --- source3/modules/vfs_time_audit.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; } -- 2.11.4.GIT