summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2021-01-20 15:01:23 +0100
committerJeremy Allison <jra@samba.org>2021-01-28 08:11:49 +0000
commitf82e89c26edfa625bad600c66186215551f6dd3a (patch)
treedf5f429cdc55b2fe8960948ead304aef9702eb98
parent2a51ed753edf868a967c7bfad1bd9f44bbf98fb0 (diff)
downloadsamba-f82e89c26edfa625bad600c66186215551f6dd3a.tar.gz
vfs_extd_audit.c: support real dirfsps in audit_unlinkat()
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/modules/vfs_extd_audit.c13
1 files 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;
}