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

s3: VFS: vfs_full_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-09 14:25:21 -07:00
parent 8d8faa53fc
commit 4d74ed6f56

View File

@ -129,6 +129,7 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_SENDFILE,
SMB_VFS_OP_RECVFILE,
SMB_VFS_OP_RENAME,
SMB_VFS_OP_RENAMEAT,
SMB_VFS_OP_FSYNC,
SMB_VFS_OP_FSYNC_SEND,
SMB_VFS_OP_FSYNC_RECV,
@ -272,6 +273,7 @@ static struct {
{ SMB_VFS_OP_SENDFILE, "sendfile" },
{ SMB_VFS_OP_RECVFILE, "recvfile" },
{ SMB_VFS_OP_RENAME, "rename" },
{ SMB_VFS_OP_RENAMEAT, "renameat" },
{ SMB_VFS_OP_FSYNC, "fsync" },
{ SMB_VFS_OP_FSYNC_SEND, "fsync_send" },
{ SMB_VFS_OP_FSYNC_RECV, "fsync_recv" },
@ -1364,6 +1366,27 @@ static int smb_full_audit_rename(vfs_handle_struct *handle,
return result;
}
static int smb_full_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);
do_log(SMB_VFS_OP_RENAMEAT, (result >= 0), handle, "%s|%s",
smb_fname_str_do_log(handle->conn, smb_fname_src),
smb_fname_str_do_log(handle->conn, smb_fname_dst));
return result;
}
struct smb_full_audit_fsync_state {
vfs_handle_struct *handle;
files_struct *fsp;
@ -2847,6 +2870,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.sendfile_fn = smb_full_audit_sendfile,
.recvfile_fn = smb_full_audit_recvfile,
.rename_fn = smb_full_audit_rename,
.renameat_fn = smb_full_audit_renameat,
.fsync_send_fn = smb_full_audit_fsync_send,
.fsync_recv_fn = smb_full_audit_fsync_recv,
.stat_fn = smb_full_audit_stat,