From: Ralph Boehme Date: Wed, 20 Jan 2021 14:19:59 +0000 (+0100) Subject: vfs_time_audit: support real dirfsps in smb_time_audit_unlinkat() X-Git-Tag: tevent-0.11.0~1922 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f81bec1b7f32e267302e84ead5a1340d3aafb95a;p=thirdparty%2Fsamba.git vfs_time_audit: support real dirfsps in smb_time_audit_unlinkat() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index fe22197f429..a56839c77ad 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -1100,10 +1100,18 @@ static int smb_time_audit_unlinkat(vfs_handle_struct *handle, const struct smb_filename *path, int flags) { + struct smb_filename *full_fname = NULL; int result; struct timespec ts1,ts2; double timediff; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + path); + if (full_fname == NULL) { + return -1; + } + clock_gettime_mono(&ts1); result = SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, @@ -1113,9 +1121,10 @@ static int smb_time_audit_unlinkat(vfs_handle_struct *handle, timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; if (timediff > audit_timeout) { - smb_time_audit_log_smb_fname("unlinkat", timediff, path); + smb_time_audit_log_smb_fname("unlinkat", timediff, full_fname); } + TALLOC_FREE(full_fname); return result; }