summarylogtreecommitdiffstats
path: root/samsung-printer-workaround.patch
diff options
context:
space:
mode:
Diffstat (limited to 'samsung-printer-workaround.patch')
-rw-r--r--samsung-printer-workaround.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/samsung-printer-workaround.patch b/samsung-printer-workaround.patch
new file mode 100644
index 000000000000..f4259ff061c8
--- /dev/null
+++ b/samsung-printer-workaround.patch
@@ -0,0 +1,30 @@
+diff --git a/cups/ppd.c b/cups/ppd.c
+index 435b992f4..29456d97a 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"))
+ {
+ /*
+