1708988 - Samsung ML-1676P Laser printer fails to print document

This commit is contained in:
Zdenek Dohnal 2019-05-31 08:27:04 +02:00
parent 798d194948
commit 9f87e922b2
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 4c00fa533f99ed1b17fa14d33e2fd42c54c45bea Mon Sep 17 00:00:00 2001
From: Michael R Sweet <michael.r.sweet@gmail.com>
Date: Mon, 15 Apr 2019 16:50:04 -0400
Subject: [PATCH] Add a workaround for old Samsung drivers (Issue #5562)
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"))
{
/*

View File

@ -15,7 +15,7 @@ Summary: CUPS printing system
Name: cups
Epoch: 1
Version: 2.2.11
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+ and LGPLv2+ with exceptions and AML
Url: http://www.cups.org/
Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz
@ -101,6 +101,8 @@ Patch29: cups-dymo-deviceid.patch
# can narrow the attack vector - do not send it
# in regular message
Patch40: cups-dont-send-http-options-field.patch
# support Emulator ppd keyword, because Samsung drivers depend on it
Patch41: 0001-Add-a-workaround-for-old-Samsung-drivers-Issue-5562.patch
##### Patches removed because IMHO they aren't no longer needed
##### but still I'll leave them in git in case their removal
@ -345,6 +347,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
#### UPSTREAMED PATCHES ####
%patch40 -p1 -b .dont-send-http-options-field
# Samsung depends on Emulator ppd keyword - this is temporary workaround
%patch41 -p1 -b .samsung-workaround
# if cupsd is set to log into /var/log/cups, then 'MaxLogSize 0' needs to be
# in cupsd.conf to disable cupsd logrotate functionality and use logrotated
@ -751,6 +755,9 @@ rm -f %{cups_serverbin}/backend/smb
%{_mandir}/man5/ipptoolfile.5.gz
%changelog
* Fri May 31 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.11-3
- 1708988 - Samsung ML-1676P Laser printer fails to print document
* Wed Apr 17 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.11-2
- 1700664 - Stop advertising the HTTP methods that are supported