From: Jeremy Allison Date: Fri, 9 Aug 2019 22:33:08 +0000 (-0700) Subject: s3: VFS: vfs_syncops. Implement renameat(). X-Git-Tag: tdb-1.4.2~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=588e64ddd02cb6b63184d5edffe7b5f2432232d8;p=thirdparty%2Fsamba.git s3: VFS: vfs_syncops. Implement renameat(). Currently identical to rename(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index 0a51fdf6e7a..6d5144eecaa 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -147,6 +147,32 @@ static int syncops_rename(vfs_handle_struct *handle, return ret; } +static int syncops_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 ret; + struct syncops_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct syncops_config_data, + return -1); + + ret = SMB_VFS_NEXT_RENAMEAT(handle, + srcfsp, + smb_fname_src, + dstfsp, + smb_fname_dst); + if (ret == 0 && config->onmeta && !config->disable) { + syncops_two_names(smb_fname_src->base_name, + smb_fname_dst->base_name); + } + return ret; +} + #define SYNCOPS_NEXT_SMB_FNAME(op, fname, args) do { \ int ret; \ struct syncops_config_data *config; \ @@ -291,6 +317,7 @@ static struct vfs_fn_pointers vfs_syncops_fns = { .rmdir_fn = syncops_rmdir, .open_fn = syncops_open, .rename_fn = syncops_rename, + .renameat_fn = syncops_renameat, .unlink_fn = syncops_unlink, .symlink_fn = syncops_symlink, .link_fn = syncops_link,