summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2017-04-11 12:03:52 +0200
committerKarolin Seeger <kseeger@samba.org>2017-04-21 09:57:21 +0200
commitb8c11dbfd1d408c949e7bf71bd2687aef8267ffc (patch)
treebebf6f30f5090cbde94018926dc7e40c99483584 /source3/modules
parent0a84f1678180a8a2653f745a276de49d698330d2 (diff)
downloadsamba-b8c11dbfd1d408c949e7bf71bd2687aef8267ffc.tar.gz
s3:vfs:shadow_copy2: fix corner case of "/@GMT-token" in shadow_copy2_strip_snapshot
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 26661218b3d3f0d4ee89039727bc110e972c2851) The last 3 patches address BUG: https://bugzilla.samba.org/show_bug.cgi?id=12743 vfs_shadow_copy2 fails to list snapshots from shares with GlusterFS backend
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_shadow_copy2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 83be84e50a8..7cacac81c1c 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -671,10 +671,11 @@ static bool shadow_copy2_strip_snapshot_internal(TALLOC_CTX *mem_ctx,
* with a path prefix.
*/
if (pstripped != NULL) {
- if (len_before_gmt > 0) {
+ if (len_before_gmt > 1) {
/*
- * There is a slash before
- * the @GMT-. Remove it.
+ * There is a path (and not only a slash)
+ * before the @GMT-. Remove the trailing
+ * slash character.
*/
len_before_gmt -= 1;
}