From ce9a972880ed3dc30ae9f8cedf6404f2ea5d589c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Oct 2013 00:04:06 +0200 Subject: [PATCH] shadow_copy2: add rel_connectpath to config. This is the share root, relative to the basedir. Signed-off-by: Michael Adam Reviewed-by: Andrew Bartlett (cherry picked from commit d34dc1b0025d18afc9ce638c7000b702f98b5d03) --- source3/modules/vfs_shadow_copy2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 1a5f211c535..ac5def51d7d 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -119,6 +119,7 @@ struct shadow_copy2_config { bool snapdir_absolute; char *basedir; char *mount_point; + char *rel_connectpath; /* share root, relative to the basedir */ }; static bool shadow_copy2_find_slashes(TALLOC_CTX *mem_ctx, const char *str, @@ -1737,8 +1738,19 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle, config->basedir = config->mount_point; } + if (strlen(config->basedir) != strlen(handle->conn->connectpath)) { + config->rel_connectpath = talloc_strdup(config, + handle->conn->connectpath + strlen(config->basedir)); + if (config->rel_connectpath == NULL) { + DEBUG(0, ("talloc_strdup() failed\n")); + errno = ENOMEM; + return -1; + } + } + if (config->snapdir[0] == '/') { config->snapdir_absolute = true; + if (config->snapdirseverywhere == true) { DEBUG(1, (__location__ " Warning: An absolute snapdir " "is incompatible with 'snapdirseverywhere', " -- 2.11.4.GIT