From 9c645390cf98c3f7665041d808f24307b452b9d1 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 29 Nov 2021 11:21:10 +0100 Subject: [PATCH] 2018957 - RFE: Implement IdleExitTimeout configuration during build --- ...h-idle-exit-timeout-configure-option.patch | 54 +++++++++++++++++++ cups.spec | 42 +++++++++------ 2 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 0001-Add-with-idle-exit-timeout-configure-option.patch diff --git a/0001-Add-with-idle-exit-timeout-configure-option.patch b/0001-Add-with-idle-exit-timeout-configure-option.patch new file mode 100644 index 0000000..994e5ef --- /dev/null +++ b/0001-Add-with-idle-exit-timeout-configure-option.patch @@ -0,0 +1,54 @@ +From d3bf52f5dc9e465faba69a85eeed5b64916efddd Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Mon, 29 Nov 2021 09:30:26 +0100 +Subject: [PATCH] Add --with-idle-exit-timeout configure option + +The option enables setting IdleExitTimeout to a desired value - f.e. +setting to zero will disable automatic shutdown, which is useful on servers, +where cupsd is expected to run even if there is no web interface, no jobs +and CUPS doesn't share queues. +--- + CHANGES.md | 1 + + conf/cupsd.conf.in | 3 +++ + config-scripts/cups-defaults.m4 | 13 +++++++++++++ + configure | 30 ++++++++++++++++++++++++++++++ + 4 files changed, 47 insertions(+) + +diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in +index 03d1d5df5..b25884907 100644 +--- a/conf/cupsd.conf.in ++++ b/conf/cupsd.conf.in +@@ -28,6 +28,9 @@ DefaultAuthType Basic + # Web interface setting... + WebInterface @CUPS_WEBIF@ + ++# Timeout after cupsd exits if idle (applied only if cupsd runs on-demand - with -l) ++IdleExitTimeout @EXIT_TIMEOUT@ ++ + # Restrict access to the server... + + Order allow,deny +diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 +index 240a95229..9420e1510 100644 +--- a/config-scripts/cups-defaults.m4 ++++ b/config-scripts/cups-defaults.m4 +@@ -428,3 +428,16 @@ AS_IF([test $CUPS_WEBIF = Yes || test $CUPS_BROWSING = Yes], [ + SYSTEMD_WANTED_BY="$SYSTEMD_WANTED_BY multi-user.target"], [ + ]) + AC_SUBST([SYSTEMD_WANTED_BY]) ++ ++dnl Set default value of IdleExitTimeout ++AC_ARG_WITH([idle_exit_timeout], AS_HELP_STRING([--with-idle-exit-timeout], [set the default value for IdleExitTimeout, default=60]), [ ++ AS_IF([test "x$withval" = "xno"], [ ++ EXIT_TIMEOUT=0 ++ ], [ ++ EXIT_TIMEOUT=$withval ++ ]) ++], [ ++ EXIT_TIMEOUT=60 ++]) ++ ++AC_SUBST([EXIT_TIMEOUT]) +-- +2.31.1 + diff --git a/cups.spec b/cups.spec index 673fb8f..3315c25 100644 --- a/cups.spec +++ b/cups.spec @@ -17,7 +17,7 @@ Summary: CUPS printing system Name: cups Epoch: 1 Version: 2.3.3%{OP_VER} -Release: 11%{?dist} +Release: 12%{?dist} License: ASL 2.0 Url: https://openprinting.github.io/cups/ # Apple stopped uploading the new versions into github, use OpenPrinting fork @@ -99,6 +99,8 @@ Patch24: cups-deprecate-drivers.patch Patch25: cups-fstack-strong.patch # Applying DigestOptions to MD5 Digest authentication defined by RFC 2069 Patch26: 0001-cups-http-support.c-Apply-DigestOptions-to-RFC-2069-.patch +# 2018957 - RFE: Implement IdleExitTimeout configuration during build +Patch27: 0001-Add-with-idle-exit-timeout-configure-option.patch ##### Patches removed because IMHO they aren't no longer needed ##### but still I'll leave them in git in case their removal @@ -326,6 +328,8 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in %patch25 -p1 -b .fstack-strong # apply DigestOptions for MD5 Digest authentication defined by RFC 2069 %patch26 -p1 -b .no-digest-rfc2069 +# 2018957 - RFE: Implement IdleExitTimeout configuration during build +%patch27 -p1 -b .conf-idleexittimeout %if %{lspp} @@ -358,23 +362,26 @@ export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS -Wall -fstack-clash-protection -D_FORTIFY # --enable-debug to avoid stripping binaries %configure --with-docdir=%{_datadir}/%{name}/www --enable-debug \ %if %{lspp} - --enable-lspp \ + --enable-lspp \ %endif --with-exe-file-perm=0755 \ - --with-cupsd-file-perm=0755 \ - --with-log-file-perm=0600 \ - --enable-relro \ - --with-dbusdir=%{_sysconfdir}/dbus-1 \ - --enable-avahi \ - --enable-threads \ - --enable-gnutls \ - --enable-webif \ - --with-xinetd=no \ - --with-access-log-level=actions \ - --enable-page-logging \ - --with-rundir=%{_rundir}/cups \ - --enable-sync-on-close \ - localedir=%{_datadir}/locale + --with-cupsd-file-perm=0755 \ + --with-log-file-perm=0600 \ + --enable-relro \ + --with-dbusdir=%{_sysconfdir}/dbus-1 \ + --enable-avahi \ + --enable-threads \ + --enable-gnutls \ + --enable-webif \ + --with-xinetd=no \ + --with-access-log-level=actions \ + --enable-page-logging \ + --with-rundir=%{_rundir}/cups \ + --enable-sync-on-close \ +%if 0%{?rhel} + --without-idle-exit-timeout \ +%endif + localedir=%{_datadir}/locale # If we got this far, all prerequisite libraries must be here. %make_build @@ -698,6 +705,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man7/ippeveps.7.gz %changelog +* Mon Nov 29 2021 Zdenek Dohnal - 1:2.3.3op2-11 +- 2018957 - RFE: Implement IdleExitTimeout configuration during build + * Mon Nov 22 2021 Zdenek Dohnal - 1:2.3.3op2-11 - turn off MD5 Digest authentication by default, because MD5 is marked insecure