]> git.ipfire.org Git - thirdparty/cups.git/log
thirdparty/cups.git
7 months agoscheduler: Fix removing Server header from HTTP if requested 1116/head
Zdenek Dohnal [Mon, 16 Dec 2024 15:35:22 +0000 (16:35 +0100)] 
scheduler: Fix removing Server header from HTTP if requested

Use `httpSetDefaultField()` in `cupsdAcceptClient()` to do the trick.

Fixes #1111

8 months agotls-gnutls.c: Use system crypto policy if available
Zdenek Dohnal [Fri, 6 Dec 2024 06:59:16 +0000 (07:59 +0100)] 
tls-gnutls.c: Use system crypto policy if available

Some Linux systems provide a way how to control cryptography on system or service level via cryptographic policies. OpenSSL implementation reflects system changes to some degree, however GnuTLS implementation does not take system policy into account.

GnuTLS supports fallback mechanism, so we can fallback to NORMAL if @System is not defined on the system.

Fortunately, the current GnuTLS implementation allows overrides via priority strings (so no "this cipher/hash is disabled" if we enabled them in our application by priority string), so allowing to honor system policy can save us work if someone wants to disable a specific cipher, so we don't have to implement it in libcups.

8 months agoscheduler: Clean up failed IPP Everywhere permanent queues
Zdenek Dohnal [Mon, 2 Dec 2024 13:20:26 +0000 (14:20 +0100)] 
scheduler: Clean up failed IPP Everywhere permanent queues

If creating of permanent queue with IPP Everywhere model fails
in separate thread, the print queue is created as raw.
It would be great if we remove such queue if creation fails,
and marking them as temporary would make them to be removed automatically.

