From 7f6801be27b58f0e560fc654c079df9c10851190 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 5 Apr 2024 08:46:37 -0400 Subject: [PATCH] Allow PPD choices and PWG keywords to select media (Issue #238) --- CHANGES.md | 1 + cups/ppd-cache.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 12ac4f1aee..54ea977a5d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -36,6 +36,7 @@ Changes in CUPS v2.5b1 (TBA) - Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error handling (fixes CVE-2023-34241) - Fixed hanging of `lpstat` on Solaris (Issue #156) +- Fixed mapping of PPD InputSlot, MediaType, and OutputBin values (Issue #238) - Fixed Digest authentication support (Issue #260) - Fixed the web interface not showing an error for a non-existent printer (Issue #423) diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 8be335b084..c39fa45961 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -2336,7 +2336,7 @@ ppd_inputslot_for_keyword( return (NULL); for (i = 0; i < pc->num_sources; i ++) - if (!_cups_strcasecmp(keyword, pc->sources[i].pwg)) + if (!_cups_strcasecmp(keyword, pc->sources[i].pwg) || !_cups_strcasecmp(keyword, pc->sources[i].ppd)) return (pc->sources[i].ppd); return (NULL); @@ -2451,7 +2451,7 @@ _ppdCacheGetMediaType( int i; /* Looping var */ for (i = 0; i < pc->num_types; i ++) - if (!_cups_strcasecmp(keyword, pc->types[i].pwg)) + if (!_cups_strcasecmp(keyword, pc->types[i].pwg) || !_cups_strcasecmp(keyword, pc->types[i].ppd)) return (pc->types[i].ppd); } @@ -2485,7 +2485,7 @@ _ppdCacheGetOutputBin( for (i = 0; i < pc->num_bins; i ++) - if (!_cups_strcasecmp(output_bin, pc->bins[i].pwg)) + if (!_cups_strcasecmp(output_bin, pc->bins[i].pwg) || !_cups_strcasecmp(output_bin, pc->bins[i].ppd)) return (pc->bins[i].ppd); return (NULL); -- 2.47.3