]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: Ensure shadow:format cannot contain a / path separator.
authorJeremy Allison <jra@samba.org>
Thu, 26 Jan 2017 18:24:52 +0000 (10:24 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 15 Feb 2017 10:42:22 +0000 (11:42 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(backported from commit cd4f940162b17e4f7345d392326a31ae478230fa)

source3/modules/vfs_shadow_copy2.c

index f2b349448376d65243b06a7c36d5ccb8820a4fe5..78f90795cf3952c1ea638a071d614f77c8cdc595 100644 (file)
@@ -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);