8 months agoFix make-and-model whitespace trimming (Issue #1096)
Michael R Sweet [Fri, 15 Nov 2024 16:55:07 +0000 (11:55 -0500)] 
Fix make-and-model whitespace trimming (Issue #1096)

9 months agoFix dependencies, temporarily downgrade NuGet version numbers.
Michael R Sweet [Tue, 15 Oct 2024 21:21:46 +0000 (17:21 -0400)] 
Fix dependencies, temporarily downgrade NuGet version numbers.

9 months agoMake sure we call inflateEnd when there is an error reading or comparing the stream...
Michael R Sweet [Sat, 12 Oct 2024 15:47:49 +0000 (11:47 -0400)] 
Make sure we call inflateEnd when there is an error reading or comparing the stream CRC (Issue #1070)

9 months agoFTBFS: Use int instead of bool
Zdenek Dohnal [Wed, 9 Oct 2024 08:42:01 +0000 (10:42 +0200)] 
FTBFS: Use int instead of bool

9 months agodest.c: Don't look for user config in cupsGetNamedDest as root
Zdenek Dohnal [Wed, 9 Oct 2024 08:31:18 +0000 (10:31 +0200)] 
dest.c: Don't look for user config in cupsGetNamedDest as root

We were still looking into ~/.cups/lpoptions as root in the function,
which IMHO is not expected.

Merged from master

10 months agoLimit ippReadIO recursion.
Michael R Sweet [Sun, 6 Oct 2024 02:11:07 +0000 (22:11 -0400)] 
Limit ippReadIO recursion.

10 months agoFix the default User-Agent string sent in requests.
Michael R Sweet [Thu, 3 Oct 2024 21:50:53 +0000 (17:50 -0400)] 
Fix the default User-Agent string sent in requests.

10 months agoUpdate files for possible next release
Zdenek Dohnal [Mon, 30 Sep 2024 12:19:33 +0000 (14:19 +0200)] 
Update files for possible next release

10 months agoPrepare release 2.4.11 v2.4.11
Zdenek Dohnal [Mon, 30 Sep 2024 11:38:35 +0000 (13:38 +0200)] 
Prepare release 2.4.11

10 months agoFix warnings for unused vars.
Michael R Sweet [Mon, 23 Sep 2024 14:11:31 +0000 (10:11 -0400)] 
Fix warnings for unused vars.

10 months agoQuote PPD localized strings.
Michael R Sweet [Mon, 23 Sep 2024 13:36:39 +0000 (09:36 -0400)] 
Quote PPD localized strings.

10 months agocups.service.in: Order after time-set.target
Zdenek Dohnal [Mon, 23 Sep 2024 10:55:10 +0000 (12:55 +0200)] 
cups.service.in: Order after time-set.target

Multiple functions that are called either implicitly or explicitly require a "roughly correct" CLOCK_REALTIME to behave.

10 months agoAdd a temporary queue before setting the defaults for lpoptions (Issue #833)
Michael R Sweet [Fri, 20 Sep 2024 17:08:09 +0000 (13:08 -0400)] 
Add a temporary queue before setting the defaults for lpoptions (Issue #833)

10 months agoMirror fix for max-fds from 2.5.
Michael R Sweet [Fri, 20 Sep 2024 15:40:28 +0000 (11:40 -0400)] 
Mirror fix for max-fds from 2.5.

10 months agoPPDize preset and template names.
Michael R Sweet [Mon, 9 Sep 2024 19:59:57 +0000 (15:59 -0400)] 
PPDize preset and template names.

10 months agoRefactor make-and-model code.
Michael R Sweet [Mon, 9 Sep 2024 18:05:42 +0000 (14:05 -0400)] 
Refactor make-and-model code.

10 months agoMirror IPP Everywhere printer changes from master.
Michael R Sweet [Mon, 9 Sep 2024 14:03:10 +0000 (10:03 -0400)] 
Mirror IPP Everywhere printer changes from master.

11 months agocups/dest.c: Set auth as required if not none
Zdenek Dohnal [Mon, 2 Sep 2024 10:38:44 +0000 (12:38 +0200)] 
cups/dest.c: Set auth as required if not none

Fixes #1037

11 months agoscheduler: add a systemd slice
Zdenek Dohnal [Mon, 2 Sep 2024 08:31:13 +0000 (10:31 +0200)] 
scheduler: add a systemd slice

From the systemd documentation[1]:

> A slice unit is a concept for hierarchically managing resources of a group of processes.

Benefits of collecting our two systemd services into a slice include
* ease of configuring resource limits on the entire CUPS system,
* ``systemctl status`` showing the CUPS units in an indented subtree,
  making it more organized,
* and the possibility of viewing all interlaced logs from all of the CUPS
  daemons using ``journalctl -u system-cups.slice``.

[1]:
https://www.freedesktop.org/software/systemd/man/latest/systemd.slice.html
or ``man systemd.slice(5)``

11 months agoFix IPP everywhere printer setup (Issue #1033)
Michael R Sweet [Thu, 15 Aug 2024 01:18:54 +0000 (21:18 -0400)] 
Fix IPP everywhere printer setup (Issue #1033)

11 months agoFixed HTTP PeerCred authentication for domain users (Issue #1001)
Zdenek Dohnal [Wed, 14 Aug 2024 08:11:06 +0000 (10:11 +0200)] 
Fixed HTTP PeerCred authentication for domain users (Issue #1001)

11 months agoFix compile issues.
Michael R Sweet [Wed, 14 Aug 2024 03:29:48 +0000 (23:29 -0400)] 
Fix compile issues.

11 months agoFix "all" support for JobPrivateAccess and SubscriptionPrivateAccess (Issue #990)
Michael R Sweet [Wed, 14 Aug 2024 03:23:56 +0000 (23:23 -0400)] 
Fix "all" support for JobPrivateAccess and SubscriptionPrivateAccess (Issue #990)

11 months agoChangelog.
Michael R Sweet [Wed, 14 Aug 2024 02:48:18 +0000 (22:48 -0400)] 
Changelog.

11 months agoFix cupsGetDestMediaByName and friends (Issue #993)
Michael R Sweet [Wed, 14 Aug 2024 02:46:04 +0000 (22:46 -0400)] 
Fix cupsGetDestMediaByName and friends (Issue #993)

11 months agoMake sure we duplicate strings returned by cgiGetTextField, just as we do for cgiGetV...
Michael R Sweet [Wed, 14 Aug 2024 00:32:08 +0000 (20:32 -0400)] 
Make sure we duplicate strings returned by cgiGetTextField, just as we do for cgiGetVariable (Issue #999)

11 months agoFix device URI when adding or modifying a printer (Issue #998)
Michael R Sweet [Wed, 14 Aug 2024 00:27:17 +0000 (20:27 -0400)] 
Fix device URI when adding or modifying a printer (Issue #998)

11 months agoFix printer-state-reasons/message in notifications (Issue #1013)
Michael R Sweet [Wed, 14 Aug 2024 00:16:14 +0000 (20:16 -0400)] 
Fix printer-state-reasons/message in notifications (Issue #1013)

11 months agoProtect against NULL in IPP backend (fixes #1026)
Zdenek Dohnal [Fri, 9 Aug 2024 05:54:41 +0000 (07:54 +0200)] 
Protect against NULL in IPP backend (fixes #1026)

11 months agoAdjust #893 for stream 2.4.x
Zdenek Dohnal [Thu, 8 Aug 2024 06:50:26 +0000 (08:50 +0200)] 
Adjust #893 for stream 2.4.x

12 months agoRework setting HTTP related errors (fixes #893)
Zdenek Dohnal [Wed, 24 Jul 2024 07:19:46 +0000 (09:19 +0200)] 
Rework setting HTTP related errors (fixes #893)

12 months agoFix checkbox support (fixes #1008)
Zdenek Dohnal [Tue, 23 Jul 2024 08:33:49 +0000 (10:33 +0200)] 
Fix checkbox support (fixes #1008)

12 months agoDo not use C99-only construct (fixes #1000)
Zdenek Dohnal [Mon, 8 Jul 2024 13:11:45 +0000 (15:11 +0200)] 
Do not use C99-only construct (fixes #1000)

13 months agoLimit the maximum number of file descriptors to 64k-1 (Issue #989)
Michael R Sweet [Thu, 20 Jun 2024 12:51:26 +0000 (08:51 -0400)] 
Limit the maximum number of file descriptors to 64k-1 (Issue #989)

13 months agoPrepare release 2.4.10 v2.4.10
Zdenek Dohnal [Tue, 18 Jun 2024 11:11:05 +0000 (13:11 +0200)] 
Prepare release 2.4.10

13 months agoconf.c: Add newline to fprintf
Zdenek Dohnal [Tue, 18 Jun 2024 08:51:38 +0000 (10:51 +0200)] 
conf.c: Add newline to fprintf

13 months agoscheduler: Fix cupsd activated on-demand via socket
zdohnal [Tue, 18 Jun 2024 08:41:50 +0000 (10:41 +0200)] 
scheduler: Fix cupsd activated on-demand via socket

If only the expected cups.sock is set as listener in cupsd.conf, the array Listeners was NULL. To prevent copying the code, do the array allocation earlier and have only one check for Listeners, in service_checkin() which is run every time cupsd starts.

Fixes #985

13 months agoscheduler: Fix cupsd activated on-demand via socket 988/head
Zdenek Dohnal [Tue, 18 Jun 2024 08:38:48 +0000 (10:38 +0200)] 
scheduler: Fix cupsd activated on-demand via socket

If only the expected cups.sock is set as listener in cupsd.conf, the
array Listeners was NULL. To prevent copying the code, do the array
allocation earlier and have only one check for Listeners, in
service_checkin() which is run every time cupsd starts.

Fixes #985

13 months agoUpdate "no listeners" message for service_checkin.
Michael R Sweet [Mon, 17 Jun 2024 13:18:08 +0000 (09:18 -0400)] 
Update "no listeners" message for service_checkin.

13 months agoFix builds without on-demand support.
Michael R Sweet [Fri, 14 Jun 2024 19:16:02 +0000 (15:16 -0400)] 
Fix builds without on-demand support.

13 months agoDon't abort early if there are no listen sockets after loading cupsd.conf (Issue...
Michael R Sweet [Fri, 14 Jun 2024 19:10:21 +0000 (15:10 -0400)] 
Don't abort early if there are no listen sockets after loading cupsd.conf (Issue #985)

13 months agoBump version.
Michael R Sweet [Fri, 14 Jun 2024 18:03:39 +0000 (14:03 -0400)] 
Bump version.

13 months agoFix error handling when reading a bad 1setOf attribute.
Michael R Sweet [Fri, 14 Jun 2024 18:02:27 +0000 (14:02 -0400)] 
Fix error handling when reading a bad 1setOf attribute.

13 months agoMake 2.4.9 release v2.4.9
Zdenek Dohnal [Tue, 11 Jun 2024 14:20:10 +0000 (16:20 +0200)] 
Make 2.4.9 release

13 months agoFix domain socket handling (fixes CVE-2024-35235)
Zdenek Dohnal [Tue, 11 Jun 2024 14:19:11 +0000 (16:19 +0200)] 
Fix domain socket handling (fixes CVE-2024-35235)

- Check status of unlink and bind system calls.
- Don't allow extra domain sockets when running from launchd/systemd.
- Validate length of domain socket path (< sizeof(sun_path))

Fixes CVE-2024-35235, written by Mike Sweet

13 months agocgi: Fix showing query string in Help
Zdenek Dohnal [Mon, 10 Jun 2024 06:49:39 +0000 (08:49 +0200)] 
cgi: Fix showing query string in Help

If a string was searched on CUPS Web UI help page, garbage was printed
out in search box. It was because text field pointer was freed before
and contained garbage - previously it was variable value which was
allocated, so the string survived `cgCleanVariables(()`, but the text
field is a pointer into form variables which gets cleaned up.

Fix is to use `strdup()` if `cgiGetTextfield()` returns non-NULL
pointer. The binary exits shortly after either way, so memory is taken
care of by OS.

14 months agoBackport French translation updates
Zdenek Dohnal [Fri, 7 Jun 2024 04:48:49 +0000 (06:48 +0200)] 
Backport French translation updates

14 months agoFix listing jobs in printers/classes pages in web ui
Zdenek Dohnal [Thu, 6 Jun 2024 10:04:20 +0000 (12:04 +0200)] 
Fix listing jobs in printers/classes pages in web ui

14 months agoFix DNS-SD lookups of local services with Avahi (Issue #970)
Michael R Sweet [Thu, 30 May 2024 12:15:42 +0000 (08:15 -0400)] 
Fix DNS-SD lookups of local services with Avahi (Issue #970)

14 months agoppd-cache.c: Fix generating cupsUrfSupported (fixes #952)
zdohnal [Thu, 30 May 2024 06:12:48 +0000 (08:12 +0200)] 
ppd-cache.c: Fix generating cupsUrfSupported (fixes #952)

The PPD keyword got the option values concatenated together without commas, which broke filter processing in libcupsfilters

Sometimes more commas better commas :)

14 months agoppd-cache.c: Fix generating cupsUrfSupported (fixes #952) 968/head
Zdenek Dohnal [Wed, 29 May 2024 06:44:35 +0000 (08:44 +0200)] 
ppd-cache.c: Fix generating cupsUrfSupported (fixes #952)

The PPD keyword got the option values concatenated together without
commas, which broke filter processing in libcupsfilters

Sometimes more commas better commas :)

14 months agoRevert Host: header change (Issue #967)
Michael R Sweet [Wed, 29 May 2024 00:44:04 +0000 (20:44 -0400)] 
Revert Host: header change (Issue #967)

14 months agoFix typo in fr/printer-default.tmpl
Zdenek Dohnal [Tue, 28 May 2024 15:27:09 +0000 (17:27 +0200)] 
Fix typo in fr/printer-default.tmpl

14 months agocups/dest.c: Raise timeout for _CUPS_DNSSD_GET_DESTS
Zdenek Dohnal [Tue, 21 May 2024 13:04:26 +0000 (15:04 +0200)] 
cups/dest.c: Raise timeout for _CUPS_DNSSD_GET_DESTS

Forgot to include in 2.4.8... fixes #751 for series 2.4.x.

14 months agoSet SNI extension with OpenSSL.
Michael R Sweet [Fri, 17 May 2024 15:59:55 +0000 (11:59 -0400)] 
Set SNI extension with OpenSSL.

14 months agoFix cgiGetTextfield() return value if original value is invalid
Zdenek Dohnal [Thu, 16 May 2024 14:02:16 +0000 (16:02 +0200)] 
Fix cgiGetTextfield() return value if original value is invalid

15 months agoSet release date v2.4.8
Zdenek Dohnal [Fri, 26 Apr 2024 11:38:21 +0000 (13:38 +0200)] 
Set release date

15 months agoFix ippeveprinter issues
Zdenek Dohnal [Fri, 26 Apr 2024 09:52:21 +0000 (11:52 +0200)] 
Fix ippeveprinter issues

15 months agoBackport fix for mime.types limit (Issue #925)
Zdenek Dohnal [Fri, 26 Apr 2024 09:17:23 +0000 (11:17 +0200)] 
Backport fix for mime.types limit (Issue #925)

15 months agoValidate input OID for _cupsSNMPString
Zdenek Dohnal [Fri, 26 Apr 2024 09:01:18 +0000 (11:01 +0200)] 
Validate input OID for _cupsSNMPString

15 months agoFix older jobs with incorrect final state
Zdenek Dohnal [Fri, 26 Apr 2024 08:59:18 +0000 (10:59 +0200)] 
Fix older jobs with incorrect final state

15 months agoUpdate checkbox support code.
Michael R Sweet [Thu, 18 Apr 2024 22:29:07 +0000 (18:29 -0400)] 
Update checkbox support code.

15 months agoFix support for simple punch finisher (Issue #821)
Michael R Sweet [Wed, 17 Apr 2024 00:25:40 +0000 (20:25 -0400)] 
Fix support for simple punch finisher (Issue #821)

15 months agoMerge pull request #937 from andreas-karlson/bugfix/fix-cupsd-new-printer-bug
Michael R Sweet [Wed, 10 Apr 2024 18:08:19 +0000 (14:08 -0400)] 
Merge pull request #937 from andreas-karlson/bugfix/fix-cupsd-new-printer-bug

scheduler: Fix regression in background thread (Issue #934)

15 months agoscheduler: Fix regression in background thread (Issue #934) 937/head
Andreas Karlson [Wed, 10 Apr 2024 12:44:22 +0000 (14:44 +0200)] 
scheduler: Fix regression in background thread (Issue #934)

The con->bg_pending value is used to indicate that the background thread
has finished running and that the connection can be safely closed.

This commit makes the con->bg_pending = 0 only after the connection
can be safely closed.

15 months agoMerge pull request #935 from andreas-karlson/bugfix/fix-cupsd-new-printer-bug
Michael R Sweet [Tue, 9 Apr 2024 15:50:32 +0000 (11:50 -0400)] 
Merge pull request #935 from andreas-karlson/bugfix/fix-cupsd-new-printer-bug

scheduler: Fix potential bug when adding new printers (Issue #934)

15 months agoscheduler: Fix potential bug when adding new printers (Issue #934) 935/head
Andreas Karlson [Tue, 9 Apr 2024 13:14:22 +0000 (15:14 +0200)] 
scheduler: Fix potential bug when adding new printers (Issue #934)

When adding a new printer a thread is created to handle PPD generation,
and the requesting client connection might close while the thread is running.
This commit prevents full connection cleanup until the thread is finished.

16 months agoReport an error if you use lpadmin to set defaults for a temporary queue (Issue ...
Michael R Sweet [Fri, 5 Apr 2024 21:27:23 +0000 (17:27 -0400)] 
Report an error if you use lpadmin to set defaults for a temporary queue (Issue #237)

16 months agoFix document-unprintable-error support (Issue #391)
Michael R Sweet [Fri, 5 Apr 2024 20:44:33 +0000 (16:44 -0400)] 
Fix document-unprintable-error support (Issue #391)

16 months agoFix cupsCopyDestInfo device connection detection (Issue #586)
Michael R Sweet [Fri, 5 Apr 2024 16:54:18 +0000 (12:54 -0400)] 
Fix cupsCopyDestInfo device connection detection (Issue #586)

16 months agoFix Upgrade header handling when there is no TLS support (Issue #775)
Michael R Sweet [Fri, 5 Apr 2024 13:05:47 +0000 (09:05 -0400)] 
Fix Upgrade header handling when there is no TLS support (Issue #775)

16 months agoAllow PPD choices and PWG keywords to select media (Issue #238)
Michael R Sweet [Fri, 5 Apr 2024 12:47:03 +0000 (08:47 -0400)] 
Allow PPD choices and PWG keywords to select media (Issue #238)

16 months agoscheduler: Fix sending response headers to client
Zdenek Dohnal [Fri, 5 Apr 2024 08:46:22 +0000 (10:46 +0200)] 
scheduler: Fix sending response headers to client

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.

16 months agoResolve CI issue on macOS.
Michael R Sweet [Thu, 4 Apr 2024 20:30:31 +0000 (16:30 -0400)] 
Resolve CI issue on macOS.

16 months agoUpdate CUPS-Add-Modify-Printer and CUPS-Create-Local-Printer code to delay responding...
Michael R Sweet [Thu, 4 Apr 2024 20:25:25 +0000 (16:25 -0400)] 
Update CUPS-Add-Modify-Printer and CUPS-Create-Local-Printer code to delay responding until the PPD is successfully generated (Issue #347)

16 months agoFix backported changes for race condition.
Michael R Sweet [Thu, 4 Apr 2024 16:12:05 +0000 (12:12 -0400)] 
Fix backported changes for race condition.

16 months agoMirror fix from master/2.5 for potential race condition with CUPS-Create-Local-Printe...
Michael R Sweet [Thu, 4 Apr 2024 16:06:19 +0000 (12:06 -0400)] 
Mirror fix from master/2.5 for potential race condition with CUPS-Create-Local-Printer (Issue #871)

16 months agoFix httpGets timeout handling (Issue #879)
Michael R Sweet [Tue, 2 Apr 2024 15:20:06 +0000 (11:20 -0400)] 
Fix httpGets timeout handling (Issue #879)

16 months agoFix the initialization and validation of checkbox and text fields in CGI forms.
Michael R Sweet [Tue, 2 Apr 2024 12:43:49 +0000 (08:43 -0400)] 
Fix the initialization and validation of checkbox and text fields in CGI forms.

16 months agocups/ipp.c: Use strcmp, since attribute names are case sensitive
Zdenek Dohnal [Fri, 22 Mar 2024 05:27:42 +0000 (06:27 +0100)] 
cups/ipp.c: Use strcmp, since attribute names are case sensitive

17 months agoFix IPv6 address encoding in the Host: header (Issue #903)
Michael R Sweet [Fri, 1 Mar 2024 16:55:39 +0000 (11:55 -0500)] 
Fix IPv6 address encoding in the Host: header (Issue #903)

17 months agoppd-cache.c: Check for required attributes if URF or PWG Raster are found
Zdenek Dohnal [Thu, 15 Feb 2024 17:15:55 +0000 (18:15 +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.
Apply the same for PWG Raster too.

Fixes Fedora issue #2263053

17 months agoUse PAM password-auth or system-auth if present
Zdenek Dohnal [Wed, 14 Feb 2024 13:22:40 +0000 (14:22 +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.

17 months agoReturn HTTP status 404 for non-existing classes and printers (Issue #423)
Michael R Sweet [Sun, 11 Feb 2024 14:23:13 +0000 (09:23 -0500)] 
Return HTTP status 404 for non-existing classes and printers (Issue #423)

17 months agoMerge pull request #888 from alexpevzner/pzz-2.4.x-fix-warnings
Alexander Pevzner [Fri, 9 Feb 2024 04:31:54 +0000 (07:31 +0300)] 
Merge pull request #888 from alexpevzner/pzz-2.4.x-fix-warnings

Fixed a couple of gcc warnings

17 months agoFixed gcc warning 888/head
Alexander Pevzner [Thu, 8 Feb 2024 08:49:02 +0000 (11:49 +0300)] 
Fixed gcc warning

In cups/dest.c:

    dest.c:1830:21: warning: ā€˜%s’ directive argument is null [-Wformat-overflow=]
     1733 |       DEBUG_printf(("1cupsGetNamedDest: Using name=\"%s\"...", name));
  |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is really true, and gcc was smart enough to deduct it from context.
Obviously, we meant to print dest_name here.

17 months agoFix Oki 407 freeze when printing larger jobs
Zdenek Dohnal [Thu, 8 Feb 2024 09:00:37 +0000 (10:00 +0100)] 
Fix Oki 407 freeze when printing larger jobs

18 months agobackend/ipp.c: Fix printing jobs with long names on older IPP printers
Zdenek Dohnal [Tue, 16 Jan 2024 12:30:17 +0000 (13:30 +0100)] 
backend/ipp.c: Fix printing jobs with long names on older IPP printers

On older printers (ones which don't support IPP operation Create-Job)
we concatenate job number and title into one string, which we use as
IPP attribute job-name. If the original title was almost 255 chars,
the joining the strings will overflow maximal required length
for this attribute, and Validate-Job fails.

We could check whether the string is longer than 255 and cut it,
but I chose to shrink the buffer to 256, since we already use snprintf()
which will cut the string and put null terminator for us.

Fixes #644

18 months agobackend/ipp.c: Fix infinite loop with Kerberos
Zdenek Dohnal [Mon, 15 Jan 2024 15:09:19 +0000 (16:09 +0100)] 
backend/ipp.c: Fix infinite loop with Kerberos

If IP address was used with Kerberos, IPP backend retried connection
indefinitely. The fix is to abort when we find out hostname is an IP
address and we require Kerberos.

18 months agoMerge fix for #859 from master
Zdenek Dohnal [Mon, 15 Jan 2024 13:14:08 +0000 (14:14 +0100)] 
Merge fix for #859 from master

18 months agoBackport fix for crash in ppdEmitString()
Zdenek Dohnal [Fri, 12 Jan 2024 10:05:17 +0000 (11:05 +0100)] 
Backport fix for crash in ppdEmitString()

18 months agoAdd/update copyrights
Zdenek Dohnal [Fri, 12 Jan 2024 09:47:08 +0000 (10:47 +0100)] 
Add/update copyrights

18 months agobackend/ipp: Fix print-scaling option support for IPP printers
Zdenek Dohnal [Fri, 12 Jan 2024 05:55:31 +0000 (06:55 +0100)] 
backend/ipp: Fix print-scaling option support for IPP printers

Fixes #862

19 months agohttpAddrConnect2: Check for error if POLLHUP is in valid revents
Zdenek Dohnal [Fri, 15 Dec 2023 09:59:54 +0000 (10:59 +0100)] 
httpAddrConnect2: Check for error if POLLHUP is in valid revents

Some Linux kernel versions put POLLOUT|POLLHUP into revents when client tries to connect with httpAddrConnect2(), which makes the connection fail.
Let's check the option SO_ERROR before scratching the attempt - if there is no error, remove POLLHUP from revents.

I've re-purposed previously Solaris-only code to be used everywhere if the conditions are met - this should prevent bigger delays than necessary.

Slightly different issue than #827, but with similar symptoms (kernel sending POLLOUT|POLLHUP).

20 months agoscheduler: Fix build failure on Linux with '-Werror -Wall'
Zdenek Dohnal [Wed, 29 Nov 2023 14:10:45 +0000 (15:10 +0100)] 
scheduler: Fix build failure on Linux with '-Werror -Wall'

The string which we add into array stays `const` after fixing #814
(because `strdup()`, which caused memory leak returned `char *`)
and compiler fails because of it if it runs with '-Werror -Wall'.

20 months agoscheduler: Set reasons in cupsdSetJobState only if we call finalize_job later
Zdenek Dohnal [Mon, 27 Nov 2023 11:59:18 +0000 (12:59 +0100)] 
scheduler: Set reasons in cupsdSetJobState only if we call finalize_job later

Before the fix, every successfully printed jobs ended up with
'processing-to-stop-point' as the last reasons message.

Final fix for #828 .

20 months agoraster-interpreter.c: Fix crash in 'scan_ps()' found by fuzzer
Zdenek Dohnal [Mon, 27 Nov 2023 09:16:01 +0000 (10:16 +0100)] 
raster-interpreter.c: Fix crash in 'scan_ps()' found by fuzzer

Fuzzer using `_cupsRasterExecPS()` found a way how to pass NULL into
`scan_ps()`, causing crash - we have to sanitize the argument for NULL
to fix it.

Fixes #831