RHEL-16026 Cups Browsed does not correctly pull printer location and description information from print server

Resolves: RHEL-16026
This commit is contained in:
Zdenek Dohnal 2023-12-20 15:22:00 +01:00
parent 8c7c8639fa
commit 640f1f684e
2 changed files with 32 additions and 0 deletions

View File

@ -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)://<remote host>:631/printers/<remote queue>
@@ -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);

View File

@ -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 <zdohnal@redhat.com> - 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 <zdohnal@redhat.com> - 1.28.7-13
- 2229784 - Add textonly driver back, but as lftocrlf