]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: Allow shadow_copy2_connectpath() to return the cached path derived from...
authorJeremy Allison <jra@samba.org>
Fri, 20 Jan 2017 20:09:08 +0000 (12:09 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 15 Feb 2017 10:42:22 +0000 (11:42 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit 42bd1acad75a6b5ea81fe4b30c067dd82623c042)

source3/modules/vfs_shadow_copy2.c

index 5b1685db1a7a47b1d5255c1010635f83cb6150e5..f2b349448376d65243b06a7c36d5ccb8820a4fe5 100644 (file)
@@ -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,
                                         &timestamp, &stripped)) {
                goto done;