]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_syncops. Implement linkat().
authorJeremy Allison <jra@samba.org>
Fri, 16 Aug 2019 23:04:02 +0000 (16:04 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 20 Aug 2019 21:09:28 +0000 (21:09 +0000)
Currently identical to link().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/modules/vfs_syncops.c

index 5764342c267d3291bac1bdc64f0591d311643ded..873b71f934c483f4d18b8a65e5eb6b9e5c75e155 100644 (file)
@@ -204,6 +204,38 @@ static int syncops_link(vfs_handle_struct *handle,
        return ret;
 }
 
+static int syncops_linkat(vfs_handle_struct *handle,
+                       files_struct *srcfsp,
+                       const struct smb_filename *old_smb_fname,
+                       files_struct *dstfsp,
+                       const struct smb_filename *new_smb_fname,
+                       int flags)
+{
+       int ret;
+       struct syncops_config_data *config;
+
+       SMB_VFS_HANDLE_GET_DATA(handle, config,
+                               struct syncops_config_data,
+                               return -1);
+
+       SMB_ASSERT(srcfsp == srcfsp->conn->cwd_fsp);
+       SMB_ASSERT(dstfsp == dstfsp->conn->cwd_fsp);
+
+       ret = SMB_VFS_NEXT_LINKAT(handle,
+                       srcfsp,
+                       old_smb_fname,
+                       dstfsp,
+                       new_smb_fname,
+                       flags);
+
+       if (ret == 0 && config->onmeta && !config->disable) {
+               syncops_two_names(old_smb_fname->base_name,
+                                 new_smb_fname->base_name);
+       }
+       return ret;
+}
+
+
 static int syncops_open(vfs_handle_struct *handle,
                        struct smb_filename *smb_fname, files_struct *fsp,
                        int flags, mode_t mode)
@@ -300,6 +332,7 @@ static struct vfs_fn_pointers vfs_syncops_fns = {
        .unlink_fn = syncops_unlink,
        .symlink_fn = syncops_symlink,
        .link_fn = syncops_link,
+       .linkat_fn = syncops_linkat,
        .mknod_fn = syncops_mknod,
        .close_fn = syncops_close,
 };