From d34dc1b0025d18afc9ce638c7000b702f98b5d03 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Oct 2013 00:04:06 +0200 Subject: 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 --- source3/modules/vfs_shadow_copy2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3') diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index afe2ff4638..8f2f466054 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, @@ -1735,8 +1736,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', " -- cgit