From: Jeremy Allison Date: Thu, 9 Jan 2020 22:48:33 +0000 (-0800) Subject: s3: VFS: Implement create_dfs_pathat() in gluster. X-Git-Tag: ldb-2.1.0~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=235e59481d9ca8e1a522e966399266fde1feb708;p=thirdparty%2Fsamba.git s3: VFS: Implement create_dfs_pathat() in gluster. Not yet used. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- 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,