2217284 - The command "cancel -x <job>" does not remove job files

Resolves: rhbz#2217284
This commit is contained in:
Zdenek Dohnal 2023-06-28 17:32:11 +02:00
parent 1ba1df1959
commit 1687ddf1f4
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,48 @@
From c5ad7aaf6c8063a39974c6b4a3cf59b7f912daae Mon Sep 17 00:00:00 2001
From: Bryan Mason <bmason@redhat.com>
Date: Tue, 27 Jun 2023 04:18:46 -0700
Subject: [PATCH 1/2] Use "purge-job" instead of "purge-jobs" when canceling a
single job (#742)
The command "cancel -x <job>" adds "purge-jobs true" to the Cancel-Job
operation; however, the correct attribute to use for Cancel-job is
"purge-job" (singular), not "purge-jobs" (plural). As a result, job
files are not removed from /var/spool/cups when "cancel -x <job>" is
executed.
This patch resolves the issue by adding "purge-job" when the IPP
operation is Cancel-Job and "purge-jobs" for other IPP operations
(Purge-Jobs, Cancel-Jobs, and Cancel-My-Jobs)
---
systemv/cancel.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/systemv/cancel.c b/systemv/cancel.c
index 572f413e1..f5b8e12b5 100644
--- a/systemv/cancel.c
+++ b/systemv/cancel.c
@@ -260,6 +260,7 @@ main(int argc, /* I - Number of command-line arguments */
* attributes-natural-language
* printer-uri + job-id *or* job-uri
* [requesting-user-name]
+ * [purge-job] or [purge-jobs]
*/
request = ippNewRequest(op);
@@ -294,7 +295,12 @@ main(int argc, /* I - Number of command-line arguments */
"requesting-user-name", NULL, cupsUser());
if (purge)
- ippAddBoolean(request, IPP_TAG_OPERATION, "purge-jobs", (char)purge);
+ {
+ if (op == IPP_CANCEL_JOB)
+ ippAddBoolean(request, IPP_TAG_OPERATION, "purge-job", (char)purge);
+ else
+ ippAddBoolean(request, IPP_TAG_OPERATION, "purge-jobs", (char)purge);
+ }
/*
* Do the request and get back a response...
--
2.41.0

View File

@ -107,6 +107,8 @@ Patch29: 0001-scheduler-cert.c-Fix-string-comparison-fixes-CVE-202.patch
Patch30: cups-local-negotiate.patch Patch30: cups-local-negotiate.patch
# 2217177 - Delays printing to lpd when reserved ports are exhausted # 2217177 - Delays printing to lpd when reserved ports are exhausted
Patch31: 0001-Fix-delays-printing-to-lpd-when-reserved-ports-are-e.patch Patch31: 0001-Fix-delays-printing-to-lpd-when-reserved-ports-are-e.patch
# 2217284 - The command "cancel -x <job>" does not remove job files
Patch32: 0001-Use-purge-job-instead-of-purge-jobs-when-canceling-a.patch
##### Patches removed because IMHO they aren't no longer needed ##### Patches removed because IMHO they aren't no longer needed
@ -345,6 +347,8 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in
%patch30 -p1 -b .local-negotiate %patch30 -p1 -b .local-negotiate
# 2217177 - Delays printing to lpd when reserved ports are exhausted # 2217177 - Delays printing to lpd when reserved ports are exhausted
%patch31 -p1 -b .lpd-delay %patch31 -p1 -b .lpd-delay
# 2217284 - The command "cancel -x <job>" does not remove job files
%patch32 -p1 -b .purge-job
%if %{lspp} %if %{lspp}
# LSPP support. # LSPP support.
@ -770,6 +774,7 @@ rm -f %{cups_serverbin}/backend/smb
%changelog %changelog
* Wed Jun 28 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-19 * Wed Jun 28 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-19
- 2217177 - Delays printing to lpd when reserved ports are exhausted - 2217177 - Delays printing to lpd when reserved ports are exhausted
- 2217284 - The command "cancel -x <job>" does not remove job files
* Wed Apr 26 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-18 * Wed Apr 26 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3op2-18
- 2189919 - CGI scripts don't work with local Negotiate authentication - 2189919 - CGI scripts don't work with local Negotiate authentication