]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cgi-bin/admin.c
No longer support backslash, question mark, or quotes in printer names (Issue #4966)
[thirdparty/cups.git] / cgi-bin / admin.c
index cfdf3ff0134e4143c458d089bfe2f6975e3f1124..179a8d68eab79a49a51af364574e502c769c8d3a 100644 (file)
@@ -695,16 +695,13 @@ do_am_printer(http_t *http,               /* I - HTTP connection */
   if ((name = cgiGetVariable("PRINTER_NAME")) != NULL)
   {
     for (ptr = name; *ptr; ptr ++)
-      if ((*ptr >= 0 && *ptr <= ' ') || *ptr == 127 || *ptr == '/' || *ptr == '#')
+      if ((*ptr >= 0 && *ptr <= ' ') || *ptr == 127 || *ptr == '/' || *ptr == '\\' || *ptr == '?' || *ptr == '\'' || *ptr == '\"' || *ptr == '#')
        break;
 
     if (*ptr || ptr == name || strlen(name) > 127)
     {
       cgiSetVariable("ERROR",
-                    cgiText(_("The printer name may only contain up to "
-                              "127 printable characters and may not "
-                              "contain spaces, slashes (/), or the "
-                              "pound sign (#).")));
+                    cgiText(_("The printer name may only contain up to 127 printable characters and may not contain spaces, slashes (/ \\), quotes (' \"), question mark (?), or the pound sign (#).")));
       cgiStartHTML(title);
       cgiCopyTemplateLang("error.tmpl");
       cgiEndHTML();