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)
committerJeremy Allison <jra@samba.org>
Mon, 30 Jan 2017 17:39:19 +0000 (18:39 +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>
source3/modules/vfs_shadow_copy2.c

index 31f36a533f946847e0742754738697cef6275f15..2206edefccc1697bb8b9846daaca7c304ab62c2f 100644 (file)
@@ -2533,6 +2533,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);