From 2482c82b3a52d91a8e6bc23833394cb0f8396e45 Mon Sep 17 00:00:00 2001 From: shirely Date: Wed, 15 Jun 2022 17:06:21 +0800 Subject: [PATCH] fix master failed (cherry picked from commit b375b5de8b6b6eb9d79ea47e452637536b6a7f02) --- backport-Also-fix-cupsfilter.patch | 31 +++++++++++++ ...r-RIP_MAX_CACHE-environment-variable.patch | 46 +++++++++++++++++++ cups.spec | 7 ++- 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 backport-Also-fix-cupsfilter.patch create mode 100644 backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch diff --git a/backport-Also-fix-cupsfilter.patch b/backport-Also-fix-cupsfilter.patch new file mode 100644 index 00000000..df8c7dcf --- /dev/null +++ b/backport-Also-fix-cupsfilter.patch @@ -0,0 +1,31 @@ +From 3a1a81d7b882c06451a39a19a87aca7ec44742e6 Mon Sep 17 00:00:00 2001 +From: Michael R Sweet +Date: Wed, 12 Jan 2022 08:33:58 -0500 +Subject: [PATCH] Also fix cupsfilter (Issue #323) + +Reference:https://github.com/OpenPrinting/cups/commit/3a1a81d7b882c06451a39a19a87aca7ec44742e6 + +--- + scheduler/cupsfilter.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/scheduler/cupsfilter.c b/scheduler/cupsfilter.c +index c6dbb8debb..a03e77de76 100644 +--- a/scheduler/cupsfilter.c ++++ b/scheduler/cupsfilter.c +@@ -981,7 +981,6 @@ exec_filters(mime_type_t *srctype, /* I - Source type */ + printer_info[255], /* PRINTER_INFO env variable */ + printer_location[255], /* PRINTER_LOCATION env variable */ + printer_name[255], /* PRINTER env variable */ +- rip_max_cache[1024], /* RIP_MAX_CACHE */ + userenv[1024], /* USER */ + #if CUPS_SNAP + fontconfig_file[1024], /* FONTCONFIG_FILE */ +@@ -1133,7 +1132,6 @@ exec_filters(mime_type_t *srctype, /* I - Source type */ + envp[i ++] = printer_info; + envp[i ++] = printer_location; + envp[i ++] = printer_name; +- envp[i ++] = rip_max_cache; + envp[i ++] = userenv; + envp[i ++] = "CHARSET=utf-8"; + if (final_content_type[0]) diff --git a/backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch b/backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch new file mode 100644 index 00000000..6179fe9e --- /dev/null +++ b/backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch @@ -0,0 +1,46 @@ +From ee02b74ad03b52a5226f80dd2f551c1b565cdbb2 Mon Sep 17 00:00:00 2001 +From: Michael R Sweet +Date: Wed, 12 Jan 2022 08:12:24 -0500 +Subject: [PATCH] Remove legacy code for RIP_MAX_CACHE environment variable + (Issue #323) + +Reference:https://github.com/OpenPrinting/cups/commit/ee02b74ad03b52a5226f80dd2f551c1b565cdbb2 + +--- + CHANGES.md | 12 +++++++++--- + scheduler/job.c | 7 ++----- + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/scheduler/job.c b/scheduler/job.c +index fd69f71c9c..fbacc4cd12 100644 +--- a/scheduler/job.c ++++ b/scheduler/job.c +@@ -541,10 +541,8 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ + /* PRINTER_LOCATION env variable */ + printer_name[255], + /* PRINTER env variable */ +- *printer_state_reasons = NULL, ++ *printer_state_reasons = NULL; + /* PRINTER_STATE_REASONS env var */ +- rip_max_cache[255]; +- /* RIP_MAX_CACHE env variable */ + + + cupsdLogMessage(CUPSD_LOG_DEBUG2, +@@ -749,7 +747,7 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ + + raw_file = !strcmp(job->filetypes[job->current_file]->super, "application") && + !strcmp(job->filetypes[job->current_file]->type, "vnd.cups-raw"); +- ++ + if ((job->compressions[job->current_file] && (!job->printer->remote || job->num_files == 1)) || + (!job->printer->remote && (job->printer->raw || raw_file) && job->num_files > 1)) + { +@@ -1051,7 +1049,6 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ + envp[envc ++] = apple_language; + #endif /* __APPLE__ */ + envp[envc ++] = ppd; +- envp[envc ++] = rip_max_cache; + envp[envc ++] = content_type; + envp[envc ++] = device_uri; + envp[envc ++] = printer_info; diff --git a/cups.spec b/cups.spec index 2ca0e6e8..3b12eba0 100644 --- a/cups.spec +++ b/cups.spec @@ -3,7 +3,7 @@ Name: cups Epoch: 1 Version: 2.4.0 -Release: 3 +Release: 4 Summary: CUPS is the standards-based, open source printing system for linux operating systems. License: GPLv2+ and LGPLv2+ with exceptions and AML Url: https://openprinting.github.io/cups/ @@ -25,6 +25,8 @@ Patch9: cups-ipp-multifile.patch Patch10: cups-web-devices-timeout.patch Patch6000: backport-CVE-2022-26691.patch +Patch6001: backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patch +Patch6002: backport-Also-fix-cupsfilter.patch BuildRequires: pam-devel pkgconf-pkg-config pkgconfig(gnutls) libacl-devel openldap-devel pkgconfig(libusb-1.0) BuildRequires: krb5-devel pkgconfig(avahi-client) systemd pkgconfig(libsystemd) pkgconfig(dbus-1) python3-cups @@ -446,6 +448,9 @@ rm -f %{_exec_prefix}/lib/cups/backend/smb %doc %{_datadir}/%{name}/www/apple-touch-icon.png %changelog +* Wed Jun 15 2022 hanhui - 2.4.0-4 +- Remove legacy code for RIP_MAX_CACHE environment variable + * Thu Jun 9 2022 hanhui - 2.4.0-3 - fix CVE-2022-26691