diff options
author | Michael Adam <obnox@samba.org> | 2013-10-04 00:04:06 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-10-05 09:21:11 +1300 |
commit | d34dc1b0025d18afc9ce638c7000b702f98b5d03 (patch) | |
tree | 45745cf8f62587918778cdbccef89da4765512e8 | |
parent | 2d5a3af4bc44d13877a26fa1857b3ceafe138de8 (diff) | |
download | samba-d34dc1b0025d18afc9ce638c7000b702f98b5d03.tar.gz samba-d34dc1b0025d18afc9ce638c7000b702f98b5d03.tar.bz2 samba-d34dc1b0025d18afc9ce638c7000b702f98b5d03.zip |
shadow_copy2: add rel_connectpath to config.
This is the share root, relative to the basedir.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source3/modules/vfs_shadow_copy2.c | 12 |
1 files changed, 12 insertions, 0 deletions
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', " |