From f82e89c26edfa625bad600c66186215551f6dd3a Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 20 Jan 2021 15:01:23 +0100 Subject: [PATCH] vfs_extd_audit.c: support real dirfsps in audit_unlinkat() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/modules/vfs_extd_audit.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c index daf88672862..45e8f1c5b3b 100644 --- a/source3/modules/vfs_extd_audit.c +++ b/source3/modules/vfs_extd_audit.c @@ -309,8 +309,16 @@ static int audit_unlinkat(vfs_handle_struct *handle, const struct smb_filename *smb_fname, int flags) { + struct smb_filename *full_fname = NULL; int result; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + return -1; + } + result = SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, smb_fname, @@ -318,15 +326,16 @@ static int audit_unlinkat(vfs_handle_struct *handle, if (lp_syslog() > 0) { syslog(audit_syslog_priority(handle), "unlinkat %s %s%s\n", - smb_fname->base_name, + full_fname->base_name, (result < 0) ? "failed: " : "", (result < 0) ? strerror(errno) : ""); } DBG_ERR("unlinkat %s %s %s\n", - smb_fname_str_dbg(smb_fname), + smb_fname_str_dbg(full_fname), (result < 0) ? "failed: " : "", (result < 0) ? strerror(errno) : ""); + TALLOC_FREE(full_fname); return result; } -- 2.11.4.GIT