cupsd can be killed by systemd if the daemon takes too much time when
starting - f.e. when loading many queues and/or not enough memory for
loading the daemon quicker.
TimeoutStartSec directive for systemd services defines the time after
which the daemon is killed - if set to 'infinity', a service is not
killed.
Zdenek Dohnal [Mon, 29 Nov 2021 08:30:26 +0000 (09:30 +0100)]
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.
Zdenek Dohnal [Fri, 19 Nov 2021 11:23:08 +0000 (12:23 +0100)]
cups/http-support.c: Apply DigestOptions to RFC 2069 support
Earlier we applied DigestOptions only for devices which implement RFC
2617 or RFC 7616, this commit applies it even for RFC 2069 support.
This issue came up during CentOS Stream/RHEL 9 development, where MD5
digest is marked as insecure for authentication/authorization, so it
should be turned off in default configurations to prevent security
issues.
Till Kamppeter [Tue, 2 Nov 2021 23:10:03 +0000 (00:10 +0100)]
Client Snap support in cupsd: Additional NULL check
When testing the newest snapd whether it works correctly together
with CUPS, I hit a segfault in the chackwhether the client is a Snap
plugging cups-control, for the case when CUPS is not snapped.
Zdenek Dohnal [Wed, 27 Oct 2021 04:58:42 +0000 (06:58 +0200)]
Test suite: Add tests for undefined page range limits
Originally pdftopdf from cups-filters doesn't support page range with
undefined upper limit (f.e. '5-'), but I found out these page ranges
aren't checked in CUPS test suite neither.
It would be great if we could cover the use case in test suite to
prevent possible regressions in the future.
Zdenek Dohnal [Tue, 26 Oct 2021 15:33:40 +0000 (17:33 +0200)]
Test suite: Add regression test for cupsSNMP/IPPSupplies
lpadmin can set cupsSNMPSupplies and cupsIPPSupplies keywords in the PPD
file which was broken in the past (Apple Issue #5610).
Until we get rid of PPD files completely or if we use the options in the
no-PPD future, it would be great if we had a regression test in the test
suite.
Use thread-safe getpwnam_r and getpwuid_r in multi-threaded code
getpwnam and getpwuid are thread-unsafe and potentially dangerous
in multi-threaded code. Substitue all their occurrences in
multi-threaded code with getpwnam_r and getpwuid_r, which are
thread-safe.
Till Kamppeter [Sat, 9 Oct 2021 22:34:43 +0000 (00:34 +0200)]
cupsd: Added debug log message if admin access from own utility is accepted
On Snap mediation there is always a debug message telling why the
administrative task was accepted or denied, it was only missing if the
client is our CUPS Snap itself.
Michael R Sweet [Tue, 5 Oct 2021 14:45:47 +0000 (10:45 -0400)]
Add support for CORS/HSTS/OSCORE/Interative Client security headers (Issue #266)
All this does is add HTTP_FIELD_xxx enumerations and the corresponding strings
to allow libcups implementations of HTTP clients/servers that send/receive them.
For the subject bug we'll still need to do a bunch of work in cupsd (later).
Michael R Sweet [Tue, 5 Oct 2021 14:45:47 +0000 (10:45 -0400)]
Add support for CORS/HSTS/OSCORE/Interative Client security headers (Issue #266)
All this does is add HTTP_FIELD_xxx enumerations and the corresponding strings
to allow libcups implementations of HTTP clients/servers that send/receive them.
For the subject bug we'll still need to do a bunch of work in cupsd (later).
The old behavior unconditionally cleared the "offline-report"
printer-reason unless the backend was 'usb:' or 'ippusb:' with the
assumption that these were the only two direct-connect USB backends
in use, with everything else being remote.
This is definitely not the case; putting aside proprietary 3rd-party
backends, there is Gutenprint's USB backend, which identifies itself
with 'gutenprint52+usb:' or 'gutenprint53+usb:' depending on the version.
So, generalize the rule to search for the string 'usb:' in the uri
instead, which will allow all three/four usb backends to use the
'offline-report' printer-reason.
(FWIW, I'm not happy with this approach; It seems to me that the
CorrectSolution(tm) is to track the device-class returned by the backend
at discovery time, and ignore 'offline-report' for anything other than
'direct', but that's going to be a lot more involved..)