]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add a workaround for old Samsung drivers (Issue #5562)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 15 Apr 2019 20:50:04 +0000 (16:50 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 15 Apr 2019 20:50:04 +0000 (16:50 -0400)
CHANGES.md
cups/ppd.c

index 4cc5795c83aa3386a2ea1f31ed7c179b0f382656..37a5d0fe2f7adca4a95f82a618d328e00f9dae66 100644 (file)
@@ -9,6 +9,8 @@ Changes in CUPS v2.3b8
 - The lpadmin command would hang with a bad PPD file (rdar://41495016)
 - Fixed a potential crash bug in cups-driverd (rdar://46625579)
 - Fixed a performance regression with large PPDs (rdar://47040759)
+- Restored minimal support for the `Emulators` keyword in PPD files to allow
+  old Samsung printer drivers to continue to work (Issue #5562)
 - The scheduler did not encode octetString values like "job-password" correctly
   for the print filters (Issue #5558)
 - The `cupsCheckDestSupported` function did not check octetString values
index 8bda7c6a08c9daa165da7695438adcd37bff25b7..f958728cbb62ec1eddb714ea4e5c012b53526a8c 100644 (file)
@@ -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"))
     {
      /*