From 3862781cc33ba48e47474ebd93793f90e3904b2a Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Tue, 15 Oct 2024 16:57:02 +0200 Subject: [PATCH] RHEL-62744 [cups-browsed] Prints to remote RAW queues are converted to PDF documents Resolves: RHEL-62744 --- ...enerate-PPD-for-remote-raw-queues-44.patch | 44 +++++++++++++++++++ cups-browsed.spec | 3 ++ 2 files changed, 47 insertions(+) create mode 100644 0001-Do-not-generate-PPD-for-remote-raw-queues-44.patch diff --git a/0001-Do-not-generate-PPD-for-remote-raw-queues-44.patch b/0001-Do-not-generate-PPD-for-remote-raw-queues-44.patch new file mode 100644 index 0000000..0b3f3e1 --- /dev/null +++ b/0001-Do-not-generate-PPD-for-remote-raw-queues-44.patch @@ -0,0 +1,44 @@ +diff --git a/daemon/cups-browsed.c b/daemon/cups-browsed.c +index 8c5349f..5496970 100644 +--- a/daemon/cups-browsed.c ++++ b/daemon/cups-browsed.c +@@ -6736,6 +6736,9 @@ create_remote_printer_entry (const char *queue_name, + p->queue_name, p->uri); + goto fail; + } ++ ++ attr = ippFindAttribute(p->prattrs, "printer-make-and-model", IPP_TAG_TEXT); ++ p->make_model = attr ? strdup(ippGetString(attr, 0, NULL)) : NULL; + } + } + else +@@ -7520,7 +7523,7 @@ create_queue(void* arg) + debug_printf("Generated Default Attributes for local queue %s\n", + p->queue_name); + } +- if (ppdfile == NULL) ++ if (ppdfile == NULL && make_model && strcmp(make_model, "Local Raw Printer")) + { + // If we do not want CUPS-generated PPDs or we cannot obtain a + // CUPS-generated PPD, for example if CUPS does not create a +@@ -7712,7 +7715,7 @@ create_queue(void* arg) + debug_printf("Generated Default Attributes for local queue %s\n", + p->queue_name); + } +- if (ppdfile == NULL) ++ if (ppdfile == NULL && make_model && strcmp(make_model, "Local Raw Printer")) + { + // If we do not want CUPS-generated PPDs or we cannot obtain a + // CUPS-generated PPD, for example if CUPS does not create a +@@ -7983,6 +7986,11 @@ create_queue(void* arg) + } + ppdfile = strdup(buf); + } ++ else ++ { ++ // No PPD - define nickname as make_model for remote raw queue ++ p->nickname = p->make_model ? strdup(p->make_model) : strdup("Local Raw Printer"); ++ } + + // Create a new CUPS queue or modify the existing queue + request = ippNewRequest(CUPS_ADD_MODIFY_PRINTER); diff --git a/cups-browsed.spec b/cups-browsed.spec index 8c3c0ab..49a0a19 100644 --- a/cups-browsed.spec +++ b/cups-browsed.spec @@ -32,6 +32,8 @@ Patch003: browsed-goto-fail.patch Patch04: browsed-ignore-NULL-attrs.patch # CVE-2024-47176 cups-browsed: cups-browsed binds on UDP INADDR_ANY:631 trusting any packet from any source Patch05: 0001-Removed-support-for-legacy-CUPS-browsing-and-for-LDA.patch +# RHEL-17124 [cups-browsed] Prints to remote RAW queues are converted to PDF documents +Patch07: 0001-Do-not-generate-PPD-for-remote-raw-queues-44.patch # remove once CentOS Stream 10 is released, cups-browsed @@ -228,6 +230,7 @@ fi %changelog * Tue Oct 15 2024 Zdenek Dohnal - 1:2.0.0-7 - CVE-2024-47176 cups-browsed: cups-browsed binds on UDP INADDR_ANY:631 trusting any packet from any source +- RHEL-17124 [cups-browsed] Prints to remote RAW queues are converted to PDF documents * Tue Aug 06 2024 Zdenek Dohnal - 1:2.0.0-6 - RHEL-51349 Cups browsing with 'Autoclustering on' cannot find printer clusters for HA due incorrect orientation-requested-default