From 1687ddf1f4cd7d766c69dbcd0f2d94adf2ffeea7 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 28 Jun 2023 17:32:11 +0200 Subject: [PATCH] 2217284 - The command "cancel -x " does not remove job files Resolves: rhbz#2217284 --- ...stead-of-purge-jobs-when-canceling-a.patch | 48 +++++++++++++++++++ cups.spec | 5 ++ 2 files changed, 53 insertions(+) create mode 100644 0001-Use-purge-job-instead-of-purge-jobs-when-canceling-a.patch diff --git a/0001-Use-purge-job-instead-of-purge-jobs-when-canceling-a.patch b/0001-Use-purge-job-instead-of-purge-jobs-when-canceling-a.patch new file mode 100644 index 0000000..fe5d29e --- /dev/null +++ b/0001-Use-purge-job-instead-of-purge-jobs-when-canceling-a.patch @@ -0,0 +1,48 @@ +From c5ad7aaf6c8063a39974c6b4a3cf59b7f912daae Mon Sep 17 00:00:00 2001 +From: Bryan Mason +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 " 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 " 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 + diff --git a/cups.spec b/cups.spec index 65bd67d..1d423a1 100644 --- a/cups.spec +++ b/cups.spec @@ -107,6 +107,8 @@ Patch29: 0001-scheduler-cert.c-Fix-string-comparison-fixes-CVE-202.patch Patch30: cups-local-negotiate.patch # 2217177 - Delays printing to lpd when reserved ports are exhausted Patch31: 0001-Fix-delays-printing-to-lpd-when-reserved-ports-are-e.patch +# 2217284 - The command "cancel -x " 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 @@ -345,6 +347,8 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in %patch30 -p1 -b .local-negotiate # 2217177 - Delays printing to lpd when reserved ports are exhausted %patch31 -p1 -b .lpd-delay +# 2217284 - The command "cancel -x " does not remove job files +%patch32 -p1 -b .purge-job %if %{lspp} # LSPP support. @@ -770,6 +774,7 @@ rm -f %{cups_serverbin}/backend/smb %changelog * Wed Jun 28 2023 Zdenek Dohnal - 1:2.3.3op2-19 - 2217177 - Delays printing to lpd when reserved ports are exhausted +- 2217284 - The command "cancel -x " does not remove job files * Wed Apr 26 2023 Zdenek Dohnal - 1:2.3.3op2-18 - 2189919 - CGI scripts don't work with local Negotiate authentication