From 640f1f684eda0a9dbcd3692dc525d17e6b0d746a Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 20 Dec 2023 15:22:00 +0100 Subject: [PATCH] RHEL-16026 Cups Browsed does not correctly pull printer location and description information from print server Resolves: RHEL-16026 --- ...location-from-server-if-available-ot.patch | 29 +++++++++++++++++++ cups-filters.spec | 3 ++ 2 files changed, 32 insertions(+) create mode 100644 0001-Use-description-location-from-server-if-available-ot.patch diff --git a/0001-Use-description-location-from-server-if-available-ot.patch b/0001-Use-description-location-from-server-if-available-ot.patch new file mode 100644 index 0000000..8cdf96a --- /dev/null +++ b/0001-Use-description-location-from-server-if-available-ot.patch @@ -0,0 +1,29 @@ +diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c +index d4396d7..6dba2ed 100644 +--- a/utils/cups-browsed.c ++++ b/utils/cups-browsed.c +@@ -8793,6 +8793,10 @@ gboolean update_cups_queues(gpointer unused) { + IPP_PRINTER_IDLE); + /* ... and accepting jobs */ + ippAddBoolean(request, IPP_TAG_PRINTER, "printer-is-accepting-jobs", 1); ++ // Location (only if the remote server actually provides a location string) ++ if (p->location && p->location[0]) ++ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, ++ "printer-location", NULL, p->location); + num_options = 0; + options = NULL; + /* Device URI: ipp(s)://:631/printers/ +@@ -8808,6 +8812,13 @@ gboolean update_cups_queues(gpointer unused) { + num_options = cupsAddOption(p->options[i].name, + p->options[i].value, + num_options, &options); ++ ++ // Description (only if the remote server actually provides a description ++ // string) ++ if (p->info && p->info[0]) ++ num_options = cupsAddOption("printer-info", p->info, ++ num_options, &options); ++ + /* Encode option list into IPP attributes */ + cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION); + cupsEncodeOptions2(request, num_options, options, IPP_TAG_PRINTER); diff --git a/cups-filters.spec b/cups-filters.spec index 033e2b5..43802e3 100644 --- a/cups-filters.spec +++ b/cups-filters.spec @@ -40,6 +40,8 @@ Patch02: 0001-cups-browsed.c-Make-NotifLeaseDuration-configurable-.patch Patch03: 0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch # CVE-2023-24805 cups-filters: remote code execution in cups-filters, beh CUPS backend Patch04: beh-cve2023.patch +# RHEL-16026 Cups Browsed does not correctly pull printer location and description information from print server +Patch05: 0001-Use-description-location-from-server-if-available-ot.patch # split cups-browsed and cups-filters-driverless from main package @@ -450,6 +452,7 @@ done %changelog * Wed Dec 20 2023 Zdenek Dohnal - 1.28.7-14 - RHEL-19201 redhat-lsb unnecessary pulls in cups and avahi dependencies +- RHEL-16026 Cups Browsed does not correctly pull printer location and description information from print server * Tue Aug 08 2023 Zdenek Dohnal - 1.28.7-13 - 2229784 - Add textonly driver back, but as lftocrlf