From: Michael R Sweet Date: Tue, 15 Oct 2019 21:05:55 +0000 (-0400) Subject: PPD files containing custom option keywords did not work (Issue #5639) X-Git-Tag: v2.3.1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a06655e5c1925f09d5a2e38cd073eb1b6f069ad;p=thirdparty%2Fcups.git PPD files containing custom option keywords did not work (Issue #5639) --- diff --git a/CHANGES.md b/CHANGES.md index 7ab8e18f25..c2635dddd9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes in CUPS v2.3.1 ---------------------- - 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`. diff --git a/cups/ppd.c b/cups/ppd.c index fae19c42ee..ff52df2e17 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -1874,9 +1874,9 @@ _ppdOpen( { 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) @@ -1903,9 +1903,9 @@ _ppdOpen( { 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) @@ -1939,9 +1939,9 @@ _ppdOpen( 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"))