[packages/cups] - avoid sending overly long job names in IPP requests

baggins baggins at pld-linux.org
Sun May 19 15:11:21 CEST 2024


commit 76453c58454dbd0755c5f65bf2a24fcaabaa6e81
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun May 19 15:06:31 2024 +0200

    - avoid sending overly long job names in IPP requests
    
    Some clients (e.g. Google Drive PDF Viewer) create hilariously long
    document titles (same hash?) when they send jobs to CUPS. CUPS uses that
    as job-name when sending IPP requests to printers and not all printers
    can accept that and reject the job. Trim job-title at arbitrary number
    of 127 characters to make all this work.

 cups.spec               |  2 ++
 job-name-too-long.patch | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)
---
diff --git a/cups.spec b/cups.spec
index 7ebfd21..5445058 100644
--- a/cups.spec
+++ b/cups.spec
@@ -41,6 +41,7 @@ Patch13:	%{name}-systemd-socket.patch
 Patch15:	reactivate_recommended_driver.patch
 Patch16:	read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
 Patch18:	%{name}-final-content-type.patch
+Patch19:	job-name-too-long.patch
 # avahi patches from fedora
 Patch100:	%{name}-avahi-address.patch
 Patch101:	%{name}-avahi-no-threaded.patch
@@ -284,6 +285,7 @@ bibliotecas do CUPS.
 %patch15 -p1
 %patch16 -p1
 %patch18 -p1
+%patch19 -p1
 
 %if %{with avahi}
 %patch100 -p1
diff --git a/job-name-too-long.patch b/job-name-too-long.patch
new file mode 100644
index 0000000..6e15d25
--- /dev/null
+++ b/job-name-too-long.patch
@@ -0,0 +1,20 @@
+--- cups-2.3.6/backend/ipp.c.orig	2024-05-19 14:12:43.566004590 +0200
++++ cups-2.3.6/backend/ipp.c	2024-05-19 14:49:20.758512651 +0200
+@@ -1519,14 +1519,13 @@
+ 
+   if (create_job)
+   {
+-    monitor.job_name = argv[3];
++    snprintf(print_job_name, 127, "%s", argv[3]);
+   }
+   else
+   {
+-    snprintf(print_job_name, sizeof(print_job_name), "%s - %s", argv[1],
+-             argv[3]);
+-    monitor.job_name = print_job_name;
++    snprintf(print_job_name, 127, "%s - %s", argv[1], argv[3]);
+   }
++  monitor.job_name = print_job_name;
+ 
+   _cupsThreadCreate((_cups_thread_func_t)monitor_printer, &monitor);
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cups.git/commitdiff/76453c58454dbd0755c5f65bf2a24fcaabaa6e81



More information about the pld-cvs-commit mailing list