RHEL-62744 [cups-browsed] Prints to remote RAW queues are converted to PDF documents

Resolves: RHEL-62744
This commit is contained in:
Zdenek Dohnal 2024-10-15 16:57:02 +02:00
parent 0330160936
commit 3862781cc3
2 changed files with 47 additions and 0 deletions

View File

@ -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);

View File

@ -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 <zdohnal@redhat.com> - 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 <zdohnal@redhat.com> - 1:2.0.0-6
- RHEL-51349 Cups browsing with 'Autoclustering on' cannot find printer clusters for HA due incorrect orientation-requested-default