The branch, master has been updated
       via  042249d95ff s3: VFS: Implement create_dfs_pathat() in catia.
       via  fa2f83e13aa s3: VFS: Implement create_dfs_pathat() in catia.
      from  677bc1b1842 s4:torture: Skip the deltest20 as user root

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 042249d95ff59d304cf37914860ee0c4d1f546f8
Author: Jeremy Allison <[email protected]>
Date:   Tue Jan 28 14:59:46 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in catia.
    
    Now we use this instead of symlinks to create
    DFS links, it's needed in cap.
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>
    
    Autobuild-User(master): Ralph Böhme <[email protected]>
    Autobuild-Date(master): Thu Jan 30 18:21:47 UTC 2020 on sn-devel-184

commit fa2f83e13aa92a12bd8d0113576a04a1e4431a44
Author: Jeremy Allison <[email protected]>
Date:   Tue Jan 28 14:42:49 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in catia.
    
    Now we use this instead of symlinks to create
    DFS links, it's needed in catia.
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_cap.c   | 35 ++++++++++++++++++++++++++++++++++-
 source3/modules/vfs_catia.c | 40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index f1ec5807b49..bc6daeccca7 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -976,6 +976,38 @@ static int cap_fsetxattr(vfs_handle_struct *handle, struct 
files_struct *fsp, co
         return SMB_VFS_NEXT_FSETXATTR(handle, fsp, cappath, value, size, 
flags);
 }
 
+static NTSTATUS cap_create_dfs_pathat(vfs_handle_struct *handle,
+                       files_struct *dirfsp,
+                       const struct smb_filename *smb_fname,
+                       const struct referral *reflist,
+                       size_t referral_count)
+{
+       char *cappath = capencode(talloc_tos(), smb_fname->base_name);
+       struct smb_filename *cap_smb_fname = NULL;
+       NTSTATUS status;
+
+       if (cappath == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
+       cap_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       cappath,
+                                       NULL,
+                                       NULL,
+                                       smb_fname->flags);
+       if (cap_smb_fname == NULL) {
+               TALLOC_FREE(cappath);
+               return NT_STATUS_NO_MEMORY;
+       }
+       status = SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
+                       dirfsp,
+                       cap_smb_fname,
+                       reflist,
+                       referral_count);
+       TALLOC_FREE(cappath);
+       TALLOC_FREE(cap_smb_fname);
+       return status;
+}
+
 static struct vfs_fn_pointers vfs_cap_fns = {
        .disk_free_fn = cap_disk_free,
        .get_quota_fn = cap_get_quota,
@@ -1007,7 +1039,8 @@ static struct vfs_fn_pointers vfs_cap_fns = {
        .removexattr_fn = cap_removexattr,
        .fremovexattr_fn = cap_fremovexattr,
        .setxattr_fn = cap_setxattr,
-       .fsetxattr_fn = cap_fsetxattr
+       .fsetxattr_fn = cap_fsetxattr,
+       .create_dfs_pathat_fn = cap_create_dfs_pathat
 };
 
 static_decl_vfs;
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 23246c72be2..1739fd77d5b 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -2365,6 +2365,45 @@ static NTSTATUS catia_set_dos_attributes(struct 
vfs_handle_struct *handle,
        return status;
 }
 
+static NTSTATUS catia_create_dfs_pathat(struct vfs_handle_struct *handle,
+                       struct files_struct *dirfsp,
+                       const struct smb_filename *smb_fname,
+                       const struct referral *reflist,
+                       size_t referral_count)
+{
+       char *mapped_name = NULL;
+       const char *path = smb_fname->base_name;
+       struct smb_filename *mapped_smb_fname = NULL;
+       NTSTATUS status;
+
+       status = catia_string_replace_allocate(handle->conn,
+                                       path,
+                                       &mapped_name,
+                                       vfs_translate_to_unix);
+       if (!NT_STATUS_IS_OK(status)) {
+               errno = map_errno_from_nt_status(status);
+               return status;
+       }
+       mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
+                                       mapped_name,
+                                       NULL,
+                                       &smb_fname->st,
+                                       smb_fname->flags);
+       if (mapped_smb_fname == NULL) {
+               TALLOC_FREE(mapped_name);
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       status = SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
+                                       dirfsp,
+                                       mapped_smb_fname,
+                                       reflist,
+                                       referral_count);
+       TALLOC_FREE(mapped_name);
+       TALLOC_FREE(mapped_smb_fname);
+       return status;
+}
+
 static struct vfs_fn_pointers vfs_catia_fns = {
        .connect_fn = catia_connect,
 
@@ -2415,6 +2454,7 @@ static struct vfs_fn_pointers vfs_catia_fns = {
        .fget_dos_attributes_fn = catia_fget_dos_attributes,
        .get_compression_fn = catia_get_compression,
        .set_compression_fn = catia_set_compression,
+       .create_dfs_pathat_fn = catia_create_dfs_pathat,
 
        /* NT ACL operations. */
        .get_nt_acl_fn = catia_get_nt_acl,


-- 
Samba Shared Repository

Reply via email to