summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-08-16 09:43:37 -0700
committerStefan Metzmacher <metze@samba.org>2016-08-28 18:12:09 +0200
commit4b266772a33653cc79c7dd88d9c6012da3cd62da (patch)
tree4c2694d1df9485689e73b996ce6d3738d88e7315 /source3/modules
parent1901c9e7da28e96b6668df6f0faceedb675ab443 (diff)
downloadsamba-4b266772a33653cc79c7dd88d9c6012da3cd62da.tar.gz
s3: vfs: shadow_copy2. Remove any trailing slash when stripping @GMT-YYYY... from the end of a path.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12150 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Aug 17 05:25:30 CEST 2016 on sn-devel-144 (cherry picked from commit 639063da8c5077170bfe2dc4d3a69c3219a4f6a1)
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_shadow_copy2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index b1aae1e5301..4ac16d3c10e 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -486,6 +486,13 @@ static bool shadow_copy2_strip_snapshot(TALLOC_CTX *mem_ctx,
* with a path prefix.
*/
if (pstripped != NULL) {
+ if (len_before_gmt > 0) {
+ /*
+ * There is a slash before
+ * the @GMT-. Remove it.
+ */
+ len_before_gmt -= 1;
+ }
stripped = talloc_strndup(mem_ctx, name,
len_before_gmt);
if (stripped == NULL) {