From: Jeremy Allison Date: Fri, 20 Jan 2017 20:09:08 +0000 (-0800) Subject: s3: VFS: Allow shadow_copy2_connectpath() to return the cached path derived from... X-Git-Tag: samba-4.4.10~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52439d70d766062ee74d64aeeccf9838c6c9ae74;p=thirdparty%2Fsamba.git s3: VFS: Allow shadow_copy2_connectpath() to return the cached path derived from $cwd. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531 Signed-off-by: Jeremy Allison Reviewed-by: Uri Simchoni (backported from commit 42bd1acad75a6b5ea81fe4b30c067dd82623c042) --- diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 5b1685db1a7..f2b34944837 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -1920,9 +1920,19 @@ static const char *shadow_copy2_connectpath(struct vfs_handle_struct *handle, char *parent_dir = NULL; int saved_errno; size_t rootpath_len = 0; + struct shadow_copy2_config *config = NULL; + + SMB_VFS_HANDLE_GET_DATA(handle, config, struct shadow_copy2_config, + return NULL); DBG_DEBUG("Calc connect path for [%s]\n", fname); + if (config->shadow_connectpath != NULL) { + DBG_DEBUG("cached connect path is [%s]\n", + config->shadow_connectpath); + return config->shadow_connectpath; + } + if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname, ×tamp, &stripped)) { goto done;