1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

vfs_audit: support real dirfsps in audit_unlinkat()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2021-01-20 14:56:50 +01:00 committed by Jeremy Allison
parent c454697eb3
commit 9838dd21a1

View File

@ -270,18 +270,27 @@ 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,
flags);
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) : "");
TALLOC_FREE(full_fname);
return result;
}