The branch, master has been updated
       via  748379c66bc s3: smbd: msdfs: Change create_msdfs_link() to call 
SMB_VFS_CREATE_DFS_PATHAT().
       via  54f9da44356 s3: VFS: Implement create_dfs_pathat() in time_audit.
       via  23df92810b3 s3: VFS: Implement create_dfs_pathat() in full_audit.
       via  51fd8756616 s3: VFS: Implement create_dfs_pathat() in snapper.
       via  6a46c5f207d s3: VFS: Implement create_dfs_pathat() in shadow_copy2.
       via  235e59481d9 s3: VFS: Implement create_dfs_pathat() in gluster.
       via  421d26a890f s3: VFS: Implement create_dfs_pathat() in ceph.
       via  b0b9dd2f869 s3: VFS: Add SMB_VFS_CREATE_DFS_PATHAT().
      from  86a31defbf2 ndr basic: Check ndr_token_store return code

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


- Log -----------------------------------------------------------------
commit 748379c66bc3d5131a9346c4c7a973d514b35563
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 14:21:46 2020 -0800

    s3: smbd: msdfs: Change create_msdfs_link() to call 
SMB_VFS_CREATE_DFS_PATHAT().
    
    No change in the (rather strange) logic.
    
    First step in abstracting MSDFS storage from direct symlink calls.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Fri Jan 10 21:05:25 UTC 2020 on sn-devel-184

commit 54f9da44356b16efca56cc85f2552624bbe81876
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 13:36:08 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in time_audit.
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit 23df92810b3367b58e8a629d7ee42cf7d167373d
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 13:33:23 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in full_audit.
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit 51fd875661640a7d305b87961b3a0201be350414
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 13:13:29 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in snapper.
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit 6a46c5f207d1792be048e0233f173286cde0560e
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 13:06:36 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in shadow_copy2.
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit 235e59481d9ca8e1a522e966399266fde1feb708
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 14:48:33 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in gluster.
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit 421d26a890f0e09feb94d9b445a51fc14ca24615
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 14:39:43 2020 -0800

    s3: VFS: Implement create_dfs_pathat() in ceph.
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

commit b0b9dd2f8693edc87840f04259e8f31fb55f601c
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Jan 9 10:13:14 2020 -0800

    s3: VFS: Add SMB_VFS_CREATE_DFS_PATHAT().
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

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

Summary of changes:
 examples/VFS/skel_opaque.c            | 10 +++++++
 examples/VFS/skel_transparent.c       | 14 ++++++++++
 source3/include/vfs.h                 | 17 ++++++++++++
 source3/include/vfs_macros.h          | 13 +++++++++
 source3/modules/vfs_ceph.c            | 41 +++++++++++++++++++++++++++
 source3/modules/vfs_default.c         | 37 +++++++++++++++++++++++++
 source3/modules/vfs_full_audit.c      | 26 ++++++++++++++++++
 source3/modules/vfs_glusterfs.c       | 37 +++++++++++++++++++++++++
 source3/modules/vfs_not_implemented.c | 10 +++++++
 source3/modules/vfs_shadow_copy2.c    | 26 ++++++++++++++++++
 source3/modules/vfs_snapper.c         | 25 +++++++++++++++++
 source3/modules/vfs_time_audit.c      | 27 ++++++++++++++++++
 source3/smbd/msdfs.c                  | 52 ++++++++++++++---------------------
 source3/smbd/vfs.c                    | 14 ++++++++++
 14 files changed, 317 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 4f0622bccc6..71c34de8013 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -103,6 +103,15 @@ static NTSTATUS skel_get_dfs_referrals(struct 
vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
+static NTSTATUS skel_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)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
 static DIR *skel_opendir(vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        const char *mask,
@@ -1032,6 +1041,7 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .statvfs_fn = skel_statvfs,
        .fs_capabilities_fn = skel_fs_capabilities,
        .get_dfs_referrals_fn = skel_get_dfs_referrals,
+       .create_dfs_pathat_fn = skel_create_dfs_pathat,
        .snap_check_path_fn = skel_snap_check_path,
        .snap_create_fn = skel_snap_create,
        .snap_delete_fn = skel_snap_delete,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index f7f7be98bb4..4b91f64f15e 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -100,6 +100,19 @@ static NTSTATUS skel_get_dfs_referrals(struct 
vfs_handle_struct *handle,
        return SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r);
 }
 
