Skip to content

Commit

Permalink
Backport CUPS 2.3.x changes to 2.2.x (Issue #5255)
Browse files Browse the repository at this point in the history
- Fixed a compile issue when PAM is not available (Issue #5253)
- Documentation fixes (Issue #5252)
- Star Micronics printers need the "unidir" USB quirk rule (Issue #5251)
- The scheduler now supports using temporary print queues for older IPP/1.1 print queues like those shared by CUPS 1.3 and earlier (Issue #5241)
- The `cupsRasterWritePixels` function did not correctly swap bytes for some formats (Issue #5225)
- Added a USB quirk rule for Canon MP280 series printers (Issue #5221)
- The `ppdInstallableConflict` tested too many constraints (Issue #5213)
- More fixes for printing to old CUPS servers (Issue #5211)
- The `cupsCopyDest` function now correctly copies the `is_default` value (Issue #5208)
- The scheduler did not work with older versions of uClibc (Issue #5188)
- The scheduler now substitutes default values for invalid job attributes when running in "relaxed conformance" mode (Issue #5186)
- Fixed PAM module detection and added support for the common PAM definitions (Issue #5185)
- Fixed a journald support bug in the scheduler (Issue #5181)
- The cups-driverd program incorrectly stopped scanning PPDs as soon as a loop was seen (Issue #5170)
- Fixed group validation on OpenBSD (Issue #5166)
- Fixed the `ippserver` sample code when threading is disabled or unavailable (Issue #5154)
- The `cupsEnumDests` function did not include options from the lpoptions files (Issue #5144)
- The `SSLOptions` directive now supports `MinTLS` and `MaxTLS` options to control the minimum and maximum TLS versions that will be allowed, respectively (Issue #5119)
- The scheduler did not write out dirty configuration and state files if there were open client connections (Issue #5118)
- The `lpadmin` command now provides a better error message when an unsupported System V interface script is used (Issue #5111)
- The `lp` and `lpr` commands now provide better error messages when the default printer cannot be found (Issue #5096)
- No longer support backslash, question mark, or quotes in printer names (Issue #4966)
- The CUPS library now supports the latest HTTP Digest authentication specification including support for SHA-256 (Issue #4862)
- The `lpstat` command now reports when new jobs are being held (Issue #4761)
- The `lpoptions` command incorrectly saved default options (Issue #4717)
- The `ppdLocalizeIPPReason` function incorrectly returned a localized version of "none" (rdar://36566269)
- TLS connections now properly timeout (rdar://34938533)
- The IPP backend did not properly detect failed PDF prints (rdar://34055474)
  • Loading branch information
michaelrsweet committed Mar 7, 2018
1 parent 18a1649 commit 1f71721
Show file tree
Hide file tree
Showing 28 changed files with 1,371 additions and 570 deletions.
51 changes: 50 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,56 @@
CHANGES - 2.2.6 - 2017-11-01
CHANGES - 2.2.7 - 2018-03-06
============================


Changes in CUPS v2.2.7
----------------------

- Fixed a compile issue when PAM is not available (Issue #5253)
- Documentation fixes (Issue #5252)
- Star Micronics printers need the "unidir" USB quirk rule (Issue #5251)
- The scheduler now supports using temporary print queues for older IPP/1.1
print queues like those shared by CUPS 1.3 and earlier (Issue #5241)
- The `cupsRasterWritePixels` function did not correctly swap bytes for some
formats (Issue #5225)
- Added a USB quirk rule for Canon MP280 series printers (Issue #5221)
- The `ppdInstallableConflict` tested too many constraints (Issue #5213)
- More fixes for printing to old CUPS servers (Issue #5211)
- The `cupsCopyDest` function now correctly copies the `is_default` value
(Issue #5208)
- The scheduler did not work with older versions of uClibc (Issue #5188)
- The scheduler now substitutes default values for invalid job attributes when
running in "relaxed conformance" mode (Issue #5186)
- Fixed PAM module detection and added support for the common PAM definitions
(Issue #5185)
- Fixed a journald support bug in the scheduler (Issue #5181)
- The cups-driverd program incorrectly stopped scanning PPDs as soon as a loop
was seen (Issue #5170)
- Fixed group validation on OpenBSD (Issue #5166)
- Fixed the `ippserver` sample code when threading is disabled or unavailable
(Issue #5154)
- The `cupsEnumDests` function did not include options from the lpoptions files
(Issue #5144)
- The `SSLOptions` directive now supports `MinTLS` and `MaxTLS` options to
control the minimum and maximum TLS versions that will be allowed,
respectively (Issue #5119)
- The scheduler did not write out dirty configuration and state files if there
were open client connections (Issue #5118)
- The `lpadmin` command now provides a better error message when an unsupported
System V interface script is used (Issue #5111)
- The `lp` and `lpr` commands now provide better error messages when the default
printer cannot be found (Issue #5096)
- No longer support backslash, question mark, or quotes in printer names
(Issue #4966)
- The CUPS library now supports the latest HTTP Digest authentication
specification including support for SHA-256 (Issue #4862)
- The `lpstat` command now reports when new jobs are being held (Issue #4761)
- The `lpoptions` command incorrectly saved default options (Issue #4717)
- The `ppdLocalizeIPPReason` function incorrectly returned a localized version
of "none" (rdar://36566269)
- TLS connections now properly timeout (rdar://34938533)
- The IPP backend did not properly detect failed PDF prints (rdar://34055474)


Changes in CUPS v2.2.6
----------------------

Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INSTALL - CUPS v2.2.6 - 2017-11-01
INSTALL - CUPS v2.2.7 - 2018-03-06
==================================

This file describes how to compile and install CUPS from source code. For more
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
README - CUPS v2.2.6 - 2017-11-01
README - CUPS v2.2.7 - 2018-03-06
=================================

Looking for compile instructions? Read the file `INSTALL.md` instead...
Expand Down Expand Up @@ -148,7 +148,7 @@ This will prevent the filters from misinterpreting your print file.
LEGAL STUFF
-----------

CUPS is copyright © 2007-2017 by Apple Inc. CUPS and the CUPS logo are
CUPS is copyright © 2007-2018 by Apple Inc. CUPS and the CUPS logo are
trademarks of Apple Inc.

The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
Expand Down
38 changes: 32 additions & 6 deletions backend/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ extern void xpc_connection_set_target_uid(xpc_connection_t connection,
#define _CUPS_JSR_ACCOUNT_LIMIT_REACHED 0x08
#define _CUPS_JSR_JOB_PASSWORD_WAIT 0x10
#define _CUPS_JSR_JOB_RELEASE_WAIT 0x20
#define _CUPS_JSR_DOCUMENT_FORMAT_ERROR 0x40
#define _CUPS_JSR_DOCUMENT_UNPRINTABLE 0x80


/*
Expand All @@ -69,6 +71,7 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
http_encryption_t encryption; /* Use encryption? */
ipp_jstate_t job_state; /* Current job state */
ipp_pstate_t printer_state; /* Current printer state */
int retryable; /* Is this a job that should be retried? */
} _cups_monitor_t;


Expand Down Expand Up @@ -1448,6 +1451,7 @@ main(int argc, /* I - Number of command-line args */
monitor.encryption = cupsEncryption();
monitor.job_state = IPP_JOB_PENDING;
monitor.printer_state = IPP_PRINTER_IDLE;
monitor.retryable = argc == 6 && document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf");

if (create_job)
{
Expand Down Expand Up @@ -2568,22 +2572,24 @@ monitor_printer(

for (i = 0; i < attr->num_values; i ++)
{
if (!strcmp(attr->values[i].string.text,
"account-authorization-failed"))
if (!strcmp(attr->values[i].string.text, "account-authorization-failed"))
new_reasons |= _CUPS_JSR_ACCOUNT_AUTHORIZATION_FAILED;
else if (!strcmp(attr->values[i].string.text, "account-closed"))
new_reasons |= _CUPS_JSR_ACCOUNT_CLOSED;
else if (!strcmp(attr->values[i].string.text, "account-info-needed"))
new_reasons |= _CUPS_JSR_ACCOUNT_INFO_NEEDED;
else if (!strcmp(attr->values[i].string.text,
"account-limit-reached"))
else if (!strcmp(attr->values[i].string.text, "account-limit-reached"))
new_reasons |= _CUPS_JSR_ACCOUNT_LIMIT_REACHED;
else if (!strcmp(attr->values[i].string.text, "job-password-wait"))
new_reasons |= _CUPS_JSR_JOB_PASSWORD_WAIT;
else if (!strcmp(attr->values[i].string.text, "job-release-wait"))
new_reasons |= _CUPS_JSR_JOB_RELEASE_WAIT;
if (!job_canceled &&
(!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
else if (!strcmp(attr->values[i].string.text, "document-format-error"))
new_reasons |= _CUPS_JSR_DOCUMENT_FORMAT_ERROR;
else if (!strcmp(attr->values[i].string.text, "document-unprintable"))
new_reasons |= _CUPS_JSR_DOCUMENT_UNPRINTABLE;

if (!job_canceled && (!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
job_canceled = 1;
}

Expand All @@ -2601,6 +2607,26 @@ monitor_printer(
fputs("JOBSTATE: job-password-wait\n", stderr);
else if (new_reasons & _CUPS_JSR_JOB_RELEASE_WAIT)
fputs("JOBSTATE: job-release-wait\n", stderr);
else if (new_reasons & (_CUPS_JSR_DOCUMENT_FORMAT_ERROR | _CUPS_JSR_DOCUMENT_UNPRINTABLE))
{
if (monitor->retryable)
{
/*
* Can't print this, so retry as raster...
*/

job_canceled = 1;
fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
}
else if (new_reasons & _CUPS_JSR_DOCUMENT_FORMAT_ERROR)
{
fputs("JOBSTATE: document-format-error\n", stderr);
}
else
{
fputs("JOBSTATE: document-unprintable\n", stderr);
}
}
else
fputs("JOBSTATE: job-printing\n", stderr);

Expand Down
32 changes: 4 additions & 28 deletions berkeley/lpr.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ main(int argc, /* I - Number of command-line arguments */
char *printer, /* Destination printer or class */
*instance, /* Instance */
*opt; /* Option pointer */
const char *title, /* Job title */
*val; /* Environment variable name */
const char *title; /* Job title */
int num_copies; /* Number of copies per file */
int num_files; /* Number of files to print */
const char *files[1000]; /* Files to print */
Expand Down Expand Up @@ -345,33 +344,10 @@ main(int argc, /* I - Number of command-line arguments */

if (printer == NULL)
{
val = NULL;

if ((printer = getenv("LPDEST")) == NULL)
{
if ((printer = getenv("PRINTER")) != NULL)
{
if (!strcmp(printer, "lp"))
printer = NULL;
else
val = "PRINTER";
}
}
else
val = "LPDEST";

if (printer && !cupsGetNamedDest(NULL, printer, NULL))
_cupsLangPrintf(stderr,
_("%s: Error - %s environment variable names "
"non-existent destination \"%s\"."), argv[0], val,
printer);
else if (cupsLastError() == IPP_NOT_FOUND)
_cupsLangPrintf(stderr,
_("%s: Error - no default destination available."),
argv[0]);
if (!cupsGetNamedDest(NULL, NULL, NULL) && cupsLastError() == IPP_STATUS_ERROR_NOT_FOUND)
_cupsLangPrintf(stderr, _("%s: Error - %s"), argv[0], cupsLastErrorString());
else
_cupsLangPrintf(stderr, _("%s: Error - scheduler not responding."),
argv[0]);
_cupsLangPrintf(stderr, _("%s: Error - scheduler not responding."), argv[0]);

return (1);
}
Expand Down
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for CUPS 2.2.6.
# Generated by GNU Autoconf 2.69 for CUPS 2.2.7.
#
# Report bugs to <https://github.com/apple/cups/issues>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='CUPS'
PACKAGE_TARNAME='cups'
PACKAGE_VERSION='2.2.6'
PACKAGE_STRING='CUPS 2.2.6'
PACKAGE_VERSION='2.2.7'
PACKAGE_STRING='CUPS 2.2.7'
PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
PACKAGE_URL='https://www.cups.org/'

Expand Down Expand Up @@ -1482,7 +1482,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures CUPS 2.2.6 to adapt to many kinds of systems.
\`configure' configures CUPS 2.2.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1547,7 +1547,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of CUPS 2.2.6:";;
short | recursive ) echo "Configuration of CUPS 2.2.7:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1728,7 +1728,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
CUPS configure 2.2.6
CUPS configure 2.2.7
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2192,7 +2192,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by CUPS $as_me 2.2.6, which was
It was created by CUPS $as_me 2.2.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -2667,7 +2667,7 @@ fi
ac_config_headers="$ac_config_headers config.h"


CUPS_VERSION="2.2.6"
CUPS_VERSION="2.2.7"
CUPS_REVISION=""
CUPS_BUILD="cups-$CUPS_VERSION"

Expand Down Expand Up @@ -10901,7 +10901,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by CUPS $as_me 2.2.6, which was
This file was extended by CUPS $as_me 2.2.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -10964,7 +10964,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
CUPS config.status 2.2.6
CUPS config.status 2.2.7
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl
dnl Configuration script for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2007-2018 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
Expand All @@ -15,7 +15,7 @@ dnl We need at least autoconf 2.60...
AC_PREREQ(2.60)

dnl Package name and version...
AC_INIT([CUPS], [2.2.6], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
AC_INIT([CUPS], [2.2.7], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])

sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
Expand Down
Loading

0 comments on commit 1f71721

Please sign in to comment.