cups/http-addr.c: Set listen backlog size to INT_MAX (fixes #308)
Use a listen queue size of INT_MAX, which should default to the maximum
supported queue size on the system.
This avoids the problem of the listening backlog queue getting full when
there are too many requests at the same time. The problem was observed
with the previous backlog size (128) by customers when submitting large
batches of print jobs, resulting in some jobs getting lost.
Till Kamppeter [Wed, 15 Feb 2023 21:01:05 +0000 (22:01 +0100)]
In auto-generated PPDs do not set RGB default on mono printers
When a PPD for a driverless printer is generated by the
_ppdCreateFromIPP2() function and the get-printer-attributes IPP
response gives "print-color-mode-default=auto" the PPD's default
setting for "ColorModel" is always "RGB", even on monochrome printers,
which makes printing fail on most devices.
Now we ignore the "print-color-mode-default" if set to "auto" and
proceed as if no default was given, finding the default by selecting
the most desirable of the existing "ColorModel" choices.
Benjamin Gordon [Wed, 1 Feb 2023 17:01:42 +0000 (10:01 -0700)]
Fix UB in cups_raster_read debug message
The first time `cups_raster_read` is called, both `r->bufptr` and
`r->buffer` are NULL. The calculation here then ends up looking like
adding a size_t to a NULL pointer, which triggers the ubsan detector.
Since we just want an offset, cast the pointer difference to ssize_t
like the code already does a few lines below.
Rose [Mon, 30 Jan 2023 22:37:09 +0000 (17:37 -0500)]
Fix bounds of description
description is 256. However, buffer is 258, which is a problem because we are possibly exceeding the bounds of description when we access description[2 * i + 2] as i approaches 256. I refactored the code to make it more obvious that this should be avoided.
Zdenek Dohnal [Mon, 30 Jan 2023 08:30:15 +0000 (09:30 +0100)]
Bug report related changes
- adjust bug template to mention CUPS version, an application instead of
browser, precise OS name and version and mention REPORTING_ISSUES
document
- fix a typo in REPORTING_ISSUES document
- mention REPORTING_ISSUES document README
Till Kamppeter [Mon, 30 Jan 2023 02:21:46 +0000 (23:21 -0300)]
Add templates for issue reports
This adds a selection screen when you click the button to report a new
issue on the "Issues" page. The selection screen does not only create
one entry for each issue template but also one extra entry for
security (private) bug reports. The latter is especially important as
otherwise the entrance point for a security bug report is hidden on
the security page.
Till Kamppeter [Sun, 22 Jan 2023 00:28:02 +0000 (21:28 -0300)]
PPD for driverless IPP: Poll "media-col-database" separately if needed
In the create_local_bg_thread() function for auto-generating a PPD
file for a CUPS queue for a driverless printer, either via the
"everywhere" model selection or an auto-created temporary queue we
need to query the full capabilities information from the printer.
To get the full set of printer properties from a driverless IPP
printer one does a "get-printer-attributes" IPP request with the
attribute "requested-attributes" set to "all,media-col-database" (note
that "all" does not include "media-col-database" because this
attribute is often very long, it contains all valid combinations of
media size, media type, media source, and margins). For some printers
this fails and we fall back to just "all" and lose valuable
information.
But some of those printers which do not support "requested-attributes"
set to "all,media-col-database" support "requested-attributes" set to
"media-col-database" alone and this we now make use of, by polling
"media-col-database" separately and adding it to the IPP response of
"all" if needed.
Rose [Fri, 20 Jan 2023 17:34:50 +0000 (12:34 -0500)]
Remove useless depth argument from static function cups_get_printer_uri
This is safe to do since this function is not supposed to be exposed via the ABI, nor is there a pointer to this function, so as long as every other function in the file accommodates this change, no behavioral change should happen.
In addition, depth is always 0 and only used for one debug print statement anyway, so we can and should remove it, instead of simply declaring it unused.
Rose [Thu, 3 Nov 2022 23:14:49 +0000 (19:14 -0400)]
Change cupsd.conf to force authentication when accessing administration
With the current default configuration, anyone can request to Find New Printers without being authenticated and with no way to be authenticated. Without authentication cups does not detects printers on the network. The person might not realize that it's because authentication is missing. It seems natural to always offer to authenticate when accessing the administration page.
Benjamin Gordon [Fri, 2 Dec 2022 17:22:09 +0000 (10:22 -0700)]
Update InputSlot selection for photo sizes (fixes #569)
_ppdCacheGetInputSlot specifically requests the photo tray for paper
sizes up to 5x7" if the client hasn't specified a media-source. This
can fail if the photo tray is physically smaller than 5x7 (for example,
L-sized).
Instead of explicitly requesting the photo tray, try to request "auto"
and fall back to "photo" if the printer doesn't provide that as an
option.
Signed-off-by: Benjamin Gordon <bmgordon@chromium.org>