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

s3: VFS: vfs_audit. Implement renameat().

Currently identical to rename().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2019-08-08 15:30:54 -07:00
parent 606398a3a6
commit 365b81238e

View File

@ -273,6 +273,30 @@ static int audit_rename(vfs_handle_struct *handle,
return result;
}
static int audit_renameat(vfs_handle_struct *handle,
files_struct *srcfsp,
const struct smb_filename *smb_fname_src,
files_struct *dstfsp,
const struct smb_filename *smb_fname_dst)
{
int result;
result = SMB_VFS_NEXT_RENAMEAT(handle,
srcfsp,
smb_fname_src,
dstfsp,
smb_fname_dst);
syslog(audit_syslog_priority(handle), "renameat %s -> %s %s%s\n",
smb_fname_src->base_name,
smb_fname_dst->base_name,
(result < 0) ? "failed: " : "",
(result < 0) ? strerror(errno) : "");
return result;
}
static int audit_unlink(vfs_handle_struct *handle,
const struct smb_filename *smb_fname)
{
@ -327,6 +351,7 @@ static struct vfs_fn_pointers vfs_audit_fns = {
.open_fn = audit_open,
.close_fn = audit_close,
.rename_fn = audit_rename,
.renameat_fn = audit_renameat,
.unlink_fn = audit_unlink,
.chmod_fn = audit_chmod,
.fchmod_fn = audit_fchmod,