From: Jeremy Allison Date: Thu, 26 Jan 2017 18:24:52 +0000 (-0800) Subject: s3: VFS: Ensure shadow:format cannot contain a / path separator. X-Git-Tag: samba-4.4.10~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50d3a7011237fcb36bf9b53f7db8846e854453d4;p=thirdparty%2Fsamba.git s3: VFS: Ensure shadow:format cannot contain a / path separator. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531 Signed-off-by: Jeremy Allison Reviewed-by: Uri Simchoni (backported from commit cd4f940162b17e4f7345d392326a31ae478230fa) --- diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index f2b34944837..78f90795cf3 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -2099,6 +2099,15 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle, return -1; } + /* config->gmt_format must not contain a path separator. */ + if (strchr(config->gmt_format, '/') != NULL) { + DEBUG(0, ("shadow:format %s must not contain a /" + "character. Unable to initialize module.\n", + config->gmt_format)); + errno = EINVAL; + return -1; + } + config->use_sscanf = lp_parm_bool(SNUM(handle->conn), "shadow", "sscanf", false);