Subject: [PATCH 07/20] s3: VFS: shadow_copy2: Ensure pathnames for parameters are correctly relative and terminated.

From: Jeremy Allison <[email-masked]>
Date: Fri, 20 Jan 2017 11:45:54 -0800

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531

Signed-off-by: Jeremy Allison <[email-masked]>
Reviewed-by: Uri Simchoni <[email-masked]>
(backported from commit 979e39252bcc88e8aacb543b8bf322dd6f17fe7f)
---
 source3/modules/vfs_shadow_copy2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index bbfad85..5f2e812 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -2161,6 +2161,11 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
 		}
 	}
 
+	trim_string(config->mount_point, NULL, "/");
+	trim_string(config->rel_connectpath, "/", "/");
+	trim_string(config->snapdir, NULL, "/");
+	trim_string(config->snapshot_basepath, NULL, "/");
+
 	DEBUG(10, ("shadow_copy2_connect: configuration:\n"
 		   "  share root: '%s'\n"
 		   "  mountpoint: '%s'\n"
-- 
2.7.4