From: Michael R Sweet Date: Fri, 29 Dec 2023 14:02:57 +0000 (-0500) Subject: Add media-source to media-col-ready for iOS 17+ (Issue #738) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49e662dd20d59584ada0ca75ce34ed629e4476d6;p=thirdparty%2Fcups.git Add media-source to media-col-ready for iOS 17+ (Issue #738) --- diff --git a/CHANGES.md b/CHANGES.md index a110a01377..398d844620 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,40 +6,41 @@ Changes in CUPS v2.5b1 (TBA) - Added `cupsDNSSD` APIs. - Added `cupsConcatString` and `cupsCopyString` string APIs. -- Added a new argument value for `lpstat` argument '-W' - `successful` - - to get successfully printed jobs (Issue #830) - Added new APIs for form, JSON, JWT, IPP, and raster setup. - Added OpenSSL support for `cupsHashData` (Issue #762) - Added warning if the device has to do IPP request for 'all,media-col-database' in separate requests (Issue #829) +- Added a new argument value for `lpstat` argument '-W' - `successful` - + to get successfully printed jobs (Issue #830) - Added driver filter to web interface (Issue #848) -- Building with TLS support is now required - CUPS supports OpenSSL, GNUTLS - and LibreSSL. -- Updated `cupsArray` APIs. +- Updated CUPS to require TLS support - OpenSSL, GNUTLS and LibreSSL are + supported. +- Updated CUPS to require ZLIB. +- Updated CUPS to require support for `poll` API. +- Updated `cupsArray` APIs to support modern naming and types. +- Updated `cups_enum_dests()` timeout for listing available IPP printers (Issue #751) - Updated `httpAddrConnect2()` to handle `POLLHUP` together with `POLLIN` or `POLLOUT` (Issue #839) -- Fixed crash in `scan_ps()` if incoming argument is NULL (Issue #831) +- Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error + handling (fixes CVE-2023-34241) +- Fixed hanging of `lpstat` on Solaris (Issue #156) - Fixed Digest authentication support (Issue #260) -- Fixed delays in lpd backend (Issue #741) - Fixed extensive looping in scheduler (Issue #604) -- Fixed hanging of `lpstat` on IBM AIX (Issue #773) -- Fixed hanging of `lpstat` on Solaris (Issue #156) -- Fixed memory leak when creating color profiles (Issue #814) -- Fixed memory leak when unloading a job (Issue #813) +- Fixed printing multiple files on specific printers (Issue #643) - Fixed segfault in `cupsGetNamedDest()` when trying to get default printer, but the default printer is not set (Issue #719) -- Fixed setting job state reasons for successful jobs (Issue #832) -- Fixed RFC 1179 port reserving behavior in LPD backend (Issue #743) -- Fixed printing multiple files on specific printers (Issue #643) -- Fixed printing to stderr if we can't open cups-files.conf (Issue #777) +- Fixed ready media support for iOS 17+ (Issue #738) +- Fixed delays in lpd backend (Issue #741) - Fixed purging job files via `cancel -x` (Issue #742) -- Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error - handling (fixes CVE-2023-34241) +- Fixed RFC 1179 port reserving behavior in LPD backend (Issue #743) - Fixed a bug in the PPD command interpretation code (Issue #768) -- Raised `cups_enum_dests()` timeout for listing available IPP printers (Issue #751) -- Removed `HAVE_LIBZ` and `HAVE_POLL` defines, making CUPS to depend - on the functionality -- Removed hash support for SHA2-512-224 and SHA2-512-256 +- Fixed hanging of `lpstat` on IBM AIX (Issue #773) +- Fixed printing to stderr if we can't open cups-files.conf (Issue #777) +- Fixed memory leak when unloading a job (Issue #813) +- Fixed memory leak when creating color profiles (Issue #814) +- Fixed crash in `scan_ps()` if incoming argument is NULL (Issue #831) +- Fixed setting job state reasons for successful jobs (Issue #832) +- Removed hash support for SHA2-512-224 and SHA2-512-256. - Removed `mantohtml` script for generating html pages (use `https://www.msweet.org/mantohtml/`) - Removed SSPI and Security.framework support (CDSA) diff --git a/scheduler/printers.c b/scheduler/printers.c index 7bca3bdc9b..fc0bc36c28 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -4485,7 +4485,8 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ for (media_col_ready = NULL, media_ready = NULL, i = p->pc->num_sizes, pwgsize = p->pc->sizes; i > 0; i --, pwgsize ++) { - ipp_t *col; // media-col-ready value + ipp_t *col; // media-col-ready value + char source[128]; // media-source value // Skip printer sizes that don't have a PPD size or aren't in the ready // sizes array... @@ -4501,6 +4502,13 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ // Add or append a media-col-ready value col = new_media_col(pwgsize); + // Add "media-source" for iOS 17 (Issue #738) + if (media_col_ready) + snprintf(source, sizeof(source), "auto.%d", ippGetCount(media_col_ready) + 1); + else + cupsCopyString(source, "auto", sizeof(source)); + ippAddString(col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-source", NULL, source); + if (media_col_ready) ippSetCollection(p->ppd_attrs, &media_col_ready, ippGetCount(media_col_ready), col); else