From a88956a0fafcab44bfe9b8c4ffb27771adb70a34 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Thu, 1 Jun 2023 15:57:36 +0200 Subject: [PATCH] printers.c: Set .strings file path if PPD cache is valid (fixes #710) --- CHANGES.md | 7 ++++--- scheduler/printers.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e926cf797c..94171d1d75 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,9 @@ Changes in CUPS v2.4.3 (TBA) - Fixed a potential SNMP OID value overflow issue (Issue #431) - Fixed an OpenSSL certificate loading issue (Issue #465) - Fixed Brazilian Portuguese translations (Issue #288) +- Fixed `cupsd` default keychain location when building with OpenSSL + (Issue #529) +- Fixed default color settings for CMYK printers as well (Issue #500) - Fixed duplicate PPD2IPP media-type names (Issue #688) - Fixed possible heap buffer overflow in `_cups_strlcpy()` (fixes CVE-2023-32324) - Fixed InputSlot heuristic for photo sizes smaller than 5x7" if there is no @@ -25,9 +28,7 @@ Changes in CUPS v2.4.3 (TBA) - Fixed memory leaks in `create_local_bg_thread()` (Issue #466) - Fixed media size tolerance in `ippeveprinter` (Issue #487) - Fixed passing command name without path into `ippeveprinter` (Issue #629) -- Fixed `cupsd` default keychain location when building with OpenSSL - (Issue #529) -- Fixed default color settings for CMYK printers as well (Issue #500) +- Fixed saving strings file path in `printers.conf` (Issue #710) - Fixed TLS certificate generation bugs (Issue #652) - `ippDeleteValues` would not delete the last value (Issue #556) - Ignore some of IPP defaults if the application sends its PPD alternative diff --git a/scheduler/printers.c b/scheduler/printers.c index ea554c0e2b..5f9852e64f 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -3935,6 +3935,16 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ * Loaded successfully! */ + /* + * Set `strings` (source for printer-strings-uri IPP attribute) + * if printer's .strings file with localization exists. + */ + + if (!access(strings_name, R_OK)) + cupsdSetString(&p->strings, strings_name); + else + cupsdClearString(&p->strings); + return; } }