From: Michael R Sweet Date: Mon, 15 Apr 2019 20:50:24 +0000 (-0400) Subject: Add a workaround for old Samsung drivers (Issue #5562) X-Git-Tag: v2.2.12~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8829edfef0d496677a94b0c1b2f08f8e407af444;p=thirdparty%2Fcups.git Add a workaround for old Samsung drivers (Issue #5562) --- diff --git a/CHANGES.md b/CHANGES.md index 60f50f78e2..722cfbb189 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,8 @@ Changes in CUPS v2.2.12 correctly (Issue #5557) - The scheduler did not encode octetString values like "job-password" correctly for the print filters (Issue #5558) +- Restored minimal support for the `Emulators` keyword in PPD files to allow + old Samsung printer drivers to continue to work (Issue #5562) Changes in CUPS v2.2.11 diff --git a/cups/ppd.c b/cups/ppd.c index 435b992f4f..29456d97a5 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -1182,6 +1182,24 @@ _ppdOpen( else if (!strcmp(string, "Plus90")) ppd->landscape = 90; } + else if (!strcmp(keyword, "Emulators") && string && ppd->num_emulations == 0) + { + /* + * Issue #5562: Samsung printer drivers incorrectly use Emulators keyword + * to configure themselves + * + * The Emulators keyword was loaded but never used by anything in CUPS, + * and has no valid purpose in CUPS. The old code was removed due to a + * memory leak (Issue #5475), so the following (new) code supports a single + * name for the Emulators keyword, allowing these drivers to work until we + * remove PPD and driver support entirely in a future version of CUPS. + */ + + ppd->num_emulations = 1; + ppd->emulations = calloc(1, sizeof(ppd_emul_t)); + + strlcpy(ppd->emulations[0].name, string, sizeof(ppd->emulations[0].name)); + } else if (!strcmp(keyword, "JobPatchFile")) { /*