Zdenek Dohnal [Thu, 1 Jun 2023 12:47:49 +0000 (14:47 +0200)]
CI: Fix i386 for now
Although Ubuntu is dropping support for i386, this PR fixes build i386
for now. However we have to remove image upgrade, so probably once there
is a new image, i386 will be broken again.
I would remove the job for i386 once it breaks again due removing
support for i386 in Ubuntu.
Zdenek Dohnal [Tue, 30 May 2023 12:57:46 +0000 (14:57 +0200)]
workflows.yaml: Fix Github Actions on i386
- build i386 was failing due missing dependencies - libgcc-s1:i386 and
libstdc++6:i386
- use ubuntu-latest, so we automatically use the latest stable, but
print out the pretty name in workflow to show which version it is
(dont wanna to look up the names :))
- update the image before testing
Nathan Muggli [Fri, 26 May 2023 18:36:45 +0000 (12:36 -0600)]
Add custom page size values to media-col-database
When creating the IPP attrs based on the PPD file, if the PPD file
supports custom page sizes update our media-col-database to contain a
media-size attr with the min/max range.
Bryan Cain [Fri, 12 May 2023 17:23:24 +0000 (11:23 -0600)]
Fix duplicate PPD->IPP media-type name mappings
If more than one MediaType in a PPD matched the pattern for a registered
PWG media-type name, they would all be mapped to that name, making it
impossible for a client using CUPS' IPP interface to distinguish between
them or specify a particular one.
This comes up with Epson-provided PPDs, which frequently hit this case
by combining print quality with media type like so:
*MediaType PLAIN_HIGH/Plain paper-High: "
*MediaType PLAIN_NORMAL/Plain paper-Standard: "
Solve this problem by not assigning the standard PWG name to either one
when such duplication occurs.
Dave Barker [Fri, 12 May 2023 09:39:52 +0000 (10:39 +0100)]
Fix check for existing color mode setting
Colour mode selection is not persisted correctly across restarts. Current check is for "printer-color-mode", but every other reference to this option is "print-color-mode" (no "er"). This was causing the selected colour mode to be reset to the PPD default on restart.
Rose [Fri, 20 Jan 2023 17:47:21 +0000 (12:47 -0500)]
Improve state handling in cases of memory allocation failure
Many lines of code assume that malloc will not fail. In cases where it does, sometimes the program does not know, and as a result, memory can leak and more disastrous consequences can happen before the program ultimately finds something is wrong and then calls exit();
Rose [Sun, 23 Apr 2023 17:09:50 +0000 (13:09 -0400)]
UBSan: Array over-read when operating on _fields
We are reading outside of the _fields boundaries and onto other fields when we iterate across all the fields, rather than comparing just those that are within _fields, and then always freeing the ones that are not.
Rose [Sun, 23 Apr 2023 16:25:39 +0000 (12:25 -0400)]
UBSan: Contain pos - fp->bufpos in parentheses
Yes I know this shouldn't change the behavior in theory, but clang insists it does in practice, so to quiet the UBSan, I put parentheses around pos - fp->bufpos.
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.