From 03d71bf344fc25e080d59f7a1ec8dbee892dc707 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Thu, 1 Jun 2023 07:49:43 +0200 Subject: [PATCH] printers.c: Save strings file path when PPD cache is not out of date Applying Mike's requested changes and mention the fix in CHANGES. --- CHANGES.md | 7 ++++--- scheduler/printers.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a60e1fbec8..16f2a0d827 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 InputSlot heuristic for photo sizes smaller than 5x7" if there is no media-source in the request (Issue #569) @@ -24,9 +27,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 1cf31a9d56..96b7eff4c2 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -3942,6 +3942,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; } }