summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-10-04 00:07:15 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-10-05 09:21:13 +1300
commita7ca55c8da6fbe6452a7a0bfc3c84b5941b8aa27 (patch)
tree2299240d05d954470e7bb08d8c4e18b138d976df /source3
parentd34dc1b0025d18afc9ce638c7000b702f98b5d03 (diff)
downloadsamba-a7ca55c8da6fbe6452a7a0bfc3c84b5941b8aa27.tar.gz
samba-a7ca55c8da6fbe6452a7a0bfc3c84b5941b8aa27.tar.bz2
samba-a7ca55c8da6fbe6452a7a0bfc3c84b5941b8aa27.zip
shadow_copy2: add snapshot_basepath to the config.
This is the absolute version of snapdir. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_shadow_copy2.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 8f2f466054..f3be5fefa3 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -120,6 +120,7 @@ struct shadow_copy2_config {
char *basedir;
char *mount_point;
char *rel_connectpath; /* share root, relative to the basedir */
+ char *snapshot_basepath; /* the absolute version of snapdir */
};
static bool shadow_copy2_find_slashes(TALLOC_CTX *mem_ctx, const char *str,
@@ -1762,6 +1763,16 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
"Disabling it.\n"));
config->crossmountpoints = false;
}
+
+ config->snapshot_basepath = config->snapdir;
+ } else {
+ config->snapshot_basepath = talloc_asprintf(config, "%s/%s",
+ config->mount_point, config->snapdir);
+ if (config->snapshot_basepath == NULL) {
+ DEBUG(0, ("talloc_asprintf() failed\n"));
+ errno = ENOMEM;
+ return -1;
+ }
}
SMB_VFS_HANDLE_SET_DATA(handle, config,