]> 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:24 +0000 (16:50 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 15 Apr 2019 20:50:24 +0000 (16:50 -0400)
CHANGES.md
cups/ppd.c

index 60f50f78e2ce69f591819b711cdc983fd1876116..722cfbb189fbaecd37a21e70c6a9934eee0ae428 100644 (file)
@@ -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
index 435b992f4f35eff0a5f44e4d44fe38d6dbf72e7a..29456d97a5c5a1c38479d1e89f6e66fe34e16579 100644 (file)
@@ -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"))
     {
      /*