+static NTSTATUS skel_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)
+{
+       return SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
+                                       dirfsp,
+                                       smb_fname,
+                                       reflist,
+                                       referral_count);
+}
+
 static DIR *skel_opendir(vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        const char *mask,
@@ -1330,6 +1343,7 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .statvfs_fn = skel_statvfs,
        .fs_capabilities_fn = skel_fs_capabilities,
        .get_dfs_referrals_fn = skel_get_dfs_referrals,
+       .create_dfs_pathat_fn = skel_create_dfs_pathat,
        .snap_check_path_fn = skel_snap_check_path,
        .snap_create_fn = skel_snap_create,
        .snap_delete_fn = skel_snap_delete,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index e4881d4940b..a836903a832 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -288,6 +288,7 @@
 /* Version 42 - Remove SMB_VFS_CHOWN */
 /* Version 42 - Remove struct write_cache *wcp from files_struct */
 /* Version 42 - SMB_VFS_NTIMES() receives null times based on UTIMES_OMIT */
+/* Version 42 - Add SMB_VFS_CREATE_DFS_PATHAT() */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -547,6 +548,7 @@ typedef struct connection_struct {
 
 struct smbd_smb2_request;
 struct privilege_paths;
+struct referral;
 
 struct smb_request {
        uint8_t cmd;
@@ -702,6 +704,11 @@ struct vfs_fn_pointers {
         */
        NTSTATUS (*get_dfs_referrals_fn)(struct vfs_handle_struct *handle,
                                         struct dfs_GetDFSReferral *r);
+       NTSTATUS (*create_dfs_pathat_fn)(struct vfs_handle_struct *handle,
+                               struct files_struct *dirfsp,
+                               const struct smb_filename *smb_fname,
+                               const struct referral *reflist,
+                               size_t referral_count);
 
        /* Directory operations */
 
@@ -1205,6 +1212,11 @@ uint32_t smb_vfs_call_fs_capabilities(struct 
vfs_handle_struct *handle,
  */
 NTSTATUS smb_vfs_call_get_dfs_referrals(struct vfs_handle_struct *handle,
                                        struct dfs_GetDFSReferral *r);
+NTSTATUS smb_vfs_call_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);
 DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        const char *mask,
@@ -1642,6 +1654,11 @@ uint32_t vfs_not_implemented_fs_capabilities(struct 
vfs_handle_struct *handle,
                                enum timestamp_set_resolution *p_ts_res);
 NTSTATUS vfs_not_implemented_get_dfs_referrals(struct vfs_handle_struct 
*handle,
                                               struct dfs_GetDFSReferral *r);
+NTSTATUS vfs_not_implemented_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);
 DIR *vfs_not_implemented_opendir(vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        const char *mask,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index cec8f6f204d..d4ccb8f5c73 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -78,6 +78,19 @@
 #define SMB_VFS_NEXT_GET_DFS_REFERRALS(handle, r) \
        smb_vfs_call_get_dfs_referrals((handle)->next, (r))
 
+#define SMB_VFS_CREATE_DFS_PATHAT(conn, dirfsp, smb_fname, reflist, count) \
+       smb_vfs_call_create_dfs_pathat((conn)->vfs_handles, \
+               (dirfsp), \
+               (smb_fname), \
+               (reflist), \
+               (count))
+#define SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle, dirfsp, smb_fname, reflist, 
count) \
+       smb_vfs_call_create_dfs_pathat((handle)->next, \
+               (dirfsp), \
+               (smb_fname), \
+               (reflist), \
+               (count))
+
 /* Directory operations */
 #define SMB_VFS_OPENDIR(conn, smb_fname, mask, attr) \
        smb_vfs_call_opendir((conn)->vfs_handles, (smb_fname), (mask), (attr))
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 2c72b6aee23..848e369e5c2 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1404,6 +1404,46 @@ static bool cephwrap_aio_force(struct vfs_handle_struct 
*handle, struct files_st
        return false;
 }
 
+static NTSTATUS cephwrap_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)
+{
+       TALLOC_CTX *frame = talloc_stackframe();
+       NTSTATUS status = NT_STATUS_NO_MEMORY;
+       int ret;
+       char *msdfs_link = NULL;
+
+       SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
+       /* Form the msdfs_link contents */
+       msdfs_link = msdfs_link_string(frame,
+                                       reflist,
+                                       referral_count);
+       if (msdfs_link == NULL) {
+               goto out;
+       }
+
+       ret = ceph_symlink(handle->data,
+                       msdfs_link,
+                       smb_fname->base_name);
+       if (ret == 0) {
+               status = NT_STATUS_OK;
+       } else {
+               status = map_nt_error_from_unix(-ret);
+        }
+
+  out:
+
+       DBG_DEBUG("[CEPH] create_dfs_pathat(%s) = %s\n",
+                       smb_fname->base_name,
+                       nt_errstr(status));
+
+       TALLOC_FREE(frame);
+       return status;
+}
+
 static struct vfs_fn_pointers ceph_fns = {
        /* Disk operations */
 
@@ -1428,6 +1468,7 @@ static struct vfs_fn_pointers ceph_fns = {
 
        /* File operations */
 
+       .create_dfs_pathat_fn = cephwrap_create_dfs_pathat,
        .open_fn = cephwrap_open,
        .close_fn = cephwrap_close,
        .pread_fn = cephwrap_pread,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 5bf76716164..f0c92f873e4 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -368,6 +368,42 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct 
vfs_handle_struct *handle,
        return NT_STATUS_OK;
 }
 
+static NTSTATUS vfswrap_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)
+{
+       TALLOC_CTX *frame = talloc_stackframe();
+       NTSTATUS status = NT_STATUS_NO_MEMORY;
+       int ret;
+       char *msdfs_link = NULL;
+
+       SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
+       /* Form the msdfs_link contents */
+       msdfs_link = msdfs_link_string(frame,
+                                       reflist,
+                                       referral_count);
+       if (msdfs_link == NULL) {
+               goto out;
+       }
+
+       ret = symlinkat(msdfs_link,
+                       dirfsp->fh->fd,
+                       smb_fname->base_name);
+       if (ret == 0) {
+               status = NT_STATUS_OK;
+       } else {
+               status = map_nt_error_from_unix(errno);
+       }
+
+  out:
+
+       TALLOC_FREE(frame);
+       return status;
+}
+
 static NTSTATUS vfswrap_snap_check_path(struct vfs_handle_struct *handle,
                                        TALLOC_CTX *mem_ctx,
                                        const char *service_path,
@@ -3480,6 +3516,7 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .statvfs_fn = vfswrap_statvfs,
        .fs_capabilities_fn = vfswrap_fs_capabilities,
        .get_dfs_referrals_fn = vfswrap_get_dfs_referrals,
+       .create_dfs_pathat_fn = vfswrap_create_dfs_pathat,
        .snap_check_path_fn = vfswrap_snap_check_path,
        .snap_create_fn = vfswrap_snap_create,
        .snap_delete_fn = vfswrap_snap_delete,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 415be388fca..1e4a641d0a4 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -101,6 +101,7 @@ typedef enum _vfs_op_type {
        SMB_VFS_OP_STATVFS,
        SMB_VFS_OP_FS_CAPABILITIES,
        SMB_VFS_OP_GET_DFS_REFERRALS,
+       SMB_VFS_OP_CREATE_DFS_PATHAT,
 
        /* Directory operations */
 
@@ -249,6 +250,7 @@ static struct {
        { SMB_VFS_OP_STATVFS,   "statvfs" },
        { SMB_VFS_OP_FS_CAPABILITIES,   "fs_capabilities" },
        { SMB_VFS_OP_GET_DFS_REFERRALS, "get_dfs_referrals" },
+       { SMB_VFS_OP_CREATE_DFS_PATHAT, "create_dfs_pathat" },
        { SMB_VFS_OP_OPENDIR,   "opendir" },
        { SMB_VFS_OP_FDOPENDIR, "fdopendir" },
        { SMB_VFS_OP_READDIR,   "readdir" },
@@ -890,6 +892,29 @@ static NTSTATUS smb_full_audit_get_dfs_referrals(
        return status;
 }
 
+static NTSTATUS smb_full_audit_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)
+{
+       NTSTATUS status;
+
+       status = SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
+                       dirfsp,
+                       smb_fname,
+                       reflist,
+                       referral_count);
+
+       do_log(SMB_VFS_OP_CREATE_DFS_PATHAT,
+               NT_STATUS_IS_OK(status),
+               handle,
+               "%s",
+               smb_fname_str_do_log(handle->conn, smb_fname));
+
+       return status;
+}
+
 static NTSTATUS smb_full_audit_snap_check_path(struct vfs_handle_struct 
*handle,
                                               TALLOC_CTX *mem_ctx,
                                               const char *service_path,
@@ -2935,6 +2960,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .statvfs_fn = smb_full_audit_statvfs,
        .fs_capabilities_fn = smb_full_audit_fs_capabilities,
        .get_dfs_referrals_fn = smb_full_audit_get_dfs_referrals,
+       .create_dfs_pathat_fn = smb_full_audit_create_dfs_pathat,
        .opendir_fn = smb_full_audit_opendir,
        .fdopendir_fn = smb_full_audit_fdopendir,
        .readdir_fn = smb_full_audit_readdir,
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index e8bd64be9e6..bce7ae5e84a 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -1869,6 +1869,42 @@ static bool vfs_gluster_aio_force(struct 
vfs_handle_struct *handle,
        return false;
 }
 
+static NTSTATUS vfs_gluster_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)
+{
+       TALLOC_CTX *frame = talloc_stackframe();
+       NTSTATUS status = NT_STATUS_NO_MEMORY;
+       int ret;
+       char *msdfs_link = NULL;
+
+       SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
+
+       /* Form the msdfs_link contents */
+       msdfs_link = msdfs_link_string(frame,
+                                       reflist,
+                                       referral_count);
+       if (msdfs_link == NULL) {
+               goto out;
+       }
+
+       ret = glfs_symlink(handle->data,
+                       msdfs_link,
+                       smb_fname->base_name);
+       if (ret == 0) {
+               status = NT_STATUS_OK;
+       } else {
+               status = map_nt_error_from_unix(errno);
+       }
+
+  out:
+
+       TALLOC_FREE(frame);
+       return status;
+}
+
 static struct vfs_fn_pointers glusterfs_fns = {
 
        /* Disk Operations */
@@ -1941,6 +1977,7 @@ static struct vfs_fn_pointers glusterfs_fns = {
        .streaminfo_fn = NULL,
        .get_real_filename_fn = vfs_gluster_get_real_filename,
        .connectpath_fn = vfs_gluster_connectpath,
+       .create_dfs_pathat_fn = vfs_gluster_create_dfs_pathat,
 
        .brl_lock_windows_fn = NULL,
        .brl_unlock_windows_fn = NULL,
diff --git a/source3/modules/vfs_not_implemented.c 
b/source3/modules/vfs_not_implemented.c
index dc4ac25b035..2bdab503d2c 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -97,6 +97,15 @@ NTSTATUS vfs_not_implemented_get_dfs_referrals(struct 
vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
+NTSTATUS vfs_not_implemented_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)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
 DIR *vfs_not_implemented_opendir(vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname,
                        const char *mask,
@@ -1037,6 +1046,7 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .statvfs_fn = vfs_not_implemented_statvfs,
        .fs_capabilities_fn = vfs_not_implemented_fs_capabilities,
        .get_dfs_referrals_fn = vfs_not_implemented_get_dfs_referrals,
+       .create_dfs_pathat_fn = vfs_not_implemented_create_dfs_pathat,
        .snap_check_path_fn = vfs_not_implemented_snap_check_path,
        .snap_create_fn = vfs_not_implemented_snap_create,
        .snap_delete_fn = vfs_not_implemented_snap_delete,
diff --git a/source3/modules/vfs_shadow_copy2.c 
b/source3/modules/vfs_shadow_copy2.c
index 94aba328835..143f92959ff 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -2442,6 +2442,31 @@ static int shadow_copy2_setxattr(struct 
vfs_handle_struct *handle,
                                aname, value, size, flags);
 }
 
+static NTSTATUS shadow_copy2_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)
+{
+       time_t timestamp = 0;
+
+       if (!shadow_copy2_strip_snapshot(talloc_tos(),
+                                       handle,
+                                       smb_fname->base_name,
+                                       &timestamp,
+                                       NULL)) {
+               return NT_STATUS_NO_MEMORY;
+       }
+       if (timestamp != 0) {
+               return NT_STATUS_MEDIA_WRITE_PROTECTED;
+       }
+       return SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
+                       dirfsp,
+                       smb_fname,
+                       reflist,
+                       referral_count);
+}
+
 static int shadow_copy2_get_real_filename(struct vfs_handle_struct *handle,
                                          const char *path,
                                          const char *name,
@@ -3123,6 +3148,7 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
        .opendir_fn = shadow_copy2_opendir,
        .disk_free_fn = shadow_copy2_disk_free,
        .get_quota_fn = shadow_copy2_get_quota,
+       .create_dfs_pathat_fn = shadow_copy2_create_dfs_pathat,
        .renameat_fn = shadow_copy2_renameat,
        .linkat_fn = shadow_copy2_linkat,
        .symlinkat_fn = shadow_copy2_symlinkat,
diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index 9ef04d91e76..91729f2abd6 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -2849,12 +2849,37 @@ static int snapper_gmt_get_quota(vfs_handle_struct 
*handle,
        return ret;
 }
 
+static NTSTATUS snapper_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)
+{
+       time_t timestamp = 0;
+
+       if (!snapper_gmt_strip_snapshot(talloc_tos(),
+                                       handle,
+                                       smb_fname->base_name,
+                                       &timestamp,
+                                       NULL)) {
+               return NT_STATUS_NO_MEMORY;
+       }
+       if (timestamp != 0) {
+               return NT_STATUS_MEDIA_WRITE_PROTECTED;
+       }
+       return SMB_VFS_NEXT_CREATE_DFS_PATHAT(handle,
+                       dirfsp,
+                       smb_fname,
+                       reflist,
+                       referral_count);
+}
 
 static struct vfs_fn_pointers snapper_fns = {
        .snap_check_path_fn = snapper_snap_check_path,
        .snap_create_fn = snapper_snap_create,
        .snap_delete_fn = snapper_snap_delete,
        .get_shadow_copy_data_fn = snapper_get_shadow_copy_data,
+       .create_dfs_pathat_fn = snapper_create_dfs_pathat,
        .opendir_fn = snapper_gmt_opendir,
        .disk_free_fn = snapper_gmt_disk_free,
        .get_quota_fn = snapper_gmt_get_quota,
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index da99a06ce3a..9f20fc5234a 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -323,6 +323,32 @@ static NTSTATUS smb_time_audit_get_dfs_referrals(
        return result;
 }
 
+static NTSTATUS smb_time_audit_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)
+{
+       NTSTATUS result;
+       struct timespec ts1,ts2;
+       double timediff;
+
+       clock_gettime_mono(&ts1);


-- 
Samba Shared Repository

Reply via email to