]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
PPD files containing custom option keywords did not work (Issue #5639)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 15 Oct 2019 21:05:55 +0000 (17:05 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 15 Oct 2019 21:05:55 +0000 (17:05 -0400)
CHANGES.md
cups/ppd.c

index 7ab8e18f253fb372546fafafa426a0aba9f6bce8..c2635dddd9029e9b5019a82befb45b706f509fef 100644 (file)
@@ -6,6 +6,7 @@ Changes in CUPS v2.3.1
 ----------------------
 
 - Documentation updates (Issue #5661)
 ----------------------
 
 - Documentation updates (Issue #5661)
+- PPD files containing "custom" option keywords did not work (Issue #5639)
 - Added a workaround for the scheduler's systemd support (Issue #5640)
 - Fixed spelling of "fold-accordion".
 - Fixed the default common name for TLS certificates used by `ippeveprinter`.
 - Added a workaround for the scheduler's systemd support (Issue #5640)
 - Fixed spelling of "fold-accordion".
 - Fixed the default common name for TLS certificates used by `ippeveprinter`.
index fae19c42ee561c5a43bc5d3d98f0143ffdad6e4f..ff52df2e17b890e7603256d538a6bfd7fcafa2f8 100644 (file)
@@ -1874,9 +1874,9 @@ _ppdOpen(
     {
       if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
       {
     {
       if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
       {
-        pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
-
-        goto error;
+        char cname[PPD_MAX_NAME];      /* Rewrite with a leading underscore */
+        snprintf(cname, sizeof(cname), "_%s", name);
+        strlcpy(name, cname, sizeof(name));
       }
 
       if ((size = ppdPageSize(ppd, name)) == NULL)
       }
 
       if ((size = ppdPageSize(ppd, name)) == NULL)
@@ -1903,9 +1903,9 @@ _ppdOpen(
     {
       if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
       {
     {
       if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
       {
-        pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
-
-        goto error;
+        char cname[PPD_MAX_NAME];      /* Rewrite with a leading underscore */
+        snprintf(cname, sizeof(cname), "_%s", name);
+        strlcpy(name, cname, sizeof(name));
       }
 
       if ((size = ppdPageSize(ppd, name)) == NULL)
       }
 
       if ((size = ppdPageSize(ppd, name)) == NULL)
@@ -1939,9 +1939,9 @@ _ppdOpen(
 
       if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
       {
 
       if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
       {
-        pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
-
-        goto error;
+        char cname[PPD_MAX_NAME];      /* Rewrite with a leading underscore */
+        snprintf(cname, sizeof(cname), "_%s", name);
+        strlcpy(name, cname, sizeof(name));
       }
 
       if (!strcmp(keyword, "PageSize"))
       }
 
       if (!strcmp(keyword, "PageSize"))