]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_syncops. Implement symlinkat().
authorJeremy Allison <jra@samba.org>
Fri, 30 Aug 2019 21:00:12 +0000 (14:00 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 3 Sep 2019 21:15:43 +0000 (21:15 +0000)
Currently identical to symlink().

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

index 04a0180a2fbf2ebfb7cfaf00764ac847a3688dc4..e8169bac1a94fdbed09699c7599674ba0572be09 100644 (file)
@@ -185,6 +185,30 @@ static int syncops_symlink(vfs_handle_struct *handle,
        return ret;
 }
 
+static int syncops_symlinkat(vfs_handle_struct *handle,
+                       const char *link_contents,
+                       struct files_struct *dirfsp,
+                       const struct smb_filename *new_smb_fname)
+{
+       int ret;
+       struct syncops_config_data *config;
+
+       SMB_VFS_HANDLE_GET_DATA(handle, config,
+                               struct syncops_config_data,
+                               return -1);
+
+       ret = SMB_VFS_NEXT_SYMLINKAT(handle,
+                               link_contents,
+                               dirfsp,
+                               new_smb_fname);
+
+       if (ret == 0 && config->onmeta && !config->disable) {
+               syncops_two_names(link_contents,
+                                 new_smb_fname->base_name);
+       }
+       return ret;
+}
+
 static int syncops_linkat(vfs_handle_struct *handle,
                        files_struct *srcfsp,
                        const struct smb_filename *old_smb_fname,
@@ -318,6 +342,7 @@ static struct vfs_fn_pointers vfs_syncops_fns = {
        .renameat_fn = syncops_renameat,
        .unlink_fn = syncops_unlink,
        .symlink_fn = syncops_symlink,
+       .symlinkat_fn = syncops_symlinkat,
        .linkat_fn = syncops_linkat,
        .mknodat_fn = syncops_mknodat,
        .close_fn = syncops_close,