shadow_copy2: in the classical case, use configured path in shadow_copy2_find_snapdir()
authorMichael Adam <obnox@samba.org>
Thu, 23 May 2013 14:21:46 +0000 (16:21 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 4 Oct 2013 20:21:17 +0000 (09:21 +1300)
There is no point in searching for snapdir if not in snapdirseverywhere mode.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/vfs_shadow_copy2.c

index 9462187362838c6b944bf12873fe9e7e9226b088..952b010acf17aa6cf8d75617ba124ed10897a263 100644 (file)
@@ -1047,6 +1047,13 @@ static char *shadow_copy2_find_snapdir(TALLOC_CTX *mem_ctx,
        SMB_VFS_HANDLE_GET_DATA(handle, config, struct shadow_copy2_config,
                                return NULL);
 
+       /*
+        * If the non-snapdisrseverywhere mode, we should not search!
+        */
+       if (!config->snapdirseverywhere) {
+               return config->snapshot_basepath;
+       }
+
        path = talloc_asprintf(mem_ctx, "%s/%s",
                               handle->conn->connectpath,
                               smb_fname->base_name);