Michael R Sweet [Sun, 14 Apr 2024 14:51:54 +0000 (10:51 -0400)]
Localize finishings/finishings-col, media-source, media-type, output-bin, and
printer-state-reasons keywords using both the standard CUPS message catalogs and
the printer's own strings files, with a backup of converting keywords like
"one-two-three" to "One Two Three".
Sometimes headers are not correctly copied into response to the client (some are missing). It happens because sent_header is set prematurely before the actual send happens. The present code in affected cupsdWriteClient() scope looks like code remains from CUPS 1.6.3, where cupsdSendHeader() is called earlier and generates the required headers by itself - the current cupsdSendHeader() sends only the headers which are saved in array fields, so the premature setting of sent_header sometimes causes not having all headers in the response.
With the change, testing via curl gives reliable results all time.
Sometimes headers are not correctly copied into response to the client
(some are missing). It happens because `sent_header` is set prematurely
before the actual send happens. The present code in affected `cupsdWriteClient`
scope looks like code remains from CUPS 1.6.3.
With the change, testing via curl gives reliable results all time.
Benjamin Gordon [Mon, 25 Mar 2024 15:59:21 +0000 (09:59 -0600)]
Add additional parameter validation to _cupsRasterWritePixels
If len is 0, the function does a lot of calculations that ultimately
don't produce any output. This can be skipped with an early return.
If cupsBytesPerLine is 0, this triggers a divide by zero if the output
isn't compressed. This is an error on the caller's part, but it's
nicer to return an error than to crash.
zdohnal [Tue, 19 Mar 2024 09:41:19 +0000 (10:41 +0100)]
snmp.c: Validate input OID string for `_cupsSNMPStringToOID()`
We can accept OID string as input in few cases (mainly via side channel) and if the crafted OID string is sent, internal function asn1_size_oid() can end up with stack buffer overflow.
The issue happens when one OID node is too large, or OID is invalid (ending with dots) - we can fix it in _cupsSNMPStringToOID() by checking if the last source character is a dot (invalid OID), and by limiting integer for OID node to 0xffff.
Zdenek Dohnal [Mon, 18 Mar 2024 14:02:30 +0000 (15:02 +0100)]
snmp.c: Validate input OID string for `_cupsSNMPStringToOID()`
We can accept OID string as input in few cases (mainly via side channel)
and if the crafted OID string is sent, internal function
`asn1_size_oid()` can end up with stack buffer overflow.
The issue happens when one OID node is too large, or OID is invalid
(ending with dots) - we can fix it in `_cupsSNMPStringToOID()` by
checking if the last source character is a dot (invalid OID),
and by limiting integer for OID node to 0xffff.
zdohnal [Thu, 15 Feb 2024 12:45:34 +0000 (13:45 +0100)]
ppd-cache.c: Check for required attributes if URF or PWG Raster are found
Some devices have image/urf in document-format-supported, but is missing urf-supported if AirPrint support is turned off, which breaks PPD generation.
Check for attribute urf-supported when we are about to decide whether the printer uses AirPrint, so in case the device supports another driverless standard, we can use it for PPD generation.
Zdenek Dohnal [Tue, 13 Feb 2024 07:20:52 +0000 (08:20 +0100)]
ppd-cache.c: Check for `urf-supported` if `image/urf` is found
Some devices have `image/urf` in `document-format-supported`, but is
missing `urf-supported` if AirPrint support is turned off, which breaks
PPD generation.
Check for attribute `urf-supported` when we are about to decide whether
the printer uses AirPrint, so in case the device supports another
driverless standard, we can use it for PPD generation.
zdohnal [Wed, 14 Feb 2024 13:08:06 +0000 (14:08 +0100)]
Use PAM password-auth or system-auth if present
Enables possibility to use PAM modules password-auth or system-auth if they exist during compilation. password-auth module is for remote authentication and system-auth for local authentication.
Zdenek Dohnal [Wed, 14 Feb 2024 08:35:05 +0000 (09:35 +0100)]
Use PAM password-auth or system-auth if present
This PR is actually based on one really old patch we have in Fedora,
which enables possibility to use PAM modules password-auth or
system-auth if they exist during compilation.
Those PAM modules looks to be used for remote, respective local
authentication, in Linux. Would it be possible to add their support into
CUPS?