1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

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>
This commit is contained in:
Michael Adam
2013-10-04 00:04:06 +02:00
committed by Andrew Bartlett
parent 2d5a3af4bc
commit d34dc1b002

View File

@ -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', "