summaryrefslogtreecommitdiff
path: root/cups/ppd.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2019-04-15 16:50:04 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2019-04-15 16:50:04 -0400
commit4c00fa533f99ed1b17fa14d33e2fd42c54c45bea (patch)
treea3eb73166f9c1d488f29d702c73e7ae79b4cba43 /cups/ppd.c
parent677e4ca625217524bfda8e69bc79ef62139906cb (diff)
downloadcups-4c00fa533f99ed1b17fa14d33e2fd42c54c45bea.tar.gz
Add a workaround for old Samsung drivers (Issue #5562)
Diffstat (limited to 'cups/ppd.c')
-rw-r--r--cups/ppd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/cups/ppd.c b/cups/ppd.c
index 8bda7c6a0..f958728cb 100644
--- a/cups/ppd.c
+++ b/cups/ppd.c
@@ -1171,6 +1171,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"))
{
/*