· 6 years ago · Dec 05, 2019, 05:20 PM
1diff --git a/.gitignore b/.gitignore
2index dd9be570a..a5e32e600 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -65,6 +65,7 @@ cups/testppd
6 cups/testpwg
7 cups/testraster
8 cups/testsnmp
9+cups/testthreads
10 cups/tlscheck
11 desktop/cups.desktop
12 doc/index.html
13@@ -79,14 +80,6 @@ filter/rastertopwg
14 locale/checkpo
15 locale/po2strings
16 locale/strings2po
17-man/client.conf.man
18-man/cups-files.conf.man
19-man/cups-lpd.man
20-man/cups-snmp.man
21-man/cupsaddsmb.man
22-man/cupsd.conf.man
23-man/cupsd.man
24-man/lpoptions.man
25 man/mantohtml
26 monitor/bcp
27 monitor/tbcp
28diff --git a/.lgtm.yml b/.lgtm.yml
29new file mode 100644
30index 000000000..626551724
31--- /dev/null
32+++ b/.lgtm.yml
33@@ -0,0 +1,4 @@
34+queries:
35+ - exclude: cpp/integer-multiplication-cast-to-long
36+ - exclude: cpp/missing-header-guard
37+ - exclude: cpp/short-global-name
38diff --git a/CHANGES.md b/CHANGES.md
39index ce57fe2fc..2afa7686a 100644
40--- a/CHANGES.md
41+++ b/CHANGES.md
42@@ -1,7 +1,43 @@
43-CHANGES - 2.3.0 - 2019-08-23
44+CHANGES - 2.3.1 - 2019-12-04
45 ============================
46
47
48+Changes in CUPS v2.3.1
49+----------------------
50+
51+- Documentation updates (Issue #5661, #5674, #5682)
52+- Fixed a crash bug in the web interface (Issue #5621)
53+- The PPD cache code now looks up page sizes using their dimensions
54+ (Issue #5633)
55+- PPD files containing "custom" option keywords did not work (Issue #5639)
56+- Added a workaround for the scheduler's systemd support (Issue #5640)
57+- On Windows, TLS certificates generated on February 29 would likely fail
58+ (Issue #5643)
59+- Added a DigestOptions directive for the `client.conf` file to control whether
60+ MD5-based Digest authentication is allowed (Issue #5647)
61+- Fixed a bug in the handling of printer resource files (Issue #5652)
62+- The libusb-based USB backend now reports an error when the distribution
63+ permissions are wrong (Issue #5658)
64+- Added paint can labels to Dymo driver (Issue #5662)
65+- The `ippeveprinter` program now supports authentication (Issue #5665)
66+- The `ippeveprinter` program now advertises DNS-SD services on the correct
67+ interfaces, and provides a way to turn them off (Issue #5666)
68+- The `--with-dbusdir` option was ignored by the configure script (Issue #5671)
69+- Sandboxed applications were not able to get the default printer (Issue #5676)
70+- Log file access controls were not preserved by `cupsctl` (Issue #5677)
71+- Default printers set with `lpoptions` did not work in all cases (Issue #5681,
72+ Issue #5683, Issue #5684)
73+- Fixed an error in the jobs web interface template (Issue #5694)
74+- Fixed an off-by-one error in `ippEnumString` (Issue #5695)
75+- The IPP backend did not detect all cases where a job should be retried using
76+- Fixed a few issues with the Apple Raster support (rdar://55301114)
77+ a raster format (rdar://56021091)
78+- Fixed spelling of "fold-accordion".
79+- Fixed the default common name for TLS certificates used by `ippeveprinter`.
80+- Fixed the option names used for IPP Everywhere finishing options.
81+- Added support for the second roll of the DYMO Twin/DUO label printers.
82+
83+
84 Changes in CUPS v2.3.0
85 ----------------------
86
87diff --git a/README.md b/README.md
88index 3d3ddb9a4..ee1125b34 100644
89--- a/README.md
90+++ b/README.md
91@@ -1,4 +1,4 @@
92-README - CUPS v2.3.0 - 2019-08-21
93+README - CUPS v2.3.1 - 2019-10-07
94 =================================
95
96 INTRODUCTION
97@@ -65,11 +65,11 @@ in your browser to access the printer administration tools:
98
99 *Do not* use the hostname for your machine - it will not work with the default
100 CUPS configuration. To enable administration access on other addresses, check
101-the `Allow Remote Administration` box and click on the `Change Settings button.
102+the `Allow Remote Administration` box and click on the `Change Settings` button.
103
104 You will be asked for the administration password (root or any other user in the
105-sys/system/root/admin/lpadmin group on your system) when performing any
106-administrative function.
107+"sys", "system", "root", "admin", or "lpadmin" group on your system) when
108+performing any administrative function.
109
110
111 SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
112@@ -79,7 +79,7 @@ CUPS currently uses PPD (PostScript Printer Description) files that describe
113 printer capabilities and driver programs needed for each printer. The
114 `everywhere` PPD is used for nearly all modern networks printers sold since
115 about 2009. For example, the following command creates a print queue for a
116-printer at address 11.22.33.44:
117+printer at address "11.22.33.44":
118
119 lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
120
121diff --git a/backend/ipp.c b/backend/ipp.c
122index 8226acc7b..60a4ef20f 100644
123--- a/backend/ipp.c
124+++ b/backend/ipp.c
125@@ -1450,6 +1450,8 @@ main(int argc, /* I - Number of command-line args */
126 monitor.printer_state = IPP_PSTATE_IDLE;
127 monitor.retryable = argc == 6 && document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf");
128
129+ fprintf(stderr, "DEBUG: retryable=%d\n", monitor.retryable);
130+
131 if (create_job)
132 {
133 monitor.job_name = argv[3];
134@@ -1867,21 +1869,29 @@ main(int argc, /* I - Number of command-line args */
135 response = cupsGetResponse(http, resource);
136 ippDelete(request);
137
138- fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
139- ippErrorString(cupsLastError()), cupsLastErrorString());
140+ fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n", ippErrorString(cupsLastError()), cupsLastErrorString());
141 debug_attributes(response);
142- ippDelete(response);
143
144 if (cupsLastError() > IPP_STATUS_OK_CONFLICTING && !job_canceled)
145 {
146+ ipp_attribute_t *reasons = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD);
147+ /* job-state-reasons values */
148+
149 ipp_status = cupsLastError();
150
151- _cupsLangPrintFilter(stderr, "ERROR",
152- _("Unable to add document to print job."));
153+ if (ippContainsString(reasons, "document-format-error"))
154+ ipp_status = IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR;
155+ else if (ippContainsString(reasons, "document-unprintable"))
156+ ipp_status = IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE;
157+
158+ ippDelete(response);
159+ _cupsLangPrintFilter(stderr, "ERROR", _("Unable to add document to print job."));
160 break;
161 }
162 else
163 {
164+ ippDelete(response);
165+
166 password_tries = 0;
167
168 if (num_files == 0 || fd < 0)
169@@ -1898,7 +1908,7 @@ main(int argc, /* I - Number of command-line args */
170 fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
171 copies_remaining --;
172 }
173- else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
174+ else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
175 argc == 6 &&
176 document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
177 {
178@@ -2114,11 +2124,10 @@ main(int argc, /* I - Number of command-line args */
179 job_sheets->values[0].integer);
180
181 /*
182- * Stop polling if the job is finished or pending-held for 30 seconds...
183+ * Stop polling if the job is finished or pending-held...
184 */
185
186- if (job_state->values[0].integer > IPP_JSTATE_STOPPED ||
187- (job_state->values[0].integer == IPP_JSTATE_HELD && time(NULL) > waittime))
188+ if (job_state->values[0].integer > IPP_JSTATE_STOPPED || job_state->values[0].integer == IPP_JSTATE_HELD)
189 {
190 ippDelete(response);
191 break;
192diff --git a/backend/lpd.c b/backend/lpd.c
193index 45cdde8e7..efc7a9acc 100644
194--- a/backend/lpd.c
195+++ b/backend/lpd.c
196@@ -71,7 +71,11 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
197 */
198
199 static int cups_rresvport(int *port, int family);
200-static int lpd_command(int lpd_fd, char *format, ...);
201+static int lpd_command(int lpd_fd, char *format, ...)
202+# ifdef __GNUC__
203+__attribute__ ((__format__ (__printf__, 2, 3)))
204+# endif /* __GNUC__ */
205+;
206 static int lpd_queue(const char *hostname, http_addrlist_t *addrlist, const char *printer, int print_fd, int snmp_fd, int mode, const char *user, const char *title, int copies, int banner, int format, int order, int reserve, int manual_copies, int timeout, int contimeout, const char *orighost) _CUPS_NONNULL((1,2,3,7,8,17));
207 static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length);
208 static void sigterm_handler(int sig);
209@@ -1042,7 +1046,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
210 * Send the control file...
211 */
212
213- if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
214+ if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", (int)strlen(control),
215 (int)getpid() % 1000, localhost))
216 {
217 close(fd);
218@@ -1175,7 +1179,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
219 * Send control file...
220 */
221
222- if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
223+ if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", (int)strlen(control),
224 (int)getpid() % 1000, localhost))
225 {
226 close(fd);
227diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c
228index 87606ac13..393fe65ee 100644
229--- a/backend/usb-libusb.c
230+++ b/backend/usb-libusb.c
231@@ -826,8 +826,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
232 err = libusb_init(NULL);
233 if (err)
234 {
235- fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
236- "libusb error %i\n", (int)err);
237+ fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)err, libusb_strerror((int)err));
238 return (NULL);
239 }
240
241@@ -879,7 +878,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
242 protocol = 0;
243
244 for (altset = 0, altptr = ifaceptr->altsetting;
245- altset < ifaceptr->num_altsetting;
246+ altset < ifaceptr->num_altsetting; // lgtm [cpp/comparison-with-wider-type]
247 altset ++, altptr ++)
248 {
249 /*
250diff --git a/berkeley/lpr.c b/berkeley/lpr.c
251index a9aed3ca4..627fa6a4e 100644
252--- a/berkeley/lpr.c
253+++ b/berkeley/lpr.c
254@@ -1,7 +1,7 @@
255 /*
256 * "lpr" command for CUPS.
257 *
258- * Copyright © 2007-2018 by Apple Inc.
259+ * Copyright © 2007-2019 by Apple Inc.
260 * Copyright © 1997-2007 by Easy Software Products.
261 *
262 * Licensed under Apache License v2.0. See the file "LICENSE" for more
263@@ -445,9 +445,9 @@ usage(void)
264 " Specify 2-sided portrait printing"));
265 _cupsLangPuts(stdout, _("-o sides=two-sided-short-edge\n"
266 " Specify 2-sided landscape printing"));
267+ _cupsLangPuts(stdout, _("-P destination Specify the destination"));
268 _cupsLangPuts(stdout, _("-q Specify the job should be held for printing"));
269 _cupsLangPuts(stdout, _("-r Remove the file(s) after submission"));
270- _cupsLangPuts(stdout, _("-P destination Specify the destination"));
271 _cupsLangPuts(stdout, _("-T title Specify the job title"));
272 _cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
273
274diff --git a/cgi-bin/var.c b/cgi-bin/var.c
275index 306375bd6..349a21845 100644
276--- a/cgi-bin/var.c
277+++ b/cgi-bin/var.c
278@@ -170,6 +170,9 @@ cgiGetArray(const char *name, /* I - Name of array variable */
279 if (element < 0 || element >= var->nvalues)
280 return (NULL);
281
282+ if (var->values[element] == NULL)
283+ return (NULL);
284+
285 return (strdup(var->values[element]));
286 }
287
288@@ -980,7 +983,7 @@ cgi_initialize_post(void)
289 */
290
291 length = (size_t)strtol(content_length, NULL, 10);
292- data = malloc(length + 1);
293+ data = malloc(length + 1); // lgtm [cpp/uncontrolled-allocation-size]
294
295 if (data == NULL)
296 return (0);
297diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4
298index 87264d850..a460a73a4 100644
299--- a/config-scripts/cups-common.m4
300+++ b/config-scripts/cups-common.m4
301@@ -293,14 +293,14 @@ fi
302 LIBS="$SAVELIBS"
303
304 dnl Check for DBUS support
305-AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
306-AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
307- DBUSDIR="$withval")
308-
309 DBUSDIR=""
310 DBUS_NOTIFIER=""
311 DBUS_NOTIFIERLIBS=""
312
313+AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
314+AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
315+ DBUSDIR="$withval")
316+
317 if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
318 AC_MSG_CHECKING(for DBUS)
319 if $PKGCONFIG --exists dbus-1; then
320@@ -317,7 +317,7 @@ if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdar
321 AC_CHECK_FUNC(dbus_threads_init,
322 AC_DEFINE(HAVE_DBUS_THREADS_INIT))
323 LIBS="$SAVELIBS"
324- if test -d /etc/dbus-1; then
325+ if test -d /etc/dbus-1 -a "x$DBUSDIR" = x; then
326 DBUSDIR="/etc/dbus-1"
327 fi
328 else
329diff --git a/config-scripts/cups-ssl.m4 b/config-scripts/cups-ssl.m4
330index 4ce926f51..c1648b1c1 100644
331--- a/config-scripts/cups-ssl.m4
332+++ b/config-scripts/cups-ssl.m4
333@@ -58,7 +58,6 @@ if test x$enable_ssl != xno; then
334
335 SAVELIBS="$LIBS"
336 LIBS="$LIBS $SSLLIBS"
337- AC_CHECK_FUNC(gnutls_fips140_set_mode, AC_DEFINE(HAVE_GNUTLS_FIPS140_SET_MODE))
338 AC_CHECK_FUNC(gnutls_transport_set_pull_timeout_function, AC_DEFINE(HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION))
339 AC_CHECK_FUNC(gnutls_priority_set_direct, AC_DEFINE(HAVE_GNUTLS_PRIORITY_SET_DIRECT))
340 LIBS="$SAVELIBS"
341diff --git a/config.h.in b/config.h.in
342index 5e93a9dac..1c2d7a826 100644
343--- a/config.h.in
344+++ b/config.h.in
345@@ -301,13 +301,6 @@
346 #undef HAVE_SSL
347
348
349-/*
350- * Do we have the gnutls_fips140_set_mode function?
351- */
352-
353-#undef HAVE_GNUTLS_FIPS140_SET_MODE
354-
355-
356 /*
357 * Do we have the gnutls_transport_set_pull_timeout_function function?
358 */
359diff --git a/configure b/configure
360index d3df145bc..004ecee99 100755
361--- a/configure
362+++ b/configure
363@@ -1,6 +1,6 @@
364 #! /bin/sh
365 # Guess values for system-dependent variables and create Makefiles.
366-# Generated by GNU Autoconf 2.69 for CUPS 2.3.0.
367+# Generated by GNU Autoconf 2.69 for CUPS 2.3.1.
368 #
369 # Report bugs to <https://github.com/apple/cups/issues>.
370 #
371@@ -580,8 +580,8 @@ MAKEFLAGS=
372 # Identity of this package.
373 PACKAGE_NAME='CUPS'
374 PACKAGE_TARNAME='cups'
375-PACKAGE_VERSION='2.3.0'
376-PACKAGE_STRING='CUPS 2.3.0'
377+PACKAGE_VERSION='2.3.1'
378+PACKAGE_STRING='CUPS 2.3.1'
379 PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
380 PACKAGE_URL='https://www.cups.org/'
381
382@@ -1467,7 +1467,7 @@ if test "$ac_init_help" = "long"; then
383 # Omit some internal or obsolete options to make the list less imposing.
384 # This message is too long to be a string in the A/UX 3.1 sh.
385 cat <<_ACEOF
386-\`configure' configures CUPS 2.3.0 to adapt to many kinds of systems.
387+\`configure' configures CUPS 2.3.1 to adapt to many kinds of systems.
388
389 Usage: $0 [OPTION]... [VAR=VALUE]...
390
391@@ -1532,7 +1532,7 @@ fi
392
393 if test -n "$ac_init_help"; then
394 case $ac_init_help in
395- short | recursive ) echo "Configuration of CUPS 2.3.0:";;
396+ short | recursive ) echo "Configuration of CUPS 2.3.1:";;
397 esac
398 cat <<\_ACEOF
399
400@@ -1713,7 +1713,7 @@ fi
401 test -n "$ac_init_help" && exit $ac_status
402 if $ac_init_version; then
403 cat <<\_ACEOF
404-CUPS configure 2.3.0
405+CUPS configure 2.3.1
406 generated by GNU Autoconf 2.69
407
408 Copyright (C) 2012 Free Software Foundation, Inc.
409@@ -2177,7 +2177,7 @@ cat >config.log <<_ACEOF
410 This file contains any messages produced by compilers while
411 running configure, to aid debugging if configure makes a mistake.
412
413-It was created by CUPS $as_me 2.3.0, which was
414+It was created by CUPS $as_me 2.3.1, which was
415 generated by GNU Autoconf 2.69. Invocation command line was
416
417 $ $0 $@
418@@ -2694,7 +2694,7 @@ done
419 ac_config_headers="$ac_config_headers config.h"
420
421
422-CUPS_VERSION="2.3.0"
423+CUPS_VERSION="2.3.1"
424 CUPS_REVISION=""
425 CUPS_BUILD="cups-$CUPS_VERSION"
426
427@@ -5775,6 +5775,10 @@ fi
428 fi
429 LIBS="$SAVELIBS"
430
431+DBUSDIR=""
432+DBUS_NOTIFIER=""
433+DBUS_NOTIFIERLIBS=""
434+
435 # Check whether --enable-dbus was given.
436 if test "${enable_dbus+set}" = set; then :
437 enableval=$enable_dbus;
438@@ -5787,10 +5791,6 @@ if test "${with_dbusdir+set}" = set; then :
439 fi
440
441
442-DBUSDIR=""
443-DBUS_NOTIFIER=""
444-DBUS_NOTIFIERLIBS=""
445-
446 if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
447 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5
448 $as_echo_n "checking for DBUS... " >&6; }
449@@ -5818,7 +5818,7 @@ if test "x$ac_cv_func_dbus_threads_init" = xyes; then :
450 fi
451
452 LIBS="$SAVELIBS"
453- if test -d /etc/dbus-1; then
454+ if test -d /etc/dbus-1 -a "x$DBUSDIR" = x; then
455 DBUSDIR="/etc/dbus-1"
456 fi
457 else
458@@ -8308,12 +8308,6 @@ fi
459
460 SAVELIBS="$LIBS"
461 LIBS="$LIBS $SSLLIBS"
462- ac_fn_c_check_func "$LINENO" "gnutls_fips140_set_mode" "ac_cv_func_gnutls_fips140_set_mode"
463-if test "x$ac_cv_func_gnutls_fips140_set_mode" = xyes; then :
464- $as_echo "#define HAVE_GNUTLS_FIPS140_SET_MODE 1" >>confdefs.h
465-
466-fi
467-
468 ac_fn_c_check_func "$LINENO" "gnutls_transport_set_pull_timeout_function" "ac_cv_func_gnutls_transport_set_pull_timeout_function"
469 if test "x$ac_cv_func_gnutls_transport_set_pull_timeout_function" = xyes; then :
470 $as_echo "#define HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION 1" >>confdefs.h
471@@ -10393,7 +10387,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
472 # report actual input values of CONFIG_FILES etc. instead of their
473 # values after options handling.
474 ac_log="
475-This file was extended by CUPS $as_me 2.3.0, which was
476+This file was extended by CUPS $as_me 2.3.1, which was
477 generated by GNU Autoconf 2.69. Invocation command line was
478
479 CONFIG_FILES = $CONFIG_FILES
480@@ -10456,7 +10450,7 @@ _ACEOF
481 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
482 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
483 ac_cs_version="\\
484-CUPS config.status 2.3.0
485+CUPS config.status 2.3.1
486 configured by $0, generated by GNU Autoconf 2.69,
487 with options \\"\$ac_cs_config\\"
488
489diff --git a/configure.ac b/configure.ac
490index 7eca9e37f..23abe870e 100644
491--- a/configure.ac
492+++ b/configure.ac
493@@ -12,7 +12,7 @@ dnl We need at least autoconf 2.60...
494 AC_PREREQ(2.60)
495
496 dnl Package name and version...
497-AC_INIT([CUPS], [2.3.0], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
498+AC_INIT([CUPS], [2.3.1], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
499
500 sinclude(config-scripts/cups-opsys.m4)
501 sinclude(config-scripts/cups-common.m4)
502diff --git a/cups/Dependencies b/cups/Dependencies
503index b30c76994..1cb291bd9 100644
504--- a/cups/Dependencies
505+++ b/cups/Dependencies
506@@ -188,7 +188,7 @@ tls.o: tls.c cups-private.h string-private.h ../config.h \
507 ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
508 pwg.h http-private.h ../cups/language.h ../cups/http.h \
509 language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
510- debug-internal.h debug-private.h tls-darwin.c
511+ debug-internal.h debug-private.h tls-darwin.c tls-darwin.h
512 transcode.o: transcode.c cups-private.h string-private.h ../config.h \
513 ../cups/versioning.h array-private.h ../cups/array.h versioning.h \
514 ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
515@@ -214,7 +214,7 @@ adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
516 language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
517 debug-internal.h debug-private.h ppd.h cups.h raster.h adminutil.h
518 backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
519- array.h language.h pwg.h
520+ array.h language.h pwg.h sidechannel.h
521 backend.o: backend.c cups-private.h string-private.h ../config.h \
522 ../cups/versioning.h array-private.h ../cups/array.h versioning.h \
523 ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
524@@ -401,6 +401,9 @@ testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \
525 pwg.h http-private.h ../cups/language.h ../cups/http.h \
526 language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
527 snmp-private.h
528+testthreads.o: testthreads.c ../cups/cups.h file.h versioning.h ipp.h \
529+ http.h array.h language.h pwg.h ../cups/thread-private.h ../config.h \
530+ ../cups/versioning.h
531 tlscheck.o: tlscheck.c cups-private.h string-private.h ../config.h \
532 ../cups/versioning.h array-private.h ../cups/array.h versioning.h \
533 ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
534diff --git a/cups/Makefile b/cups/Makefile
535index 87d85babc..4e2aa6d37 100644
536--- a/cups/Makefile
537+++ b/cups/Makefile
538@@ -106,6 +106,7 @@ TESTOBJS = \
539 testpwg.o \
540 testraster.o \
541 testsnmp.o \
542+ testthreads.o \
543 tlscheck.o
544 OBJS = \
545 $(LIBOBJS) \
546@@ -191,6 +192,7 @@ UNITTARGETS = \
547 testpwg \
548 testraster \
549 testsnmp \
550+ testthreads \
551 tlscheck
552
553 TARGETS = \
554@@ -700,6 +702,16 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
555 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
556
557
558+#
559+# testthreads (dependency on static CUPS library is intentional)
560+#
561+
562+testthreads: testthreads.o $(LIBCUPSSTATIC)
563+ echo Linking $@...
564+ $(LD_CC) $(ALL_LDFLAGS) -o $@ testthreads.o $(LINKCUPSSTATIC)
565+ $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
566+
567+
568 #
569 # tlscheck (dependency on static CUPS library is intentional)
570 #
571diff --git a/cups/adminutil.c b/cups/adminutil.c
572index 7ff5bf2bc..3118968c6 100644
573--- a/cups/adminutil.c
574+++ b/cups/adminutil.c
575@@ -1,7 +1,7 @@
576 /*
577 * Administration utility API definitions for CUPS.
578 *
579- * Copyright © 2007-2018 by Apple Inc.
580+ * Copyright © 2007-2019 by Apple Inc.
581 * Copyright © 2001-2007 by Easy Software Products.
582 *
583 * Licensed under Apache License v2.0. See the file "LICENSE" for more
584@@ -738,13 +738,9 @@ cupsAdminSetServerSettings(
585 {
586 if (!wrote_browsing)
587 {
588- int new_share_printers = (share_printers > 0 ||
589- (share_printers == -1 &&
590- old_share_printers > 0));
591-
592 wrote_browsing = 1;
593
594- if (new_share_printers)
595+ if (share_printers)
596 {
597 const char *localp = cupsGetOption("BrowseLocalProtocols",
598 num_settings, settings);
599@@ -989,7 +985,7 @@ cupsAdminSetServerSettings(
600
601 in_cancel_job = 0;
602 }
603- else if ((((in_admin_location || in_conf_location || in_root_location) &&
604+ else if ((((in_admin_location || in_conf_location || in_root_location || in_log_location) &&
605 (remote_admin >= 0 || remote_any >= 0)) ||
606 (in_root_location && share_printers >= 0)) &&
607 (!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") ||
608diff --git a/cups/auth.c b/cups/auth.c
609index 634ed1fba..db45bbba6 100644
610--- a/cups/auth.c
611+++ b/cups/auth.c
612@@ -289,7 +289,7 @@ cupsDoAuthentication(
613
614 if (_httpSetDigestAuthString(http, nonce, method, resource))
615 {
616- DEBUG_puts("2cupsDoAuthentication: Using Basic.");
617+ DEBUG_puts("2cupsDoAuthentication: Using Digest.");
618 break;
619 }
620 }
621diff --git a/cups/cups-private.h b/cups/cups-private.h
622index f1b052a30..97734a539 100644
623--- a/cups/cups-private.h
624+++ b/cups/cups-private.h
625@@ -57,6 +57,12 @@ typedef struct _cups_raster_error_s /**** Error buffer structure ****/
626 *end; /* End of buffer */
627 } _cups_raster_error_t;
628
629+typedef enum _cups_digestoptions_e /**** Digest Options values */
630+{
631+ _CUPS_DIGESTOPTIONS_NONE, /* No Digest authentication options */
632+ _CUPS_DIGESTOPTIONS_DENYMD5 /* Do not use MD5 hashes for digest */
633+} _cups_digestoptions_t;
634+
635 typedef enum _cups_uatokens_e /**** UserAgentTokens values */
636 {
637 _CUPS_UATOKENS_NONE, /* Do not send User-Agent */
638@@ -76,6 +82,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
639 *cups_serverroot,
640 /* CUPS_SERVERROOT environment var */
641 *cups_statedir, /* CUPS_STATEDIR environment var */
642+ *home, /* HOME environment var */
643 *localedir; /* LOCALDIR environment var */
644
645 /* adminutil.c */
646@@ -157,6 +164,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
647 char tempfile[1024]; /* cupsTempFd/File buffer */
648
649 /* usersys.c */
650+ _cups_digestoptions_t digestoptions; /* DigestOptions setting */
651 _cups_uatokens_t uatokens; /* UserAgentTokens setting */
652 http_encryption_t encryption; /* Encryption setting */
653 char user[65], /* User name */
654diff --git a/cups/cups.h b/cups/cups.h
655index e64fdcc96..77a66c17b 100644
656--- a/cups/cups.h
657+++ b/cups/cups.h
658@@ -42,10 +42,10 @@ extern "C" {
659 * Constants...
660 */
661
662-# define CUPS_VERSION 2.0300
663+# define CUPS_VERSION 2.0301
664 # define CUPS_VERSION_MAJOR 2
665 # define CUPS_VERSION_MINOR 3
666-# define CUPS_VERSION_PATCH 0
667+# define CUPS_VERSION_PATCH 1
668
669 # define CUPS_BC_FD 3
670 /* Back-channel file descriptor for
671diff --git a/cups/cupspm.md b/cups/cupspm.md
672index 260b261f5..d4d6d7c55 100644
673--- a/cups/cupspm.md
674+++ b/cups/cupspm.md
675@@ -2,7 +2,7 @@
676 title: CUPS Programming Manual
677 author: Michael R Sweet
678 copyright: Copyright © 2007-2019 by Apple Inc. All Rights Reserved.
679-version: 2.3.0
680+version: 2.3.1
681 ...
682
683 > Please [file issues on Github](https://github.com/apple/cups/issues) to
684@@ -108,7 +108,7 @@ to the file. Build and run (CMD+R) to see the list of destinations.
685
686 ### Compiling with GCC
687
688-From the command-line, create a file called `sample.c` using your favorite
689+From the command-line, create a file called `simple.c` using your favorite
690 editor, copy the example to this file, and save. Then run the following command
691 to compile it with GCC and run it:
692
693diff --git a/cups/dest.c b/cups/dest.c
694index 17d96fe4a..cde987a09 100644
695--- a/cups/dest.c
696+++ b/cups/dest.c
697@@ -1748,7 +1748,6 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
698 cups_dest_t *dest; /* Destination */
699 char filename[1024], /* Path to lpoptions */
700 defname[256]; /* Default printer name */
701- const char *home = getenv("HOME"); /* Home directory */
702 int set_as_default = 0; /* Set returned destination as default */
703 ipp_op_t op = IPP_OP_GET_PRINTER_ATTRIBUTES;
704 /* IPP operation to get server ops */
705@@ -1780,13 +1779,13 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
706 else
707 instance = NULL;
708 }
709- else if (home)
710+ else if (cg->home)
711 {
712 /*
713 * No default in the environment, try the user's lpoptions files...
714 */
715
716- snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
717+ snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
718
719 dest_name = cups_get_default(filename, defname, sizeof(defname), &instance);
720
721@@ -1892,9 +1891,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
722 snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
723 cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
724
725- if (home)
726+ if (cg->home)
727 {
728- snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
729+ snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
730
731 cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
732 }
733@@ -2032,9 +2031,6 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
734 cups_option_t *option; /* Current option */
735 _ipp_option_t *match; /* Matching attribute for option */
736 FILE *fp; /* File pointer */
737-#ifndef _WIN32
738- const char *home; /* HOME environment variable */
739-#endif /* _WIN32 */
740 char filename[1024]; /* lpoptions file */
741 int num_temps; /* Number of temporary destinations */
742 cups_dest_t *temps = NULL, /* Temporary destinations */
743@@ -2068,27 +2064,18 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
744
745 snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
746
747-#ifndef _WIN32
748- if (getuid())
749+ if (cg->home)
750 {
751 /*
752- * Point to user defaults...
753+ * Create ~/.cups subdirectory...
754 */
755
756- if ((home = getenv("HOME")) != NULL)
757- {
758- /*
759- * Create ~/.cups subdirectory...
760- */
761+ snprintf(filename, sizeof(filename), "%s/.cups", cg->home);
762+ if (access(filename, 0))
763+ mkdir(filename, 0700);
764
765- snprintf(filename, sizeof(filename), "%s/.cups", home);
766- if (access(filename, 0))
767- mkdir(filename, 0700);
768-
769- snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
770- }
771+ snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
772 }
773-#endif /* !_WIN32 */
774
775 /*
776 * Try to open the file...
777@@ -2269,7 +2256,7 @@ _cupsUserDefault(char *name, /* I - Name buffer */
778 * system preferences...
779 */
780
781- if ((locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
782+ if (!getenv("CUPS_NO_APPLE_DEFAULT") && (locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
783 {
784 CFStringGetCString(locprinter, name, (CFIndex)namesize, kCFStringEncodingUTF8);
785 CFRelease(locprinter);
786@@ -3392,10 +3379,9 @@ cups_enum_dests(
787 int i, j, /* Looping vars */
788 num_dests; /* Number of destinations */
789 cups_dest_t *dests = NULL, /* Destinations */
790- *dest, /* Current destination */
791- *user_dest; /* User destination */
792+ *dest; /* Current destination */
793 cups_option_t *option; /* Current option */
794- char *user_default; /* User default printer */
795+ const char *user_default; /* Default printer from environment */
796 #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
797 int count, /* Number of queries started */
798 completed, /* Number of completed queries */
799@@ -3426,7 +3412,6 @@ cups_enum_dests(
800 #else
801 _cups_getdata_t data; /* Data for callback */
802 #endif /* HAVE_DNSSD || HAVE_AVAHI */
803- const char *home; /* HOME environment variable */
804 char filename[1024]; /* Local lpoptions file */
805 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
806
807@@ -3451,13 +3436,35 @@ cups_enum_dests(
808
809 memset(&data, 0, sizeof(data));
810
811- if ((user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name))) == NULL)
812+ user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name));
813+
814+ snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
815+ data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
816+
817+ if (cg->home)
818 {
819- const char *defprinter = cupsGetDefault2(http);
820- /* Server default, if any */
821+ snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
822
823- if (defprinter)
824- strlcpy(data.def_name, defprinter, sizeof(data.def_name));
825+ data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
826+ }
827+
828+ if (!user_default && (dest = cupsGetDest(NULL, NULL, data.num_dests, data.dests)) != NULL)
829+ {
830+ /*
831+ * Use an lpoptions default printer...
832+ */
833+
834+ if (dest->instance)
835+ snprintf(data.def_name, sizeof(data.def_name), "%s/%s", dest->name, dest->instance);
836+ else
837+ strlcpy(data.def_name, dest->name, sizeof(data.def_name));
838+ }
839+ else
840+ {
841+ const char *default_printer; /* Server default printer */
842+
843+ if ((default_printer = cupsGetDefault2(http)) != NULL)
844+ strlcpy(data.def_name, default_printer, sizeof(data.def_name));
845 }
846
847 if (data.def_name[0])
848@@ -3472,16 +3479,6 @@ cups_enum_dests(
849
850 DEBUG_printf(("1cups_enum_dests: def_name=\"%s\", def_instance=\"%s\"", data.def_name, data.def_instance));
851
852- snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
853- data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
854-
855- if ((home = getenv("HOME")) != NULL)
856- {
857- snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
858-
859- data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
860- }
861-
862 /*
863 * Get ready to enumerate...
864 */
865@@ -3519,8 +3516,9 @@ cups_enum_dests(
866 i > 0 && (!cancel || !*cancel);
867 i --, dest ++)
868 {
869+ cups_dest_t *user_dest; /* Destination from lpoptions */
870 #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
871- const char *device_uri; /* Device URI */
872+ const char *device_uri; /* Device URI */
873 #endif /* HAVE_DNSSD || HAVE_AVAHI */
874
875 if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
876@@ -3789,6 +3787,8 @@ cups_enum_dests(
877
878 if ((device->type & mask) == type)
879 {
880+ cups_dest_t *user_dest; /* Destination from lpoptions */
881+
882 dest = &device->dest;
883
884 if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
885diff --git a/cups/encode.c b/cups/encode.c
886index 2469406e2..5bcbf6fe5 100644
887--- a/cups/encode.c
888+++ b/cups/encode.c
889@@ -523,7 +523,7 @@ _cupsEncodeOption(
890
891 quote = *sep;
892 }
893- else if (*sep == ',' && count > 1)
894+ else if (*sep == ',')
895 break;
896 else if (*sep == '\\' && sep[1])
897 {
898diff --git a/cups/globals.c b/cups/globals.c
899index b75434f2c..fd41baefe 100644
900--- a/cups/globals.c
901+++ b/cups/globals.c
902@@ -1,10 +1,11 @@
903 /*
904 * Global variable access routines for CUPS.
905 *
906- * Copyright 2007-2015 by Apple Inc.
907- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
908+ * Copyright © 2007-2019 by Apple Inc.
909+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
910 *
911- * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
912+ * Licensed under Apache License v2.0. See the file "LICENSE" for more
913+ * information.
914 */
915
916 /*
917@@ -12,6 +13,9 @@
918 */
919
920 #include "cups-private.h"
921+#ifndef _WIN32
922+# include <pwd.h>
923+#endif /* !_WIN32 */
924
925
926 /*
927@@ -269,6 +273,8 @@ cups_globals_alloc(void)
928 if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
929 cg->localedir = localedir;
930
931+ cg->home = getenv("HOME");
932+
933 #else
934 # ifdef HAVE_GETEUID
935 if ((geteuid() != getuid() && getuid()) || getegid() != getgid())
936@@ -307,6 +313,21 @@ cups_globals_alloc(void)
937
938 if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
939 cg->localedir = CUPS_LOCALEDIR;
940+
941+ cg->home = getenv("HOME");
942+
943+# ifdef __APPLE__ /* Sandboxing now exposes the container as the home directory */
944+ if (cg->home && strstr(cg->home, "/Library/Containers/"))
945+ cg->home = NULL;
946+# endif /* !__APPLE__ */
947+ }
948+
949+ if (!cg->home)
950+ {
951+ struct passwd *pw; /* User info */
952+
953+ if ((pw = getpwuid(getuid())) != NULL)
954+ cg->home = _cupsStrAlloc(pw->pw_dir);
955 }
956 #endif /* _WIN32 */
957
958diff --git a/cups/hash.c b/cups/hash.c
959index 7b3ea818e..4fbb443db 100644
960--- a/cups/hash.c
961+++ b/cups/hash.c
962@@ -16,6 +16,7 @@
963 # include <CommonCrypto/CommonDigest.h>
964 #elif defined(HAVE_GNUTLS)
965 # include <gnutls/crypto.h>
966+# include "md5-internal.h"
967 #else
968 # include "md5-internal.h"
969 #endif /* __APPLE__ */
970@@ -186,14 +187,23 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
971 size_t tempsize = 0; /* Truncate to this size? */
972
973
974-# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
975- unsigned oldmode = gnutls_fips140_mode_enabled();
976+ if (!strcmp(algorithm, "md5"))
977+ {
978+ /*
979+ * Some versions of GNU TLS disable MD5 without warning...
980+ */
981
982- gnutls_fips140_set_mode(GNUTLS_FIPS140_LAX, GNUTLS_FIPS140_SET_MODE_THREAD);
983-# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
984+ _cups_md5_state_t state; /* MD5 state info */
985
986- if (!strcmp(algorithm, "md5"))
987- alg = GNUTLS_DIG_MD5;
988+ if (hashsize < 16)
989+ goto too_small;
990+
991+ _cupsMD5Init(&state);
992+ _cupsMD5Append(&state, data, datalen);
993+ _cupsMD5Finish(&state, hash);
994+
995+ return (16);
996+ }
997 else if (!strcmp(algorithm, "sha"))
998 alg = GNUTLS_DIG_SHA1;
999 else if (!strcmp(algorithm, "sha2-224"))
1000@@ -229,10 +239,6 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
1001 gnutls_hash_fast(alg, data, datalen, temp);
1002 memcpy(hash, temp, tempsize);
1003
1004-# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
1005- gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
1006-# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
1007-
1008 return ((ssize_t)tempsize);
1009 }
1010
1011@@ -241,17 +247,9 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
1012
1013 gnutls_hash_fast(alg, data, datalen, hash);
1014
1015-# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
1016- gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
1017-# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
1018-
1019 return ((ssize_t)gnutls_hash_get_len(alg));
1020 }
1021
1022-# ifdef HAVE_GNUTLS_FIPS140_SET_MODE
1023- gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
1024-# endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
1025-
1026 #else
1027 /*
1028 * No hash support beyond MD5 without CommonCrypto or GNU TLS...
1029@@ -261,6 +259,9 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
1030 {
1031 _cups_md5_state_t state; /* MD5 state info */
1032
1033+ if (hashsize < 16)
1034+ goto too_small;
1035+
1036 _cupsMD5Init(&state);
1037 _cupsMD5Append(&state, data, datalen);
1038 _cupsMD5Finish(&state, hash);
1039@@ -285,10 +286,6 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
1040
1041 too_small:
1042
1043-#ifdef HAVE_GNUTLS_FIPS140_SET_MODE
1044- gnutls_fips140_set_mode(oldmode, GNUTLS_FIPS140_SET_MODE_THREAD);
1045-#endif /* HAVE_GNUTLS_FIPS140_SET_MODE */
1046-
1047 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Hash buffer too small."), 1);
1048 return (-1);
1049 }
1050diff --git a/cups/http-support.c b/cups/http-support.c
1051index 6d8607140..63175145e 100644
1052--- a/cups/http-support.c
1053+++ b/cups/http-support.c
1054@@ -1,7 +1,7 @@
1055 /*
1056 * HTTP support routines for CUPS.
1057 *
1058- * Copyright 2007-2018 by Apple Inc.
1059+ * Copyright 2007-2019 by Apple Inc.
1060 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
1061 *
1062 * Licensed under Apache License v2.0. See the file "LICENSE" for more
1063@@ -799,14 +799,12 @@ httpGetDateString2(time_t t, /* I - Time in seconds */
1064 char *s, /* I - String buffer */
1065 int slen) /* I - Size of string buffer */
1066 {
1067- struct tm *tdate; /* UNIX date/time data */
1068+ struct tm tdate; /* UNIX date/time data */
1069
1070
1071- tdate = gmtime(&t);
1072- if (tdate)
1073- snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate->tm_wday], tdate->tm_mday, http_months[tdate->tm_mon], tdate->tm_year + 1900, tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
1074- else
1075- s[0] = '\0';
1076+ gmtime_r(&t, &tdate);
1077+
1078+ snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate.tm_wday], tdate.tm_mday, http_months[tdate.tm_mon], tdate.tm_year + 1900, tdate.tm_hour, tdate.tm_min, tdate.tm_sec);
1079
1080 return (s);
1081 }
1082@@ -1321,6 +1319,7 @@ _httpSetDigestAuthString(
1083 digest[1024]; /* Digest auth data */
1084 unsigned char hash[32]; /* Hash buffer */
1085 size_t hashsize; /* Size of hash */
1086+ _cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
1087
1088
1089 DEBUG_printf(("2_httpSetDigestAuthString(http=%p, nonce=\"%s\", method=\"%s\", resource=\"%s\")", (void *)http, nonce, method, resource));
1090@@ -1363,6 +1362,12 @@ _httpSetDigestAuthString(
1091 * RFC 2617 Digest with MD5
1092 */
1093
1094+ if (cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5)
1095+ {
1096+ DEBUG_puts("3_httpSetDigestAuthString: MD5 Digest is disabled.");
1097+ return (0);
1098+ }
1099+
1100 hashalg = "md5";
1101 }
1102 else if (!_cups_strcasecmp(http->algorithm, "SHA-256"))
1103diff --git a/cups/http.c b/cups/http.c
1104index fbb1bf13c..8d69ce31f 100644
1105--- a/cups/http.c
1106+++ b/cups/http.c
1107@@ -1733,7 +1733,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
1108
1109 if (http->used > 0 && ((z_stream *)http->stream)->avail_in < HTTP_MAX_BUFFER)
1110 {
1111- size_t buflen = buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
1112+ size_t buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
1113 /* Number of bytes to copy */
1114
1115 if (((z_stream *)http->stream)->avail_in > 0 &&
1116diff --git a/cups/ipp-support.c b/cups/ipp-support.c
1117index 7d028b4f2..bfb9dff09 100644
1118--- a/cups/ipp-support.c
1119+++ b/cups/ipp-support.c
1120@@ -460,7 +460,7 @@ static const char * const ipp_document_states[] =
1121 "punch-multiple-top", /* IPP Finishings 2.1/Canon */
1122 "punch-multiple-right",/* IPP Finishings 2.1/Canon */
1123 "punch-multiple-bottom",/* IPP Finishings 2.1/Canon */
1124- "fold-accordian", /* IPP Finishings 2.0 */
1125+ "fold-accordion", /* IPP Finishings 2.0 */
1126 "fold-double-gate", /* IPP Finishings 2.0 */
1127 "fold-gate", /* IPP Finishings 2.0 */
1128 "fold-half", /* IPP Finishings 2.0 */
1129@@ -571,7 +571,7 @@ static const char * const ipp_document_states[] =
1130 "0x40000057",
1131 "0x40000058",
1132 "0x40000059",
1133- "cups-fold-accordian",
1134+ "cups-fold-accordion",
1135 "cups-fold-double-gate",
1136 "cups-fold-gate",
1137 "cups-fold-half",
1138@@ -2093,7 +2093,7 @@ ippEnumString(const char *attrname, /* I - Attribute name */
1139 {
1140 if (enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
1141 return (ipp_finishings[enumvalue - 3]);
1142- else if (enumvalue >= 0x40000000 && enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0]))))
1143+ else if (enumvalue >= 0x40000000 && enumvalue < (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0]))))
1144 return (ipp_finishings_vendor[enumvalue - 0x40000000]);
1145 }
1146 else if ((!strcmp(attrname, "job-collation-type") || !strcmp(attrname, "job-collation-type-actual")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) / sizeof(ipp_job_collation_types[0]))))
1147diff --git a/cups/ipp.c b/cups/ipp.c
1148index 1bd59cef1..d0cac8cfe 100644
1149--- a/cups/ipp.c
1150+++ b/cups/ipp.c
1151@@ -4659,7 +4659,7 @@ ippSetVersion(ipp_t *ipp, /* I - IPP message */
1152 const ipp_uchar_t * /* O - RFC-2579 date/time data */
1153 ippTimeToDate(time_t t) /* I - Time in seconds */
1154 {
1155- struct tm *unixdate; /* UNIX unixdate/time info */
1156+ struct tm unixdate; /* UNIX unixdate/time info */
1157 ipp_uchar_t *date = _cupsGlobals()->ipp_date;
1158 /* RFC-2579 date/time data */
1159
1160@@ -4681,16 +4681,16 @@ ippTimeToDate(time_t t) /* I - Time in seconds */
1161 * 10 UTC minutes (0 to 59)
1162 */
1163
1164- unixdate = gmtime(&t);
1165- unixdate->tm_year += 1900;
1166+ gmtime_r(&t, &unixdate);
1167+ unixdate.tm_year += 1900;
1168
1169- date[0] = (ipp_uchar_t)(unixdate->tm_year >> 8);
1170- date[1] = (ipp_uchar_t)(unixdate->tm_year);
1171- date[2] = (ipp_uchar_t)(unixdate->tm_mon + 1);
1172- date[3] = (ipp_uchar_t)unixdate->tm_mday;
1173- date[4] = (ipp_uchar_t)unixdate->tm_hour;
1174- date[5] = (ipp_uchar_t)unixdate->tm_min;
1175- date[6] = (ipp_uchar_t)unixdate->tm_sec;
1176+ date[0] = (ipp_uchar_t)(unixdate.tm_year >> 8);
1177+ date[1] = (ipp_uchar_t)(unixdate.tm_year);
1178+ date[2] = (ipp_uchar_t)(unixdate.tm_mon + 1);
1179+ date[3] = (ipp_uchar_t)unixdate.tm_mday;
1180+ date[4] = (ipp_uchar_t)unixdate.tm_hour;
1181+ date[5] = (ipp_uchar_t)unixdate.tm_min;
1182+ date[6] = (ipp_uchar_t)unixdate.tm_sec;
1183 date[7] = 0;
1184 date[8] = '+';
1185 date[9] = 0;
1186diff --git a/cups/ipp.h b/cups/ipp.h
1187index 6402855a7..b7412a40c 100644
1188--- a/cups/ipp.h
1189+++ b/cups/ipp.h
1190@@ -145,11 +145,11 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
1191 IPP_FINISHINGS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge */
1192 IPP_FINISHINGS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side */
1193 IPP_FINISHINGS_PUNCH_QUAD_BOTTOM, /* Punch 4 holes bottom edge */
1194- IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT, /* Pucnh multiple holes left side */
1195- IPP_FINISHINGS_PUNCH_MULTIPLE_TOP, /* Pucnh multiple holes top edge */
1196- IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT, /* Pucnh multiple holes right side */
1197- IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM, /* Pucnh multiple holes bottom edge */
1198- IPP_FINISHINGS_FOLD_ACCORDIAN = 90, /* Accordian-fold the paper vertically into four sections */
1199+ IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT, /* Punch multiple holes left side */
1200+ IPP_FINISHINGS_PUNCH_MULTIPLE_TOP, /* Punch multiple holes top edge */
1201+ IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT, /* Punch multiple holes right side */
1202+ IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM, /* Punch multiple holes bottom edge */
1203+ IPP_FINISHINGS_FOLD_ACCORDION = 90, /* Accordion-fold the paper vertically into four sections */
1204 IPP_FINISHINGS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */
1205 IPP_FINISHINGS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline */
1206 IPP_FINISHINGS_FOLD_HALF, /* Fold the paper in half vertically */
1207@@ -184,8 +184,8 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
1208 IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side @exclude all@ */
1209 IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM,/* Punch 4 holes bottom edge @exclude all@ */
1210
1211- IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN = 0x4000005A,
1212- /* Accordian-fold the paper vertically into four sections @exclude all@ */
1213+ IPP_FINISHINGS_CUPS_FOLD_ACCORDION = 0x4000005A,
1214+ /* Accordion-fold the paper vertically into four sections @exclude all@ */
1215 IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically @exclude all@ */
1216 IPP_FINISHINGS_CUPS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline @exclude all@ */
1217 IPP_FINISHINGS_CUPS_FOLD_HALF, /* Fold the paper in half vertically @exclude all@ */
1218@@ -198,8 +198,10 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
1219 IPP_FINISHINGS_CUPS_FOLD_Z /* Fold the paper vertically into three sections, forming a Z @exclude all@ */
1220 } ipp_finishings_t;
1221 # ifndef _CUPS_NO_DEPRECATED
1222+# define IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN IPP_FINISHINGS_CUPS_FOLD_ACCORDION
1223+# define IPP_FINISHINGS_FOLD_ACCORDIAN IPP_FINISHINGS_FOLD_ACCORDION
1224 # define IPP_FINISHINGS_JOB_OFFSET IPP_FINISHINGS_JOG_OFFSET
1225- /* Long-time misspelling... */
1226+ /* Long-time misspellings... */
1227 typedef enum ipp_finishings_e ipp_finish_t;
1228 # endif /* !_CUPS_NO_DEPRECATED */
1229
1230diff --git a/cups/md5.c b/cups/md5.c
1231index c3b2768dd..a94646c72 100644
1232--- a/cups/md5.c
1233+++ b/cups/md5.c
1234@@ -43,7 +43,7 @@
1235 #include "md5-internal.h"
1236 #include "string-private.h"
1237
1238-#if !defined(__APPLE__) && !defined(HAVE_GNUTLS)
1239+#if !defined(__APPLE__)
1240 # define T1 0xd76aa478
1241 # define T2 0xe8c7b756
1242 # define T3 0x242070db
1243@@ -338,4 +338,4 @@ _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16])
1244 for (i = 0; i < 16; ++i)
1245 digest[i] = (unsigned char)(pms->abcd[i >> 2] >> ((i & 3) << 3));
1246 }
1247-#endif /* !__APPLE__ && !HAVE_GNUTLS */
1248+#endif /* !__APPLE__ */
1249diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c
1250index 6a35ef41a..5965e382b 100644
1251--- a/cups/ppd-cache.c
1252+++ b/cups/ppd-cache.c
1253@@ -1075,7 +1075,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
1254 * Convert the PPD size name to the corresponding PWG keyword name.
1255 */
1256
1257- if ((pwg_media = pwgMediaForPPD(ppd_size->name)) != NULL)
1258+ if ((pwg_media = pwgMediaForSize(PWG_FROM_POINTS(ppd_size->width), PWG_FROM_POINTS(ppd_size->length))) != NULL)
1259 {
1260 /*
1261 * Standard name, do we have conflicts?
1262@@ -3983,7 +3983,25 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1263 if ((attr = ippFindAttribute(response, "finishings-supported", IPP_TAG_ENUM)) != NULL)
1264 {
1265 int value; /* Enum value */
1266+ const char *ppd_keyword; /* PPD keyword for enum */
1267 cups_array_t *names; /* Names we've added */
1268+ static const char * const base_keywords[] =
1269+ { /* Base STD 92 keywords */
1270+ NULL, /* none */
1271+ "SingleAuto", /* staple */
1272+ "SingleAuto", /* punch */
1273+ NULL, /* cover */
1274+ "BindAuto", /* bind */
1275+ "SaddleStitch", /* saddle-stitch */
1276+ "EdgeStitchAuto", /* edge-stitch */
1277+ "Auto", /* fold */
1278+ NULL, /* trim */
1279+ NULL, /* bale */
1280+ NULL, /* booklet-maker */
1281+ NULL, /* jog-offset */
1282+ NULL, /* coat */
1283+ NULL /* laminate */
1284+ };
1285
1286 count = ippGetCount(attr);
1287 names = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
1288@@ -4004,6 +4022,33 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1289
1290 if (i < count)
1291 {
1292+ static const char * const staple_keywords[] =
1293+ { /* StapleLocation keywords */
1294+ "SinglePortrait",
1295+ "SingleRevLandscape",
1296+ "SingleLandscape",
1297+ "SingleRevPortrait",
1298+ "EdgeStitchPortrait",
1299+ "EdgeStitchLandscape",
1300+ "EdgeStitchRevPortrait",
1301+ "EdgeStitchRevLandscape",
1302+ "DualPortrait",
1303+ "DualLandscape",
1304+ "DualRevPortrait",
1305+ "DualRevLandscape",
1306+ "TriplePortrait",
1307+ "TripleLandscape",
1308+ "TripleRevPortrait",
1309+ "TripleRevLandscape"
1310+ };
1311+ static const char * const bind_keywords[] =
1312+ { /* StapleLocation binding keywords */
1313+ "BindPortrait",
1314+ "BindLandscape",
1315+ "BindRevPortrait",
1316+ "BindRevLandscape"
1317+ };
1318+
1319 cupsArrayAdd(fin_options, "*StapleLocation");
1320
1321 cupsFilePuts(fp, "*OpenUI *StapleLocation: PickOne\n");
1322@@ -4031,9 +4076,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1323 if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
1324 msgstr = keyword;
1325
1326- cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", keyword);
1327- cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, keyword, msgstr);
1328- cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, keyword);
1329+ if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
1330+ ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
1331+ else if (value >= IPP_FINISHINGS_STAPLE_TOP_LEFT && value <= IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM)
1332+ ppd_keyword = staple_keywords[value - IPP_FINISHINGS_STAPLE_TOP_LEFT];
1333+ else if (value >= IPP_FINISHINGS_BIND_LEFT && value <= IPP_FINISHINGS_BIND_BOTTOM)
1334+ ppd_keyword = bind_keywords[value - IPP_FINISHINGS_BIND_LEFT];
1335+ else
1336+ ppd_keyword = NULL;
1337+
1338+ if (!ppd_keyword)
1339+ continue;
1340+
1341+ cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", ppd_keyword);
1342+ cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
1343+ cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, ppd_keyword);
1344 }
1345
1346 cupsFilePuts(fp, "*CloseUI: *StapleLocation\n");
1347@@ -4048,12 +4105,28 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1348 value = ippGetInteger(attr, i);
1349 keyword = ippEnumString("finishings", value);
1350
1351- if (!strncmp(keyword, "fold-", 5))
1352+ if (!strncmp(keyword, "cups-fold-", 10) || !strcmp(keyword, "fold") || !strncmp(keyword, "fold-", 5))
1353 break;
1354 }
1355
1356 if (i < count)
1357 {
1358+ static const char * const fold_keywords[] =
1359+ { /* FoldType keywords */
1360+ "Accordion",
1361+ "DoubleGate",
1362+ "Gate",
1363+ "Half",
1364+ "HalfZ",
1365+ "LeftGate",
1366+ "Letter",
1367+ "Parallel",
1368+ "XFold",
1369+ "RightGate",
1370+ "ZFold",
1371+ "EngineeringZ"
1372+ };
1373+
1374 cupsArrayAdd(fin_options, "*FoldType");
1375
1376 cupsFilePuts(fp, "*OpenUI *FoldType: PickOne\n");
1377@@ -4068,7 +4141,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1378 value = ippGetInteger(attr, i);
1379 keyword = ippEnumString("finishings", value);
1380
1381- if (strncmp(keyword, "fold-", 5))
1382+ if (!strncmp(keyword, "cups-fold-", 10))
1383+ keyword += 5;
1384+ else if (strcmp(keyword, "fold") && strncmp(keyword, "fold-", 5))
1385 continue;
1386
1387 if (cupsArrayFind(names, (char *)keyword))
1388@@ -4081,9 +4156,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1389 if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
1390 msgstr = keyword;
1391
1392- cupsFilePrintf(fp, "*FoldType %s: \"\"\n", keyword);
1393- cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, keyword, msgstr);
1394- cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, keyword);
1395+ if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
1396+ ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
1397+ else if (value >= IPP_FINISHINGS_FOLD_ACCORDION && value <= IPP_FINISHINGS_FOLD_ENGINEERING_Z)
1398+ ppd_keyword = fold_keywords[value - IPP_FINISHINGS_FOLD_ACCORDION];
1399+ else if (value >= IPP_FINISHINGS_CUPS_FOLD_ACCORDION && value <= IPP_FINISHINGS_CUPS_FOLD_Z)
1400+ ppd_keyword = fold_keywords[value - IPP_FINISHINGS_CUPS_FOLD_ACCORDION];
1401+ else
1402+ ppd_keyword = NULL;
1403+
1404+ if (!ppd_keyword)
1405+ continue;
1406+
1407+ cupsFilePrintf(fp, "*FoldType %s: \"\"\n", ppd_keyword);
1408+ cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
1409+ cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, ppd_keyword);
1410 }
1411
1412 cupsFilePuts(fp, "*CloseUI: *FoldType\n");
1413@@ -4098,12 +4185,36 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1414 value = ippGetInteger(attr, i);
1415 keyword = ippEnumString("finishings", value);
1416
1417- if (!strncmp(keyword, "punch-", 6))
1418+ if (!strncmp(keyword, "cups-punch-", 11) || !strncmp(keyword, "punch-", 6))
1419 break;
1420 }
1421
1422 if (i < count)
1423 {
1424+ static const char * const punch_keywords[] =
1425+ { /* PunchMedia keywords */
1426+ "SinglePortrait",
1427+ "SingleRevLandscape",
1428+ "SingleLandscape",
1429+ "SingleRevPortrait",
1430+ "DualPortrait",
1431+ "DualLandscape",
1432+ "DualRevPortrait",
1433+ "DualRevLandscape",
1434+ "TriplePortrait",
1435+ "TripleLandscape",
1436+ "TripleRevPortrait",
1437+ "TripleRevLandscape",
1438+ "QuadPortrait",
1439+ "QuadLandscape",
1440+ "QuadRevPortrait",
1441+ "QuadRevLandscape",
1442+ "MultiplePortrait",
1443+ "MultipleLandscape",
1444+ "MultipleRevPortrait",
1445+ "MultipleRevLandscape"
1446+ };
1447+
1448 cupsArrayAdd(fin_options, "*PunchMedia");
1449
1450 cupsFilePuts(fp, "*OpenUI *PunchMedia: PickOne\n");
1451@@ -4118,7 +4229,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1452 value = ippGetInteger(attr, i);
1453 keyword = ippEnumString("finishings", value);
1454
1455- if (strncmp(keyword, "punch-", 6))
1456+ if (!strncmp(keyword, "cups-punch-", 11))
1457+ keyword += 5;
1458+ else if (strncmp(keyword, "punch-", 6))
1459 continue;
1460
1461 if (cupsArrayFind(names, (char *)keyword))
1462@@ -4131,9 +4244,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1463 if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
1464 msgstr = keyword;
1465
1466- cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", keyword);
1467- cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, keyword, msgstr);
1468- cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, keyword);
1469+ if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
1470+ ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
1471+ else if (value >= IPP_FINISHINGS_PUNCH_TOP_LEFT && value <= IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM)
1472+ ppd_keyword = punch_keywords[value - IPP_FINISHINGS_PUNCH_TOP_LEFT];
1473+ else if (value >= IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT && value <= IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM)
1474+ ppd_keyword = punch_keywords[value - IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT];
1475+ else
1476+ ppd_keyword = NULL;
1477+
1478+ if (!ppd_keyword)
1479+ continue;
1480+
1481+ cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", ppd_keyword);
1482+ cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
1483+ cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, ppd_keyword);
1484 }
1485
1486 cupsFilePuts(fp, "*CloseUI: *PunchMedia\n");
1487@@ -4157,6 +4282,69 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1488 cupsFilePuts(fp, "*CloseUI: *Booklet\n");
1489 }
1490
1491+ /*
1492+ * CutMedia
1493+ */
1494+
1495+ for (i = 0; i < count; i ++)
1496+ {
1497+ value = ippGetInteger(attr, i);
1498+ keyword = ippEnumString("finishings", value);
1499+
1500+ if (!strcmp(keyword, "trim") || !strncmp(keyword, "trim-", 5))
1501+ break;
1502+ }
1503+
1504+ if (i < count)
1505+ {
1506+ static const char * const trim_keywords[] =
1507+ { /* CutMedia keywords */
1508+ "EndOfPage",
1509+ "EndOfDoc",
1510+ "EndOfSet",
1511+ "EndOfJob"
1512+ };
1513+
1514+ cupsArrayAdd(fin_options, "*CutMedia");
1515+
1516+ cupsFilePuts(fp, "*OpenUI *CutMedia: PickOne\n");
1517+ cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *CutMedia\n");
1518+ cupsFilePrintf(fp, "*%s.Translation CutMedia/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Cut")));
1519+ cupsFilePuts(fp, "*DefaultCutMedia: None\n");
1520+ cupsFilePuts(fp, "*CutMedia None: \"\"\n");
1521+ cupsFilePrintf(fp, "*%s.CutMedia None/%s: \"\"\n", lang->language, _cupsLangString(lang, _("None")));
1522+
1523+ for (i = 0; i < count; i ++)
1524+ {
1525+ value = ippGetInteger(attr, i);
1526+ keyword = ippEnumString("finishings", value);
1527+
1528+ if (strcmp(keyword, "trim") && strncmp(keyword, "trim-", 5))
1529+ continue;
1530+
1531+ if (cupsArrayFind(names, (char *)keyword))
1532+ continue; /* Already did this finishing template */
1533+
1534+ cupsArrayAdd(names, (char *)keyword);
1535+
1536+ snprintf(msgid, sizeof(msgid), "finishings.%d", value);
1537+ if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
1538+ if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
1539+ msgstr = keyword;
1540+
1541+ if (value == IPP_FINISHINGS_TRIM)
1542+ ppd_keyword = "Auto";
1543+ else
1544+ ppd_keyword = trim_keywords[value - IPP_FINISHINGS_TRIM_AFTER_PAGES];
1545+
1546+ cupsFilePrintf(fp, "*CutMedia %s: \"\"\n", ppd_keyword);
1547+ cupsFilePrintf(fp, "*%s.CutMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
1548+ cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*CutMedia %s\"\n", value, keyword, ppd_keyword);
1549+ }
1550+
1551+ cupsFilePuts(fp, "*CloseUI: *CutMedia\n");
1552+ }
1553+
1554 cupsArrayDelete(names);
1555 }
1556
1557@@ -4184,7 +4372,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
1558 if (!keyword || cupsArrayFind(templates, (void *)keyword))
1559 continue;
1560
1561- if (strncmp(keyword, "fold-", 5) && (strstr(keyword, "-bottom") || strstr(keyword, "-left") || strstr(keyword, "-right") || strstr(keyword, "-top")))
1562+ if (!strcmp(keyword, "none"))
1563 continue;
1564
1565 cupsArrayAdd(templates, (void *)keyword);
1566diff --git a/cups/ppd.c b/cups/ppd.c
1567index fae19c42e..ff52df2e1 100644
1568--- a/cups/ppd.c
1569+++ b/cups/ppd.c
1570@@ -1874,9 +1874,9 @@ _ppdOpen(
1571 {
1572 if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
1573 {
1574- pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
1575-
1576- goto error;
1577+ char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
1578+ snprintf(cname, sizeof(cname), "_%s", name);
1579+ strlcpy(name, cname, sizeof(name));
1580 }
1581
1582 if ((size = ppdPageSize(ppd, name)) == NULL)
1583@@ -1903,9 +1903,9 @@ _ppdOpen(
1584 {
1585 if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
1586 {
1587- pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
1588-
1589- goto error;
1590+ char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
1591+ snprintf(cname, sizeof(cname), "_%s", name);
1592+ strlcpy(name, cname, sizeof(name));
1593 }
1594
1595 if ((size = ppdPageSize(ppd, name)) == NULL)
1596@@ -1939,9 +1939,9 @@ _ppdOpen(
1597
1598 if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
1599 {
1600- pg->ppd_status = PPD_ILLEGAL_OPTION_KEYWORD;
1601-
1602- goto error;
1603+ char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
1604+ snprintf(cname, sizeof(cname), "_%s", name);
1605+ strlcpy(name, cname, sizeof(name));
1606 }
1607
1608 if (!strcmp(keyword, "PageSize"))
1609diff --git a/cups/raster-stream.c b/cups/raster-stream.c
1610index d7db020f1..1459817cf 100644
1611--- a/cups/raster-stream.c
1612+++ b/cups/raster-stream.c
1613@@ -1,7 +1,7 @@
1614 /*
1615 * Raster file routines for CUPS.
1616 *
1617- * Copyright 2007-2018 by Apple Inc.
1618+ * Copyright 2007-2019 by Apple Inc.
1619 * Copyright 1997-2006 by Easy Software Products.
1620 *
1621 * This file is part of the CUPS Imaging library.
1622@@ -32,6 +32,24 @@ typedef void (*_cups_copyfunc_t)(void *dst, const void *src, size_t bytes);
1623 * Local globals...
1624 */
1625
1626+static const char * const apple_media_types[] =
1627+{ /* media-type values for Apple Raster */
1628+ "auto",
1629+ "stationery",
1630+ "transparency",
1631+ "envelope",
1632+ "cardstock",
1633+ "labels",
1634+ "stationery-letterhead",
1635+ "disc",
1636+ "photographic-matte",
1637+ "photographic-satin",
1638+ "photographic-semi-gloss",
1639+ "photographic-glossy",
1640+ "photographic-high-gloss",
1641+ "other"
1642+};
1643+
1644 #ifdef DEBUG
1645 static const char * const cups_modes[] =
1646 { /* Open modes */
1647@@ -638,7 +656,7 @@ _cupsRasterReadHeader(
1648 {
1649 CUPS_CSPACE_SW,
1650 CUPS_CSPACE_SRGB,
1651- CUPS_CSPACE_RGBW,
1652+ CUPS_CSPACE_CIELab,
1653 CUPS_CSPACE_ADOBERGB,
1654 CUPS_CSPACE_W,
1655 CUPS_CSPACE_RGB,
1656@@ -648,7 +666,7 @@ _cupsRasterReadHeader(
1657 {
1658 1,
1659 3,
1660- 4,
1661+ 3,
1662 3,
1663 1,
1664 3,
1665@@ -681,8 +699,21 @@ _cupsRasterReadHeader(
1666 r->header.cupsPageSize[1] = (float)(r->header.cupsHeight * 72.0 / r->header.HWResolution[1]);
1667 }
1668
1669- r->header.cupsInteger[0] = r->apple_page_count;
1670- r->header.cupsInteger[7] = 0xffffff;
1671+ r->header.cupsInteger[CUPS_RASTER_PWG_TotalPageCount] = r->apple_page_count;
1672+ r->header.cupsInteger[CUPS_RASTER_PWG_AlternatePrimary] = 0xffffff;
1673+ r->header.cupsInteger[CUPS_RASTER_PWG_PrintQuality] = appleheader[3];
1674+
1675+ if (appleheader[2] >= 2)
1676+ r->header.Duplex = 1;
1677+ if (appleheader[2] == 2)
1678+ r->header.Tumble = 1;
1679+
1680+ r->header.MediaPosition = appleheader[5];
1681+
1682+ if (appleheader[4] < (int)(sizeof(apple_media_types) / sizeof(apple_media_types[0])))
1683+ strlcpy(r->header.MediaType, apple_media_types[appleheader[4]], sizeof(r->header.MediaType));
1684+ else
1685+ strlcpy(r->header.MediaType, "other", sizeof(r->header.MediaType));
1686 }
1687 break;
1688 }
1689@@ -1072,8 +1103,9 @@ _cupsRasterWriteHeader(
1690 * zeroed.
1691 */
1692
1693- unsigned char appleheader[32]; /* Raw page header */
1694- unsigned height = r->header.cupsHeight * r->rowheight;
1695+ int i; /* Looping var */
1696+ unsigned char appleheader[32];/* Raw page header */
1697+ unsigned height = r->header.cupsHeight * r->rowheight;
1698 /* Computed page height */
1699
1700 if (r->apple_page_count == 0xffffffffU)
1701@@ -1101,11 +1133,14 @@ _cupsRasterWriteHeader(
1702
1703 appleheader[0] = (unsigned char)r->header.cupsBitsPerPixel;
1704 appleheader[1] = r->header.cupsColorSpace == CUPS_CSPACE_SRGB ? 1 :
1705- r->header.cupsColorSpace == CUPS_CSPACE_RGBW ? 2 :
1706+ r->header.cupsColorSpace == CUPS_CSPACE_CIELab ? 2 :
1707 r->header.cupsColorSpace == CUPS_CSPACE_ADOBERGB ? 3 :
1708 r->header.cupsColorSpace == CUPS_CSPACE_W ? 4 :
1709 r->header.cupsColorSpace == CUPS_CSPACE_RGB ? 5 :
1710 r->header.cupsColorSpace == CUPS_CSPACE_CMYK ? 6 : 0;
1711+ appleheader[2] = r->header.Duplex ? (r->header.Tumble ? 2 : 3) : 1;
1712+ appleheader[3] = (unsigned char)(r->header.cupsInteger[CUPS_RASTER_PWG_PrintQuality]);
1713+ appleheader[5] = (unsigned char)(r->header.MediaPosition);
1714 appleheader[12] = (unsigned char)(r->header.cupsWidth >> 24);
1715 appleheader[13] = (unsigned char)(r->header.cupsWidth >> 16);
1716 appleheader[14] = (unsigned char)(r->header.cupsWidth >> 8);
1717@@ -1119,6 +1154,15 @@ _cupsRasterWriteHeader(
1718 appleheader[22] = (unsigned char)(r->header.HWResolution[0] >> 8);
1719 appleheader[23] = (unsigned char)(r->header.HWResolution[0]);
1720
1721+ for (i = 0; i < (int)(sizeof(apple_media_types) / sizeof(apple_media_types[0])); i ++)
1722+ {
1723+ if (!strcmp(r->header.MediaType, apple_media_types[i]))
1724+ {
1725+ appleheader[4] = (unsigned char)i;
1726+ break;
1727+ }
1728+ }
1729+
1730 return (cups_raster_io(r, appleheader, sizeof(appleheader)) == sizeof(appleheader));
1731 }
1732 else
1733diff --git a/cups/sidechannel.c b/cups/sidechannel.c
1734index b43123a8c..56a5d0116 100644
1735--- a/cups/sidechannel.c
1736+++ b/cups/sidechannel.c
1737@@ -1,10 +1,11 @@
1738 /*
1739 * Side-channel API code for CUPS.
1740 *
1741- * Copyright 2007-2014 by Apple Inc.
1742- * Copyright 2006 by Easy Software Products.
1743+ * Copyright © 2007-2019 by Apple Inc.
1744+ * Copyright © 2006 by Easy Software Products.
1745 *
1746- * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
1747+ * Licensed under Apache License v2.0. See the file "LICENSE" for more
1748+ * information.
1749 */
1750
1751 /*
1752@@ -589,8 +590,8 @@ cupsSideChannelWrite(
1753 if ((buffer = _cupsBufferGet((size_t)datalen + 4)) == NULL)
1754 return (-1);
1755
1756- buffer[0] = command;
1757- buffer[1] = status;
1758+ buffer[0] = (char)command;
1759+ buffer[1] = (char)status;
1760 buffer[2] = (char)(datalen >> 8);
1761 buffer[3] = (char)(datalen & 255);
1762
1763diff --git a/cups/snmp.c b/cups/snmp.c
1764index 1d9da01f2..6da119d76 100644
1765--- a/cups/snmp.c
1766+++ b/cups/snmp.c
1767@@ -1,7 +1,7 @@
1768 /*
1769 * SNMP functions for CUPS.
1770 *
1771- * Copyright © 2007-2014 by Apple Inc.
1772+ * Copyright © 2007-2019 by Apple Inc.
1773 * Copyright © 2006-2007 by Easy Software Products, all rights reserved.
1774 *
1775 * Licensed under Apache License v2.0. See the file "LICENSE" for more
1776@@ -1167,7 +1167,7 @@ asn1_encode_snmp(unsigned char *buffer, /* I - Buffer */
1777 memcpy(bufptr, packet->community, commlen);
1778 bufptr += commlen;
1779
1780- *bufptr++ = packet->request_type; /* Get-Request-PDU/Get-Next-Request-PDU */
1781+ *bufptr++ = (unsigned char)packet->request_type; /* Get-Request-PDU/Get-Next-Request-PDU */
1782 asn1_set_length(&bufptr, reqlen);
1783
1784 asn1_set_integer(&bufptr, (int)packet->request_id);
1785diff --git a/cups/string.c b/cups/string.c
1786index 54f7bd0cf..93cdad19d 100644
1787--- a/cups/string.c
1788+++ b/cups/string.c
1789@@ -146,7 +146,7 @@ _cupsStrDate(char *buf, /* I - Buffer */
1790 size_t bufsize, /* I - Size of buffer */
1791 time_t timeval) /* I - Time value */
1792 {
1793- struct tm *dateval; /* Local date/time */
1794+ struct tm date; /* Local date/time */
1795 char temp[1024]; /* Temporary buffer */
1796 _cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
1797
1798@@ -154,15 +154,15 @@ _cupsStrDate(char *buf, /* I - Buffer */
1799 if (!cg->lang_default)
1800 cg->lang_default = cupsLangDefault();
1801
1802- dateval = localtime(&timeval);
1803+ localtime_r(&timeval, &date);
1804
1805 if (cg->lang_default->encoding != CUPS_UTF8)
1806 {
1807- strftime(temp, sizeof(temp), "%c", dateval);
1808+ strftime(temp, sizeof(temp), "%c", &date);
1809 cupsCharsetToUTF8((cups_utf8_t *)buf, temp, (int)bufsize, cg->lang_default->encoding);
1810 }
1811 else
1812- strftime(buf, bufsize, "%c", dateval);
1813+ strftime(buf, bufsize, "%c", &date);
1814
1815 return (buf);
1816 }
1817diff --git a/cups/testraster.c b/cups/testraster.c
1818index d3dab4bbc..de72a4bfb 100644
1819--- a/cups/testraster.c
1820+++ b/cups/testraster.c
1821@@ -1,7 +1,7 @@
1822 /*
1823 * Raster test program routines for CUPS.
1824 *
1825- * Copyright © 2007-2018 by Apple Inc.
1826+ * Copyright © 2007-2019 by Apple Inc.
1827 * Copyright © 1997-2007 by Easy Software Products.
1828 *
1829 * Licensed under Apache License v2.0. See the file "LICENSE" for more
1830@@ -22,8 +22,7 @@
1831
1832 static int do_ras_file(const char *filename);
1833 static int do_raster_tests(cups_mode_t mode);
1834-static void print_changes(cups_page_header2_t *header,
1835- cups_page_header2_t *expected);
1836+static void print_changes(cups_page_header2_t *header, cups_page_header2_t *expected);
1837
1838
1839 /*
1840@@ -174,6 +173,8 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
1841 header.cupsPageSize[0] = 288.0f;
1842 header.cupsPageSize[1] = 288.0f;
1843
1844+ strlcpy(header.MediaType, "auto", sizeof(header.MediaType));
1845+
1846 if (page & 1)
1847 {
1848 header.cupsBytesPerLine *= 4;
1849@@ -308,6 +309,8 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
1850 expected.PageSize[0] = 288;
1851 expected.PageSize[1] = 288;
1852
1853+ strlcpy(expected.MediaType, "auto", sizeof(expected.MediaType));
1854+
1855 if (mode != CUPS_RASTER_WRITE_PWG)
1856 {
1857 expected.cupsPageSize[0] = 288.0f;
1858diff --git a/cups/testthreads.c b/cups/testthreads.c
1859new file mode 100644
1860index 000000000..441bc9f15
1861--- /dev/null
1862+++ b/cups/testthreads.c
1863@@ -0,0 +1,268 @@
1864+/*
1865+ * Threaded test program for CUPS.
1866+ *
1867+ * Copyright © 2012-2019 by Apple Inc.
1868+ *
1869+ * Licensed under Apache License v2.0. See the file "LICENSE" for more
1870+ * information.
1871+ */
1872+
1873+/*
1874+ * Include necessary headers...
1875+ */
1876+
1877+#include <stdio.h>
1878+#include <errno.h>
1879+#include <cups/cups.h>
1880+#include <cups/thread-private.h>
1881+
1882+
1883+/*
1884+ * Local functions...
1885+ */
1886+
1887+static int enum_dests_cb(void *_name, unsigned flags, cups_dest_t *dest);
1888+static void *run_query(cups_dest_t *dest);
1889+static void show_supported(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, const char *option, const char *value);
1890+
1891+
1892+/*
1893+ * 'main()' - Main entry.
1894+ */
1895+
1896+int /* O - Exit status */
1897+main(int argc, /* I - Number of command-line arguments */
1898+ char *argv[]) /* I - Command-line arguments */
1899+{
1900+ /*
1901+ * Go through all the available destinations to find the requested one...
1902+ */
1903+
1904+ (void)argc;
1905+
1906+ cupsEnumDests(CUPS_DEST_FLAGS_NONE, -1, NULL, 0, 0, enum_dests_cb, argv[1]);
1907+
1908+ return (0);
1909+}
1910+
1911+
1912+/*
1913+ * 'enum_dests_cb()' - Destination enumeration function...
1914+ */
1915+
1916+static int /* O - 1 to continue, 0 to stop */
1917+enum_dests_cb(void *_name, /* I - Printer name, if any */
1918+ unsigned flags, /* I - Enumeration flags */
1919+ cups_dest_t *dest) /* I - Found destination */
1920+{
1921+ const char *name = (const char *)_name;
1922+ /* Printer name */
1923+ cups_dest_t *cdest; /* Copied destination */
1924+
1925+
1926+ (void)flags;
1927+
1928+ /*
1929+ * If a name was specified, compare it...
1930+ */
1931+
1932+ if (name && strcasecmp(name, dest->name))
1933+ return (1); /* Continue */
1934+
1935+ /*
1936+ * Copy the destination and run the query on a separate thread...
1937+ */
1938+
1939+ cupsCopyDest(dest, 0, &cdest);
1940+ _cupsThreadWait(_cupsThreadCreate((_cups_thread_func_t)run_query, cdest));
1941+
1942+ cupsFreeDests(1, cdest);
1943+
1944+ /*
1945+ * Continue if no name was specified or the name matches...
1946+ */
1947+
1948+ return (!name || !strcasecmp(name, dest->name));
1949+}
1950+
1951+
1952+/*
1953+ * 'run_query()' - Query printer capabilities on a separate thread.
1954+ */
1955+
1956+static void * /* O - Return value (not used) */
1957+run_query(cups_dest_t *dest) /* I - Destination to query */
1958+{
1959+ http_t *http; /* Connection to destination */
1960+ cups_dinfo_t *dinfo; /* Destination info */
1961+ unsigned dflags = CUPS_DEST_FLAGS_NONE;
1962+ /* Destination flags */
1963+
1964+
1965+ if ((http = cupsConnectDest(dest, dflags, 300, NULL, NULL, 0, NULL, NULL)) == NULL)
1966+ {
1967+ printf("testthreads: Unable to connect to destination \"%s\": %s\n", dest->name, cupsLastErrorString());
1968+ return (NULL);
1969+ }
1970+
1971+ if ((dinfo = cupsCopyDestInfo(http, dest)) == NULL)
1972+ {
1973+ printf("testdest: Unable to get information for destination \"%s\": %s\n", dest->name, cupsLastErrorString());
1974+ return (NULL);
1975+ }
1976+
1977+ printf("\n%s:\n", dest->name);
1978+
1979+ show_supported(http, dest, dinfo, NULL, NULL);
1980+
1981+ return (NULL);
1982+}
1983+
1984+
1985+
1986+/*
1987+ * 'show_supported()' - Show supported options, values, etc.
1988+ */
1989+
1990+static void
1991+show_supported(http_t *http, /* I - Connection to destination */
1992+ cups_dest_t *dest, /* I - Destination */
1993+ cups_dinfo_t *dinfo, /* I - Destination information */
1994+ const char *option, /* I - Option, if any */
1995+ const char *value) /* I - Value, if any */
1996+{
1997+ ipp_attribute_t *attr; /* Attribute */
1998+ int i, /* Looping var */
1999+ count; /* Number of values */
2000+
2001+
2002+ if (!option)
2003+ {
2004+ attr = cupsFindDestSupported(http, dest, dinfo, "job-creation-attributes");
2005+ if (attr)
2006+ {
2007+ count = ippGetCount(attr);
2008+ for (i = 0; i < count; i ++)
2009+ show_supported(http, dest, dinfo, ippGetString(attr, i, NULL), NULL);
2010+ }
2011+ else
2012+ {
2013+ static const char * const options[] =
2014+ { /* List of standard options */
2015+ CUPS_COPIES,
2016+ CUPS_FINISHINGS,
2017+ CUPS_MEDIA,
2018+ CUPS_NUMBER_UP,
2019+ CUPS_ORIENTATION,
2020+ CUPS_PRINT_COLOR_MODE,
2021+ CUPS_PRINT_QUALITY,
2022+ CUPS_SIDES
2023+ };
2024+
2025+ puts(" No job-creation-attributes-supported attribute, probing instead.");
2026+
2027+ for (i = 0; i < (int)(sizeof(options) / sizeof(options[0])); i ++)
2028+ if (cupsCheckDestSupported(http, dest, dinfo, options[i], NULL))
2029+ show_supported(http, dest, dinfo, options[i], NULL);
2030+ }
2031+ }
2032+ else if (!value)
2033+ {
2034+ printf(" %s (%s - %s)\n", option, cupsLocalizeDestOption(http, dest, dinfo, option), cupsCheckDestSupported(http, dest, dinfo, option, NULL) ? "supported" : "not-supported");
2035+
2036+ if ((attr = cupsFindDestSupported(http, dest, dinfo, option)) != NULL)
2037+ {
2038+ count = ippGetCount(attr);
2039+
2040+ switch (ippGetValueTag(attr))
2041+ {
2042+ case IPP_TAG_INTEGER :
2043+ for (i = 0; i < count; i ++)
2044+ printf(" %d\n", ippGetInteger(attr, i));
2045+ break;
2046+
2047+ case IPP_TAG_ENUM :
2048+ for (i = 0; i < count; i ++)
2049+ {
2050+ int val = ippGetInteger(attr, i);
2051+ char valstr[256];
2052+
2053+ snprintf(valstr, sizeof(valstr), "%d", val);
2054+ printf(" %s (%s)\n", ippEnumString(option, ippGetInteger(attr, i)), cupsLocalizeDestValue(http, dest, dinfo, option, valstr));
2055+ }
2056+ break;
2057+
2058+ case IPP_TAG_RANGE :
2059+ for (i = 0; i < count; i ++)
2060+ {
2061+ int upper, lower = ippGetRange(attr, i, &upper);
2062+
2063+ printf(" %d-%d\n", lower, upper);
2064+ }
2065+ break;
2066+
2067+ case IPP_TAG_RESOLUTION :
2068+ for (i = 0; i < count; i ++)
2069+ {
2070+ int xres, yres;
2071+ ipp_res_t units;
2072+ xres = ippGetResolution(attr, i, &yres, &units);
2073+
2074+ if (xres == yres)
2075+ printf(" %d%s\n", xres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
2076+ else
2077+ printf(" %dx%d%s\n", xres, yres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
2078+ }
2079+ break;
2080+
2081+ case IPP_TAG_KEYWORD :
2082+ for (i = 0; i < count; i ++)
2083+ printf(" %s (%s)\n", ippGetString(attr, i, NULL), cupsLocalizeDestValue(http, dest, dinfo, option, ippGetString(attr, i, NULL)));
2084+ break;
2085+
2086+ case IPP_TAG_TEXTLANG :
2087+ case IPP_TAG_NAMELANG :
2088+ case IPP_TAG_TEXT :
2089+ case IPP_TAG_NAME :
2090+ case IPP_TAG_URI :
2091+ case IPP_TAG_URISCHEME :
2092+ case IPP_TAG_CHARSET :
2093+ case IPP_TAG_LANGUAGE :
2094+ case IPP_TAG_MIMETYPE :
2095+ for (i = 0; i < count; i ++)
2096+ printf(" %s\n", ippGetString(attr, i, NULL));
2097+ break;
2098+
2099+ case IPP_TAG_STRING :
2100+ for (i = 0; i < count; i ++)
2101+ {
2102+ int j, len;
2103+ unsigned char *data = ippGetOctetString(attr, i, &len);
2104+
2105+ fputs(" ", stdout);
2106+ for (j = 0; j < len; j ++)
2107+ {
2108+ if (data[j] < ' ' || data[j] >= 0x7f)
2109+ printf("<%02X>", data[j]);
2110+ else
2111+ putchar(data[j]);
2112+ }
2113+ putchar('\n');
2114+ }
2115+ break;
2116+
2117+ case IPP_TAG_BOOLEAN :
2118+ break;
2119+
2120+ default :
2121+ printf(" %s\n", ippTagString(ippGetValueTag(attr)));
2122+ break;
2123+ }
2124+ }
2125+
2126+ }
2127+ else if (cupsCheckDestSupported(http, dest, dinfo, option, value))
2128+ puts("YES");
2129+ else
2130+ puts("NO");
2131+}
2132diff --git a/cups/tls-darwin.c b/cups/tls-darwin.c
2133index e8c4fb713..b3bd50bf8 100644
2134--- a/cups/tls-darwin.c
2135+++ b/cups/tls-darwin.c
2136@@ -2002,7 +2002,8 @@ static const char * /* O - Keychain path */
2137 http_cdsa_default_path(char *buffer, /* I - Path buffer */
2138 size_t bufsize) /* I - Size of buffer */
2139 {
2140- const char *home = getenv("HOME"); /* HOME environment variable */
2141+ _cups_globals_t *cg = _cupsGlobals();
2142+ /* Pointer to library globals */
2143
2144
2145 /*
2146@@ -2011,8 +2012,8 @@ http_cdsa_default_path(char *buffer, /* I - Path buffer */
2147 * 10.11.4 (!), so we need to create our own keychain just for CUPS.
2148 */
2149
2150- if (getuid() && home)
2151- snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", home);
2152+ if (cg->home)
2153+ snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", cg->home);
2154 else
2155 strlcpy(buffer, "/etc/cups/ssl.keychain", bufsize);
2156
2157diff --git a/cups/tls-gnutls.c b/cups/tls-gnutls.c
2158index fc52f493c..329cc0eb4 100644
2159--- a/cups/tls-gnutls.c
2160+++ b/cups/tls-gnutls.c
2161@@ -935,12 +935,13 @@ static const char * /* O - Path or NULL on error */
2162 http_gnutls_default_path(char *buffer,/* I - Path buffer */
2163 size_t bufsize)/* I - Size of path buffer */
2164 {
2165- const char *home = getenv("HOME"); /* HOME environment variable */
2166+ _cups_globals_t *cg = _cupsGlobals();
2167+ /* Pointer to library globals */
2168
2169
2170- if (getuid() && home)
2171+ if (cg->home)
2172 {
2173- snprintf(buffer, bufsize, "%s/.cups", home);
2174+ snprintf(buffer, bufsize, "%s/.cups", cg->home);
2175 if (access(buffer, 0))
2176 {
2177 DEBUG_printf(("1http_gnutls_default_path: Making directory \"%s\".", buffer));
2178@@ -951,7 +952,7 @@ http_gnutls_default_path(char *buffer,/* I - Path buffer */
2179 }
2180 }
2181
2182- snprintf(buffer, bufsize, "%s/.cups/ssl", home);
2183+ snprintf(buffer, bufsize, "%s/.cups/ssl", cg->home);
2184 if (access(buffer, 0))
2185 {
2186 DEBUG_printf(("1http_gnutls_default_path: Making directory \"%s\".", buffer));
2187diff --git a/cups/tls-sspi.c b/cups/tls-sspi.c
2188index 6e3c03b9e..ccbdf8aaf 100644
2189--- a/cups/tls-sspi.c
2190+++ b/cups/tls-sspi.c
2191@@ -1967,6 +1967,8 @@ http_sspi_make_credentials(
2192
2193 GetSystemTime(&et);
2194 et.wYear += years;
2195+ if (et.wMonth == 2 && et.wDay == 29)
2196+ et.wDay = 28; /* Avoid Feb 29th due to leap years */
2197
2198 ZeroMemory(&exts, sizeof(exts));
2199
2200diff --git a/cups/usersys.c b/cups/usersys.c
2201index 497681e27..d74c951cf 100644
2202--- a/cups/usersys.c
2203+++ b/cups/usersys.c
2204@@ -40,6 +40,8 @@
2205 # define kCUPSPrintingPrefs CFSTR(".GlobalPreferences")
2206 # define kPREFIX "AirPrint"
2207 # endif /* TARGET_OS_OSX */
2208+# define kDigestOptionsKey CFSTR(kPREFIX "DigestOptions")
2209+# define kUserKey CFSTR(kPREFIX "User")
2210 # define kUserAgentTokensKey CFSTR(kPREFIX "UserAgentTokens")
2211 # define kAllowAnyRootKey CFSTR(kPREFIX "AllowAnyRoot")
2212 # define kAllowExpiredCertsKey CFSTR(kPREFIX "AllowExpiredCerts")
2213@@ -63,6 +65,7 @@
2214
2215 typedef struct _cups_client_conf_s /**** client.conf config data ****/
2216 {
2217+ _cups_digestoptions_t digestoptions; /* DigestOptions values */
2218 _cups_uatokens_t uatokens; /* UserAgentTokens values */
2219 #ifdef HAVE_SSL
2220 int ssl_options, /* SSLOptions values */
2221@@ -97,6 +100,7 @@ static void cups_finalize_client_conf(_cups_client_conf_t *cc);
2222 static void cups_init_client_conf(_cups_client_conf_t *cc);
2223 static void cups_read_client_conf(cups_file_t *fp, _cups_client_conf_t *cc);
2224 static void cups_set_default_ipp_port(_cups_globals_t *cg);
2225+static void cups_set_digestoptions(_cups_client_conf_t *cc, const char *value);
2226 static void cups_set_encryption(_cups_client_conf_t *cc, const char *value);
2227 #ifdef HAVE_GSSAPI
2228 static void cups_set_gss_service_name(_cups_client_conf_t *cc, const char *value);
2229@@ -967,7 +971,6 @@ void
2230 _cupsSetDefaults(void)
2231 {
2232 cups_file_t *fp; /* File */
2233- const char *home; /* Home directory of user */
2234 char filename[1024]; /* Filename */
2235 _cups_client_conf_t cc; /* client.conf values */
2236 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
2237@@ -993,19 +996,13 @@ _cupsSetDefaults(void)
2238 cupsFileClose(fp);
2239 }
2240
2241-# ifdef HAVE_GETEUID
2242- if ((geteuid() == getuid() || !getuid()) && getegid() == getgid() && (home = getenv("HOME")) != NULL)
2243-# elif !defined(_WIN32)
2244- if (getuid() && (home = getenv("HOME")) != NULL)
2245-# else
2246- if ((home = getenv("HOME")) != NULL)
2247-# endif /* HAVE_GETEUID */
2248+ if (cg->home)
2249 {
2250 /*
2251 * Look for ~/.cups/client.conf...
2252 */
2253
2254- snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
2255+ snprintf(filename, sizeof(filename), "%s/.cups/client.conf", cg->home);
2256 if ((fp = cupsFileOpen(filename, "r")) != NULL)
2257 {
2258 cups_read_client_conf(fp, &cc);
2259@@ -1324,10 +1321,14 @@ cups_init_client_conf(
2260 cc->validate_certs = bval;
2261 # endif /* HAVE_SSL */
2262
2263+ if (cups_apple_get_string(kDigestOptionsKey, sval, sizeof(sval)))
2264+ cups_set_digestoptions(cc, sval);
2265+
2266+ if (cups_apple_get_string(kUserKey, sval, sizeof(sval)))
2267+ strlcpy(cc->user, sval, sizeof(cc->user));
2268+
2269 if (cups_apple_get_string(kUserAgentTokensKey, sval, sizeof(sval)))
2270- {
2271 cups_set_uatokens(cc, sval);
2272- }
2273 #endif /* __APPLE__ */
2274 }
2275
2276@@ -1353,7 +1354,9 @@ cups_read_client_conf(
2277 linenum = 0;
2278 while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
2279 {
2280- if (!_cups_strcasecmp(line, "Encryption") && value)
2281+ if (!_cups_strcasecmp(line, "DigestOptions") && value)
2282+ cups_set_digestoptions(cc, value);
2283+ else if (!_cups_strcasecmp(line, "Encryption") && value)
2284 cups_set_encryption(cc, value);
2285 #ifndef __APPLE__
2286 /*
2287@@ -1408,6 +1411,23 @@ cups_set_default_ipp_port(
2288 cg->ipp_port = CUPS_DEFAULT_IPP_PORT;
2289 }
2290
2291+
2292+/*
2293+ * 'cups_set_digestoptions()' - Set the DigestOptions value.
2294+ */
2295+
2296+static void
2297+cups_set_digestoptions(
2298+ _cups_client_conf_t *cc, /* I - client.conf values */
2299+ const char *value) /* I - Value */
2300+{
2301+ if (!_cups_strcasecmp(value, "DenyMD5"))
2302+ cc->digestoptions = _CUPS_DIGESTOPTIONS_DENYMD5;
2303+ else if (!_cups_strcasecmp(value, "None"))
2304+ cc->digestoptions = _CUPS_DIGESTOPTIONS_NONE;
2305+}
2306+
2307+
2308 /*
2309 * 'cups_set_encryption()' - Set the Encryption value.
2310 */
2311diff --git a/doc/help/api-admin.html b/doc/help/api-admin.html
2312index 7e6b40702..f9969d4a9 100644
2313--- a/doc/help/api-admin.html
2314+++ b/doc/help/api-admin.html
2315@@ -5,7 +5,7 @@
2316 <title>Administration APIs</title>
2317 <meta name="keywords" content="Programming">
2318 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
2319- <meta name="creator" content="codedoc v3.2">
2320+ <meta name="creator" content="codedoc v3.1">
2321 <meta name="author" content="Unknown">
2322 <meta name="copyright" content="Unknown">
2323 <meta name="version" content="0.0">
2324@@ -450,7 +450,6 @@ h3.title {
2325 --></style>
2326 </head>
2327 <body>
2328- <div class="header">
2329 <!--
2330 Administrative API header for CUPS.
2331
2332@@ -482,7 +481,6 @@ h3.title {
2333 </tr>
2334 </tbody>
2335 </table></div>
2336- </div>
2337 <div class="contents">
2338 <h2 class="title">Contents</h2>
2339 <ul class="contents">
2340diff --git a/doc/help/api-filter.html b/doc/help/api-filter.html
2341index 961f4623a..eddd06389 100644
2342--- a/doc/help/api-filter.html
2343+++ b/doc/help/api-filter.html
2344@@ -5,7 +5,7 @@
2345 <title>Filter and Backend Programming</title>
2346 <meta name="keywords" content="Programming">
2347 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
2348- <meta name="creator" content="codedoc v3.2">
2349+ <meta name="creator" content="codedoc v3.1">
2350 <meta name="author" content="Unknown">
2351 <meta name="copyright" content="Unknown">
2352 <meta name="version" content="0.0">
2353@@ -450,7 +450,6 @@ h3.title {
2354 --></style>
2355 </head>
2356 <body>
2357- <div class="header">
2358 <!--
2359 Filter and backend programming header for CUPS.
2360
2361@@ -488,7 +487,6 @@ h3.title {
2362 </tr>
2363 </tbody>
2364 </table></div>
2365- </div>
2366 <div class="contents">
2367 <h2 class="title">Contents</h2>
2368 <ul class="contents">
2369diff --git a/doc/help/api-ppd.html b/doc/help/api-ppd.html
2370index 623a3a8e0..fce4da3f7 100644
2371--- a/doc/help/api-ppd.html
2372+++ b/doc/help/api-ppd.html
2373@@ -5,7 +5,7 @@
2374 <title>PPD API (DEPRECATED)</title>
2375 <meta name="keywords" content="Programming">
2376 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
2377- <meta name="creator" content="codedoc v3.2">
2378+ <meta name="creator" content="codedoc v3.1">
2379 <meta name="author" content="Unknown">
2380 <meta name="copyright" content="Unknown">
2381 <meta name="version" content="0.0">
2382@@ -450,7 +450,6 @@ h3.title {
2383 --></style>
2384 </head>
2385 <body>
2386- <div class="header">
2387 <!--
2388 PPD API header for CUPS.
2389
2390@@ -487,7 +486,6 @@ h3.title {
2391 </tr>
2392 </tbody>
2393 </table></div>
2394- </div>
2395 <div class="contents">
2396 <h2 class="title">Contents</h2>
2397 <ul class="contents">
2398diff --git a/doc/help/api-raster.html b/doc/help/api-raster.html
2399index 6a9e76385..6eccab791 100644
2400--- a/doc/help/api-raster.html
2401+++ b/doc/help/api-raster.html
2402@@ -5,7 +5,7 @@
2403 <title>Raster API</title>
2404 <meta name="keywords" content="Programming">
2405 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
2406- <meta name="creator" content="codedoc v3.2">
2407+ <meta name="creator" content="codedoc v3.1">
2408 <meta name="author" content="Unknown">
2409 <meta name="copyright" content="Unknown">
2410 <meta name="version" content="0.0">
2411@@ -450,7 +450,6 @@ h3.title {
2412 --></style>
2413 </head>
2414 <body>
2415- <div class="header">
2416 <!--
2417 Raster API documentation for CUPS.
2418
2419@@ -482,7 +481,6 @@ h3.title {
2420 </tr>
2421 </tbody>
2422 </table></div>
2423- </div>
2424 <div class="contents">
2425 <h2 class="title">Contents</h2>
2426 <ul class="contents">
2427diff --git a/doc/help/cupspm.epub b/doc/help/cupspm.epub
2428index 1a8c38823..1d8572474 100644
2429Binary files a/doc/help/cupspm.epub and b/doc/help/cupspm.epub differ
2430diff --git a/doc/help/cupspm.html b/doc/help/cupspm.html
2431index fa1a87681..9b48cde34 100644
2432--- a/doc/help/cupspm.html
2433+++ b/doc/help/cupspm.html
2434@@ -5,62 +5,91 @@
2435 <title>CUPS Programming Manual</title>
2436 <meta name="keywords" content="Programming">
2437 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
2438- <meta name="creator" content="codedoc v3.2">
2439+ <meta name="creator" content="codedoc v3.1">
2440 <meta name="author" content="Michael R Sweet">
2441 <meta name="copyright" content="Copyright © 2007-2019 by Apple Inc. All Rights Reserved.">
2442- <meta name="version" content="2.3.0">
2443+ <meta name="version" content="2.3.1">
2444 <style type="text/css"><!--
2445-body, p, h1, h2, h3, h4, h5, h6 {
2446+body, p, h1, h2, h3, h4 {
2447 font-family: sans-serif;
2448- line-height: 1.4;
2449 }
2450-h1, h2, h3, h4, h5, h6 {
2451- font-weight: bold;
2452- page-break-inside: avoid;
2453-}
2454-h1 {
2455+div.body h1 {
2456 font-size: 250%;
2457+ font-weight: bold;
2458 margin: 0;
2459 }
2460-h2 {
2461+div.body h2 {
2462 font-size: 250%;
2463 margin-top: 1.5em;
2464 }
2465-h3 {
2466- font-size: 200%;
2467+div.body h3 {
2468+ font-size: 150%;
2469 margin-bottom: 0.5em;
2470 margin-top: 1.5em;
2471 }
2472-h4 {
2473- font-size: 150%;
2474+div.body h4 {
2475+ font-size: 110%;
2476 margin-bottom: 0.5em;
2477 margin-top: 1.5em;
2478 }
2479-h5 {
2480- font-size: 125%;
2481+div.body h5 {
2482+ font-size: 100%;
2483 margin-bottom: 0.5em;
2484 margin-top: 1.5em;
2485 }
2486-h6 {
2487+div.contents {
2488+ background: #e8e8e8;
2489+ border: solid thin black;
2490+ padding: 10px;
2491+}
2492+div.contents h1 {
2493 font-size: 110%;
2494- margin-bottom: 0.5em;
2495- margin-top: 1.5em;
2496 }
2497-div.header h1, div.header p {
2498- text-align: center;
2499+div.contents h2 {
2500+ font-size: 100%;
2501 }
2502-div.contents, div.body, div.footer {
2503- page-break-before: always;
2504+div.contents ul.contents {
2505+ font-size: 80%;
2506 }
2507-.class, .enumeration, .function, .struct, .typedef, .union {
2508+.class {
2509 border-bottom: solid 2px gray;
2510 }
2511+.constants {
2512+}
2513 .description {
2514 margin-top: 0.5em;
2515 }
2516+.discussion {
2517+}
2518+.enumeration {
2519+ border-bottom: solid 2px gray;
2520+}
2521 .function {
2522+ border-bottom: solid 2px gray;
2523 margin-bottom: 0;
2524 }
2525+.members {
2526+}
2527+.method {
2528+}
2529+.parameters {
2530+}
2531+.returnvalue {
2532+}
2533+.struct {
2534+ border-bottom: solid 2px gray;
2535+}
2536+.typedef {
2537+ border-bottom: solid 2px gray;
2538+}
2539+.union {
2540+ border-bottom: solid 2px gray;
2541+}
2542+.variable {
2543+}
2544+h1, h2, h3, h4, h5, h6 {
2545+ page-break-inside: avoid;
2546+}
2547 blockquote {
2548 border: solid thin gray;
2549 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
2550@@ -68,15 +97,19 @@ blockquote {
2551 page-break-inside: avoid;
2552 }
2553 p code, li code, p.code, pre, ul.code li {
2554+ background: rgba(127,127,127,0.1);
2555+ border: thin dotted gray;
2556 font-family: monospace;
2557+ font-size: 90%;
2558 hyphens: manual;
2559 -webkit-hyphens: manual;
2560+ page-break-inside: avoid;
2561 }
2562 p.code, pre, ul.code li {
2563- background: rgba(127,127,127,0.1);
2564- border: thin dotted gray;
2565 padding: 10px;
2566- page-break-inside: avoid;
2567+}
2568+p code, li code {
2569+ padding: 2px 5px;
2570 }
2571 a:link, a:visited {
2572 text-decoration: none;
2573@@ -90,7 +123,7 @@ span.info {
2574 font-weight: bold;
2575 white-space: nowrap;
2576 }
2577-h1 span.info, h2 span.info, h3 span.info, h4 span.info {
2578+h3 span.info, h4 span.info {
2579 border-top-left-radius: 10px;
2580 border-top-right-radius: 10px;
2581 float: right;
2582@@ -110,38 +143,13 @@ ul.contents > li {
2583 ul.contents li ul.code, ul.contents li ul.subcontents {
2584 padding-left: 2em;
2585 }
2586-table {
2587- border-collapse: collapse;
2588- border-spacing: 0;
2589-}
2590-td {
2591- border: solid 1px #666;
2592- padding: 5px 10px;
2593- vertical-align: top;
2594-}
2595-td.left {
2596- text-align: left;
2597-}
2598-td.center {
2599- text-align: center;
2600-}
2601-td.right {
2602- text-align: right;
2603-}
2604-th {
2605- border-bottom: solid 2px #000;
2606- padding: 1px 5px;
2607- text-align: center;
2608- vertical-align: bottom;
2609-}
2610-tr:nth-child(even) {
2611- background: rgba(127,127,127,0.1);n}
2612 table.list {
2613 border-collapse: collapse;
2614 width: 100%;
2615 }
2616+table.list tr:nth-child(even) {
2617+ background: rgba(127,127,127,0.1);]n}
2618 table.list th {
2619- border-bottom: none;
2620 border-right: 2px solid gray;
2621 font-family: monospace;
2622 padding: 5px 10px 5px 2px;
2623@@ -149,22 +157,24 @@ table.list th {
2624 vertical-align: top;
2625 }
2626 table.list td {
2627- border: none;
2628 padding: 5px 2px 5px 10px;
2629 text-align: left;
2630 vertical-align: top;
2631 }
2632-h2.title, h3.title {
2633+h1.title {
2634+}
2635+h2.title {
2636+ border-bottom: solid 2px black;
2637+}
2638+h3.title {
2639 border-bottom: solid 2px black;
2640 }
2641 --></style>
2642 </head>
2643 <body>
2644- <div class="header">
2645- <h1 class="title">CUPS Programming Manual</h1>
2646- <p>Michael R Sweet</p>
2647- <p>Copyright © 2007-2019 by Apple Inc. All Rights Reserved.</p>
2648- </div>
2649+ <h1 class="title">CUPS Programming Manual</h1>
2650+ <p>Michael R Sweet</p>
2651+ <p>Copyright © 2007-2019 by Apple Inc. All Rights Reserved.</p>
2652 <div class="contents">
2653 <h2 class="title">Contents</h2>
2654 <ul class="contents">
2655@@ -506,20 +516,16 @@ h2.title, h3.title {
2656 <blockquote>
2657 <p>Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide feedback on this document.</p>
2658 </blockquote>
2659- <h2 class="title" id="introduction">Introduction</h2>
2660+ <h2><a id="introduction">Introduction</a></h2>
2661 <p>CUPS provides the "cups" library to talk to the different parts of CUPS and with Internet Printing Protocol (IPP) printers. The "cups" library functions are accessed by including the <code><cups/cups.h></code> header.</p>
2662 <p>CUPS is based on the Internet Printing Protocol ("IPP"), which allows clients (applications) to communicate with a server (the scheduler, printers, etc.) to get a list of destinations, send print jobs, and so forth. You identify which server you want to communicate with using a pointer to the opaque structure <code>http_t</code>. The <code>CUPS_HTTP_DEFAULT</code> constant can be used when you want to talk to the CUPS scheduler.</p>
2663- <h3 class="title" id="guidelines">Guidelines</h3>
2664+ <h3><a id="guidelines">Guidelines</a></h3>
2665 <p>When writing software (other than printer drivers) that uses the "cups" library:</p>
2666 <ul>
2667- <li> <p>Do not use undocumented or deprecated APIs,</p>
2668-</li>
2669- <li> <p>Do not rely on pre-configured printers,</p>
2670-</li>
2671- <li> <p>Do not assume that printers support specific features or formats, and</p>
2672-</li>
2673- <li> <p>Do not rely on implementation details (PPDs, etc.)</p>
2674-</li>
2675+ <li>Do not use undocumented or deprecated APIs,</li>
2676+ <li>Do not rely on pre-configured printers,</li>
2677+ <li>Do not assume that printers support specific features or formats, and</li>
2678+ <li>Do not rely on implementation details (PPDs, etc.)</li>
2679 </ul>
2680 <p>CUPS is designed to insulate users and developers from the implementation details of printers and file formats. The goal is to allow an application to supply a print file in a standard format with the user intent ("print four copies, two-sided on A4 media, and staple each copy") and have the printing system manage the printer communication and format conversion needed.</p>
2681 <p>Similarly, printer and job management applications can use standard query operations to obtain the status information in a common, generic form and use standard management operations to control the state of those printers and jobs.</p>
2682@@ -527,9 +533,9 @@ h2.title, h3.title {
2683 <p><strong>Note:</strong></p>
2684 <p>CUPS printer drivers necessarily depend on specific file formats and certain implementation details of the CUPS software. Please consult the Postscript and raster printer driver developer documentation on <a href="https://www.cups.org/documentation.html">CUPS.org</a> for more information.</p>
2685 </blockquote>
2686- <h3 class="title" id="terms-used-in-this-document">Terms Used in This Document</h3>
2687- <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print Job</em> is a collection of one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p>
2688- <h3 class="title" id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</h3>
2689+ <h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3>
2690+ <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print</em> <em>Job</em> is a collection of one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p>
2691+ <h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3>
2692 <p>The CUPS libraries can be used from any C, C++, or Objective C program. The method of compiling against the libraries varies depending on the operating system and installation of CUPS. The following sections show how to compile a simple program (shown below) in two common environments.</p>
2693 <p>The following simple program lists the available destinations:</p>
2694 <pre><code>#include <stdio.h>
2695@@ -552,20 +558,20 @@ int main(void)
2696 return (0);
2697 }
2698 </code></pre>
2699- <h4 id="compiling-with-xcode">Compiling with Xcode</h4>
2700- <p>In Xcode, choose <em>New Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command Line Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example "firstcups". Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p>
2701- <p>In the project window, click on the <em>Build Phases</em> group and expand the <em>Link Binary with Libraries</em> section. Click <em>+</em>, type "libcups" to show the library, and then double-click on <code>libcups.tbd</code>.</p>
2702+ <h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4>
2703+ <p>In Xcode, choose <em>New</em> <em>Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command</em> <em>Line</em> <em>Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example "firstcups". Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p>
2704+ <p>In the project window, click on the <em>Build</em> <em>Phases</em> group and expand the <em>Link</em> <em>Binary</em> <em>with</em> <em>Libraries</em> section. Click <em>+</em>, type "libcups" to show the library, and then double-click on <code>libcups.tbd</code>.</p>
2705 <p>Finally, click on the <code>main.c</code> file in the sidebar and copy the example program to the file. Build and run (CMD+R) to see the list of destinations.</p>
2706- <h4 id="compiling-with-gcc">Compiling with GCC</h4>
2707- <p>From the command-line, create a file called <code>sample.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p>
2708+ <h4><a id="compiling-with-gcc">Compiling with GCC</a></h4>
2709+ <p>From the command-line, create a file called <code>simple.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p>
2710 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
2711 ./simple
2712 </code></pre>
2713 <p>The <code>cups-config</code> command provides the compiler flags (<code>cups-config --cflags</code>) and libraries (<code>cups-config --libs</code>) needed for the local system.</p>
2714- <h2 class="title" id="working-with-destinations">Working with Destinations</h2>
2715+ <h2><a id="working-with-destinations">Working with Destinations</a></h2>
2716 <p>Destinations, which in CUPS represent individual printers or classes (collections or pools) of printers, are represented by the <code>cups_dest_t</code> structure which includes the name (<code>name</code>), instance (<code>instance</code>, saved options/settings), whether the destination is the default for the user (<code>is_default</code>), and the options and basic information associated with that destination (<code>num_options</code> and <code>options</code>).</p>
2717 <p>Historically destinations have been manually maintained by the administrator of a system or network, but CUPS also supports dynamic discovery of destinations on the current network.</p>
2718- <h3 class="title" id="finding-available-destinations">Finding Available Destinations</h3>
2719+ <h3><a id="finding-available-destinations">Finding Available Destinations</a></h3>
2720 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
2721 <pre><code> int
2722 cupsEnumDests(unsigned flags, int msec, int *cancel,
2723@@ -577,42 +583,24 @@ int main(void)
2724 <p>The <code>cancel</code> argument points to an integer variable that, when set to a non-zero value, will cause enumeration to stop as soon as possible. It can be <code>NULL</code> if not needed.</p>
2725 <p>The <code>type</code> and <code>mask</code> arguments are bitfields that allow the caller to filter the destinations based on categories and/or capabilities. The destination's "printer-type" value is masked by the <code>mask</code> value and compared to the <code>type</code> value when filtering. For example, to only enumerate destinations that are hosted on the local system, pass <code>CUPS_PRINTER_LOCAL</code> for the <code>type</code> argument and <code>CUPS_PRINTER_DISCOVERED</code> for the <code>mask</code> argument. The following constants can be used for filtering:</p>
2726 <ul>
2727- <li> <p><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</p>
2728-</li>
2729- <li> <p><code>CUPS_PRINTER_FAX</code>: A facsimile device.</p>
2730-</li>
2731- <li> <p><code>CUPS_PRINTER_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the <code>type</code> argument and is paired with the <code>CUPS_PRINTER_REMOTE</code> or <code>CUPS_PRINTER_DISCOVERED</code> constant passed in the <code>mask</code> argument.</p>
2732-</li>
2733- <li> <p><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</p>
2734-</li>
2735- <li> <p><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</p>
2736-</li>
2737- <li> <p><code>CUPS_PRINTER_BW</code>: Can do B&W printing.</p>
2738-</li>
2739- <li> <p><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</p>
2740-</li>
2741- <li> <p><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</p>
2742-</li>
2743- <li> <p><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</p>
2744-</li>
2745- <li> <p><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</p>
2746-</li>
2747- <li> <p><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</p>
2748-</li>
2749- <li> <p><code>CUPS_PRINTER_COVER</code>: Can cover output.</p>
2750-</li>
2751- <li> <p><code>CUPS_PRINTER_BIND</code>: Can bind output.</p>
2752-</li>
2753- <li> <p><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</p>
2754-</li>
2755- <li> <p><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</p>
2756-</li>
2757- <li> <p><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</p>
2758-</li>
2759- <li> <p><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</p>
2760-</li>
2761- <li> <p><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</p>
2762-</li>
2763+ <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li>
2764+ <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li>
2765+ <li><code>CUPS_PRINTER_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the <code>type</code> argument and is paired with the <code>CUPS_PRINTER_REMOTE</code> or <code>CUPS_PRINTER_DISCOVERED</code> constant passed in the <code>mask</code> argument.</li>
2766+ <li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li>
2767+ <li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li>
2768+ <li><code>CUPS_PRINTER_BW</code>: Can do B&W printing.</li>
2769+ <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li>
2770+ <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li>
2771+ <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li>
2772+ <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li>
2773+ <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li>
2774+ <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li>
2775+ <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li>
2776+ <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li>
2777+ <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li>
2778+ <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li>
2779+ <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li>
2780+ <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li>
2781 </ul>
2782 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
2783 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
2784@@ -621,12 +609,9 @@ int main(void)
2785 </code></pre>
2786 <p>The callback function receives a copy of the <code>user_data</code> argument along with a bitfield (<code>flags</code>) and the destination that was found. The <code>flags</code> argument can have any of the following constant (bit) values set:</p>
2787 <ul>
2788- <li> <p><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</p>
2789-</li>
2790- <li> <p><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</p>
2791-</li>
2792- <li> <p><code>CUPS_DEST_FLAGS_ERROR</code>: An error occurred. The reason for the error can be found by calling the <code>cupsLastError</code> and/or <code>cupsLastErrorString</code> functions.</p>
2793-</li>
2794+ <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li>
2795+ <li><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</li>
2796+ <li><code>CUPS_DEST_FLAGS_ERROR</code>: An error occurred. The reason for the error can be found by calling the <code>cupsLastError</code> and/or <code>cupsLastErrorString</code> functions.</li>
2797 </ul>
2798 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
2799 <blockquote>
2800@@ -700,45 +685,34 @@ my_get_dests(cups_ptype_t type, cups_ptype_t mask,
2801 return (user_data.num_dests);
2802 }
2803 </code></pre>
2804- <h3 class="title" id="basic-destination-information">Basic Destination Information</h3>
2805+ <h3><a id="basic-destination-information">Basic Destination Information</a></h3>
2806 <p>The <code>num_options</code> and <code>options</code> members of the <code>cups_dest_t</code> structure provide basic attributes about the destination in addition to the user default options and values for that destination. The following names are predefined for various destination attributes:</p>
2807 <ul>
2808- <li> <p>"auth-info-required": The type of authentication required for printing to this destination: "none", "username,password", "domain,username,password", or "negotiate" (Kerberos).</p>
2809-</li>
2810- <li> <p>"printer-info": The human-readable description of the destination such as "My Laser Printer".</p>
2811-</li>
2812- <li> <p>"printer-is-accepting-jobs": "true" if the destination is accepting new jobs, "false" otherwise.</p>
2813-</li>
2814- <li> <p>"printer-is-shared": "true" if the destination is being shared with other computers, "false" otherwise.</p>
2815-</li>
2816- <li> <p>"printer-location": The human-readable location of the destination such as "Lab 4".</p>
2817-</li>
2818- <li> <p>"printer-make-and-model": The human-readable make and model of the destination such as "ExampleCorp LaserPrinter 4000 Series".</p>
2819-</li>
2820- <li> <p>"printer-state": "3" if the destination is idle, "4" if the destination is printing a job, and "5" if the destination is stopped.</p>
2821-</li>
2822- <li> <p>"printer-state-change-time": The UNIX time when the destination entered the current state.</p>
2823-</li>
2824- <li> <p>"printer-state-reasons": Additional comma-delimited state keywords for the destination such as "media-tray-empty-error" and "toner-low-warning".</p>
2825-</li>
2826- <li> <p>"printer-type": The <code>cups_ptype_t</code> value associated with the destination.</p>
2827-</li>
2828- <li> <p>"printer-uri-supported": The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</p>
2829-</li>
2830+ <li>"auth-info-required": The type of authentication required for printing to this destination: "none", "username,password", "domain,username,password", or "negotiate" (Kerberos).</li>
2831+ <li>"printer-info": The human-readable description of the destination such as "My Laser Printer".</li>
2832+ <li>"printer-is-accepting-jobs": "true" if the destination is accepting new jobs, "false" otherwise.</li>
2833+ <li>"printer-is-shared": "true" if the destination is being shared with other computers, "false" otherwise.</li>
2834+ <li>"printer-location": The human-readable location of the destination such as "Lab 4".</li>
2835+ <li>"printer-make-and-model": The human-readable make and model of the destination such as "ExampleCorp LaserPrinter 4000 Series".</li>
2836+ <li>"printer-state": "3" if the destination is idle, "4" if the destination is printing a job, and "5" if the destination is stopped.</li>
2837+ <li>"printer-state-change-time": The UNIX time when the destination entered the current state.</li>
2838+ <li>"printer-state-reasons": Additional comma-delimited state keywords for the destination such as "media-tray-empty-error" and "toner-low-warning".</li>
2839+ <li>"printer-type": The <code>cups_ptype_t</code> value associated with the destination.</li>
2840+ <li>"printer-uri-supported": The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</li>
2841 </ul>
2842 <p>Use the <code>cupsGetOption</code> function to retrieve the value. For example, the following code gets the make and model of a destination:</p>
2843 <pre><code>const char *model = cupsGetOption("printer-make-and-model",
2844 dest->num_options,
2845 dest->options);
2846 </code></pre>
2847- <h3 class="title" id="detailed-destination-information">Detailed Destination Information</h3>
2848+ <h3><a id="detailed-destination-information">Detailed Destination Information</a></h3>
2849 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
2850 <pre><code>cups_dinfo_t *
2851 cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
2852 </code></pre>
2853 <p>The <code>http</code> argument specifies a connection to the CUPS scheduler and is typically the constant <code>CUPS_HTTP_DEFAULT</code>. The <code>dest</code> argument specifies the destination to query.</p>
2854 <p>The <code>cups_dinfo_t</code> structure that is returned contains a snapshot of the supported options and their supported, ready, and default values. It also can report constraints between different options and values, and recommend changes to resolve those constraints.</p>
2855- <h4 id="getting-supported-options-and-values">Getting Supported Options and Values</h4>
2856+ <h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4>
2857 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
2858 <pre><code>int
2859 cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
2860@@ -748,26 +722,16 @@ cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
2861 </code></pre>
2862 <p>The <code>option</code> argument specifies the name of the option to check. The following constants can be used to check the various standard options:</p>
2863 <ul>
2864- <li> <p><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</p>
2865-</li>
2866- <li> <p><code>CUPS_FINISHINGS</code>: A comma-delimited list of integer constants that control the finishing processes that are applied to the job, including stapling, punching, and folding.</p>
2867-</li>
2868- <li> <p><code>CUPS_MEDIA</code>: Controls the media size that is used, typically one of the following: <code>CUPS_MEDIA_3X5</code>, <code>CUPS_MEDIA_4X6</code>, <code>CUPS_MEDIA_5X7</code>, <code>CUPS_MEDIA_8X10</code>, <code>CUPS_MEDIA_A3</code>, <code>CUPS_MEDIA_A4</code>, <code>CUPS_MEDIA_A5</code>, <code>CUPS_MEDIA_A6</code>, <code>CUPS_MEDIA_ENV10</code>, <code>CUPS_MEDIA_ENVDL</code>, <code>CUPS_MEDIA_LEGAL</code>, <code>CUPS_MEDIA_LETTER</code>, <code>CUPS_MEDIA_PHOTO_L</code>, <code>CUPS_MEDIA_SUPERBA3</code>, or <code>CUPS_MEDIA_TABLOID</code>.</p>
2869-</li>
2870- <li> <p><code>CUPS_MEDIA_SOURCE</code>: Controls where the media is pulled from, typically either <code>CUPS_MEDIA_SOURCE_AUTO</code> or <code>CUPS_MEDIA_SOURCE_MANUAL</code>.</p>
2871-</li>
2872- <li> <p><code>CUPS_MEDIA_TYPE</code>: Controls the type of media that is used, typically one of the following: <code>CUPS_MEDIA_TYPE_AUTO</code>, <code>CUPS_MEDIA_TYPE_ENVELOPE</code>, <code>CUPS_MEDIA_TYPE_LABELS</code>, <code>CUPS_MEDIA_TYPE_LETTERHEAD</code>, <code>CUPS_MEDIA_TYPE_PHOTO</code>, <code>CUPS_MEDIA_TYPE_PHOTO_GLOSSY</code>, <code>CUPS_MEDIA_TYPE_PHOTO_MATTE</code>, <code>CUPS_MEDIA_TYPE_PLAIN</code>, or <code>CUPS_MEDIA_TYPE_TRANSPARENCY</code>.</p>
2873-</li>
2874- <li> <p><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</p>
2875-</li>
2876- <li> <p><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</p>
2877-</li>
2878- <li> <p><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</p>
2879-</li>
2880- <li> <p><code>CUPS_PRINT_QUALITY</code>: Controls the generate quality of the output: <code>CUPS_PRINT_QUALITY_DRAFT</code>, <code>CUPS_PRINT_QUALITY_NORMAL</code>, or <code>CUPS_PRINT_QUALITY_HIGH</code>.</p>
2881-</li>
2882- <li> <p><code>CUPS_SIDES</code>: Controls whether prints are placed on one or both sides of the media: <code>CUPS_SIDES_ONE_SIDED</code>, <code>CUPS_SIDES_TWO_SIDED_PORTRAIT</code>, or <code>CUPS_SIDES_TWO_SIDED_LANDSCAPE</code>.</p>
2883-</li>
2884+ <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li>
2885+ <li><code>CUPS_FINISHINGS</code>: A comma-delimited list of integer constants that control the finishing processes that are applied to the job, including stapling, punching, and folding.</li>
2886+ <li><code>CUPS_MEDIA</code>: Controls the media size that is used, typically one of the following: <code>CUPS_MEDIA_3X5</code>, <code>CUPS_MEDIA_4X6</code>, <code>CUPS_MEDIA_5X7</code>, <code>CUPS_MEDIA_8X10</code>, <code>CUPS_MEDIA_A3</code>, <code>CUPS_MEDIA_A4</code>, <code>CUPS_MEDIA_A5</code>, <code>CUPS_MEDIA_A6</code>, <code>CUPS_MEDIA_ENV10</code>, <code>CUPS_MEDIA_ENVDL</code>, <code>CUPS_MEDIA_LEGAL</code>, <code>CUPS_MEDIA_LETTER</code>, <code>CUPS_MEDIA_PHOTO_L</code>, <code>CUPS_MEDIA_SUPERBA3</code>, or <code>CUPS_MEDIA_TABLOID</code>.</li>
2887+ <li><code>CUPS_MEDIA_SOURCE</code>: Controls where the media is pulled from, typically either <code>CUPS_MEDIA_SOURCE_AUTO</code> or <code>CUPS_MEDIA_SOURCE_MANUAL</code>.</li>
2888+ <li><code>CUPS_MEDIA_TYPE</code>: Controls the type of media that is used, typically one of the following: <code>CUPS_MEDIA_TYPE_AUTO</code>, <code>CUPS_MEDIA_TYPE_ENVELOPE</code>, <code>CUPS_MEDIA_TYPE_LABELS</code>, <code>CUPS_MEDIA_TYPE_LETTERHEAD</code>, <code>CUPS_MEDIA_TYPE_PHOTO</code>, <code>CUPS_MEDIA_TYPE_PHOTO_GLOSSY</code>, <code>CUPS_MEDIA_TYPE_PHOTO_MATTE</code>, <code>CUPS_MEDIA_TYPE_PLAIN</code>, or <code>CUPS_MEDIA_TYPE_TRANSPARENCY</code>.</li>
2889+ <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li>
2890+ <li><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</li>
2891+ <li><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</li>
2892+ <li><code>CUPS_PRINT_QUALITY</code>: Controls the generate quality of the output: <code>CUPS_PRINT_QUALITY_DRAFT</code>, <code>CUPS_PRINT_QUALITY_NORMAL</code>, or <code>CUPS_PRINT_QUALITY_HIGH</code>.</li>
2893+ <li><code>CUPS_SIDES</code>: Controls whether prints are placed on one or both sides of the media: <code>CUPS_SIDES_ONE_SIDED</code>, <code>CUPS_SIDES_TWO_SIDED_PORTRAIT</code>, or <code>CUPS_SIDES_TWO_SIDED_LANDSCAPE</code>.</li>
2894 </ul>
2895 <p>If the <code>value</code> argument is <code>NULL</code>, the <code>cupsCheckDestSupported</code> function returns whether the option is supported by the destination. Otherwise, the function returns whether the specified value of the option is supported.</p>
2896 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
2897@@ -804,7 +768,7 @@ int i, count = ippGetCount(attrs);
2898 for (i = 0; i < count; i ++)
2899 puts(ippGetString(attrs, i, NULL));
2900 </code></pre>
2901- <h4 id="getting-default-values">Getting Default Values</h4>
2902+ <h4><a id="getting-default-values">Getting Default Values</a></h4>
2903 <p>There are two sets of default values - user defaults that are available via the <code>num_options</code> and <code>options</code> members of the <code>cups_dest_t</code> structure, and destination defaults that available via the <code>cups_dinfo_t</code> structure and the <code>cupsFindDestDefault</code> function which returns the IPP attribute containing the default value(s) for a given option:</p>
2904 <pre><code>ipp_attribute_t *
2905 cupsFindDestDefault(http_t *http, cups_dest_t *dest,
2906@@ -834,7 +798,7 @@ else
2907 putchar('\n');
2908 }
2909 </code></pre>
2910- <h4 id="getting-ready-loaded-values">Getting Ready (Loaded) Values</h4>
2911+ <h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4>
2912 <p>The finishings and media options also support queries for the ready, or loaded, values. For example, a printer may have punch and staple finishers installed but be out of staples - the supported values will list both punch and staple finishing processes but the ready values will only list the punch processes. Similarly, a printer may support hundreds of different sizes of media but only have a single size loaded at any given time - the ready values are limited to the media that is actually in the printer.</p>
2913 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
2914 <pre><code>ipp_attribute_t *
2915@@ -857,7 +821,7 @@ if (ready_finishings != NULL)
2916 else
2917 puts("no finishings are ready.");
2918 </code></pre>
2919- <h4 id="media-size-options">Media Size Options</h4>
2920+ <h4><a id="media-size-options">Media Size Options</a></h4>
2921 <p>CUPS provides functions for querying the dimensions and margins for each of the supported media size options. The <code>cups_size_t</code> structure is used to describe a media size:</p>
2922 <pre><code>typedef struct cups_size_s
2923 {
2924@@ -882,16 +846,11 @@ cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
2925 </code></pre>
2926 <p>The <code>media</code>, <code>width</code>, and <code>length</code> arguments specify the size to lookup. The <code>flags</code> argument specifies a bitfield controlling various lookup options:</p>
2927 <ul>
2928- <li> <p><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</p>
2929-</li>
2930- <li> <p><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</p>
2931-</li>
2932- <li> <p><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</p>
2933-</li>
2934- <li> <p><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</p>
2935-</li>
2936- <li> <p><code>CUPS_MEDIA_FLAGS_READY</code>: If the printer supports media sensing or configuration of the media in each tray/source, find the size amongst the "ready" media.</p>
2937-</li>
2938+ <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li>
2939+ <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li>
2940+ <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li>
2941+ <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li>
2942+ <li><code>CUPS_MEDIA_FLAGS_READY</code>: If the printer supports media sensing or configuration of the media in each tray/source, find the size amongst the "ready" media.</li>
2943 </ul>
2944 <p>If a matching size is found for the destination, the size information is stored in the structure pointed to by the <code>size</code> argument and 1 is returned. Otherwise 0 is returned.</p>
2945 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
2946@@ -949,7 +908,7 @@ cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
2947 cups_dinfo_t *dinfo, unsigned flags,
2948 cups_size_t *size);
2949 </code></pre>
2950- <h4 id="localizing-options-and-values">Localizing Options and Values</h4>
2951+ <h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4>
2952 <p>CUPS provides three functions to get localized, human-readable strings in the user's current locale for options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p>
2953 <pre><code>const char *
2954 cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
2955@@ -966,7 +925,7 @@ cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
2956 cups_dinfo_t *info,
2957 const char *option, const char *value);
2958 </code></pre>
2959- <h3 class="title" id="submitting-a-print-job">Submitting a Print Job</h3>
2960+ <h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3>
2961 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
2962 <pre><code>ipp_status_t
2963 cupsCreateDestJob(http_t *http, cups_dest_t *dest,
2964@@ -1017,14 +976,10 @@ cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
2965 </code></pre>
2966 <p>The <code>docname</code> argument specifies the name of the document, typically the original filename. The <code>format</code> argument specifies the MIME media type of the document, including the following constants:</p>
2967 <ul>
2968- <li> <p><code>CUPS_FORMAT_JPEG</code>: "image/jpeg"</p>
2969-</li>
2970- <li> <p><code>CUPS_FORMAT_PDF</code>: "application/pdf"</p>
2971-</li>
2972- <li> <p><code>CUPS_FORMAT_POSTSCRIPT</code>: "application/postscript"</p>
2973-</li>
2974- <li> <p><code>CUPS_FORMAT_TEXT</code>: "text/plain"</p>
2975-</li>
2976+ <li><code>CUPS_FORMAT_JPEG</code>: "image/jpeg"</li>
2977+ <li><code>CUPS_FORMAT_PDF</code>: "application/pdf"</li>
2978+ <li><code>CUPS_FORMAT_POSTSCRIPT</code>: "application/postscript"</li>
2979+ <li><code>CUPS_FORMAT_TEXT</code>: "text/plain"</li>
2980 </ul>
2981 <p>The <code>num_options</code> and <code>options</code> arguments specify per-document print options, which at present must be 0 and <code>NULL</code>. The <code>last_document</code> argument specifies whether this is the last document in the job.</p>
2982 <p>For example, the following code submits a PDF file to the job that was just created:</p>
2983@@ -1051,9 +1006,9 @@ if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
2984
2985 fclose(fp);
2986 </code></pre>
2987- <h2 class="title" id="sending-ipp-requests">Sending IPP Requests</h2>
2988+ <h2><a id="sending-ipp-requests">Sending IPP Requests</a></h2>
2989 <p>CUPS provides a rich API for sending IPP requests to the scheduler or printers, typically from management or utility applications whose primary purpose is not to send print jobs.</p>
2990- <h3 class="title" id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</h3>
2991+ <h3><a id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></h3>
2992 <p>The connection to the scheduler or printer is represented by the HTTP connection type <code>http_t</code>. The <code>cupsConnectDest</code> function connects to the scheduler or printer associated with the destination:</p>
2993 <pre><code>http_t *
2994 cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec,
2995@@ -1074,7 +1029,7 @@ http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
2996 30000, NULL, resource,
2997 sizeof(resource), NULL, NULL);
2998 </code></pre>
2999- <h3 class="title" id="creating-an-ipp-request">Creating an IPP Request</h3>
3000+ <h3><a id="creating-an-ipp-request">Creating an IPP Request</a></h3>
3001 <p>IPP requests are represented by the IPP message type <code>ipp_t</code> and each IPP attribute in the request is representing using the type <code>ipp_attribute_t</code>. Each IPP request includes an operation code (<code>IPP_OP_CREATE_JOB</code>, <code>IPP_OP_GET_PRINTER_ATTRIBUTES</code>, etc.) and a 32-bit integer identifier.</p>
3002 <p>The <code>ippNewRequest</code> function creates a new IPP request:</p>
3003 <pre><code>ipp_t *
3004@@ -1112,30 +1067,19 @@ ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
3005 <p>The <code>ippAddStrings</code> function adds an attribute with one or more strings, in this case three. The <code>IPP_TAG_KEYWORD</code> argument specifies that the strings are keyword values, which are used for attribute names. All strings use the same language (<code>NULL</code>), and the attribute will contain the three strings in the array <code>requested_attributes</code>.</p>
3006 <p>CUPS provides many functions to adding attributes of different types:</p>
3007 <ul>
3008- <li> <p><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</p>
3009-</li>
3010- <li> <p><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</p>
3011-</li>
3012- <li> <p><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</p>
3013-</li>
3014- <li> <p><code>ippAddOctetString</code> adds an octetString attribute with one value.</p>
3015-</li>
3016- <li> <p><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</p>
3017-</li>
3018- <li> <p><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</p>
3019-</li>
3020- <li> <p><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</p>
3021-</li>
3022- <li> <p><code>ippAddResolution</code> adds a resolution attribute with one resolution.</p>
3023-</li>
3024- <li> <p><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</p>
3025-</li>
3026- <li> <p><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</p>
3027-</li>
3028- <li> <p><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</p>
3029-</li>
3030+ <li><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</li>
3031+ <li><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</li>
3032+ <li><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</li>
3033+ <li><code>ippAddOctetString</code> adds an octetString attribute with one value.</li>
3034+ <li><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</li>
3035+ <li><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</li>
3036+ <li><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</li>
3037+ <li><code>ippAddResolution</code> adds a resolution attribute with one resolution.</li>
3038+ <li><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</li>
3039+ <li><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</li>
3040+ <li><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</li>
3041 </ul>
3042- <h3 class="title" id="sending-the-ipp-request">Sending the IPP Request</h3>
3043+ <h3><a id="sending-the-ipp-request">Sending the IPP Request</a></h3>
3044 <p>Once you have created the IPP request, you can send it using the <code>cupsDoRequest</code> function. For example, the following code sends the IPP Get-Printer-Attributes request to the destination and saves the response:</p>
3045 <pre><code>ipp_t *response = cupsDoRequest(http, request, resource);
3046 </code></pre>
3047@@ -1157,7 +1101,7 @@ ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
3048 printf("Request failed: %s\n", cupsLastErrorString());
3049 }
3050 </code></pre>
3051- <h3 class="title" id="processing-the-ipp-response">Processing the IPP Response</h3>
3052+ <h3><a id="processing-the-ipp-response">Processing the IPP Response</a></h3>
3053 <p>Each response to an IPP request is also an IPP message (<code>ipp_t</code>) with its own IPP attributes (<code>ipp_attribute_t</code>) that includes a status code (<code>IPP_STATUS_OK</code>, <code>IPP_STATUS_ERROR_BAD_REQUEST</code>, etc.) and the corresponding 32-bit integer identifier from the request.</p>
3054 <p>For example, the following code finds the printer state attributes and prints their values:</p>
3055 <pre><code>ipp_attribute_t *attr;
3056@@ -1194,7 +1138,7 @@ if ((attr = ippFindAttribute(response, "printer-state-reasons",
3057 <p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p>
3058 <pre><code>ippDelete(response);
3059 </code></pre>
3060- <h3 class="title" id="authentication">Authentication</h3>
3061+ <h3><a id="authentication">Authentication</a></h3>
3062 <p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p>
3063 <pre><code>void
3064 cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
3065@@ -6339,7 +6283,7 @@ are server-oriented...</p>
3066 <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
3067 <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
3068 <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
3069- <tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
3070+ <tr><th>IPP_FINISHINGS_FOLD_ACCORDION </th> <td class="description">Accordion-fold the paper vertically into four sections</td></tr>
3071 <tr><th>IPP_FINISHINGS_FOLD_DOUBLE_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr>
3072 <tr><th>IPP_FINISHINGS_FOLD_ENGINEERING_Z </th> <td class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</td></tr>
3073 <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
3074@@ -6361,10 +6305,10 @@ are server-oriented...</p>
3075 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
3076 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
3077 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
3078- <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
3079- <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
3080- <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
3081- <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
3082+ <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Punch multiple holes bottom edge</td></tr>
3083+ <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Punch multiple holes left side</td></tr>
3084+ <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Punch multiple holes right side</td></tr>
3085+ <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Punch multiple holes top edge</td></tr>
3086 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
3087 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
3088 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
3089diff --git a/doc/help/man-client.conf.html b/doc/help/man-client.conf.html
3090index 58b091fe0..032cd333d 100644
3091--- a/doc/help/man-client.conf.html
3092+++ b/doc/help/man-client.conf.html
3093@@ -19,28 +19,32 @@ See the NOTES section below for more information.
3094 <h3><a name="DIRECTIVES">Directives</a></h3>
3095 The following directives are understood by the client. Consult the online help for detailed descriptions:
3096 <dl class="man">
3097-<dt><b>AllowAnyRoot Yes</b>
3098+<dt><a name="AllowAnyRoot"></a><b>AllowAnyRoot Yes</b>
3099 <dd style="margin-left: 5.0em"><dt><b>AllowAnyRoot No</b>
3100 <dd style="margin-left: 5.0em">Specifies whether to allow TLS with certificates that have not been signed by a trusted Certificate Authority.
3101 The default is "Yes".
3102-<dt><b>AllowExpiredCerts Yes</b>
3103+<dt><a name="AllowExpiredCerts"></a><b>AllowExpiredCerts Yes</b>
3104 <dd style="margin-left: 5.0em"><dt><b>AllowExpiredCerts No</b>
3105 <dd style="margin-left: 5.0em">Specifies whether to allow TLS with expired certificates.
3106 The default is "No".
3107-<dt><b>Encryption IfRequested</b>
3108+<dt><a name="DigestOptions"></a><b>DigestOptions DenyMD5</b>
3109+<dd style="margin-left: 5.0em"><dt><b>DigestOptions None</b>
3110+<dd style="margin-left: 5.0em">Specifies HTTP Digest authentication options.
3111+<b>DenyMD5</b> disables support for the original MD5 hash algorithm.
3112+<dt><a name="Encryption"></a><b>Encryption IfRequested</b>
3113 <dd style="margin-left: 5.0em"><dt><b>Encryption Never</b>
3114 <dd style="margin-left: 5.0em"><dt><b>Encryption Required</b>
3115 <dd style="margin-left: 5.0em">Specifies the level of encryption that should be used.
3116-<dt><b>GSSServiceName </b><i>name</i>
3117+<dt><a name="GSSServiceName"></a><b>GSSServiceName </b><i>name</i>
3118 <dd style="margin-left: 5.0em">Specifies the Kerberos service name that is used for authentication, typically "host", "http", or "ipp".
3119 CUPS adds the remote hostname ("name@server.example.com") for you. The default name is "http".
3120-<dt><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]
3121+<dt><a name="ServerName"></a><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]
3122 <dd style="margin-left: 5.0em"><dt><b>ServerName </b><i>/domain/socket</i>
3123 <dd style="margin-left: 5.0em">Specifies the address and optionally the port to use when connecting to the server.
3124 <b>Note: This directive is not supported on macOS 10.7 or later.</b>
3125 <dt><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]<b>/version=1.1</b>
3126 <dd style="margin-left: 5.0em">Specifies the address and optionally the port to use when connecting to a server running CUPS 1.3.12 and earlier.
3127-<dt><b>SSLOptions </b>[<i>AllowDH</i>] [<i>AllowRC4</i>] [<i>AllowSSL3</i>] [<i>DenyCBC</i>] [<i>DenyTLS1.0</i>] [<i>MaxTLS1.0</i>] [<i>MaxTLS1.1</i>] [<i>MaxTLS1.2</i>] [<i>MaxTLS1.3</i>] [<i>MinTLS1.0</i>] [<i>MinTLS1.1</i>] [<i>MinTLS1.2</i>] [<i>MinTLS1.3</i>]
3128+<dt><a name="SSLOptions"></a><b>SSLOptions </b>[<i>AllowDH</i>] [<i>AllowRC4</i>] [<i>AllowSSL3</i>] [<i>DenyCBC</i>] [<i>DenyTLS1.0</i>] [<i>MaxTLS1.0</i>] [<i>MaxTLS1.1</i>] [<i>MaxTLS1.2</i>] [<i>MaxTLS1.3</i>] [<i>MinTLS1.0</i>] [<i>MinTLS1.1</i>] [<i>MinTLS1.2</i>] [<i>MinTLS1.3</i>]
3129 <dd style="margin-left: 5.0em"><dt><b>SSLOptions None</b>
3130 <dd style="margin-left: 5.0em">Sets encryption options (only in /etc/cups/client.conf).
3131 By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites.
3132@@ -54,11 +58,11 @@ The <i>DenyTLS1.0</i> option disables TLS v1.0 support - this sets the minimum p
3133 The <i>MinTLS</i> options set the minimum TLS version to support.
3134 The <i>MaxTLS</i> options set the maximum TLS version to support.
3135 Not all operating systems support TLS 1.3 at this time.
3136-<dt><b>TrustOnFirstUse Yes</b>
3137+<dt><a name="TrustOnFirstUse"></a><b>TrustOnFirstUse Yes</b>
3138 <dd style="margin-left: 5.0em"><dt><b>TrustOnFirstUse No</b>
3139 <dd style="margin-left: 5.0em">Specifies whether to trust new TLS certificates by default.
3140 The default is "Yes".
3141-<dt><b>User </b><i>name</i>
3142+<dt><a name="User"></a><b>User </b><i>name</i>
3143 <dd style="margin-left: 5.0em">Specifies the default user name to use for requests.
3144 <dt><a name="UserAgentTokens"></a><b>UserAgentTokens None</b>
3145 <dd style="margin-left: 5.0em"><dt><b>UserAgentTokens ProductOnly</b>
3146@@ -76,7 +80,7 @@ The default is "Yes".
3147 "OS" reports "CUPS/major.minor.path (osname osversion) IPP/2.1".
3148 "Full" reports "CUPS/major.minor.path (osname osversion; architecture) IPP/2.1".
3149 The default is "Minimal".
3150-<dt><b>ValidateCerts Yes</b>
3151+<dt><a name="ValidateCerts"></a><b>ValidateCerts Yes</b>
3152 <dd style="margin-left: 5.0em"><dt><b>ValidateCerts No</b>
3153 <dd style="margin-left: 5.0em">Specifies whether to only allow TLS with certificates whose common name matches the hostname.
3154 The default is "No".
3155diff --git a/doc/help/man-ippeveprinter.html b/doc/help/man-ippeveprinter.html
3156index d37d63559..bcd91ae48 100644
3157--- a/doc/help/man-ippeveprinter.html
3158+++ b/doc/help/man-ippeveprinter.html
3159@@ -16,10 +16,15 @@ ippeveprinter - an ipp everywhere printer application for cups
3160 ] [
3161 <b>--no-web-forms</b>
3162 ] [
3163+<b>--pam-service</b>
3164+<i>service</i>
3165+] [
3166 <b>--version</b>
3167 ] [
3168 <b>-2</b>
3169 ] [
3170+<b>-A</b>
3171+] [
3172 <b>-D</b>
3173 <i>device-uri</i>
3174 ] [
3175@@ -87,10 +92,17 @@ The following options are recognized by
3176 <dd style="margin-left: 5.0em">Show program usage.
3177 <dt><b>--no-web-forms</b>
3178 <dd style="margin-left: 5.0em">Disable the web interface forms used to update the media and supply levels.
3179+<dt><b>--pam-service </b><i>service</i>
3180+<dd style="margin-left: 5.0em">Set the PAM service name.
3181+The default service is "cups".
3182 <dt><b>--version</b>
3183 <dd style="margin-left: 5.0em">Show the CUPS version.
3184 <dt><b>-2</b>
3185 <dd style="margin-left: 5.0em">Report support for two-sided (duplex) printing.
3186+<dt><b>-A</b>
3187+<dd style="margin-left: 5.0em">Enable authentication for the created printer.
3188+<b>ippeveprinter</b>
3189+uses PAM to authenticate HTTP Basic credentials.
3190 <dt><b>-D </b><i>device-uri</i>
3191 <dd style="margin-left: 5.0em">Set the device URI for print output.
3192 The URI can be a filename, directory, or a network socket URI of the form "socket://ADDRESS[:PORT]" (where the default port number is 9100).
3193@@ -149,6 +161,8 @@ command.
3194 <dt><b>-p </b><i>port</i>
3195 <dd style="margin-left: 5.0em">Specifies the port number to listen on.
3196 The default is a user-specific number from 8000 to 8999.
3197+<dt><b>-r</b><b>off</b>
3198+<dd style="margin-left: 5.0em">Turns off DNS-SD service advertisements entirely.
3199 <dt><b>-r </b><i>subtype[,subtype]</i>
3200 <dd style="margin-left: 5.0em">Specifies the DNS-SD subtype(s) to advertise.
3201 Separate multiple subtypes with a comma.
3202diff --git a/doc/help/postscript-driver.html b/doc/help/postscript-driver.html
3203index 59832ebdc..f94fa72fd 100644
3204--- a/doc/help/postscript-driver.html
3205+++ b/doc/help/postscript-driver.html
3206@@ -5,7 +5,7 @@
3207 <title>Developing PostScript Printer Drivers</title>
3208 <meta name="keywords" content="Programming">
3209 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
3210- <meta name="creator" content="codedoc v3.2">
3211+ <meta name="creator" content="codedoc v3.1">
3212 <meta name="author" content="Unknown">
3213 <meta name="copyright" content="Unknown">
3214 <meta name="version" content="0.0">
3215@@ -450,7 +450,6 @@ h3.title {
3216 --></style>
3217 </head>
3218 <body>
3219- <div class="header">
3220 <!--
3221 PostScript printer driver documentation for CUPS.
3222
3223@@ -478,7 +477,6 @@ h3.title {
3224 </tr>
3225 </tbody>
3226 </table></div>
3227- </div>
3228 <div class="contents">
3229 <h2 class="title">Contents</h2>
3230 <ul class="contents">
3231diff --git a/doc/help/ppd-compiler.html b/doc/help/ppd-compiler.html
3232index f85ebc2d4..b33ca2d27 100644
3233--- a/doc/help/ppd-compiler.html
3234+++ b/doc/help/ppd-compiler.html
3235@@ -5,7 +5,7 @@
3236 <title>Introduction to the PPD Compiler</title>
3237 <meta name="keywords" content="Programming">
3238 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
3239- <meta name="creator" content="codedoc v3.2">
3240+ <meta name="creator" content="codedoc v3.1">
3241 <meta name="author" content="Unknown">
3242 <meta name="copyright" content="Unknown">
3243 <meta name="version" content="0.0">
3244@@ -450,7 +450,6 @@ h3.title {
3245 --></style>
3246 </head>
3247 <body>
3248- <div class="header">
3249 <!--
3250 PPD compiler documentation for CUPS.
3251
3252@@ -486,7 +485,6 @@ that describe the features and capabilities of one or more printers.</P>
3253 </tr>
3254 </tbody>
3255 </table></div>
3256- </div>
3257 <div class="contents">
3258 <h2 class="title">Contents</h2>
3259 <ul class="contents">
3260diff --git a/doc/help/raster-driver.html b/doc/help/raster-driver.html
3261index 9b7c84e3f..de573c616 100644
3262--- a/doc/help/raster-driver.html
3263+++ b/doc/help/raster-driver.html
3264@@ -5,7 +5,7 @@
3265 <title>Developing Raster Printer Drivers</title>
3266 <meta name="keywords" content="Programming">
3267 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
3268- <meta name="creator" content="codedoc v3.2">
3269+ <meta name="creator" content="codedoc v3.1">
3270 <meta name="author" content="Unknown">
3271 <meta name="copyright" content="Unknown">
3272 <meta name="version" content="0.0">
3273@@ -450,7 +450,6 @@ h3.title {
3274 --></style>
3275 </head>
3276 <body>
3277- <div class="header">
3278 <!--
3279 Raster printer driver documentation for CUPS.
3280
3281@@ -478,7 +477,6 @@ h3.title {
3282 </tr>
3283 </tbody>
3284 </table></div>
3285- </div>
3286 <div class="contents">
3287 <h2 class="title">Contents</h2>
3288 <ul class="contents">
3289diff --git a/doc/help/spec-ipp.html b/doc/help/spec-ipp.html
3290index 3574cd658..8f0ad313d 100644
3291--- a/doc/help/spec-ipp.html
3292+++ b/doc/help/spec-ipp.html
3293@@ -35,7 +35,11 @@
3294
3295 <li><a href="http://ftp.pwg.org/pub/pwg/candidates/cs-ipptrans10-20131108-5100.16.pdf">PWG 5100.16: IPP Transaction-Based Printing Extensions</a></li>
3296
3297- <li><a href="http://tools.ietf.org/html/rfc3998">RFC 3998: IPP Job and Printer Administrative Operations</a> (Disable-Printer, Enable-Printer, Hold-New-Jobs, and Release-Held-New-Jobs operations)</li>
3298+ <li><a href="http://tools.ietf.org/html/rfc3995">RFC 3995: IPP: Event Notifications and Subscriptions</a></li>
3299+
3300+ <li><a href="http://tools.ietf.org/html/rfc3996">RFC 3996: IPP: The 'ippget' Delivery Method for Event Notifications</li>
3301+
3302+ <li><a href="http://tools.ietf.org/html/rfc3998">RFC 3998: IPP: Job and Printer Administrative Operations</a> (Disable-Printer, Enable-Printer, Hold-New-Jobs, and Release-Held-New-Jobs operations)</li>
3303
3304 <li><a href="http://tools.ietf.org/html/rfc7472">RFC 7472: IPP over HTTPS Transport Binding and 'ipps' URI Scheme</a></li>
3305
3306@@ -1614,11 +1618,13 @@ CUPS-Get-PPDs Response:
3307
3308 <li>'domain': A domain name is required.</li>
3309
3310+ <li>'negotiate': Kerberos is required - this keyword can only appear by itself and causes cupsd to collect the UID of the printing user.</li>
3311+
3312 <li>'none': No authentication is required - this keyword can only appear by itself.</li>
3313
3314 <li>'password': A password is required.</li>
3315
3316- <li>'username': A username is required.</li>
3317+ <li>'username': A username is required. Some protocols (like SMB) prefix the username with the domain, for example "DOMAIN\user".</li>
3318
3319 </ul>
3320
3321diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html
3322index e0ed28603..ee383fbe0 100644
3323--- a/doc/help/spec-ppd.html
3324+++ b/doc/help/spec-ppd.html
3325@@ -5,7 +5,7 @@
3326 <title>CUPS PPD Extensions</title>
3327 <meta name="keywords" content="Specifications">
3328 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
3329- <meta name="creator" content="codedoc v3.2">
3330+ <meta name="creator" content="codedoc v3.1">
3331 <meta name="author" content="Unknown">
3332 <meta name="copyright" content="Unknown">
3333 <meta name="version" content="0.0">
3334@@ -450,7 +450,6 @@ h3.title {
3335 --></style>
3336 </head>
3337 <body>
3338- <div class="header">
3339 <!--
3340 PPD extension documentation for CUPS.
3341
3342@@ -478,7 +477,6 @@ h3.title {
3343 </tr>
3344 </tbody>
3345 </table></div>
3346- </div>
3347 <div class="contents">
3348 <h2 class="title">Contents</h2>
3349 <ul class="contents">
3350@@ -498,7 +496,7 @@ h3.title {
3351 <li><a href="#cupsUIResolver">cupsUIResolver</a></li>
3352 </ul></li>
3353 <li><a href="#I18N">Globalized PPD Support</a></li>
3354- <li><a href="#OPTIONS">Custom Options</a></li>
3355+ <li><a href="#OPTIONS"><span class="info">CUPS 1.3/macOS 10.6</span>Custom Options</a></li>
3356 <li><a href="#RASTERPS">Writing PostScript Option Commands for Raster Drivers</a></li>
3357 <li><a href="#MEDIA">Media Keywords</a><ul class="subcontents">
3358 <li><a href="#cupsMediaQualifier2">cupsMediaQualifier2</a></li>
3359diff --git a/filter/rastertolabel.c b/filter/rastertolabel.c
3360index 35d678db7..73ac4d76e 100644
3361--- a/filter/rastertolabel.c
3362+++ b/filter/rastertolabel.c
3363@@ -23,12 +23,12 @@
3364
3365
3366 /*
3367- * This driver filter currently supports Dymo, Intellitech, and Zebra
3368+ * This driver filter currently supports DYMO, Intellitech, and Zebra
3369 * label printers.
3370 *
3371- * The Dymo portion of the driver has been tested with the 300, 330,
3372- * and 330 Turbo label printers; it may also work with other models.
3373- * The Dymo printers support printing at 136, 203, and 300 DPI.
3374+ * The DYMO portion of the driver has been tested with the 300, 330,
3375+ * 330 Turbo, and 450 Twin Turbo label printers; it may also work with other
3376+ * models. The DYMO printers support printing at 136, 203, and 300 DPI.
3377 *
3378 * The Intellitech portion of the driver has been tested with the
3379 * Intellibar 408, 412, and 808 and supports their PCL variant.
3380@@ -43,7 +43,7 @@
3381 * Model number constants...
3382 */
3383
3384-#define DYMO_3x0 0 /* Dymo Labelwriter 300/330/330 Turbo */
3385+#define DYMO_3x0 0 /* DYMO Labelwriter 300/330/330 Turbo */
3386
3387 #define ZEBRA_EPL_LINE 0x10 /* Zebra EPL line mode printers */
3388 #define ZEBRA_EPL_PAGE 0x11 /* Zebra EPL page mode printers */
3389@@ -191,6 +191,7 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */
3390 printf("\033D%c", header->cupsBytesPerLine);
3391
3392 printf("\033%c", header->cupsCompression + 'c'); /* Darkness */
3393+ printf("\033q%d", header->MediaPosition + 1); /* Roll Select */
3394 break;
3395
3396 case ZEBRA_EPL_LINE :
3397diff --git a/man/client.conf.5 b/man/client.conf.5
3398index 8805561db..4dbf0c49b 100644
3399--- a/man/client.conf.5
3400+++ b/man/client.conf.5
3401@@ -7,7 +7,7 @@
3402 .\" Licensed under Apache License v2.0. See the file "LICENSE" for more
3403 .\" information.
3404 .\"
3405-.TH client.conf 5 "CUPS" "26 April 2019" "Apple Inc."
3406+.TH client.conf 5 "CUPS" "15 October 2019" "Apple Inc."
3407 .SH NAME
3408 client.conf \- client configuration file for cups (deprecated on macos)
3409 .SH DESCRIPTION
3410@@ -20,18 +20,28 @@ Starting with macOS 10.12, all applications can access these settings in the \fI
3411 See the NOTES section below for more information.
3412 .SS DIRECTIVES
3413 The following directives are understood by the client. Consult the online help for detailed descriptions:
3414+.\"#AllowAnyRoot
3415 .TP 5
3416 \fBAllowAnyRoot Yes\fR
3417 .TP 5
3418 \fBAllowAnyRoot No\fR
3419 Specifies whether to allow TLS with certificates that have not been signed by a trusted Certificate Authority.
3420 The default is "Yes".
3421+.\"#AllowExpiredCerts
3422 .TP 5
3423 \fBAllowExpiredCerts Yes\fR
3424 .TP 5
3425 \fBAllowExpiredCerts No\fR
3426 Specifies whether to allow TLS with expired certificates.
3427 The default is "No".
3428+.\"#DigestOptions
3429+.TP 5
3430+\fBDigestOptions DenyMD5\fR
3431+.TP 5
3432+\fBDigestOptions None\fR
3433+Specifies HTTP Digest authentication options.
3434+\fBDenyMD5\fR disables support for the original MD5 hash algorithm.
3435+.\"#Encryption
3436 .TP 5
3437 \fBEncryption IfRequested\fR
3438 .TP 5
3439@@ -39,10 +49,12 @@ The default is "No".
3440 .TP 5
3441 \fBEncryption Required\fR
3442 Specifies the level of encryption that should be used.
3443+.\"#GSSServiceName
3444 .TP 5
3445 \fBGSSServiceName \fIname\fR
3446 Specifies the Kerberos service name that is used for authentication, typically "host", "http", or "ipp".
3447 CUPS adds the remote hostname ("name@server.example.com") for you. The default name is "http".
3448+.\"#ServerName
3449 .TP 5
3450 \fBServerName \fIhostname-or-ip-address\fR[\fI:port\fR]
3451 .TP 5
3452@@ -52,6 +64,7 @@ Specifies the address and optionally the port to use when connecting to the serv
3453 .TP 5
3454 \fBServerName \fIhostname-or-ip-address\fR[\fI:port\fR]\fB/version=1.1\fR
3455 Specifies the address and optionally the port to use when connecting to a server running CUPS 1.3.12 and earlier.
3456+.\"#SSLOptions
3457 .TP 5
3458 \fBSSLOptions \fR[\fIAllowDH\fR] [\fIAllowRC4\fR] [\fIAllowSSL3\fR] [\fIDenyCBC\fR] [\fIDenyTLS1.0\fR] [\fIMaxTLS1.0\fR] [\fIMaxTLS1.1\fR] [\fIMaxTLS1.2\fR] [\fIMaxTLS1.3\fR] [\fIMinTLS1.0\fR] [\fIMinTLS1.1\fR] [\fIMinTLS1.2\fR] [\fIMinTLS1.3\fR]
3459 .TP 5
3460@@ -68,12 +81,14 @@ The \fIDenyTLS1.0\fR option disables TLS v1.0 support - this sets the minimum pr
3461 The \fIMinTLS\fR options set the minimum TLS version to support.
3462 The \fIMaxTLS\fR options set the maximum TLS version to support.
3463 Not all operating systems support TLS 1.3 at this time.
3464+.\"#TrustOnFirstUse
3465 .TP 5
3466 \fBTrustOnFirstUse Yes\fR
3467 .TP 5
3468 \fBTrustOnFirstUse No\fR
3469 Specifies whether to trust new TLS certificates by default.
3470 The default is "Yes".
3471+.\"#User
3472 .TP 5
3473 \fBUser \fIname\fR
3474 Specifies the default user name to use for requests.
3475@@ -101,6 +116,7 @@ Specifies what information is included in the User-Agent header of HTTP requests
3476 "OS" reports "CUPS/major.minor.path (osname osversion) IPP/2.1".
3477 "Full" reports "CUPS/major.minor.path (osname osversion; architecture) IPP/2.1".
3478 The default is "Minimal".
3479+.\"#ValidateCerts
3480 .TP 5
3481 \fBValidateCerts Yes\fR
3482 .TP 5
3483diff --git a/man/ippeveprinter.1 b/man/ippeveprinter.1
3484index 5753c69da..fa32efb2e 100644
3485--- a/man/ippeveprinter.1
3486+++ b/man/ippeveprinter.1
3487@@ -6,7 +6,7 @@
3488 .\" Licensed under Apache License v2.0. See the file "LICENSE" for more
3489 .\" information.
3490 .\"
3491-.TH ippeveprinter 1 "CUPS" "17 May 2019" "Apple Inc."
3492+.TH ippeveprinter 1 "CUPS" "2 December 2019" "Apple Inc."
3493 .SH NAME
3494 ippeveprinter \- an ipp everywhere printer application for cups
3495 .SH SYNOPSIS
3496@@ -16,10 +16,15 @@ ippeveprinter \- an ipp everywhere printer application for cups
3497 ] [
3498 .B \-\-no\-web\-forms
3499 ] [
3500+.B \-\-pam\-service
3501+.I service
3502+] [
3503 .B \-\-version
3504 ] [
3505 .B \-2
3506 ] [
3507+.B \-A
3508+] [
3509 .B \-D
3510 .I device-uri
3511 ] [
3512@@ -89,12 +94,21 @@ Show program usage.
3513 .B \-\-no\-web\-forms
3514 Disable the web interface forms used to update the media and supply levels.
3515 .TP 5
3516+\fB\-\-pam\-service \fIservice\fR
3517+Set the PAM service name.
3518+The default service is "cups".
3519+.TP 5
3520 .B \-\-version
3521 Show the CUPS version.
3522 .TP 5
3523 .B \-2
3524 Report support for two-sided (duplex) printing.
3525 .TP 5
3526+.B \-A
3527+Enable authentication for the created printer.
3528+.B ippeveprinter
3529+uses PAM to authenticate HTTP Basic credentials.
3530+.TP 5
3531 \fB\-D \fIdevice-uri\fR
3532 Set the device URI for print output.
3533 The URI can be a filename, directory, or a network socket URI of the form "socket://ADDRESS[:PORT]" (where the default port number is 9100).
3534@@ -168,6 +182,9 @@ command.
3535 Specifies the port number to listen on.
3536 The default is a user-specific number from 8000 to 8999.
3537 .TP 5
3538+.B \-r off
3539+Turns off DNS-SD service advertisements entirely.
3540+.TP 5
3541 \fB\-r \fIsubtype[,subtype]\fR
3542 Specifies the DNS-SD subtype(s) to advertise.
3543 Separate multiple subtypes with a comma.
3544diff --git a/ppdc/sample.drv b/ppdc/sample.drv
3545index 6ca0e82b5..148cf0f54 100644
3546--- a/ppdc/sample.drv
3547+++ b/ppdc/sample.drv
3548@@ -1,7 +1,7 @@
3549 //
3550 // Driver info file for CUPS-supplied PPDs.
3551 //
3552-// Copyright © 2007-2018 by Apple Inc.
3553+// Copyright © 2007-2019 by Apple Inc.
3554 // Copyright © 1993-2006 by Easy Software Products.
3555 //
3556 // Licensed under Apache License v2.0. See the file "LICENSE" for more
3557@@ -66,6 +66,7 @@
3558 #media "w144h396/2.00x5.50\"" 144 396
3559 #media "w162h36/2.25x0.50\"" 162 36
3560 #media "w162h90/2.25x1.25\"" 162 90
3561+#media "w162h225/30859 Paint Can Label" 162 225
3562 #media "w162h288/2.25x4.00\"" 162 288
3563 #media "w162h396/2.25x5.50\"" 162 396
3564 #media "w171h396/2.38x5.50\"" 171 396
3565@@ -114,7 +115,7 @@ Attribute "FileSystem" "" "False"
3566 Attribute "LandscapeOrientation" "" "Plus90"
3567 Attribute "TTRasterizer" "" "Type42"
3568
3569-Copyright "Copyright (c) 2007-2018 by Apple Inc."
3570+Copyright "Copyright (c) 2007-2019 by Apple Inc."
3571 Copyright "Copyright (c) 1997-2007 by Easy Software Products."
3572 Copyright ""
3573 Copyright "Licensed under Apache License v2.0. See the file \"LICENSE\" for more"
3574@@ -124,11 +125,11 @@ Font *
3575
3576 Version "2.3"
3577
3578-// Dymo Label Printer
3579+// DYMO Label Printer
3580 {
3581- Manufacturer "Dymo"
3582+ Manufacturer "DYMO"
3583 ModelName "Label Printer"
3584- Attribute NickName "" "Dymo Label Printer"
3585+ Attribute NickName "" "DYMO Label Printer"
3586 PCFileName "dymo.ppd"
3587 DriverType label
3588 ModelNumber $DYMO_3x0
3589@@ -142,7 +143,8 @@ Version "2.3"
3590 *MediaSize w81h252
3591 MediaSize w101h252
3592 MediaSize w54h144
3593- MediaSize w167h288
3594+ MediaSize w162h225
3595+ MediaSize w162h288
3596 MediaSize w162h540
3597 MediaSize w162h504
3598 MediaSize w41h248
3599@@ -153,6 +155,9 @@ Version "2.3"
3600 Resolution k 1 0 0 0 203dpi
3601 *Resolution k 1 0 0 0 300dpi
3602
3603+ *InputSlot 0 "Roll/Main Roll"
3604+ InputSlot 1 "Roll2/Second Roll (DUO/Twin Only)"
3605+
3606 Darkness 0 Light
3607 Darkness 1 Medium
3608 *Darkness 2 Normal
3609diff --git a/scheduler/auth.c b/scheduler/auth.c
3610index 5bb80edc9..4fbad6e24 100644
3611--- a/scheduler/auth.c
3612+++ b/scheduler/auth.c
3613@@ -757,7 +757,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
3614 * Decode the authorization string to get the input token...
3615 */
3616
3617- len = (int)strlen(authorization);
3618+ len = (int)strlen(authorization) + 0;
3619 input_token.value = malloc((size_t)len);
3620 input_token.value = httpDecode64_2(input_token.value, &len,
3621 authorization);
3622diff --git a/scheduler/classes.c b/scheduler/classes.c
3623index 776e79a91..14d2558bf 100644
3624--- a/scheduler/classes.c
3625+++ b/scheduler/classes.c
3626@@ -664,7 +664,7 @@ cupsdSaveAllClasses(void)
3627 cupsd_printer_t *pclass; /* Current printer class */
3628 int i; /* Looping var */
3629 time_t curtime; /* Current time */
3630- struct tm *curdate; /* Current date */
3631+ struct tm curdate; /* Current date */
3632 cups_option_t *option; /* Current option */
3633
3634
3635@@ -683,9 +683,9 @@ cupsdSaveAllClasses(void)
3636 * Write a small header to the file...
3637 */
3638
3639- curtime = time(NULL);
3640- curdate = localtime(&curtime);
3641- strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
3642+ time(&curtime);
3643+ localtime_r(&curtime, &curdate);
3644+ strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", &curdate);
3645
3646 cupsFilePuts(fp, "# Class configuration file for " CUPS_SVERSION "\n");
3647 cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp);
3648diff --git a/scheduler/client.c b/scheduler/client.c
3649index f693e7c49..c2ee8f12a 100644
3650--- a/scheduler/client.c
3651+++ b/scheduler/client.c
3652@@ -1099,7 +1099,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
3653 }
3654 }
3655 }
3656- else if (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/printers", 9) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5))
3657+ else if (!buf[0] && (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5) || !strncmp(con->uri, "/printers", 9)))
3658 {
3659 if (!WebInterface)
3660 {
3661@@ -1125,14 +1125,6 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
3662 cupsdSetStringf(&con->command, "%s/cgi-bin/admin.cgi", ServerBin);
3663 cupsdSetString(&con->options, strchr(con->uri + 6, '?'));
3664 }
3665- else if (!strncmp(con->uri, "/printers", 9))
3666- {
3667- cupsdSetStringf(&con->command, "%s/cgi-bin/printers.cgi", ServerBin);
3668- if (con->uri[9] && con->uri[10])
3669- cupsdSetString(&con->options, con->uri + 9);
3670- else
3671- cupsdSetString(&con->options, NULL);
3672- }
3673 else if (!strncmp(con->uri, "/classes", 8))
3674 {
3675 cupsdSetStringf(&con->command, "%s/cgi-bin/classes.cgi", ServerBin);
3676@@ -1149,6 +1141,14 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
3677 else
3678 cupsdSetString(&con->options, NULL);
3679 }
3680+ else if (!strncmp(con->uri, "/printers", 9))
3681+ {
3682+ cupsdSetStringf(&con->command, "%s/cgi-bin/printers.cgi", ServerBin);
3683+ if (con->uri[9] && con->uri[10])
3684+ cupsdSetString(&con->options, con->uri + 9);
3685+ else
3686+ cupsdSetString(&con->options, NULL);
3687+ }
3688 else
3689 {
3690 cupsdSetStringf(&con->command, "%s/cgi-bin/help.cgi", ServerBin);
3691@@ -1458,7 +1458,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
3692 break;
3693 }
3694
3695- if (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/printers", 9) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5))
3696+ if (!buf[0] && (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5) || !strncmp(con->uri, "/printers", 9)))
3697 {
3698 /*
3699 * CGI output...
3700@@ -2701,6 +2701,7 @@ get_file(cupsd_client_t *con, /* I - Client connection */
3701 * Figure out the real filename...
3702 */
3703
3704+ filename[0] = '\0';
3705 language[0] = '\0';
3706
3707 if (!strncmp(con->uri, "/help", 5) && (con->uri[5] == '/' || !con->uri[5]))
3708@@ -2718,6 +2719,7 @@ get_file(cupsd_client_t *con, /* I - Client connection */
3709
3710 if ((p = cupsdFindDest(dest)) == NULL)
3711 {
3712+ strlcpy(filename, "/", len);
3713 cupsdLogClient(con, CUPSD_LOG_INFO, "No destination \"%s\" found.", dest);
3714 return (NULL);
3715 }
3716@@ -2754,6 +2756,7 @@ get_file(cupsd_client_t *con, /* I - Client connection */
3717
3718 if ((p = cupsdFindDest(dest)) == NULL)
3719 {
3720+ strlcpy(filename, "/", len);
3721 cupsdLogClient(con, CUPSD_LOG_INFO, "No destination \"%s\" found.", dest);
3722 return (NULL);
3723 }
3724@@ -2786,6 +2789,14 @@ get_file(cupsd_client_t *con, /* I - Client connection */
3725
3726 perm_check = 0;
3727 }
3728+ else if (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/jobs", 5) || !strncmp(con->uri, "/printers", 9))
3729+ {
3730+ /*
3731+ * Admin/class/job/printer pages are served by CGI...
3732+ */
3733+
3734+ return (NULL);
3735+ }
3736 else if (!strncmp(con->uri, "/rss/", 5) && !strchr(con->uri + 5, '/'))
3737 snprintf(filename, len, "%s/rss/%s", CacheDir, con->uri + 5);
3738 else if (!strncmp(con->uri, "/strings/", 9) && !strcmp(con->uri + strlen(con->uri) - 8, ".strings"))
3739@@ -2795,12 +2806,14 @@ get_file(cupsd_client_t *con, /* I - Client connection */
3740
3741 if ((p = cupsdFindDest(dest)) == NULL)
3742 {
3743+ strlcpy(filename, "/", len);
3744 cupsdLogClient(con, CUPSD_LOG_INFO, "No destination \"%s\" found.", dest);
3745 return (NULL);
3746 }
3747
3748 if (!p->strings)
3749 {
3750+ strlcpy(filename, "/", len);
3751 cupsdLogClient(con, CUPSD_LOG_INFO, "No strings files for \"%s\".", dest);
3752 return (NULL);
3753 }
3754diff --git a/scheduler/ipp.c b/scheduler/ipp.c
3755index a38559751..2fe3bf25c 100644
3756--- a/scheduler/ipp.c
3757+++ b/scheduler/ipp.c
3758@@ -10429,7 +10429,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */
3759
3760 case IPP_JOB_PROCESSING :
3761 case IPP_JOB_STOPPED :
3762- if (job->state_value != attr->values[0].integer)
3763+ if (job->state_value != (ipp_jstate_t)attr->values[0].integer)
3764 {
3765 send_ipp_status(con, IPP_NOT_POSSIBLE,
3766 _("Job state cannot be changed."));
3767diff --git a/scheduler/job.c b/scheduler/job.c
3768index 2cfb1b03d..e20e7c563 100644
3769--- a/scheduler/job.c
3770+++ b/scheduler/job.c
3771@@ -2183,7 +2183,7 @@ cupsdSaveAllJobs(void)
3772 temp[1024]; /* Temporary string */
3773 cupsd_job_t *job; /* Current job */
3774 time_t curtime; /* Current time */
3775- struct tm *curdate; /* Current date */
3776+ struct tm curdate; /* Current date */
3777
3778
3779 snprintf(filename, sizeof(filename), "%s/job.cache", CacheDir);
3780@@ -2196,9 +2196,9 @@ cupsdSaveAllJobs(void)
3781 * Write a small header to the file...
3782 */
3783
3784- curtime = time(NULL);
3785- curdate = localtime(&curtime);
3786- strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
3787+ time(&curtime);
3788+ localtime_r(&curtime, &curdate);
3789+ strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", &curdate);
3790
3791 cupsFilePuts(fp, "# Job cache file for " CUPS_SVERSION "\n");
3792 cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp);
3793@@ -2311,7 +2311,7 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /* I - Job */
3794 int update)/* I - Update job-hold-until attr? */
3795 {
3796 time_t curtime; /* Current time */
3797- struct tm *curdate; /* Current date */
3798+ struct tm curdate; /* Current date */
3799 int hour; /* Hold hour */
3800 int minute; /* Hold minute */
3801 int second = 0; /* Hold second */
3802@@ -2380,15 +2380,15 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /* I - Job */
3803 * Hold to 6am the next morning unless local time is < 6pm.
3804 */
3805
3806- curtime = time(NULL);
3807- curdate = localtime(&curtime);
3808+ time(&curtime);
3809+ localtime_r(&curtime, &curdate);
3810
3811- if (curdate->tm_hour < 18)
3812+ if (curdate.tm_hour < 18)
3813 job->hold_until = curtime;
3814 else
3815 job->hold_until = curtime +
3816- ((29 - curdate->tm_hour) * 60 + 59 -
3817- curdate->tm_min) * 60 + 60 - curdate->tm_sec;
3818+ ((29 - curdate.tm_hour) * 60 + 59 -
3819+ curdate.tm_min) * 60 + 60 - curdate.tm_sec;
3820 }
3821 else if (!strcmp(when, "evening") || !strcmp(when, "night"))
3822 {
3823@@ -2396,15 +2396,15 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /* I - Job */
3824 * Hold to 6pm unless local time is > 6pm or < 6am.
3825 */
3826
3827- curtime = time(NULL);
3828- curdate = localtime(&curtime);
3829+ time(&curtime);
3830+ localtime_r(&curtime, &curdate);
3831
3832- if (curdate->tm_hour < 6 || curdate->tm_hour >= 18)
3833+ if (curdate.tm_hour < 6 || curdate.tm_hour >= 18)
3834 job->hold_until = curtime;
3835 else
3836 job->hold_until = curtime +
3837- ((17 - curdate->tm_hour) * 60 + 59 -
3838- curdate->tm_min) * 60 + 60 - curdate->tm_sec;
3839+ ((17 - curdate.tm_hour) * 60 + 59 -
3840+ curdate.tm_min) * 60 + 60 - curdate.tm_sec;
3841 }
3842 else if (!strcmp(when, "second-shift"))
3843 {
3844@@ -2412,15 +2412,15 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /* I - Job */
3845 * Hold to 4pm unless local time is > 4pm.
3846 */
3847
3848- curtime = time(NULL);
3849- curdate = localtime(&curtime);
3850+ time(&curtime);
3851+ localtime_r(&curtime, &curdate);
3852
3853- if (curdate->tm_hour >= 16)
3854+ if (curdate.tm_hour >= 16)
3855 job->hold_until = curtime;
3856 else
3857 job->hold_until = curtime +
3858- ((15 - curdate->tm_hour) * 60 + 59 -
3859- curdate->tm_min) * 60 + 60 - curdate->tm_sec;
3860+ ((15 - curdate.tm_hour) * 60 + 59 -
3861+ curdate.tm_min) * 60 + 60 - curdate.tm_sec;
3862 }
3863 else if (!strcmp(when, "third-shift"))
3864 {
3865@@ -2428,15 +2428,15 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /* I - Job */
3866 * Hold to 12am unless local time is < 8am.
3867 */
3868
3869- curtime = time(NULL);
3870- curdate = localtime(&curtime);
3871+ time(&curtime);
3872+ localtime_r(&curtime, &curdate);
3873
3874- if (curdate->tm_hour < 8)
3875+ if (curdate.tm_hour < 8)
3876 job->hold_until = curtime;
3877 else
3878 job->hold_until = curtime +
3879- ((23 - curdate->tm_hour) * 60 + 59 -
3880- curdate->tm_min) * 60 + 60 - curdate->tm_sec;
3881+ ((23 - curdate.tm_hour) * 60 + 59 -
3882+ curdate.tm_min) * 60 + 60 - curdate.tm_sec;
3883 }
3884 else if (!strcmp(when, "weekend"))
3885 {
3886@@ -2444,16 +2444,16 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /* I - Job */
3887 * Hold to weekend unless we are in the weekend.
3888 */
3889
3890- curtime = time(NULL);
3891- curdate = localtime(&curtime);
3892+ time(&curtime);
3893+ localtime_r(&curtime, &curdate);
3894
3895- if (curdate->tm_wday == 0 || curdate->tm_wday == 6)
3896+ if (curdate.tm_wday == 0 || curdate.tm_wday == 6)
3897 job->hold_until = curtime;
3898 else
3899 job->hold_until = curtime +
3900- (((5 - curdate->tm_wday) * 24 +
3901- (17 - curdate->tm_hour)) * 60 + 59 -
3902- curdate->tm_min) * 60 + 60 - curdate->tm_sec;
3903+ (((5 - curdate.tm_wday) * 24 +
3904+ (17 - curdate.tm_hour)) * 60 + 59 -
3905+ curdate.tm_min) * 60 + 60 - curdate.tm_sec;
3906 }
3907 else if (sscanf(when, "%d:%d:%d", &hour, &minute, &second) >= 2)
3908 {
3909@@ -2461,12 +2461,12 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /* I - Job */
3910 * Hold to specified GMT time (HH:MM or HH:MM:SS)...
3911 */
3912
3913- curtime = time(NULL);
3914- curdate = gmtime(&curtime);
3915+ time(&curtime);
3916+ gmtime_r(&curtime, &curdate);
3917
3918 job->hold_until = curtime +
3919- ((hour - curdate->tm_hour) * 60 + minute -
3920- curdate->tm_min) * 60 + second - curdate->tm_sec;
3921+ ((hour - curdate.tm_hour) * 60 + minute -
3922+ curdate.tm_min) * 60 + second - curdate.tm_sec;
3923
3924 /*
3925 * Hold until next day as needed...
3926@@ -2957,7 +2957,7 @@ dump_job_history(cupsd_job_t *job) /* I - Job */
3927 {
3928 int i, /* Looping var */
3929 oldsize; /* Current MaxLogSize */
3930- struct tm *date; /* Date/time value */
3931+ struct tm date; /* Date/time value */
3932 cupsd_joblog_t *message; /* Current message */
3933 char temp[2048], /* Log message */
3934 *ptr, /* Pointer into log message */
3935@@ -2985,12 +2985,12 @@ dump_job_history(cupsd_job_t *job) /* I - Job */
3936 */
3937
3938 message = (cupsd_joblog_t *)cupsArrayFirst(job->history);
3939- date = localtime(&(message->time));
3940- strftime(start, sizeof(start), "%X", date);
3941+ localtime_r(&(message->time), &date);
3942+ strftime(start, sizeof(start), "%X", &date);
3943
3944 message = (cupsd_joblog_t *)cupsArrayLast(job->history);
3945- date = localtime(&(message->time));
3946- strftime(end, sizeof(end), "%X", date);
3947+ localtime_r(&(message->time), &date);
3948+ strftime(end, sizeof(end), "%X", &date);
3949
3950 snprintf(temp, sizeof(temp),
3951 "[Job %d] The following messages were recorded from %s to %s",
3952diff --git a/scheduler/log.c b/scheduler/log.c
3953index cdb5437dc..2bd1952f7 100644
3954--- a/scheduler/log.c
3955+++ b/scheduler/log.c
3956@@ -301,7 +301,7 @@ cupsdGetDateTime(struct timeval *t, /* I - Time value or NULL for current */
3957 cupsd_time_t format) /* I - Format to use */
3958 {
3959 struct timeval curtime; /* Current time value */
3960- struct tm *date; /* Date/time value */
3961+ struct tm date; /* Date/time value */
3962 static struct timeval last_time = { 0, 0 };
3963 /* Last time we formatted */
3964 static char s[1024]; /* Date/time string */
3965@@ -351,23 +351,23 @@ cupsdGetDateTime(struct timeval *t, /* I - Time value or NULL for current */
3966 * (*BSD and Darwin store the timezone offset in the tm structure)
3967 */
3968
3969- date = localtime(&(t->tv_sec));
3970+ localtime_r(&(t->tv_sec), &date);
3971
3972 if (format == CUPSD_TIME_STANDARD)
3973 snprintf(s, sizeof(s), "[%02d/%s/%04d:%02d:%02d:%02d %+03ld%02ld]",
3974- date->tm_mday, months[date->tm_mon], 1900 + date->tm_year,
3975- date->tm_hour, date->tm_min, date->tm_sec,
3976+ date.tm_mday, months[date.tm_mon], 1900 + date.tm_year,
3977+ date.tm_hour, date.tm_min, date.tm_sec,
3978 #ifdef HAVE_TM_GMTOFF
3979- date->tm_gmtoff / 3600, (date->tm_gmtoff / 60) % 60);
3980+ date.tm_gmtoff / 3600, (date.tm_gmtoff / 60) % 60);
3981 #else
3982 timezone / 3600, (timezone / 60) % 60);
3983 #endif /* HAVE_TM_GMTOFF */
3984 else
3985 snprintf(s, sizeof(s), "[%02d/%s/%04d:%02d:%02d:%02d.%06d %+03ld%02ld]",
3986- date->tm_mday, months[date->tm_mon], 1900 + date->tm_year,
3987- date->tm_hour, date->tm_min, date->tm_sec, (int)t->tv_usec,
3988+ date.tm_mday, months[date.tm_mon], 1900 + date.tm_year,
3989+ date.tm_hour, date.tm_min, date.tm_sec, (int)t->tv_usec,
3990 #ifdef HAVE_TM_GMTOFF
3991- date->tm_gmtoff / 3600, (date->tm_gmtoff / 60) % 60);
3992+ date.tm_gmtoff / 3600, (date.tm_gmtoff / 60) % 60);
3993 #else
3994 timezone / 3600, (timezone / 60) % 60);
3995 #endif /* HAVE_TM_GMTOFF */
3996diff --git a/scheduler/main.c b/scheduler/main.c
3997index 842b00a42..d5fdf971a 100644
3998--- a/scheduler/main.c
3999+++ b/scheduler/main.c
4000@@ -757,7 +757,9 @@ main(int argc, /* I - Number of command-line args */
4001 #ifdef HAVE_ONDEMAND
4002 if (OnDemand)
4003 {
4004+# ifndef HAVE_SYSTEMD /* Issue #5640: systemd doesn't actually support launch-on-demand services, need to fake it */
4005 stop_scheduler = 1;
4006+# endif /* HAVE_SYSTEMD */
4007 break;
4008 }
4009 #endif /* HAVE_ONDEMAND */
4010diff --git a/scheduler/printers.c b/scheduler/printers.c
4011index 75ef4c0d2..80690397d 100644
4012--- a/scheduler/printers.c
4013+++ b/scheduler/printers.c
4014@@ -1478,7 +1478,7 @@ cupsdSaveAllPrinters(void)
4015 *name; /* Current user/group name */
4016 cupsd_printer_t *printer; /* Current printer class */
4017 time_t curtime; /* Current time */
4018- struct tm *curdate; /* Current date */
4019+ struct tm curdate; /* Current date */
4020 cups_option_t *option; /* Current option */
4021 ipp_attribute_t *marker; /* Current marker attribute */
4022
4023@@ -1498,9 +1498,9 @@ cupsdSaveAllPrinters(void)
4024 * Write a small header to the file...
4025 */
4026
4027- curtime = time(NULL);
4028- curdate = localtime(&curtime);
4029- strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
4030+ time(&curtime);
4031+ localtime_r(&curtime, &curdate);
4032+ strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", &curdate);
4033
4034 cupsFilePuts(fp, "# Printer configuration file for " CUPS_SVERSION "\n");
4035 cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp);
4036diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c
4037index 3267a2ff6..15acedca8 100644
4038--- a/scheduler/subscriptions.c
4039+++ b/scheduler/subscriptions.c
4040@@ -1025,7 +1025,7 @@ cupsdSaveAllSubscriptions(void)
4041 temp[1024]; /* Temporary string */
4042 cupsd_subscription_t *sub; /* Current subscription */
4043 time_t curtime; /* Current time */
4044- struct tm *curdate; /* Current date */
4045+ struct tm curdate; /* Current date */
4046 unsigned mask; /* Current event mask */
4047 const char *name; /* Current event name */
4048 int hex; /* Non-zero if we are writing hex data */
4049@@ -1046,9 +1046,9 @@ cupsdSaveAllSubscriptions(void)
4050 * Write a small header to the file...
4051 */
4052
4053- curtime = time(NULL);
4054- curdate = localtime(&curtime);
4055- strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
4056+ time(&curtime);
4057+ localtime_r(&curtime, &curdate);
4058+ strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", &curdate);
4059
4060 cupsFilePuts(fp, "# Subscription configuration file for " CUPS_SVERSION "\n");
4061 cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp);
4062diff --git a/systemv/lp.c b/systemv/lp.c
4063index ad22715b2..298c15825 100644
4064--- a/systemv/lp.c
4065+++ b/systemv/lp.c
4066@@ -1,7 +1,7 @@
4067 /*
4068 * "lp" command for CUPS.
4069 *
4070- * Copyright © 2007-2018 by Apple Inc.
4071+ * Copyright © 2007-2019 by Apple Inc.
4072 * Copyright © 1997-2007 by Easy Software Products.
4073 *
4074 * Licensed under Apache License v2.0. See the file "LICENSE" for more
4075@@ -749,6 +749,7 @@ usage(void)
4076 " lp [options] -i id"));
4077 _cupsLangPuts(stdout, _("Options:"));
4078 _cupsLangPuts(stdout, _("-c Make a copy of the print file(s)"));
4079+ _cupsLangPuts(stdout, _("-d destination Specify the destination"));
4080 _cupsLangPuts(stdout, _("-E Encrypt the connection to the server"));
4081 _cupsLangPuts(stdout, _("-h server[:port] Connect to the named server and port"));
4082 _cupsLangPuts(stdout, _("-H HH:MM Hold the job until the specified UTC time"));
4083diff --git a/templates/jobs.tmpl b/templates/jobs.tmpl
4084index 8d787572d..353767cba 100644
4085--- a/templates/jobs.tmpl
4086+++ b/templates/jobs.tmpl
4087@@ -20,7 +20,7 @@
4088 <FORM ACTION="/jobs/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="restart-job"><INPUT TYPE="HIDDEN" NAME="job_id" VALUE="{job_id}"><INPUT TYPE="HIDDEN" NAME="job_printer_uri" VALUE="{job_printer_uri}"><INPUT TYPE="SUBMIT" VALUE="Reprint Job"></FORM>:}:}
4089 {job_state=4?{job_hold_until=auth-info-required?Held for authentication.:
4090 <FORM ACTION="/jobs/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="release-job"><INPUT TYPE="HIDDEN" NAME="job_id" VALUE="{job_id}"><INPUT TYPE="HIDDEN" NAME="job_printer_uri" VALUE="{job_printer_uri}">
4091-<INPUT TYPE="SUBMIT" VALUE="Release Job"></FORM>:}}
4092+<INPUT TYPE="SUBMIT" VALUE="Release Job"></FORM>:}:}
4093 {job_state=3?
4094 <FORM ACTION="/jobs/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="org.cups.sid" VALUE="{$org.cups.sid}"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="hold-job"><INPUT TYPE="HIDDEN" NAME="job_id" VALUE="{job_id}"><INPUT TYPE="HIDDEN" NAME="job_printer_uri" VALUE="{job_printer_uri}">
4095 <INPUT TYPE="SUBMIT" VALUE="Hold Job"></FORM>:}
4096diff --git a/tools/Makefile b/tools/Makefile
4097index be9cba366..f1781ef0b 100644
4098--- a/tools/Makefile
4099+++ b/tools/Makefile
4100@@ -147,7 +147,7 @@ local: ippeveprinter-static ipptool-static
4101
4102 ippeveprinter: ippeveprinter.o ../cups/$(LIBCUPS)
4103 echo Linking $@...
4104- $(LD_CC) $(ALL_LDFLAGS) -o $@ ippeveprinter.o $(DNSSDLIBS) $(LINKCUPS)
4105+ $(LD_CC) $(ALL_LDFLAGS) -o $@ ippeveprinter.o $(DNSSDLIBS) $(PAMLIBS) $(LINKCUPS)
4106 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
4107
4108
4109@@ -157,7 +157,7 @@ ippeveprinter: ippeveprinter.o ../cups/$(LIBCUPS)
4110
4111 ippeveprinter-static: ippeveprinter.o ../cups/$(LIBCUPSSTATIC)
4112 echo Linking $@...
4113- $(LD_CC) $(ALL_LDFLAGS) -o $@ ippeveprinter.o $(LINKCUPSSTATIC)
4114+ $(LD_CC) $(ALL_LDFLAGS) -o $@ ippeveprinter.o $(PAMLIBS) $(LINKCUPSSTATIC)
4115 $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
4116
4117
4118diff --git a/tools/ippeveprinter.c b/tools/ippeveprinter.c
4119index 76c57961a..41954a570 100644
4120--- a/tools/ippeveprinter.c
4121+++ b/tools/ippeveprinter.c
4122@@ -51,6 +51,7 @@ extern char **environ;
4123 # include <avahi-common/error.h>
4124 # include <avahi-common/thread-watch.h>
4125 #endif /* HAVE_DNSSD */
4126+
4127 #ifdef HAVE_SYS_MOUNT_H
4128 # include <sys/mount.h>
4129 #endif /* HAVE_SYS_MOUNT_H */
4130@@ -64,6 +65,14 @@ extern char **environ;
4131 # include <sys/vfs.h>
4132 #endif /* HAVE_SYS_VFS_H */
4133
4134+#if HAVE_LIBPAM
4135+# ifdef HAVE_PAM_PAM_APPL_H
4136+# include <pam/pam_appl.h>
4137+# else
4138+# include <security/pam_appl.h>
4139+# endif /* HAVE_PAM_PAM_APPL_H */
4140+#endif /* HAVE_LIBPAM */
4141+
4142 #include "printer-png.h"
4143
4144
4145@@ -148,6 +157,14 @@ typedef void *ippeve_srv_t; /* Service reference */
4146 typedef void *ippeve_txt_t; /* TXT record */
4147 #endif /* HAVE_DNSSD */
4148
4149+#if HAVE_LIBPAM
4150+typedef struct ippeve_authdata_s /* Authentication data */
4151+{
4152+ char username[HTTP_MAX_VALUE], /* Username string */
4153+ *password; /* Password string */
4154+} ippeve_authdata_t;
4155+#endif /* HAVE_LIBPAM */
4156+
4157 typedef struct ippeve_filter_s /**** Attribute filter ****/
4158 {
4159 cups_array_t *ra; /* Requested attributes */
4160@@ -224,7 +241,9 @@ typedef struct ippeve_client_s /**** Client data ****/
4161 char uri[1024], /* Request URI */
4162 *options; /* URI options */
4163 http_addr_t addr; /* Client address */
4164- char hostname[256]; /* Client hostname */
4165+ char hostname[256], /* Client hostname */
4166+ username[HTTP_MAX_VALUE];
4167+ /* Authenticated username, if any */
4168 ippeve_printer_t *printer; /* Printer */
4169 ippeve_job_t *job; /* Current job, if any */
4170 } ippeve_client_t;
4171@@ -234,6 +253,7 @@ typedef struct ippeve_client_s /**** Client data ****/
4172 * Local functions...
4173 */
4174
4175+static http_status_t authenticate_request(ippeve_client_t *client);
4176 static void clean_jobs(ippeve_printer_t *printer);
4177 static int compare_jobs(ippeve_job_t *a, ippeve_job_t *b);
4178 static void copy_attributes(ipp_t *to, ipp_t *from, cups_array_t *ra, ipp_tag_t group_tag, int quickcopy);
4179@@ -281,6 +301,9 @@ static ipp_t *load_legacy_attributes(const char *make, const char *model, int p
4180 #if !CUPS_LITE
4181 static ipp_t *load_ppd_attributes(const char *ppdfile, cups_array_t *docformats);
4182 #endif /* !CUPS_LITE */
4183+#if HAVE_LIBPAM
4184+static int pam_func(int, const struct pam_message **, struct pam_response **, void *);
4185+#endif /* HAVE_LIBPAM */
4186 static int parse_options(ippeve_client_t *client, cups_option_t **options);
4187 static void process_attr_message(ippeve_job_t *job, char *message);
4188 static void *process_client(ippeve_client_t *client);
4189@@ -316,6 +339,8 @@ static AvahiClient *DNSSDClient = NULL;
4190 static int KeepFiles = 0, /* Keep spooled job files? */
4191 MaxVersion = 20,/* Maximum IPP version (20 = 2.0, 11 = 1.1, etc.) */
4192 Verbosity = 0; /* Verbosity level */
4193+static const char *PAMService = NULL;
4194+ /* PAM service */
4195
4196
4197 /*
4198@@ -371,6 +396,14 @@ main(int argc, /* I - Number of command-line args */
4199 {
4200 web_forms = 0;
4201 }
4202+ else if (!strcmp(argv[i], "--pam-service"))
4203+ {
4204+ i ++;
4205+ if (i >= argc)
4206+ usage(1);
4207+
4208+ PAMService = argv[i];
4209+ }
4210 else if (!strcmp(argv[i], "--version"))
4211 {
4212 puts(CUPS_SVERSION);
4213@@ -392,6 +425,11 @@ main(int argc, /* I - Number of command-line args */
4214 legacy = 1;
4215 break;
4216
4217+ case 'A' : /* -A (enable authentication) */
4218+ if (!PAMService)
4219+ PAMService = "cups";
4220+ break;
4221+
4222 case 'D' : /* -D device-uri */
4223 i ++;
4224 if (i >= argc)
4225@@ -631,10 +669,6 @@ main(int argc, /* I - Number of command-line args */
4226 _cupsLangPrintf(stderr, _("Using spool directory \"%s\"."), directory);
4227 }
4228
4229-#ifdef HAVE_SSL
4230- cupsSetServerCredentials(keypath, servername, 1);
4231-#endif /* HAVE_SSL */
4232-
4233 /*
4234 * Initialize DNS-SD...
4235 */
4236@@ -675,6 +709,10 @@ main(int argc, /* I - Number of command-line args */
4237 printer->ppdfile = strdup(ppdfile);
4238 #endif /* !CUPS_LITE */
4239
4240+#ifdef HAVE_SSL
4241+ cupsSetServerCredentials(keypath, printer->hostname, 1);
4242+#endif /* HAVE_SSL */
4243+
4244 /*
4245 * Run the print service...
4246 */
4247@@ -691,6 +729,105 @@ main(int argc, /* I - Number of command-line args */
4248 }
4249
4250
4251+/*
4252+ * 'authenticate_request()' - Try to authenticate the request.
4253+ */
4254+
4255+static http_status_t /* O - HTTP_STATUS_CONTINUE to keep going, otherwise status to return */
4256+authenticate_request(
4257+ ippeve_client_t *client) /* I - Client */
4258+{
4259+#if HAVE_LIBPAM
4260+ /*
4261+ * If PAM isn't enabled, return 'continue' now...
4262+ */
4263+
4264+ const char *authorization; /* Pointer into Authorization string */
4265+ int userlen; /* Username:password length */
4266+ pam_handle_t *pamh; /* PAM authentication handle */
4267+ int pamerr; /* PAM error code */
4268+ struct pam_conv pamdata; /* PAM conversation data */
4269+ ippeve_authdata_t data; /* Authentication data */
4270+
4271+
4272+ if (!PAMService)
4273+ return (HTTP_STATUS_CONTINUE);
4274+
4275+ /*
4276+ * Try authenticating using PAM...
4277+ */
4278+
4279+ authorization = httpGetField(client->http, HTTP_FIELD_AUTHORIZATION);
4280+
4281+ if (!*authorization)
4282+ return (HTTP_STATUS_UNAUTHORIZED);
4283+
4284+ if (strncmp(authorization, "Basic ", 6))
4285+ {
4286+ fputs("Unsupported scheme in Authorization header.\n", stderr);
4287+ return (HTTP_STATUS_BAD_REQUEST);
4288+ }
4289+
4290+ authorization += 5;
4291+ while (isspace(*authorization & 255))
4292+ authorization ++;
4293+
4294+ userlen = sizeof(data.username);
4295+ httpDecode64_2(data.username, &userlen, authorization);
4296+
4297+ if ((data.password = strchr(data.username, ':')) == NULL)
4298+ {
4299+ fputs("No password in Authorization header.\n", stderr);
4300+ return (HTTP_STATUS_BAD_REQUEST);
4301+ }
4302+
4303+ *(data.password)++ = '\0';
4304+
4305+ if (!data.username[0])
4306+ {
4307+ fputs("No username in Authorization header.\n", stderr);
4308+ return (HTTP_STATUS_BAD_REQUEST);
4309+ }
4310+
4311+ pamdata.conv = pam_func;
4312+ pamdata.appdata_ptr = &data;
4313+
4314+ if ((pamerr = pam_start(PAMService, data.username, &pamdata, &pamh)) != PAM_SUCCESS)
4315+ {
4316+ fprintf(stderr, "pam_start() returned %d (%s)\n", pamerr, pam_strerror(pamh, pamerr));
4317+ return (HTTP_STATUS_SERVER_ERROR);
4318+ }
4319+
4320+ if ((pamerr = pam_authenticate(pamh, PAM_SILENT)) != PAM_SUCCESS)
4321+ {
4322+ fprintf(stderr, "pam_authenticate() returned %d (%s)\n", pamerr, pam_strerror(pamh, pamerr));
4323+ pam_end(pamh, 0);
4324+ return (HTTP_STATUS_UNAUTHORIZED);
4325+ }
4326+
4327+ if ((pamerr = pam_acct_mgmt(pamh, PAM_SILENT)) != PAM_SUCCESS)
4328+ {
4329+ fprintf(stderr, "pam_acct_mgmt() returned %d (%s)\n", pamerr, pam_strerror(pamh, pamerr));
4330+ pam_end(pamh, 0);
4331+ return (HTTP_STATUS_SERVER_ERROR);
4332+ }
4333+
4334+ strlcpy(client->username, data.username, sizeof(client->username));
4335+
4336+ pam_end(pamh, PAM_SUCCESS);
4337+
4338+ return (HTTP_STATUS_CONTINUE);
4339+
4340+#else
4341+ /*
4342+ * No authentication support built-in, return 'continue'...
4343+ */
4344+
4345+ return (HTTP_STATUS_CONTINUE);
4346+#endif /* HAVE_LIBPAM */
4347+}
4348+
4349+
4350 /*
4351 * 'clean_jobs()' - Clean out old (completed) jobs.
4352 */
4353@@ -1427,6 +1564,11 @@ create_printer(
4354 "none",
4355 "none"
4356 };
4357+ static const char * const uri_authentication_basic[] =
4358+ { /* uri-authentication-supported values with authentication */
4359+ "basic",
4360+ "basic"
4361+ };
4362 static const char * const uri_security_supported[] =
4363 { /* uri-security-supported values */
4364 "none",
4365@@ -1763,9 +1905,15 @@ create_printer(
4366
4367 /* uri-authentication-supported */
4368 #ifdef HAVE_SSL
4369- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "uri-authentication-supported", 2, NULL, uri_authentication_supported);
4370+ if (PAMService)
4371+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "uri-authentication-supported", 2, NULL, uri_authentication_basic);
4372+ else
4373+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "uri-authentication-supported", 2, NULL, uri_authentication_supported);
4374 #else
4375- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "uri-authentication-supported", NULL, "none");
4376+ if (PAMService)
4377+ ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "uri-authentication-supported", NULL, "basic");
4378+ else
4379+ ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_CONST_TAG(IPP_TAG_KEYWORD), "uri-authentication-supported", NULL, "none");
4380 #endif /* HAVE_SSL */
4381
4382 /* uri-security-supported */
4383@@ -5226,6 +5374,78 @@ load_ppd_attributes(
4384 #endif /* !CUPS_LITE */
4385
4386
4387+#if HAVE_LIBPAM
4388+/*
4389+ * 'pam_func()' - PAM conversation function.
4390+ */
4391+
4392+static int /* O - Success or failure */
4393+pam_func(
4394+ int num_msg, /* I - Number of messages */
4395+ const struct pam_message **msg, /* I - Messages */
4396+ struct pam_response **resp, /* O - Responses */
4397+ void *appdata_ptr)
4398+ /* I - Pointer to connection */
4399+{
4400+ int i; /* Looping var */
4401+ struct pam_response *replies; /* Replies */
4402+ ippeve_authdata_t *data; /* Pointer to auth data */
4403+
4404+
4405+ /*
4406+ * Allocate memory for the responses...
4407+ */
4408+
4409+ if ((replies = malloc(sizeof(struct pam_response) * (size_t)num_msg)) == NULL)
4410+ return (PAM_CONV_ERR);
4411+
4412+ /*
4413+ * Answer all of the messages...
4414+ */
4415+
4416+ data = (ippeve_authdata_t *)appdata_ptr;
4417+
4418+ for (i = 0; i < num_msg; i ++)
4419+ {
4420+ switch (msg[i]->msg_style)
4421+ {
4422+ case PAM_PROMPT_ECHO_ON:
4423+ replies[i].resp_retcode = PAM_SUCCESS;
4424+ replies[i].resp = strdup(data->username);
4425+ break;
4426+
4427+ case PAM_PROMPT_ECHO_OFF:
4428+ replies[i].resp_retcode = PAM_SUCCESS;
4429+ replies[i].resp = strdup(data->password);
4430+ break;
4431+
4432+ case PAM_TEXT_INFO:
4433+ replies[i].resp_retcode = PAM_SUCCESS;
4434+ replies[i].resp = NULL;
4435+ break;
4436+
4437+ case PAM_ERROR_MSG:
4438+ replies[i].resp_retcode = PAM_SUCCESS;
4439+ replies[i].resp = NULL;
4440+ break;
4441+
4442+ default:
4443+ free(replies);
4444+ return (PAM_CONV_ERR);
4445+ }
4446+ }
4447+
4448+ /*
4449+ * Return the responses back to PAM...
4450+ */
4451+
4452+ *resp = replies;
4453+
4454+ return (PAM_SUCCESS);
4455+}
4456+#endif /* HAVE_LIBPAM */
4457+
4458+
4459 /*
4460 * 'parse_options()' - Parse URL options into CUPS options.
4461 *
4462@@ -5431,6 +5651,8 @@ process_http(ippeve_client_t *client) /* I - Client connection */
4463 * Clear state variables...
4464 */
4465
4466+ client->username[0] = '\0';
4467+
4468 ippDelete(client->request);
4469 ippDelete(client->response);
4470
4471@@ -5526,8 +5748,7 @@ process_http(ippeve_client_t *client) /* I - Client connection */
4472 * Handle HTTP Upgrade...
4473 */
4474
4475- if (!strcasecmp(httpGetField(client->http, HTTP_FIELD_CONNECTION),
4476- "Upgrade"))
4477+ if (!strcasecmp(httpGetField(client->http, HTTP_FIELD_CONNECTION), "Upgrade"))
4478 {
4479 #ifdef HAVE_SSL
4480 if (strstr(httpGetField(client->http, HTTP_FIELD_UPGRADE), "TLS/") != NULL && !httpIsEncrypted(client->http))
4481@@ -5552,34 +5773,6 @@ process_http(ippeve_client_t *client) /* I - Client connection */
4482 return (0);
4483 }
4484
4485- /*
4486- * Handle HTTP Expect...
4487- */
4488-
4489- if (httpGetExpect(client->http) &&
4490- (client->operation == HTTP_STATE_POST ||
4491- client->operation == HTTP_STATE_PUT))
4492- {
4493- if (httpGetExpect(client->http) == HTTP_STATUS_CONTINUE)
4494- {
4495- /*
4496- * Send 100-continue header...
4497- */
4498-
4499- if (!respond_http(client, HTTP_STATUS_CONTINUE, NULL, NULL, 0))
4500- return (0);
4501- }
4502- else
4503- {
4504- /*
4505- * Send 417-expectation-failed header...
4506- */
4507-
4508- if (!respond_http(client, HTTP_STATUS_EXPECTATION_FAILED, NULL, NULL, 0))
4509- return (0);
4510- }
4511- }
4512-
4513 /*
4514 * Handle new transfers...
4515 */
4516@@ -5646,32 +5839,44 @@ process_http(ippeve_client_t *client) /* I - Client connection */
4517 httpFlushWrite(client->http);
4518 }
4519 }
4520- else if (!strcmp(client->uri, "/"))
4521+ else
4522 {
4523 /*
4524- * Show web status page...
4525+ * Authenticate if needed...
4526 */
4527
4528- return (show_status(client));
4529- }
4530- else if (!strcmp(client->uri, "/media"))
4531- {
4532- /*
4533- * Show web media page...
4534- */
4535+ if ((http_status = authenticate_request(client)) != HTTP_STATUS_CONTINUE)
4536+ {
4537+ return (respond_http(client, http_status, NULL, NULL, 0));
4538+ }
4539
4540- return (show_media(client));
4541- }
4542- else if (!strcmp(client->uri, "/supplies"))
4543- {
4544- /*
4545- * Show web supplies page...
4546- */
4547+ if (!strcmp(client->uri, "/"))
4548+ {
4549+ /*
4550+ * Show web status page...
4551+ */
4552
4553- return (show_supplies(client));
4554+ return (show_status(client));
4555+ }
4556+ else if (!strcmp(client->uri, "/media"))
4557+ {
4558+ /*
4559+ * Show web media page...
4560+ */
4561+
4562+ return (show_media(client));
4563+ }
4564+ else if (!strcmp(client->uri, "/supplies"))
4565+ {
4566+ /*
4567+ * Show web supplies page...
4568+ */
4569+
4570+ return (show_supplies(client));
4571+ }
4572+ else
4573+ return (respond_http(client, HTTP_STATUS_NOT_FOUND, NULL, NULL, 0));
4574 }
4575- else
4576- return (respond_http(client, HTTP_STATUS_NOT_FOUND, NULL, NULL, 0));
4577 break;
4578
4579 case HTTP_STATE_POST :
4580@@ -5730,6 +5935,7 @@ process_ipp(ippeve_client_t *client) /* I - Client */
4581 ipp_attribute_t *uri; /* Printer URI attribute */
4582 int major, minor; /* Version number */
4583 const char *name; /* Name of attribute */
4584+ http_status_t status; /* Authentication status */
4585
4586
4587 debug_attributes("Request", client->request, 1);
4588@@ -5880,13 +6086,48 @@ process_ipp(ippeve_client_t *client) /* I - Client */
4589 strcmp(resource, "/ipp/print")))
4590 respond_ipp(client, IPP_STATUS_ERROR_NOT_FOUND, "%s %s not found.",
4591 name, ippGetString(uri, 0, NULL));
4592- else
4593+ else if (client->operation_id != IPP_OP_GET_PRINTER_ATTRIBUTES && (status = authenticate_request(client)) != HTTP_STATUS_CONTINUE)
4594+ {
4595+ httpFlush(client->http);
4596+
4597+ return (respond_http(client, status, NULL, NULL, 0));
4598+ }
4599+ else
4600 {
4601+ /*
4602+ * Handle HTTP Expect...
4603+ */
4604+
4605+ if (httpGetExpect(client->http))
4606+ {
4607+ if (httpGetExpect(client->http) == HTTP_STATUS_CONTINUE)
4608+ {
4609+ /*
4610+ * Send 100-continue header...
4611+ */
4612+
4613+ if (!respond_http(client, HTTP_STATUS_CONTINUE, NULL, NULL, 0))
4614+ return (0);
4615+ }
4616+ else
4617+ {
4618+ /*
4619+ * Send 417-expectation-failed header...
4620+ */
4621+
4622+ if (!respond_http(client, HTTP_STATUS_EXPECTATION_FAILED, NULL, NULL, 0))
4623+ return (0);
4624+
4625+ httpFlush(client->http);
4626+ return (1);
4627+ }
4628+ }
4629+
4630 /*
4631 * Try processing the operation...
4632 */
4633
4634- switch (ippGetOperation(client->request))
4635+ switch (client->operation_id)
4636 {
4637 case IPP_OP_PRINT_JOB :
4638 ipp_print_job(client);
4639@@ -6529,6 +6770,10 @@ register_printer(
4640 urf[252], /* List of supported URF values */
4641 *ptr; /* Pointer into string */
4642
4643+
4644+ if (!strcmp(subtypes, "off"))
4645+ return (1);
4646+
4647 color_supported = ippFindAttribute(printer->attrs, "color-supported", IPP_TAG_BOOLEAN);
4648 document_format_supported = ippFindAttribute(printer->attrs, "document-format-supported", IPP_TAG_MIMETYPE);
4649 printer_location = ippFindAttribute(printer->attrs, "printer-location", IPP_TAG_TEXT);
4650@@ -6574,6 +6819,7 @@ register_printer(
4651 #ifdef HAVE_DNSSD
4652 DNSServiceErrorType error; /* Error from Bonjour */
4653 char regtype[256]; /* Bonjour service type */
4654+ uint32_t interface; /* Interface index */
4655
4656
4657 /*
4658@@ -6606,9 +6852,11 @@ register_printer(
4659 * defend our service name but not actually support LPD...
4660 */
4661
4662+ interface = !strcmp(printer->hostname, "localhost") ? kDNSServiceInterfaceIndexLocalOnly : kDNSServiceInterfaceIndexAny;
4663+
4664 printer->printer_ref = DNSSDMaster;
4665
4666- if ((error = DNSServiceRegister(&(printer->printer_ref), kDNSServiceFlagsShareConnection, 0 /* interfaceIndex */, printer->dnssd_name, "_printer._tcp", NULL /* domain */, NULL /* host */, 0 /* port */, 0 /* txtLen */, NULL /* txtRecord */, (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4667+ if ((error = DNSServiceRegister(&(printer->printer_ref), kDNSServiceFlagsShareConnection, interface, printer->dnssd_name, "_printer._tcp", NULL /* domain */, NULL /* host */, 0 /* port */, 0 /* txtLen */, NULL /* txtRecord */, (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4668 {
4669 _cupsLangPrintf(stderr, _("Unable to register \"%s.%s\": %d"), printer->dnssd_name, "_printer._tcp", error);
4670 return (0);
4671@@ -6626,7 +6874,7 @@ register_printer(
4672 else
4673 strlcpy(regtype, "_ipp._tcp", sizeof(regtype));
4674
4675- if ((error = DNSServiceRegister(&(printer->ipp_ref), kDNSServiceFlagsShareConnection, 0 /* interfaceIndex */, printer->dnssd_name, regtype, NULL /* domain */, NULL /* host */, htons(printer->port), TXTRecordGetLength(&ipp_txt), TXTRecordGetBytesPtr(&ipp_txt), (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4676+ if ((error = DNSServiceRegister(&(printer->ipp_ref), kDNSServiceFlagsShareConnection, interface, printer->dnssd_name, regtype, NULL /* domain */, NULL /* host */, htons(printer->port), TXTRecordGetLength(&ipp_txt), TXTRecordGetBytesPtr(&ipp_txt), (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4677 {
4678 _cupsLangPrintf(stderr, _("Unable to register \"%s.%s\": %d"), printer->dnssd_name, regtype, error);
4679 return (0);
4680@@ -6645,7 +6893,7 @@ register_printer(
4681 else
4682 strlcpy(regtype, "_ipps._tcp", sizeof(regtype));
4683
4684- if ((error = DNSServiceRegister(&(printer->ipps_ref), kDNSServiceFlagsShareConnection, 0 /* interfaceIndex */, printer->dnssd_name, regtype, NULL /* domain */, NULL /* host */, htons(printer->port), TXTRecordGetLength(&ipp_txt), TXTRecordGetBytesPtr(&ipp_txt), (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4685+ if ((error = DNSServiceRegister(&(printer->ipps_ref), kDNSServiceFlagsShareConnection, interface, printer->dnssd_name, regtype, NULL /* domain */, NULL /* host */, htons(printer->port), TXTRecordGetLength(&ipp_txt), TXTRecordGetBytesPtr(&ipp_txt), (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4686 {
4687 _cupsLangPrintf(stderr, _("Unable to register \"%s.%s\": %d"), printer->dnssd_name, regtype, error);
4688 return (0);
4689@@ -6659,7 +6907,7 @@ register_printer(
4690
4691 printer->http_ref = DNSSDMaster;
4692
4693- if ((error = DNSServiceRegister(&(printer->http_ref), kDNSServiceFlagsShareConnection, 0 /* interfaceIndex */, printer->dnssd_name, "_http._tcp,_printer", NULL /* domain */, NULL /* host */, htons(printer->port), 0 /* txtLen */, NULL /* txtRecord */, (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4694+ if ((error = DNSServiceRegister(&(printer->http_ref), kDNSServiceFlagsShareConnection, interface, printer->dnssd_name, "_http._tcp,_printer", NULL /* domain */, NULL /* host */, htons(printer->port), 0 /* txtLen */, NULL /* txtRecord */, (DNSServiceRegisterReply)dnssd_callback, printer)) != kDNSServiceErr_NoError)
4695 {
4696 _cupsLangPrintf(stderr, _("Unable to register \"%s.%s\": %d"), printer->dnssd_name, "_http._tcp,_printer", error);
4697 return (0);
4698@@ -6824,6 +7072,14 @@ respond_http(
4699 client->operation == HTTP_STATE_OPTIONS)
4700 httpSetField(client->http, HTTP_FIELD_ALLOW, "GET, HEAD, OPTIONS, POST");
4701
4702+ if (code == HTTP_STATUS_UNAUTHORIZED)
4703+ {
4704+ char value[256]; /* WWW-Authenticate value */
4705+
4706+ snprintf(value, sizeof(value), "Basic realm=\"%s\"", PAMService);
4707+ httpSetField(client->http, HTTP_FIELD_WWW_AUTHENTICATE, value);
4708+ }
4709+
4710 if (type)
4711 {
4712 if (!strcmp(type, "text/html"))
4713@@ -7645,10 +7901,12 @@ time_string(time_t tv, /* I - Time value */
4714 char *buffer, /* I - Buffer */
4715 size_t bufsize) /* I - Size of buffer */
4716 {
4717- struct tm *curtime = localtime(&tv);
4718- /* Local time */
4719+ struct tm date; /* Local time and date */
4720+
4721+ localtime_r(&tv, &date);
4722+
4723+ strftime(buffer, bufsize, "%X", &date);
4724
4725- strftime(buffer, bufsize, "%X", curtime);
4726 return (buffer);
4727 }
4728
4729@@ -7662,10 +7920,12 @@ usage(int status) /* O - Exit status */
4730 {
4731 _cupsLangPuts(stdout, _("Usage: ippeveprinter [options] \"name\""));
4732 _cupsLangPuts(stdout, _("Options:"));
4733- _cupsLangPuts(stderr, _("--help Show program help"));
4734- _cupsLangPuts(stderr, _("--no-web-forms Disable web forms for media and supplies"));
4735- _cupsLangPuts(stderr, _("--version Show program version"));
4736+ _cupsLangPuts(stdout, _("--help Show program help"));
4737+ _cupsLangPuts(stdout, _("--no-web-forms Disable web forms for media and supplies"));
4738+ _cupsLangPuts(stdout, _("--pam-service service Use the named PAM service"));
4739+ _cupsLangPuts(stdout, _("--version Show program version"));
4740 _cupsLangPuts(stdout, _("-2 Set 2-sided printing support (default=1-sided)"));
4741+ _cupsLangPuts(stdout, _("-A Enable authentication"));
4742 _cupsLangPuts(stdout, _("-D device-uri Set the device URI for the printer"));
4743 _cupsLangPuts(stdout, _("-F output-type/subtype Set the output format for the printer"));
4744 #ifdef HAVE_SSL
4745@@ -7686,7 +7946,7 @@ usage(int status) /* O - Exit status */
4746 _cupsLangPuts(stdout, _("-p port Set port number for printer"));
4747 _cupsLangPuts(stdout, _("-r subtype,[subtype] Set DNS-SD service subtype"));
4748 _cupsLangPuts(stdout, _("-s speed[,color-speed] Set speed in pages per minute"));
4749- _cupsLangPuts(stderr, _("-v Be verbose"));
4750+ _cupsLangPuts(stdout, _("-v Be verbose"));
4751
4752 exit(status);
4753 }
4754diff --git a/tools/ipptool.c b/tools/ipptool.c
4755index e54b78ad3..a3a694d5f 100644
4756--- a/tools/ipptool.c
4757+++ b/tools/ipptool.c
4758@@ -2162,16 +2162,16 @@ static char * /* O - ISO 8601 date/time string */
4759 iso_date(const ipp_uchar_t *date) /* I - IPP (RFC 1903) date/time value */
4760 {
4761 time_t utctime; /* UTC time since 1970 */
4762- struct tm *utcdate; /* UTC date/time */
4763+ struct tm utcdate; /* UTC date/time */
4764 static char buffer[255]; /* String buffer */
4765
4766
4767 utctime = ippDateToTime(date);
4768- utcdate = gmtime(&utctime);
4769+ gmtime_r(&utctime, &utcdate);
4770
4771 snprintf(buffer, sizeof(buffer), "%04d-%02d-%02dT%02d:%02d:%02dZ",
4772- utcdate->tm_year + 1900, utcdate->tm_mon + 1, utcdate->tm_mday,
4773- utcdate->tm_hour, utcdate->tm_min, utcdate->tm_sec);
4774+ utcdate.tm_year + 1900, utcdate.tm_mon + 1, utcdate.tm_mday,
4775+ utcdate.tm_hour, utcdate.tm_min, utcdate.tm_sec);
4776
4777 return (buffer);
4778 }
4779diff --git a/vcnet/config.h b/vcnet/config.h
4780index ad6919071..4ad1dc8f1 100644
4781--- a/vcnet/config.h
4782+++ b/vcnet/config.h
4783@@ -46,6 +46,14 @@
4784 #define write _write
4785
4786
4787+/*
4788+ * Microsoft "safe" functions use a different argument order than POSIX...
4789+ */
4790+
4791+#define gmtime_r(t,tm) gmtime_s(tm,t)
4792+#define localtime_r(t,tm) localtime_s(tm,t)
4793+
4794+
4795 /*
4796 * Map the POSIX strcasecmp() and strncasecmp() functions to the Win32
4797 * _stricmp() and _strnicmp() functions...
4798@@ -89,8 +97,8 @@ typedef unsigned long useconds_t;
4799 * Version of software...
4800 */
4801
4802-#define CUPS_SVERSION "CUPS v2.3.0"
4803-#define CUPS_MINIMAL "CUPS/2.3.0"
4804+#define CUPS_SVERSION "CUPS v2.3.1"
4805+#define CUPS_MINIMAL "CUPS/2.3.1"
4806
4807
4808 /*
4809@@ -375,13 +383,6 @@ typedef unsigned long useconds_t;
4810 #define HAVE_SSL 1
4811
4812
4813-/*
4814- * Do we have the gnutls_fips140_set_mode function?
4815- */
4816-
4817-/* #undef HAVE_GNUTLS_FIPS140_SET_MODE */
4818-
4819-
4820 /*
4821 * Do we have the gnutls_transport_set_pull_timeout_function function?
4822 */
4823diff --git a/xcode/CUPS.xcodeproj/project.pbxproj b/xcode/CUPS.xcodeproj/project.pbxproj
4824index 595220ad2..21b1212d9 100644
4825--- a/xcode/CUPS.xcodeproj/project.pbxproj
4826+++ b/xcode/CUPS.xcodeproj/project.pbxproj
4827@@ -49,6 +49,7 @@
4828 271284C31CC11FA500E517C7 /* PBXTargetDependency */,
4829 271284C51CC11FA500E517C7 /* PBXTargetDependency */,
4830 271284C71CC11FA500E517C7 /* PBXTargetDependency */,
4831+ 274770E42345347D0089BC31 /* PBXTargetDependency */,
4832 271284C91CC11FA500E517C7 /* PBXTargetDependency */,
4833 726AD704135E8AA1002C930D /* PBXTargetDependency */,
4834 2767FC5419267469000F61D3 /* PBXTargetDependency */,
4835@@ -333,6 +334,12 @@
4836 273B1ECA226B420C00428143 /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72220EAE1333047D00FCA411 /* libcups.dylib */; };
4837 273B1ECD226B421E00428143 /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72220EAE1333047D00FCA411 /* libcups.dylib */; };
4838 273BF6C71333B5370022CAAB /* testcups.c in Sources */ = {isa = PBXBuildFile; fileRef = 273BF6C61333B5370022CAAB /* testcups.c */; };
4839+ 274770D72345342B0089BC31 /* libcups_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 72A4332F155844CF002E172D /* libcups_static.a */; };
4840+ 274770D82345342B0089BC31 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E5136B64AF00836530 /* CoreFoundation.framework */; };
4841+ 274770D92345342B0089BC31 /* Kerberos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E6136B64B000836530 /* Kerberos.framework */; };
4842+ 274770DA2345342B0089BC31 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E7136B64B000836530 /* Security.framework */; };
4843+ 274770DB2345342B0089BC31 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E8136B64B000836530 /* SystemConfiguration.framework */; };
4844+ 274770E2234534660089BC31 /* testthreads.c in Sources */ = {isa = PBXBuildFile; fileRef = 274770E1234534660089BC31 /* testthreads.c */; };
4845 274FF5D913332CC700317ECB /* cups-driverd.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 274FF5D613332CC700317ECB /* cups-driverd.cxx */; };
4846 274FF5DA13332CC700317ECB /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = 274FF5D713332CC700317ECB /* util.c */; };
4847 274FF5DD13332D0600317ECB /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72220EAE1333047D00FCA411 /* libcups.dylib */; };
4848@@ -465,6 +472,7 @@
4849 278C58EA136B64B000836530 /* Kerberos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E6136B64B000836530 /* Kerberos.framework */; };
4850 278C58EB136B64B000836530 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E7136B64B000836530 /* Security.framework */; };
4851 278C58EC136B64B000836530 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E8136B64B000836530 /* SystemConfiguration.framework */; };
4852+ 279AE6F52395B80F004DD600 /* libpam.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 279AE6F42395B80F004DD600 /* libpam.tbd */; };
4853 27A034821A8BDC3A00650675 /* lpadmin.c in Sources */ = {isa = PBXBuildFile; fileRef = 2732E08D137A3F5200FAFEF6 /* lpadmin.c */; };
4854 27A034851A8BDC5C00650675 /* libcups.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 72220EAE1333047D00FCA411 /* libcups.dylib */; };
4855 7200511218F492F200E7B81B /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 278C58E5136B64AF00836530 /* CoreFoundation.framework */; };
4856@@ -1661,6 +1669,20 @@
4857 remoteGlobalIDString = 273BF6BC1333B5000022CAAB;
4858 remoteInfo = testcups;
4859 };
4860+ 274770D32345342B0089BC31 /* PBXContainerItemProxy */ = {
4861+ isa = PBXContainerItemProxy;
4862+ containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
4863+ proxyType = 1;
4864+ remoteGlobalIDString = 274FF6891333B1C400317ECB;
4865+ remoteInfo = libcups_static;
4866+ };
4867+ 274770E32345347D0089BC31 /* PBXContainerItemProxy */ = {
4868+ isa = PBXContainerItemProxy;
4869+ containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
4870+ proxyType = 1;
4871+ remoteGlobalIDString = 274770D12345342B0089BC31;
4872+ remoteInfo = testthreads;
4873+ };
4874 274FF5DB13332CF900317ECB /* PBXContainerItemProxy */ = {
4875 isa = PBXContainerItemProxy;
4876 containerPortal = 72BF96371333042100B1EAD7 /* Project object */;
4877@@ -2676,6 +2698,15 @@
4878 );
4879 runOnlyForDeploymentPostprocessing = 1;
4880 };
4881+ 274770DC2345342B0089BC31 /* CopyFiles */ = {
4882+ isa = PBXCopyFilesBuildPhase;
4883+ buildActionMask = 2147483647;
4884+ dstPath = /usr/share/man/man1/;
4885+ dstSubfolderSpec = 0;
4886+ files = (
4887+ );
4888+ runOnlyForDeploymentPostprocessing = 1;
4889+ };
4890 274FF5CA13332B1F00317ECB /* CopyFiles */ = {
4891 isa = PBXCopyFilesBuildPhase;
4892 buildActionMask = 2147483647;
4893@@ -3210,6 +3241,8 @@
4894 274561471F545B2E000378E4 /* cupspm.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = cupspm.md; path = ../cups/cupspm.md; sourceTree = "<group>"; };
4895 274561481F545B2E000378E4 /* api-admin.header */ = {isa = PBXFileReference; lastKnownFileType = text; name = "api-admin.header"; path = "../cups/api-admin.header"; sourceTree = "<group>"; };
4896 274561491F545B2E000378E4 /* api-admin.shtml */ = {isa = PBXFileReference; lastKnownFileType = text.html.other; name = "api-admin.shtml"; path = "../cups/api-admin.shtml"; sourceTree = "<group>"; };
4897+ 274770E02345342B0089BC31 /* testthreads */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testthreads; sourceTree = BUILT_PRODUCTS_DIR; };
4898+ 274770E1234534660089BC31 /* testthreads.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testthreads.c; path = ../cups/testthreads.c; sourceTree = "<group>"; };
4899 274FF5CC13332B1F00317ECB /* cups-driverd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "cups-driverd"; sourceTree = BUILT_PRODUCTS_DIR; };
4900 274FF5D613332CC700317ECB /* cups-driverd.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "cups-driverd.cxx"; path = "../scheduler/cups-driverd.cxx"; sourceTree = "<group>"; };
4901 274FF5D713332CC700317ECB /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = util.c; path = ../scheduler/util.c; sourceTree = "<group>"; };
4902@@ -3275,6 +3308,7 @@
4903 278C58E6136B64B000836530 /* Kerberos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kerberos.framework; path = /System/Library/Frameworks/Kerberos.framework; sourceTree = "<absolute>"; };
4904 278C58E7136B64B000836530 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
4905 278C58E8136B64B000836530 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = "<absolute>"; };
4906+ 279AE6F42395B80F004DD600 /* libpam.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libpam.tbd; path = usr/lib/libpam.tbd; sourceTree = SDKROOT; };
4907 27A0347B1A8BDB1300650675 /* lpadmin */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = lpadmin; sourceTree = BUILT_PRODUCTS_DIR; };
4908 27D3037D134148CB00F022B1 /* libcups2.def */ = {isa = PBXFileReference; lastKnownFileType = text; name = libcups2.def; path = ../cups/libcups2.def; sourceTree = "<group>"; };
4909 27F89DA21B3AC43B00E5A4B7 /* testraster.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testraster.c; path = ../cups/testraster.c; sourceTree = "<group>"; };
4910@@ -3972,6 +4006,18 @@
4911 );
4912 runOnlyForDeploymentPostprocessing = 0;
4913 };
4914+ 274770D62345342B0089BC31 /* Frameworks */ = {
4915+ isa = PBXFrameworksBuildPhase;
4916+ buildActionMask = 2147483647;
4917+ files = (
4918+ 274770D72345342B0089BC31 /* libcups_static.a in Frameworks */,
4919+ 274770D82345342B0089BC31 /* CoreFoundation.framework in Frameworks */,
4920+ 274770D92345342B0089BC31 /* Kerberos.framework in Frameworks */,
4921+ 274770DA2345342B0089BC31 /* Security.framework in Frameworks */,
4922+ 274770DB2345342B0089BC31 /* SystemConfiguration.framework in Frameworks */,
4923+ );
4924+ runOnlyForDeploymentPostprocessing = 0;
4925+ };
4926 274FF5C913332B1F00317ECB /* Frameworks */ = {
4927 isa = PBXFrameworksBuildPhase;
4928 buildActionMask = 2147483647;
4929@@ -4593,6 +4639,7 @@
4930 isa = PBXFrameworksBuildPhase;
4931 buildActionMask = 2147483647;
4932 files = (
4933+ 279AE6F52395B80F004DD600 /* libpam.tbd in Frameworks */,
4934 273B1ECA226B420C00428143 /* libcups.dylib in Frameworks */,
4935 2767FC6619267538000F61D3 /* CoreFoundation.framework in Frameworks */,
4936 2767FC6719267538000F61D3 /* libresolv.dylib in Frameworks */,
4937@@ -4699,6 +4746,7 @@
4938 727EF04F192E3602001EF690 /* testsub.c */,
4939 724FA65D1CC0389F0092477B /* testsupplies.c */,
4940 727EF03F192E3498001EF690 /* testtemplate.c */,
4941+ 274770E1234534660089BC31 /* testthreads.c */,
4942 271286681CC130BD00E517C7 /* tlscheck.c */,
4943 );
4944 name = tests;
4945@@ -4888,6 +4936,7 @@
4946 729181BE201155C1005E7560 /* testclient */,
4947 273B1EAA226B3E4800428143 /* ippevepcl */,
4948 273B1EBB226B3E5200428143 /* ippeveps */,
4949+ 274770E02345342B0089BC31 /* testthreads */,
4950 );
4951 name = Products;
4952 sourceTree = "<group>";
4953@@ -5084,6 +5133,7 @@
4954 72220FB113330B4A00FCA411 /* Frameworks */ = {
4955 isa = PBXGroup;
4956 children = (
4957+ 279AE6F42395B80F004DD600 /* libpam.tbd */,
4958 2767FC591926750C000F61D3 /* CoreFoundation.framework */,
4959 2767FC5A1926750C000F61D3 /* libiconv.dylib */,
4960 2767FC5B1926750C000F61D3 /* libresolv.dylib */,
4961@@ -6120,6 +6170,24 @@
4962 productReference = 273BF6BD1333B5000022CAAB /* testcups */;
4963 productType = "com.apple.product-type.tool";
4964 };
4965+ 274770D12345342B0089BC31 /* testthreads */ = {
4966+ isa = PBXNativeTarget;
4967+ buildConfigurationList = 274770DD2345342B0089BC31 /* Build configuration list for PBXNativeTarget "testthreads" */;
4968+ buildPhases = (
4969+ 274770D42345342B0089BC31 /* Sources */,
4970+ 274770D62345342B0089BC31 /* Frameworks */,
4971+ 274770DC2345342B0089BC31 /* CopyFiles */,
4972+ );
4973+ buildRules = (
4974+ );
4975+ dependencies = (
4976+ 274770D22345342B0089BC31 /* PBXTargetDependency */,
4977+ );
4978+ name = testthreads;
4979+ productName = testmime;
4980+ productReference = 274770E02345342B0089BC31 /* testthreads */;
4981+ productType = "com.apple.product-type.tool";
4982+ };
4983 274FF5CB13332B1F00317ECB /* cups-driverd */ = {
4984 isa = PBXNativeTarget;
4985 buildConfigurationList = 274FF5D213332B1F00317ECB /* Build configuration list for PBXNativeTarget "cups-driverd" */;
4986@@ -7230,7 +7298,7 @@
4987 72BF96371333042100B1EAD7 /* Project object */ = {
4988 isa = PBXProject;
4989 attributes = {
4990- LastUpgradeCheck = 1020;
4991+ LastUpgradeCheck = 1100;
4992 ORGANIZATIONNAME = "Apple Inc.";
4993 TargetAttributes = {
4994 270695FD1CADF3E200FFE5FB = {
4995@@ -7355,6 +7423,7 @@
4996 724FA6BF1CC0395A0092477B /* testtemplate */,
4997 271286571CC1309000E517C7 /* tlscheck */,
4998 7243795A1333FF1D009631B9 /* usb */,
4999+ 274770D12345342B0089BC31 /* testthreads */,
5000 );
5001 };
5002 /* End PBXProject section */
5003@@ -7702,6 +7771,14 @@
5004 );
5005 runOnlyForDeploymentPostprocessing = 0;
5006 };
5007+ 274770D42345342B0089BC31 /* Sources */ = {
5008+ isa = PBXSourcesBuildPhase;
5009+ buildActionMask = 2147483647;
5010+ files = (
5011+ 274770E2234534660089BC31 /* testthreads.c in Sources */,
5012+ );
5013+ runOnlyForDeploymentPostprocessing = 0;
5014+ };
5015 274FF5C813332B1F00317ECB /* Sources */ = {
5016 isa = PBXSourcesBuildPhase;
5017 buildActionMask = 2147483647;
5018@@ -8941,6 +9018,16 @@
5019 target = 273BF6BC1333B5000022CAAB /* testcups */;
5020 targetProxy = 273BF6DD1333B6370022CAAB /* PBXContainerItemProxy */;
5021 };
5022+ 274770D22345342B0089BC31 /* PBXTargetDependency */ = {
5023+ isa = PBXTargetDependency;
5024+ target = 274FF6891333B1C400317ECB /* libcups_static */;
5025+ targetProxy = 274770D32345342B0089BC31 /* PBXContainerItemProxy */;
5026+ };
5027+ 274770E42345347D0089BC31 /* PBXTargetDependency */ = {
5028+ isa = PBXTargetDependency;
5029+ target = 274770D12345342B0089BC31 /* testthreads */;
5030+ targetProxy = 274770E32345347D0089BC31 /* PBXContainerItemProxy */;
5031+ };
5032 274FF5DC13332CF900317ECB /* PBXTargetDependency */ = {
5033 isa = PBXTargetDependency;
5034 target = 72220EAD1333047D00FCA411 /* libcups */;
5035@@ -9473,6 +9560,7 @@
5036 isa = XCBuildConfiguration;
5037 buildSettings = {
5038 CLANG_ENABLE_OBJC_WEAK = YES;
5039+ CODE_SIGN_IDENTITY = "-";
5040 PRODUCT_NAME = "$(TARGET_NAME)";
5041 };
5042 name = Debug;
5043@@ -9481,6 +9569,7 @@
5044 isa = XCBuildConfiguration;
5045 buildSettings = {
5046 CLANG_ENABLE_OBJC_WEAK = YES;
5047+ CODE_SIGN_IDENTITY = "-";
5048 PRODUCT_NAME = "$(TARGET_NAME)";
5049 };
5050 name = Release;
5051@@ -9489,6 +9578,7 @@
5052 isa = XCBuildConfiguration;
5053 buildSettings = {
5054 CLANG_ENABLE_OBJC_WEAK = YES;
5055+ CODE_SIGN_IDENTITY = "-";
5056 PRODUCT_NAME = "$(TARGET_NAME)";
5057 };
5058 name = Debug;
5059@@ -9497,6 +9587,7 @@
5060 isa = XCBuildConfiguration;
5061 buildSettings = {
5062 CLANG_ENABLE_OBJC_WEAK = YES;
5063+ CODE_SIGN_IDENTITY = "-";
5064 PRODUCT_NAME = "$(TARGET_NAME)";
5065 };
5066 name = Release;
5067@@ -9505,6 +9596,7 @@
5068 isa = XCBuildConfiguration;
5069 buildSettings = {
5070 CLANG_ENABLE_OBJC_WEAK = YES;
5071+ CODE_SIGN_IDENTITY = "-";
5072 INSTALL_PATH = /usr/bin;
5073 PRODUCT_NAME = "$(TARGET_NAME)";
5074 };
5075@@ -9514,6 +9606,7 @@
5076 isa = XCBuildConfiguration;
5077 buildSettings = {
5078 CLANG_ENABLE_OBJC_WEAK = YES;
5079+ CODE_SIGN_IDENTITY = "-";
5080 INSTALL_PATH = /usr/bin;
5081 PRODUCT_NAME = "$(TARGET_NAME)";
5082 };
5083@@ -9523,6 +9616,7 @@
5084 isa = XCBuildConfiguration;
5085 buildSettings = {
5086 CLANG_ENABLE_OBJC_WEAK = YES;
5087+ CODE_SIGN_IDENTITY = "-";
5088 INSTALL_PATH = /usr/sbin;
5089 PRODUCT_NAME = "$(TARGET_NAME)";
5090 };
5091@@ -9532,6 +9626,7 @@
5092 isa = XCBuildConfiguration;
5093 buildSettings = {
5094 CLANG_ENABLE_OBJC_WEAK = YES;
5095+ CODE_SIGN_IDENTITY = "-";
5096 INSTALL_PATH = /usr/sbin;
5097 PRODUCT_NAME = "$(TARGET_NAME)";
5098 };
5099@@ -9541,6 +9636,7 @@
5100 isa = XCBuildConfiguration;
5101 buildSettings = {
5102 CLANG_ENABLE_OBJC_WEAK = YES;
5103+ CODE_SIGN_IDENTITY = "-";
5104 INSTALL_PATH = /usr/bin;
5105 PRODUCT_NAME = "$(TARGET_NAME)";
5106 };
5107@@ -9550,6 +9646,7 @@
5108 isa = XCBuildConfiguration;
5109 buildSettings = {
5110 CLANG_ENABLE_OBJC_WEAK = YES;
5111+ CODE_SIGN_IDENTITY = "-";
5112 INSTALL_PATH = /usr/bin;
5113 PRODUCT_NAME = "$(TARGET_NAME)";
5114 };
5115@@ -9559,6 +9656,7 @@
5116 isa = XCBuildConfiguration;
5117 buildSettings = {
5118 CLANG_ENABLE_OBJC_WEAK = YES;
5119+ CODE_SIGN_IDENTITY = "-";
5120 INSTALL_PATH = /usr/sbin;
5121 PRODUCT_NAME = "$(TARGET_NAME)";
5122 };
5123@@ -9568,6 +9666,7 @@
5124 isa = XCBuildConfiguration;
5125 buildSettings = {
5126 CLANG_ENABLE_OBJC_WEAK = YES;
5127+ CODE_SIGN_IDENTITY = "-";
5128 INSTALL_PATH = /usr/sbin;
5129 PRODUCT_NAME = "$(TARGET_NAME)";
5130 };
5131@@ -9577,6 +9676,7 @@
5132 isa = XCBuildConfiguration;
5133 buildSettings = {
5134 CLANG_ENABLE_OBJC_WEAK = YES;
5135+ CODE_SIGN_IDENTITY = "-";
5136 INSTALL_PATH = /usr/sbin;
5137 PRODUCT_NAME = "$(TARGET_NAME)";
5138 };
5139@@ -9586,6 +9686,7 @@
5140 isa = XCBuildConfiguration;
5141 buildSettings = {
5142 CLANG_ENABLE_OBJC_WEAK = YES;
5143+ CODE_SIGN_IDENTITY = "-";
5144 INSTALL_PATH = /usr/sbin;
5145 PRODUCT_NAME = "$(TARGET_NAME)";
5146 };
5147@@ -9595,6 +9696,7 @@
5148 isa = XCBuildConfiguration;
5149 buildSettings = {
5150 CLANG_ENABLE_OBJC_WEAK = YES;
5151+ CODE_SIGN_IDENTITY = "-";
5152 INSTALL_PATH = /usr/bin;
5153 PRODUCT_NAME = "$(TARGET_NAME)";
5154 };
5155@@ -9604,6 +9706,7 @@
5156 isa = XCBuildConfiguration;
5157 buildSettings = {
5158 CLANG_ENABLE_OBJC_WEAK = YES;
5159+ CODE_SIGN_IDENTITY = "-";
5160 INSTALL_PATH = /usr/bin;
5161 PRODUCT_NAME = "$(TARGET_NAME)";
5162 };
5163@@ -9613,6 +9716,7 @@
5164 isa = XCBuildConfiguration;
5165 buildSettings = {
5166 CLANG_ENABLE_OBJC_WEAK = YES;
5167+ CODE_SIGN_IDENTITY = "-";
5168 INSTALL_PATH = /usr/bin;
5169 PRODUCT_NAME = "$(TARGET_NAME)";
5170 };
5171@@ -9622,6 +9726,7 @@
5172 isa = XCBuildConfiguration;
5173 buildSettings = {
5174 CLANG_ENABLE_OBJC_WEAK = YES;
5175+ CODE_SIGN_IDENTITY = "-";
5176 INSTALL_PATH = /usr/bin;
5177 PRODUCT_NAME = "$(TARGET_NAME)";
5178 };
5179@@ -9631,6 +9736,7 @@
5180 isa = XCBuildConfiguration;
5181 buildSettings = {
5182 CLANG_ENABLE_OBJC_WEAK = YES;
5183+ CODE_SIGN_IDENTITY = "-";
5184 INSTALL_PATH = /usr/bin;
5185 PRODUCT_NAME = "$(TARGET_NAME)";
5186 };
5187@@ -9640,6 +9746,7 @@
5188 isa = XCBuildConfiguration;
5189 buildSettings = {
5190 CLANG_ENABLE_OBJC_WEAK = YES;
5191+ CODE_SIGN_IDENTITY = "-";
5192 INSTALL_PATH = /usr/bin;
5193 PRODUCT_NAME = "$(TARGET_NAME)";
5194 };
5195@@ -9649,6 +9756,7 @@
5196 isa = XCBuildConfiguration;
5197 buildSettings = {
5198 CLANG_ENABLE_OBJC_WEAK = YES;
5199+ CODE_SIGN_IDENTITY = "-";
5200 INSTALL_PATH = /usr/bin;
5201 PRODUCT_NAME = "$(TARGET_NAME)";
5202 };
5203@@ -9658,6 +9766,7 @@
5204 isa = XCBuildConfiguration;
5205 buildSettings = {
5206 CLANG_ENABLE_OBJC_WEAK = YES;
5207+ CODE_SIGN_IDENTITY = "-";
5208 INSTALL_PATH = /usr/bin;
5209 PRODUCT_NAME = "$(TARGET_NAME)";
5210 };
5211@@ -9667,6 +9776,7 @@
5212 isa = XCBuildConfiguration;
5213 buildSettings = {
5214 CLANG_ENABLE_OBJC_WEAK = YES;
5215+ CODE_SIGN_IDENTITY = "-";
5216 INSTALL_PATH = /usr/bin;
5217 PRODUCT_NAME = "$(TARGET_NAME)";
5218 };
5219@@ -9676,6 +9786,7 @@
5220 isa = XCBuildConfiguration;
5221 buildSettings = {
5222 CLANG_ENABLE_OBJC_WEAK = YES;
5223+ CODE_SIGN_IDENTITY = "-";
5224 INSTALL_PATH = /usr/bin;
5225 PRODUCT_NAME = "$(TARGET_NAME)";
5226 };
5227@@ -9685,6 +9796,7 @@
5228 isa = XCBuildConfiguration;
5229 buildSettings = {
5230 CLANG_ENABLE_OBJC_WEAK = YES;
5231+ CODE_SIGN_IDENTITY = "-";
5232 INSTALL_PATH = /usr/bin;
5233 PRODUCT_NAME = "$(TARGET_NAME)";
5234 };
5235@@ -9694,6 +9806,7 @@
5236 isa = XCBuildConfiguration;
5237 buildSettings = {
5238 CLANG_ENABLE_OBJC_WEAK = YES;
5239+ CODE_SIGN_IDENTITY = "-";
5240 INSTALL_PATH = /usr/bin;
5241 PRODUCT_NAME = "$(TARGET_NAME)";
5242 };
5243@@ -9703,6 +9816,7 @@
5244 isa = XCBuildConfiguration;
5245 buildSettings = {
5246 CLANG_ENABLE_OBJC_WEAK = YES;
5247+ CODE_SIGN_IDENTITY = "-";
5248 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5249 PRODUCT_NAME = "$(TARGET_NAME)";
5250 };
5251@@ -9712,6 +9826,7 @@
5252 isa = XCBuildConfiguration;
5253 buildSettings = {
5254 CLANG_ENABLE_OBJC_WEAK = YES;
5255+ CODE_SIGN_IDENTITY = "-";
5256 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5257 PRODUCT_NAME = "$(TARGET_NAME)";
5258 };
5259@@ -9721,6 +9836,7 @@
5260 isa = XCBuildConfiguration;
5261 buildSettings = {
5262 CLANG_ENABLE_OBJC_WEAK = YES;
5263+ CODE_SIGN_IDENTITY = "-";
5264 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5265 PRODUCT_NAME = "$(TARGET_NAME)";
5266 };
5267@@ -9730,6 +9846,7 @@
5268 isa = XCBuildConfiguration;
5269 buildSettings = {
5270 CLANG_ENABLE_OBJC_WEAK = YES;
5271+ CODE_SIGN_IDENTITY = "-";
5272 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5273 PRODUCT_NAME = "$(TARGET_NAME)";
5274 };
5275@@ -9739,6 +9856,7 @@
5276 isa = XCBuildConfiguration;
5277 buildSettings = {
5278 CLANG_ENABLE_OBJC_WEAK = YES;
5279+ CODE_SIGN_IDENTITY = "-";
5280 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5281 PRODUCT_NAME = "$(TARGET_NAME)";
5282 };
5283@@ -9748,6 +9866,7 @@
5284 isa = XCBuildConfiguration;
5285 buildSettings = {
5286 CLANG_ENABLE_OBJC_WEAK = YES;
5287+ CODE_SIGN_IDENTITY = "-";
5288 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5289 PRODUCT_NAME = "$(TARGET_NAME)";
5290 };
5291@@ -9757,6 +9876,7 @@
5292 isa = XCBuildConfiguration;
5293 buildSettings = {
5294 CLANG_ENABLE_OBJC_WEAK = YES;
5295+ CODE_SIGN_IDENTITY = "-";
5296 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5297 PRODUCT_NAME = "$(TARGET_NAME)";
5298 };
5299@@ -9766,6 +9886,7 @@
5300 isa = XCBuildConfiguration;
5301 buildSettings = {
5302 CLANG_ENABLE_OBJC_WEAK = YES;
5303+ CODE_SIGN_IDENTITY = "-";
5304 INSTALL_PATH = "/usr/libexec/cups/cgi-bin";
5305 PRODUCT_NAME = "$(TARGET_NAME)";
5306 };
5307@@ -9775,6 +9896,7 @@
5308 isa = XCBuildConfiguration;
5309 buildSettings = {
5310 CLANG_ENABLE_OBJC_WEAK = YES;
5311+ CODE_SIGN_IDENTITY = "-";
5312 INSTALL_PATH = /usr/libexec/cups/filter;
5313 PRODUCT_NAME = "$(TARGET_NAME)";
5314 };
5315@@ -9784,6 +9906,7 @@
5316 isa = XCBuildConfiguration;
5317 buildSettings = {
5318 CLANG_ENABLE_OBJC_WEAK = YES;
5319+ CODE_SIGN_IDENTITY = "-";
5320 INSTALL_PATH = /usr/libexec/cups/filter;
5321 PRODUCT_NAME = "$(TARGET_NAME)";
5322 };
5323@@ -9793,6 +9916,7 @@
5324 isa = XCBuildConfiguration;
5325 buildSettings = {
5326 CLANG_ENABLE_OBJC_WEAK = YES;
5327+ CODE_SIGN_IDENTITY = "-";
5328 INSTALL_PATH = /usr/libexec/cups/filter;
5329 PRODUCT_NAME = "$(TARGET_NAME)";
5330 };
5331@@ -9802,6 +9926,7 @@
5332 isa = XCBuildConfiguration;
5333 buildSettings = {
5334 CLANG_ENABLE_OBJC_WEAK = YES;
5335+ CODE_SIGN_IDENTITY = "-";
5336 INSTALL_PATH = /usr/libexec/cups/filter;
5337 PRODUCT_NAME = "$(TARGET_NAME)";
5338 };
5339@@ -9811,6 +9936,7 @@
5340 isa = XCBuildConfiguration;
5341 buildSettings = {
5342 CLANG_ENABLE_OBJC_WEAK = YES;
5343+ CODE_SIGN_IDENTITY = "-";
5344 INSTALL_PATH = /usr/libexec/cups/filter;
5345 PRODUCT_NAME = "$(TARGET_NAME)";
5346 };
5347@@ -9820,6 +9946,7 @@
5348 isa = XCBuildConfiguration;
5349 buildSettings = {
5350 CLANG_ENABLE_OBJC_WEAK = YES;
5351+ CODE_SIGN_IDENTITY = "-";
5352 INSTALL_PATH = /usr/libexec/cups/filter;
5353 PRODUCT_NAME = "$(TARGET_NAME)";
5354 };
5355@@ -9829,6 +9956,7 @@
5356 isa = XCBuildConfiguration;
5357 buildSettings = {
5358 CLANG_ENABLE_OBJC_WEAK = YES;
5359+ CODE_SIGN_IDENTITY = "-";
5360 INSTALL_PATH = /usr/libexec/cups/filter;
5361 PRODUCT_NAME = "$(TARGET_NAME)";
5362 };
5363@@ -9838,6 +9966,7 @@
5364 isa = XCBuildConfiguration;
5365 buildSettings = {
5366 CLANG_ENABLE_OBJC_WEAK = YES;
5367+ CODE_SIGN_IDENTITY = "-";
5368 INSTALL_PATH = /usr/libexec/cups/filter;
5369 PRODUCT_NAME = "$(TARGET_NAME)";
5370 };
5371@@ -9847,6 +9976,7 @@
5372 isa = XCBuildConfiguration;
5373 buildSettings = {
5374 CLANG_ENABLE_OBJC_WEAK = YES;
5375+ CODE_SIGN_IDENTITY = "-";
5376 INSTALL_PATH = /usr/libexec/cups/filter;
5377 PRODUCT_NAME = "$(TARGET_NAME)";
5378 };
5379@@ -9856,6 +9986,7 @@
5380 isa = XCBuildConfiguration;
5381 buildSettings = {
5382 CLANG_ENABLE_OBJC_WEAK = YES;
5383+ CODE_SIGN_IDENTITY = "-";
5384 INSTALL_PATH = /usr/libexec/cups/filter;
5385 PRODUCT_NAME = "$(TARGET_NAME)";
5386 };
5387@@ -9865,6 +9996,7 @@
5388 isa = XCBuildConfiguration;
5389 buildSettings = {
5390 CLANG_ENABLE_OBJC_WEAK = YES;
5391+ CODE_SIGN_IDENTITY = "-";
5392 INSTALL_PATH = /usr/libexec/cups/filter;
5393 PRODUCT_NAME = "$(TARGET_NAME)";
5394 };
5395@@ -9874,6 +10006,7 @@
5396 isa = XCBuildConfiguration;
5397 buildSettings = {
5398 CLANG_ENABLE_OBJC_WEAK = YES;
5399+ CODE_SIGN_IDENTITY = "-";
5400 INSTALL_PATH = /usr/libexec/cups/filter;
5401 PRODUCT_NAME = "$(TARGET_NAME)";
5402 };
5403@@ -9883,6 +10016,7 @@
5404 isa = XCBuildConfiguration;
5405 buildSettings = {
5406 CLANG_ENABLE_OBJC_WEAK = YES;
5407+ CODE_SIGN_IDENTITY = "-";
5408 PRODUCT_NAME = "$(TARGET_NAME)";
5409 };
5410 name = Debug;
5411@@ -9891,6 +10025,7 @@
5412 isa = XCBuildConfiguration;
5413 buildSettings = {
5414 CLANG_ENABLE_OBJC_WEAK = YES;
5415+ CODE_SIGN_IDENTITY = "-";
5416 PRODUCT_NAME = "$(TARGET_NAME)";
5417 };
5418 name = Release;
5419@@ -9899,6 +10034,7 @@
5420 isa = XCBuildConfiguration;
5421 buildSettings = {
5422 CLANG_ENABLE_OBJC_WEAK = YES;
5423+ CODE_SIGN_IDENTITY = "-";
5424 PRODUCT_NAME = "$(TARGET_NAME)";
5425 };
5426 name = Debug;
5427@@ -9907,6 +10043,7 @@
5428 isa = XCBuildConfiguration;
5429 buildSettings = {
5430 CLANG_ENABLE_OBJC_WEAK = YES;
5431+ CODE_SIGN_IDENTITY = "-";
5432 PRODUCT_NAME = "$(TARGET_NAME)";
5433 };
5434 name = Release;
5435@@ -9915,6 +10052,7 @@
5436 isa = XCBuildConfiguration;
5437 buildSettings = {
5438 CLANG_ENABLE_OBJC_WEAK = YES;
5439+ CODE_SIGN_IDENTITY = "-";
5440 PRODUCT_NAME = "$(TARGET_NAME)";
5441 };
5442 name = Debug;
5443@@ -9923,6 +10061,7 @@
5444 isa = XCBuildConfiguration;
5445 buildSettings = {
5446 CLANG_ENABLE_OBJC_WEAK = YES;
5447+ CODE_SIGN_IDENTITY = "-";
5448 PRODUCT_NAME = "$(TARGET_NAME)";
5449 };
5450 name = Release;
5451@@ -9931,6 +10070,7 @@
5452 isa = XCBuildConfiguration;
5453 buildSettings = {
5454 CLANG_ENABLE_OBJC_WEAK = YES;
5455+ CODE_SIGN_IDENTITY = "-";
5456 PRODUCT_NAME = "$(TARGET_NAME)";
5457 };
5458 name = Debug;
5459@@ -9939,6 +10079,7 @@
5460 isa = XCBuildConfiguration;
5461 buildSettings = {
5462 CLANG_ENABLE_OBJC_WEAK = YES;
5463+ CODE_SIGN_IDENTITY = "-";
5464 PRODUCT_NAME = "$(TARGET_NAME)";
5465 };
5466 name = Release;
5467@@ -9947,6 +10088,7 @@
5468 isa = XCBuildConfiguration;
5469 buildSettings = {
5470 CLANG_ENABLE_OBJC_WEAK = YES;
5471+ CODE_SIGN_IDENTITY = "-";
5472 PRODUCT_NAME = "$(TARGET_NAME)";
5473 };
5474 name = Debug;
5475@@ -9955,6 +10097,7 @@
5476 isa = XCBuildConfiguration;
5477 buildSettings = {
5478 CLANG_ENABLE_OBJC_WEAK = YES;
5479+ CODE_SIGN_IDENTITY = "-";
5480 PRODUCT_NAME = "$(TARGET_NAME)";
5481 };
5482 name = Release;
5483@@ -9963,6 +10106,7 @@
5484 isa = XCBuildConfiguration;
5485 buildSettings = {
5486 CLANG_ENABLE_OBJC_WEAK = YES;
5487+ CODE_SIGN_IDENTITY = "-";
5488 INSTALL_PATH = /usr/libexec/cups/monitor;
5489 PRODUCT_NAME = "$(TARGET_NAME)";
5490 };
5491@@ -9972,6 +10116,7 @@
5492 isa = XCBuildConfiguration;
5493 buildSettings = {
5494 CLANG_ENABLE_OBJC_WEAK = YES;
5495+ CODE_SIGN_IDENTITY = "-";
5496 INSTALL_PATH = /usr/libexec/cups/monitor;
5497 PRODUCT_NAME = "$(TARGET_NAME)";
5498 };
5499@@ -9981,6 +10126,7 @@
5500 isa = XCBuildConfiguration;
5501 buildSettings = {
5502 CLANG_ENABLE_OBJC_WEAK = YES;
5503+ CODE_SIGN_IDENTITY = "-";
5504 INSTALL_PATH = /usr/libexec/cups/monitor;
5505 PRODUCT_NAME = "$(TARGET_NAME)";
5506 };
5507@@ -9990,6 +10136,7 @@
5508 isa = XCBuildConfiguration;
5509 buildSettings = {
5510 CLANG_ENABLE_OBJC_WEAK = YES;
5511+ CODE_SIGN_IDENTITY = "-";
5512 INSTALL_PATH = /usr/libexec/cups/monitor;
5513 PRODUCT_NAME = "$(TARGET_NAME)";
5514 };
5515@@ -9999,6 +10146,7 @@
5516 isa = XCBuildConfiguration;
5517 buildSettings = {
5518 CLANG_ENABLE_OBJC_WEAK = YES;
5519+ CODE_SIGN_IDENTITY = "-";
5520 INSTALL_PATH = /usr/libexec/cups/notifier;
5521 PRODUCT_NAME = "$(TARGET_NAME)";
5522 };
5523@@ -10008,6 +10156,7 @@
5524 isa = XCBuildConfiguration;
5525 buildSettings = {
5526 CLANG_ENABLE_OBJC_WEAK = YES;
5527+ CODE_SIGN_IDENTITY = "-";
5528 INSTALL_PATH = /usr/libexec/cups/notifier;
5529 PRODUCT_NAME = "$(TARGET_NAME)";
5530 };
5531@@ -10017,6 +10166,7 @@
5532 isa = XCBuildConfiguration;
5533 buildSettings = {
5534 CLANG_ENABLE_OBJC_WEAK = YES;
5535+ CODE_SIGN_IDENTITY = "-";
5536 INSTALL_PATH = /usr/libexec/cups/notifier;
5537 PRODUCT_NAME = "$(TARGET_NAME)";
5538 };
5539@@ -10026,6 +10176,7 @@
5540 isa = XCBuildConfiguration;
5541 buildSettings = {
5542 CLANG_ENABLE_OBJC_WEAK = YES;
5543+ CODE_SIGN_IDENTITY = "-";
5544 INSTALL_PATH = /usr/libexec/cups/notifier;
5545 PRODUCT_NAME = "$(TARGET_NAME)";
5546 };
5547@@ -10035,6 +10186,7 @@
5548 isa = XCBuildConfiguration;
5549 buildSettings = {
5550 CLANG_ENABLE_OBJC_WEAK = YES;
5551+ CODE_SIGN_IDENTITY = "-";
5552 PRODUCT_NAME = "$(TARGET_NAME)";
5553 };
5554 name = Debug;
5555@@ -10043,6 +10195,7 @@
5556 isa = XCBuildConfiguration;
5557 buildSettings = {
5558 CLANG_ENABLE_OBJC_WEAK = YES;
5559+ CODE_SIGN_IDENTITY = "-";
5560 PRODUCT_NAME = "$(TARGET_NAME)";
5561 };
5562 name = Release;
5563@@ -10051,6 +10204,7 @@
5564 isa = XCBuildConfiguration;
5565 buildSettings = {
5566 CLANG_ENABLE_OBJC_WEAK = YES;
5567+ CODE_SIGN_IDENTITY = "-";
5568 INSTALL_PATH = /usr/bin;
5569 PRODUCT_NAME = "$(TARGET_NAME)";
5570 };
5571@@ -10060,6 +10214,7 @@
5572 isa = XCBuildConfiguration;
5573 buildSettings = {
5574 CLANG_ENABLE_OBJC_WEAK = YES;
5575+ CODE_SIGN_IDENTITY = "-";
5576 INSTALL_PATH = /usr/bin;
5577 PRODUCT_NAME = "$(TARGET_NAME)";
5578 };
5579@@ -10069,6 +10224,7 @@
5580 isa = XCBuildConfiguration;
5581 buildSettings = {
5582 CLANG_ENABLE_OBJC_WEAK = YES;
5583+ CODE_SIGN_IDENTITY = "-";
5584 INSTALL_PATH = /usr/libexec/cups/ippeveprinter;
5585 PRODUCT_NAME = "$(TARGET_NAME)";
5586 };
5587@@ -10078,6 +10234,7 @@
5588 isa = XCBuildConfiguration;
5589 buildSettings = {
5590 CLANG_ENABLE_OBJC_WEAK = YES;
5591+ CODE_SIGN_IDENTITY = "-";
5592 INSTALL_PATH = /usr/libexec/cups/ippeveprinter;
5593 PRODUCT_NAME = "$(TARGET_NAME)";
5594 };
5595@@ -10087,6 +10244,7 @@
5596 isa = XCBuildConfiguration;
5597 buildSettings = {
5598 CLANG_ENABLE_OBJC_WEAK = YES;
5599+ CODE_SIGN_IDENTITY = "-";
5600 INSTALL_PATH = /usr/libexec/cups/ippeveprinter;
5601 PRODUCT_NAME = "$(TARGET_NAME)";
5602 };
5603@@ -10096,6 +10254,7 @@
5604 isa = XCBuildConfiguration;
5605 buildSettings = {
5606 CLANG_ENABLE_OBJC_WEAK = YES;
5607+ CODE_SIGN_IDENTITY = "-";
5608 INSTALL_PATH = /usr/libexec/cups/ippeveprinter;
5609 PRODUCT_NAME = "$(TARGET_NAME)";
5610 };
5611@@ -10105,6 +10264,7 @@
5612 isa = XCBuildConfiguration;
5613 buildSettings = {
5614 CLANG_ENABLE_OBJC_WEAK = YES;
5615+ CODE_SIGN_IDENTITY = "-";
5616 PRODUCT_NAME = "$(TARGET_NAME)";
5617 };
5618 name = Debug;
5619@@ -10113,6 +10273,7 @@
5620 isa = XCBuildConfiguration;
5621 buildSettings = {
5622 CLANG_ENABLE_OBJC_WEAK = YES;
5623+ CODE_SIGN_IDENTITY = "-";
5624 PRODUCT_NAME = "$(TARGET_NAME)";
5625 };
5626 name = Release;
5627@@ -10133,10 +10294,29 @@
5628 };
5629 name = Release;
5630 };
5631+ 274770DE2345342B0089BC31 /* Debug */ = {
5632+ isa = XCBuildConfiguration;
5633+ buildSettings = {
5634+ CLANG_ENABLE_OBJC_WEAK = YES;
5635+ CODE_SIGN_IDENTITY = "-";
5636+ PRODUCT_NAME = "$(TARGET_NAME)";
5637+ };
5638+ name = Debug;
5639+ };
5640+ 274770DF2345342B0089BC31 /* Release */ = {
5641+ isa = XCBuildConfiguration;
5642+ buildSettings = {
5643+ CLANG_ENABLE_OBJC_WEAK = YES;
5644+ CODE_SIGN_IDENTITY = "-";
5645+ PRODUCT_NAME = "$(TARGET_NAME)";
5646+ };
5647+ name = Release;
5648+ };
5649 274FF5D313332B1F00317ECB /* Debug */ = {
5650 isa = XCBuildConfiguration;
5651 buildSettings = {
5652 CLANG_ENABLE_OBJC_WEAK = YES;
5653+ CODE_SIGN_IDENTITY = "-";
5654 INSTALL_PATH = /usr/libexec/cups/daemon;
5655 PRODUCT_NAME = "$(TARGET_NAME)";
5656 };
5657@@ -10146,6 +10326,7 @@
5658 isa = XCBuildConfiguration;
5659 buildSettings = {
5660 CLANG_ENABLE_OBJC_WEAK = YES;
5661+ CODE_SIGN_IDENTITY = "-";
5662 INSTALL_PATH = /usr/libexec/cups/daemon;
5663 PRODUCT_NAME = "$(TARGET_NAME)";
5664 };
5665@@ -10199,6 +10380,7 @@
5666 isa = XCBuildConfiguration;
5667 buildSettings = {
5668 CLANG_ENABLE_OBJC_WEAK = YES;
5669+ CODE_SIGN_IDENTITY = "-";
5670 INSTALL_PATH = /usr/libexec/cups/daemon;
5671 PRODUCT_NAME = "$(TARGET_NAME)";
5672 };
5673@@ -10208,6 +10390,7 @@
5674 isa = XCBuildConfiguration;
5675 buildSettings = {
5676 CLANG_ENABLE_OBJC_WEAK = YES;
5677+ CODE_SIGN_IDENTITY = "-";
5678 INSTALL_PATH = /usr/libexec/cups/daemon;
5679 PRODUCT_NAME = "$(TARGET_NAME)";
5680 };
5681@@ -10217,6 +10400,7 @@
5682 isa = XCBuildConfiguration;
5683 buildSettings = {
5684 CLANG_ENABLE_OBJC_WEAK = YES;
5685+ CODE_SIGN_IDENTITY = "-";
5686 INSTALL_PATH = /usr/libexec/cups/daemon;
5687 PRODUCT_NAME = "$(TARGET_NAME)";
5688 };
5689@@ -10226,6 +10410,7 @@
5690 isa = XCBuildConfiguration;
5691 buildSettings = {
5692 CLANG_ENABLE_OBJC_WEAK = YES;
5693+ CODE_SIGN_IDENTITY = "-";
5694 INSTALL_PATH = /usr/libexec/cups/daemon;
5695 PRODUCT_NAME = "$(TARGET_NAME)";
5696 };
5697@@ -10235,6 +10420,7 @@
5698 isa = XCBuildConfiguration;
5699 buildSettings = {
5700 CLANG_ENABLE_OBJC_WEAK = YES;
5701+ CODE_SIGN_IDENTITY = "-";
5702 INSTALL_PATH = /usr/libexec/cups/daemon;
5703 PRODUCT_NAME = "$(TARGET_NAME)";
5704 };
5705@@ -10244,6 +10430,7 @@
5706 isa = XCBuildConfiguration;
5707 buildSettings = {
5708 CLANG_ENABLE_OBJC_WEAK = YES;
5709+ CODE_SIGN_IDENTITY = "-";
5710 INSTALL_PATH = /usr/libexec/cups/daemon;
5711 PRODUCT_NAME = "$(TARGET_NAME)";
5712 };
5713@@ -10253,6 +10440,7 @@
5714 isa = XCBuildConfiguration;
5715 buildSettings = {
5716 CLANG_ENABLE_OBJC_WEAK = YES;
5717+ CODE_SIGN_IDENTITY = "-";
5718 INSTALL_PATH = /usr/bin;
5719 PRODUCT_NAME = "$(TARGET_NAME)";
5720 };
5721@@ -10262,6 +10450,7 @@
5722 isa = XCBuildConfiguration;
5723 buildSettings = {
5724 CLANG_ENABLE_OBJC_WEAK = YES;
5725+ CODE_SIGN_IDENTITY = "-";
5726 INSTALL_PATH = /usr/bin;
5727 PRODUCT_NAME = "$(TARGET_NAME)";
5728 };
5729@@ -10301,6 +10490,7 @@
5730 isa = XCBuildConfiguration;
5731 buildSettings = {
5732 CLANG_ENABLE_OBJC_WEAK = YES;
5733+ CODE_SIGN_IDENTITY = "-";
5734 INSTALL_PATH = /usr/sbin;
5735 PRODUCT_NAME = "$(TARGET_NAME)";
5736 };
5737@@ -10310,6 +10500,7 @@
5738 isa = XCBuildConfiguration;
5739 buildSettings = {
5740 CLANG_ENABLE_OBJC_WEAK = YES;
5741+ CODE_SIGN_IDENTITY = "-";
5742 INSTALL_PATH = /usr/sbin;
5743 PRODUCT_NAME = "$(TARGET_NAME)";
5744 };
5745@@ -10319,6 +10510,7 @@
5746 isa = XCBuildConfiguration;
5747 buildSettings = {
5748 CLANG_ENABLE_OBJC_WEAK = YES;
5749+ CODE_SIGN_IDENTITY = "-";
5750 INSTALL_PATH = /usr/bin;
5751 PRODUCT_NAME = "$(TARGET_NAME)";
5752 };
5753@@ -10328,6 +10520,7 @@
5754 isa = XCBuildConfiguration;
5755 buildSettings = {
5756 CLANG_ENABLE_OBJC_WEAK = YES;
5757+ CODE_SIGN_IDENTITY = "-";
5758 INSTALL_PATH = /usr/bin;
5759 PRODUCT_NAME = "$(TARGET_NAME)";
5760 };
5761@@ -10337,6 +10530,7 @@
5762 isa = XCBuildConfiguration;
5763 buildSettings = {
5764 CLANG_ENABLE_OBJC_WEAK = YES;
5765+ CODE_SIGN_IDENTITY = "-";
5766 INSTALL_PATH = /usr/bin;
5767 PRODUCT_NAME = "$(TARGET_NAME)";
5768 };
5769@@ -10346,6 +10540,7 @@
5770 isa = XCBuildConfiguration;
5771 buildSettings = {
5772 CLANG_ENABLE_OBJC_WEAK = YES;
5773+ CODE_SIGN_IDENTITY = "-";
5774 INSTALL_PATH = /usr/bin;
5775 PRODUCT_NAME = "$(TARGET_NAME)";
5776 };
5777@@ -10355,6 +10550,7 @@
5778 isa = XCBuildConfiguration;
5779 buildSettings = {
5780 CLANG_ENABLE_OBJC_WEAK = YES;
5781+ CODE_SIGN_IDENTITY = "-";
5782 INSTALL_PATH = /usr/bin;
5783 PRODUCT_NAME = "$(TARGET_NAME)";
5784 };
5785@@ -10364,6 +10560,7 @@
5786 isa = XCBuildConfiguration;
5787 buildSettings = {
5788 CLANG_ENABLE_OBJC_WEAK = YES;
5789+ CODE_SIGN_IDENTITY = "-";
5790 INSTALL_PATH = /usr/bin;
5791 PRODUCT_NAME = "$(TARGET_NAME)";
5792 };
5793@@ -10373,6 +10570,7 @@
5794 isa = XCBuildConfiguration;
5795 buildSettings = {
5796 CLANG_ENABLE_OBJC_WEAK = YES;
5797+ CODE_SIGN_IDENTITY = "-";
5798 INSTALL_PATH = /usr/bin;
5799 PRODUCT_NAME = "$(TARGET_NAME)";
5800 };
5801@@ -10382,6 +10580,7 @@
5802 isa = XCBuildConfiguration;
5803 buildSettings = {
5804 CLANG_ENABLE_OBJC_WEAK = YES;
5805+ CODE_SIGN_IDENTITY = "-";
5806 INSTALL_PATH = /usr/bin;
5807 PRODUCT_NAME = "$(TARGET_NAME)";
5808 };
5809@@ -10391,6 +10590,7 @@
5810 isa = XCBuildConfiguration;
5811 buildSettings = {
5812 CLANG_ENABLE_OBJC_WEAK = YES;
5813+ CODE_SIGN_IDENTITY = "-";
5814 INSTALL_PATH = /usr/bin;
5815 PRODUCT_NAME = "$(TARGET_NAME)";
5816 };
5817@@ -10400,6 +10600,7 @@
5818 isa = XCBuildConfiguration;
5819 buildSettings = {
5820 CLANG_ENABLE_OBJC_WEAK = YES;
5821+ CODE_SIGN_IDENTITY = "-";
5822 INSTALL_PATH = /usr/bin;
5823 PRODUCT_NAME = "$(TARGET_NAME)";
5824 };
5825@@ -10409,6 +10610,7 @@
5826 isa = XCBuildConfiguration;
5827 buildSettings = {
5828 CLANG_ENABLE_OBJC_WEAK = YES;
5829+ CODE_SIGN_IDENTITY = "-";
5830 INSTALL_PATH = /usr/bin;
5831 PRODUCT_NAME = "$(TARGET_NAME)";
5832 };
5833@@ -10418,6 +10620,7 @@
5834 isa = XCBuildConfiguration;
5835 buildSettings = {
5836 CLANG_ENABLE_OBJC_WEAK = YES;
5837+ CODE_SIGN_IDENTITY = "-";
5838 INSTALL_PATH = /usr/bin;
5839 PRODUCT_NAME = "$(TARGET_NAME)";
5840 };
5841@@ -10427,6 +10630,7 @@
5842 isa = XCBuildConfiguration;
5843 buildSettings = {
5844 CLANG_ENABLE_OBJC_WEAK = YES;
5845+ CODE_SIGN_IDENTITY = "-";
5846 PRODUCT_NAME = testdest;
5847 };
5848 name = Debug;
5849@@ -10435,6 +10639,7 @@
5850 isa = XCBuildConfiguration;
5851 buildSettings = {
5852 CLANG_ENABLE_OBJC_WEAK = YES;
5853+ CODE_SIGN_IDENTITY = "-";
5854 PRODUCT_NAME = testdest;
5855 };
5856 name = Release;
5857@@ -10443,6 +10648,7 @@
5858 isa = XCBuildConfiguration;
5859 buildSettings = {
5860 CLANG_ENABLE_OBJC_WEAK = YES;
5861+ CODE_SIGN_IDENTITY = "-";
5862 PRODUCT_NAME = "$(TARGET_NAME)";
5863 };
5864 name = Debug;
5865@@ -10451,6 +10657,7 @@
5866 isa = XCBuildConfiguration;
5867 buildSettings = {
5868 CLANG_ENABLE_OBJC_WEAK = YES;
5869+ CODE_SIGN_IDENTITY = "-";
5870 PRODUCT_NAME = "$(TARGET_NAME)";
5871 };
5872 name = Release;
5873@@ -10472,6 +10679,7 @@
5874 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
5875 CLANG_WARN_UNREACHABLE_CODE = YES;
5876 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
5877+ CODE_SIGN_IDENTITY = "-";
5878 COPY_PHASE_STRIP = NO;
5879 ENABLE_STRICT_OBJC_MSGSEND = YES;
5880 GCC_C_LANGUAGE_STANDARD = gnu99;
5881@@ -10510,6 +10718,7 @@
5882 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
5883 CLANG_WARN_UNREACHABLE_CODE = YES;
5884 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
5885+ CODE_SIGN_IDENTITY = "-";
5886 COPY_PHASE_STRIP = YES;
5887 ENABLE_NS_ASSERTIONS = NO;
5888 ENABLE_STRICT_OBJC_MSGSEND = YES;
5889@@ -10529,6 +10738,7 @@
5890 isa = XCBuildConfiguration;
5891 buildSettings = {
5892 CLANG_ENABLE_OBJC_WEAK = YES;
5893+ CODE_SIGN_IDENTITY = "-";
5894 INSTALL_PATH = /usr/libexec/cups/backend;
5895 PRODUCT_NAME = "$(TARGET_NAME)";
5896 };
5897@@ -10538,6 +10748,7 @@
5898 isa = XCBuildConfiguration;
5899 buildSettings = {
5900 CLANG_ENABLE_OBJC_WEAK = YES;
5901+ CODE_SIGN_IDENTITY = "-";
5902 INSTALL_PATH = /usr/libexec/cups/backend;
5903 PRODUCT_NAME = "$(TARGET_NAME)";
5904 };
5905@@ -10577,6 +10788,7 @@
5906 isa = XCBuildConfiguration;
5907 buildSettings = {
5908 CLANG_ENABLE_OBJC_WEAK = YES;
5909+ CODE_SIGN_IDENTITY = "-";
5910 INSTALL_PATH = /usr/sbin;
5911 PRODUCT_NAME = "$(TARGET_NAME)";
5912 };
5913@@ -10586,6 +10798,7 @@
5914 isa = XCBuildConfiguration;
5915 buildSettings = {
5916 CLANG_ENABLE_OBJC_WEAK = YES;
5917+ CODE_SIGN_IDENTITY = "-";
5918 INSTALL_PATH = /usr/sbin;
5919 PRODUCT_NAME = "$(TARGET_NAME)";
5920 };
5921@@ -10617,6 +10830,7 @@
5922 isa = XCBuildConfiguration;
5923 buildSettings = {
5924 CLANG_ENABLE_OBJC_WEAK = YES;
5925+ CODE_SIGN_IDENTITY = "-";
5926 INSTALL_MODE_FLAG = "u+rwX,go-rwX";
5927 INSTALL_PATH = /usr/libexec/cups/backend;
5928 PRODUCT_NAME = "$(TARGET_NAME)";
5929@@ -10627,6 +10841,7 @@
5930 isa = XCBuildConfiguration;
5931 buildSettings = {
5932 CLANG_ENABLE_OBJC_WEAK = YES;
5933+ CODE_SIGN_IDENTITY = "-";
5934 INSTALL_MODE_FLAG = "u+rwX,go-rwX";
5935 INSTALL_PATH = /usr/libexec/cups/backend;
5936 PRODUCT_NAME = "$(TARGET_NAME)";
5937@@ -10637,6 +10852,7 @@
5938 isa = XCBuildConfiguration;
5939 buildSettings = {
5940 CLANG_ENABLE_OBJC_WEAK = YES;
5941+ CODE_SIGN_IDENTITY = "-";
5942 INSTALL_PATH = /usr/libexec/cups/backend;
5943 PRODUCT_NAME = "$(TARGET_NAME)";
5944 };
5945@@ -10646,6 +10862,7 @@
5946 isa = XCBuildConfiguration;
5947 buildSettings = {
5948 CLANG_ENABLE_OBJC_WEAK = YES;
5949+ CODE_SIGN_IDENTITY = "-";
5950 INSTALL_PATH = /usr/libexec/cups/backend;
5951 PRODUCT_NAME = "$(TARGET_NAME)";
5952 };
5953@@ -10655,6 +10872,7 @@
5954 isa = XCBuildConfiguration;
5955 buildSettings = {
5956 CLANG_ENABLE_OBJC_WEAK = YES;
5957+ CODE_SIGN_IDENTITY = "-";
5958 INSTALL_PATH = /usr/libexec/cups/backend;
5959 PRODUCT_NAME = "$(TARGET_NAME)";
5960 };
5961@@ -10664,6 +10882,7 @@
5962 isa = XCBuildConfiguration;
5963 buildSettings = {
5964 CLANG_ENABLE_OBJC_WEAK = YES;
5965+ CODE_SIGN_IDENTITY = "-";
5966 INSTALL_PATH = /usr/libexec/cups/backend;
5967 PRODUCT_NAME = "$(TARGET_NAME)";
5968 };
5969@@ -10673,6 +10892,7 @@
5970 isa = XCBuildConfiguration;
5971 buildSettings = {
5972 CLANG_ENABLE_OBJC_WEAK = YES;
5973+ CODE_SIGN_IDENTITY = "-";
5974 INSTALL_PATH = /usr/libexec/cups/backend;
5975 PRODUCT_NAME = "$(TARGET_NAME)";
5976 };
5977@@ -10682,6 +10902,7 @@
5978 isa = XCBuildConfiguration;
5979 buildSettings = {
5980 CLANG_ENABLE_OBJC_WEAK = YES;
5981+ CODE_SIGN_IDENTITY = "-";
5982 INSTALL_PATH = /usr/libexec/cups/backend;
5983 PRODUCT_NAME = "$(TARGET_NAME)";
5984 };
5985@@ -10691,6 +10912,7 @@
5986 isa = XCBuildConfiguration;
5987 buildSettings = {
5988 CLANG_ENABLE_OBJC_WEAK = YES;
5989+ CODE_SIGN_IDENTITY = "-";
5990 INSTALL_PATH = /usr/libexec/cups/backend;
5991 PRODUCT_NAME = "$(TARGET_NAME)";
5992 };
5993@@ -10700,6 +10922,7 @@
5994 isa = XCBuildConfiguration;
5995 buildSettings = {
5996 CLANG_ENABLE_OBJC_WEAK = YES;
5997+ CODE_SIGN_IDENTITY = "-";
5998 INSTALL_PATH = /usr/libexec/cups/backend;
5999 PRODUCT_NAME = "$(TARGET_NAME)";
6000 };
6001@@ -10709,6 +10932,7 @@
6002 isa = XCBuildConfiguration;
6003 buildSettings = {
6004 CLANG_ENABLE_OBJC_WEAK = YES;
6005+ CODE_SIGN_IDENTITY = "-";
6006 PRODUCT_NAME = "$(TARGET_NAME)";
6007 };
6008 name = Debug;
6009@@ -10717,6 +10941,7 @@
6010 isa = XCBuildConfiguration;
6011 buildSettings = {
6012 CLANG_ENABLE_OBJC_WEAK = YES;
6013+ CODE_SIGN_IDENTITY = "-";
6014 PRODUCT_NAME = "$(TARGET_NAME)";
6015 };
6016 name = Release;
6017@@ -10725,6 +10950,7 @@
6018 isa = XCBuildConfiguration;
6019 buildSettings = {
6020 CLANG_ENABLE_OBJC_WEAK = YES;
6021+ CODE_SIGN_IDENTITY = "-";
6022 PRODUCT_NAME = "$(TARGET_NAME)";
6023 };
6024 name = Debug;
6025@@ -10733,6 +10959,7 @@
6026 isa = XCBuildConfiguration;
6027 buildSettings = {
6028 CLANG_ENABLE_OBJC_WEAK = YES;
6029+ CODE_SIGN_IDENTITY = "-";
6030 PRODUCT_NAME = "$(TARGET_NAME)";
6031 };
6032 name = Release;
6033@@ -10741,6 +10968,7 @@
6034 isa = XCBuildConfiguration;
6035 buildSettings = {
6036 CLANG_ENABLE_OBJC_WEAK = YES;
6037+ CODE_SIGN_IDENTITY = "-";
6038 PRODUCT_NAME = "$(TARGET_NAME)";
6039 };
6040 name = Debug;
6041@@ -10749,6 +10977,7 @@
6042 isa = XCBuildConfiguration;
6043 buildSettings = {
6044 CLANG_ENABLE_OBJC_WEAK = YES;
6045+ CODE_SIGN_IDENTITY = "-";
6046 PRODUCT_NAME = "$(TARGET_NAME)";
6047 };
6048 name = Release;
6049@@ -10757,6 +10986,7 @@
6050 isa = XCBuildConfiguration;
6051 buildSettings = {
6052 CLANG_ENABLE_OBJC_WEAK = YES;
6053+ CODE_SIGN_IDENTITY = "-";
6054 PRODUCT_NAME = "$(TARGET_NAME)";
6055 };
6056 name = Debug;
6057@@ -10765,6 +10995,7 @@
6058 isa = XCBuildConfiguration;
6059 buildSettings = {
6060 CLANG_ENABLE_OBJC_WEAK = YES;
6061+ CODE_SIGN_IDENTITY = "-";
6062 PRODUCT_NAME = "$(TARGET_NAME)";
6063 };
6064 name = Release;
6065@@ -10773,6 +11004,7 @@
6066 isa = XCBuildConfiguration;
6067 buildSettings = {
6068 CLANG_ENABLE_OBJC_WEAK = YES;
6069+ CODE_SIGN_IDENTITY = "-";
6070 PRODUCT_NAME = "$(TARGET_NAME)";
6071 };
6072 name = Debug;
6073@@ -10781,6 +11013,7 @@
6074 isa = XCBuildConfiguration;
6075 buildSettings = {
6076 CLANG_ENABLE_OBJC_WEAK = YES;
6077+ CODE_SIGN_IDENTITY = "-";
6078 PRODUCT_NAME = "$(TARGET_NAME)";
6079 };
6080 name = Release;
6081@@ -10789,6 +11022,7 @@
6082 isa = XCBuildConfiguration;
6083 buildSettings = {
6084 CLANG_ENABLE_OBJC_WEAK = YES;
6085+ CODE_SIGN_IDENTITY = "-";
6086 PRODUCT_NAME = "$(TARGET_NAME)";
6087 };
6088 name = Debug;
6089@@ -10797,6 +11031,7 @@
6090 isa = XCBuildConfiguration;
6091 buildSettings = {
6092 CLANG_ENABLE_OBJC_WEAK = YES;
6093+ CODE_SIGN_IDENTITY = "-";
6094 PRODUCT_NAME = "$(TARGET_NAME)";
6095 };
6096 name = Release;
6097@@ -10805,6 +11040,7 @@
6098 isa = XCBuildConfiguration;
6099 buildSettings = {
6100 CLANG_ENABLE_OBJC_WEAK = YES;
6101+ CODE_SIGN_IDENTITY = "-";
6102 PRODUCT_NAME = "$(TARGET_NAME)";
6103 };
6104 name = Debug;
6105@@ -10813,6 +11049,7 @@
6106 isa = XCBuildConfiguration;
6107 buildSettings = {
6108 CLANG_ENABLE_OBJC_WEAK = YES;
6109+ CODE_SIGN_IDENTITY = "-";
6110 PRODUCT_NAME = "$(TARGET_NAME)";
6111 };
6112 name = Release;
6113@@ -10821,6 +11058,7 @@
6114 isa = XCBuildConfiguration;
6115 buildSettings = {
6116 CLANG_ENABLE_OBJC_WEAK = YES;
6117+ CODE_SIGN_IDENTITY = "-";
6118 PRODUCT_NAME = "$(TARGET_NAME)";
6119 };
6120 name = Debug;
6121@@ -10829,6 +11067,7 @@
6122 isa = XCBuildConfiguration;
6123 buildSettings = {
6124 CLANG_ENABLE_OBJC_WEAK = YES;
6125+ CODE_SIGN_IDENTITY = "-";
6126 PRODUCT_NAME = "$(TARGET_NAME)";
6127 };
6128 name = Release;
6129@@ -10837,6 +11076,7 @@
6130 isa = XCBuildConfiguration;
6131 buildSettings = {
6132 CLANG_ENABLE_OBJC_WEAK = YES;
6133+ CODE_SIGN_IDENTITY = "-";
6134 PRODUCT_NAME = "$(TARGET_NAME)";
6135 };
6136 name = Debug;
6137@@ -10845,6 +11085,7 @@
6138 isa = XCBuildConfiguration;
6139 buildSettings = {
6140 CLANG_ENABLE_OBJC_WEAK = YES;
6141+ CODE_SIGN_IDENTITY = "-";
6142 PRODUCT_NAME = "$(TARGET_NAME)";
6143 };
6144 name = Release;
6145@@ -10853,6 +11094,7 @@
6146 isa = XCBuildConfiguration;
6147 buildSettings = {
6148 CLANG_ENABLE_OBJC_WEAK = YES;
6149+ CODE_SIGN_IDENTITY = "-";
6150 PRODUCT_NAME = "$(TARGET_NAME)";
6151 };
6152 name = Debug;
6153@@ -10861,6 +11103,7 @@
6154 isa = XCBuildConfiguration;
6155 buildSettings = {
6156 CLANG_ENABLE_OBJC_WEAK = YES;
6157+ CODE_SIGN_IDENTITY = "-";
6158 PRODUCT_NAME = "$(TARGET_NAME)";
6159 };
6160 name = Release;
6161@@ -10869,6 +11112,7 @@
6162 isa = XCBuildConfiguration;
6163 buildSettings = {
6164 CLANG_ENABLE_OBJC_WEAK = YES;
6165+ CODE_SIGN_IDENTITY = "-";
6166 PRODUCT_NAME = "$(TARGET_NAME)";
6167 };
6168 name = Debug;
6169@@ -10877,6 +11121,7 @@
6170 isa = XCBuildConfiguration;
6171 buildSettings = {
6172 CLANG_ENABLE_OBJC_WEAK = YES;
6173+ CODE_SIGN_IDENTITY = "-";
6174 PRODUCT_NAME = "$(TARGET_NAME)";
6175 };
6176 name = Release;
6177@@ -10885,6 +11130,7 @@
6178 isa = XCBuildConfiguration;
6179 buildSettings = {
6180 CLANG_ENABLE_OBJC_WEAK = YES;
6181+ CODE_SIGN_IDENTITY = "-";
6182 PRODUCT_NAME = "$(TARGET_NAME)";
6183 };
6184 name = Debug;
6185@@ -10893,6 +11139,7 @@
6186 isa = XCBuildConfiguration;
6187 buildSettings = {
6188 CLANG_ENABLE_OBJC_WEAK = YES;
6189+ CODE_SIGN_IDENTITY = "-";
6190 PRODUCT_NAME = "$(TARGET_NAME)";
6191 };
6192 name = Release;
6193@@ -10901,6 +11148,7 @@
6194 isa = XCBuildConfiguration;
6195 buildSettings = {
6196 CLANG_ENABLE_OBJC_WEAK = YES;
6197+ CODE_SIGN_IDENTITY = "-";
6198 PRODUCT_NAME = "$(TARGET_NAME)";
6199 };
6200 name = Debug;
6201@@ -10909,6 +11157,7 @@
6202 isa = XCBuildConfiguration;
6203 buildSettings = {
6204 CLANG_ENABLE_OBJC_WEAK = YES;
6205+ CODE_SIGN_IDENTITY = "-";
6206 PRODUCT_NAME = "$(TARGET_NAME)";
6207 };
6208 name = Release;
6209@@ -10917,6 +11166,7 @@
6210 isa = XCBuildConfiguration;
6211 buildSettings = {
6212 CLANG_ENABLE_OBJC_WEAK = YES;
6213+ CODE_SIGN_IDENTITY = "-";
6214 PRODUCT_NAME = "$(TARGET_NAME)";
6215 };
6216 name = Debug;
6217@@ -10925,6 +11175,7 @@
6218 isa = XCBuildConfiguration;
6219 buildSettings = {
6220 CLANG_ENABLE_OBJC_WEAK = YES;
6221+ CODE_SIGN_IDENTITY = "-";
6222 PRODUCT_NAME = "$(TARGET_NAME)";
6223 };
6224 name = Release;
6225@@ -10933,6 +11184,7 @@
6226 isa = XCBuildConfiguration;
6227 buildSettings = {
6228 CLANG_ENABLE_OBJC_WEAK = YES;
6229+ CODE_SIGN_IDENTITY = "-";
6230 PRODUCT_NAME = "$(TARGET_NAME)";
6231 };
6232 name = Debug;
6233@@ -10941,6 +11193,7 @@
6234 isa = XCBuildConfiguration;
6235 buildSettings = {
6236 CLANG_ENABLE_OBJC_WEAK = YES;
6237+ CODE_SIGN_IDENTITY = "-";
6238 PRODUCT_NAME = "$(TARGET_NAME)";
6239 };
6240 name = Release;
6241@@ -10949,6 +11202,7 @@
6242 isa = XCBuildConfiguration;
6243 buildSettings = {
6244 CLANG_ENABLE_OBJC_WEAK = YES;
6245+ CODE_SIGN_IDENTITY = "-";
6246 PRODUCT_NAME = "$(TARGET_NAME)";
6247 };
6248 name = Debug;
6249@@ -10957,6 +11211,7 @@
6250 isa = XCBuildConfiguration;
6251 buildSettings = {
6252 CLANG_ENABLE_OBJC_WEAK = YES;
6253+ CODE_SIGN_IDENTITY = "-";
6254 PRODUCT_NAME = "$(TARGET_NAME)";
6255 };
6256 name = Release;
6257@@ -10965,6 +11220,7 @@
6258 isa = XCBuildConfiguration;
6259 buildSettings = {
6260 CLANG_ENABLE_OBJC_WEAK = YES;
6261+ CODE_SIGN_IDENTITY = "-";
6262 PRODUCT_NAME = "$(TARGET_NAME)";
6263 };
6264 name = Debug;
6265@@ -10973,6 +11229,7 @@
6266 isa = XCBuildConfiguration;
6267 buildSettings = {
6268 CLANG_ENABLE_OBJC_WEAK = YES;
6269+ CODE_SIGN_IDENTITY = "-";
6270 PRODUCT_NAME = "$(TARGET_NAME)";
6271 };
6272 name = Release;
6273@@ -10981,6 +11238,7 @@
6274 isa = XCBuildConfiguration;
6275 buildSettings = {
6276 CLANG_ENABLE_OBJC_WEAK = YES;
6277+ CODE_SIGN_IDENTITY = "-";
6278 PRODUCT_NAME = "$(TARGET_NAME)";
6279 };
6280 name = Debug;
6281@@ -10989,6 +11247,7 @@
6282 isa = XCBuildConfiguration;
6283 buildSettings = {
6284 CLANG_ENABLE_OBJC_WEAK = YES;
6285+ CODE_SIGN_IDENTITY = "-";
6286 PRODUCT_NAME = "$(TARGET_NAME)";
6287 };
6288 name = Release;
6289@@ -10997,6 +11256,7 @@
6290 isa = XCBuildConfiguration;
6291 buildSettings = {
6292 CLANG_ENABLE_OBJC_WEAK = YES;
6293+ CODE_SIGN_IDENTITY = "-";
6294 PRODUCT_NAME = "$(TARGET_NAME)";
6295 };
6296 name = Debug;
6297@@ -11005,6 +11265,7 @@
6298 isa = XCBuildConfiguration;
6299 buildSettings = {
6300 CLANG_ENABLE_OBJC_WEAK = YES;
6301+ CODE_SIGN_IDENTITY = "-";
6302 PRODUCT_NAME = "$(TARGET_NAME)";
6303 };
6304 name = Release;
6305@@ -11013,6 +11274,7 @@
6306 isa = XCBuildConfiguration;
6307 buildSettings = {
6308 CLANG_ENABLE_OBJC_WEAK = YES;
6309+ CODE_SIGN_IDENTITY = "-";
6310 PRODUCT_NAME = "$(TARGET_NAME)";
6311 };
6312 name = Debug;
6313@@ -11021,6 +11283,7 @@
6314 isa = XCBuildConfiguration;
6315 buildSettings = {
6316 CLANG_ENABLE_OBJC_WEAK = YES;
6317+ CODE_SIGN_IDENTITY = "-";
6318 PRODUCT_NAME = "$(TARGET_NAME)";
6319 };
6320 name = Release;
6321@@ -11029,6 +11292,7 @@
6322 isa = XCBuildConfiguration;
6323 buildSettings = {
6324 CLANG_ENABLE_OBJC_WEAK = YES;
6325+ CODE_SIGN_IDENTITY = "-";
6326 PRODUCT_NAME = "$(TARGET_NAME)";
6327 };
6328 name = Debug;
6329@@ -11037,6 +11301,7 @@
6330 isa = XCBuildConfiguration;
6331 buildSettings = {
6332 CLANG_ENABLE_OBJC_WEAK = YES;
6333+ CODE_SIGN_IDENTITY = "-";
6334 PRODUCT_NAME = "$(TARGET_NAME)";
6335 };
6336 name = Release;
6337@@ -11045,6 +11310,7 @@
6338 isa = XCBuildConfiguration;
6339 buildSettings = {
6340 CLANG_ENABLE_OBJC_WEAK = YES;
6341+ CODE_SIGN_IDENTITY = "-";
6342 PRODUCT_NAME = "$(TARGET_NAME)";
6343 };
6344 name = Debug;
6345@@ -11053,6 +11319,7 @@
6346 isa = XCBuildConfiguration;
6347 buildSettings = {
6348 CLANG_ENABLE_OBJC_WEAK = YES;
6349+ CODE_SIGN_IDENTITY = "-";
6350 PRODUCT_NAME = "$(TARGET_NAME)";
6351 };
6352 name = Release;
6353@@ -11061,6 +11328,7 @@
6354 isa = XCBuildConfiguration;
6355 buildSettings = {
6356 CLANG_ENABLE_OBJC_WEAK = YES;
6357+ CODE_SIGN_IDENTITY = "-";
6358 PRODUCT_NAME = "$(TARGET_NAME)";
6359 };
6360 name = Debug;
6361@@ -11069,6 +11337,7 @@
6362 isa = XCBuildConfiguration;
6363 buildSettings = {
6364 CLANG_ENABLE_OBJC_WEAK = YES;
6365+ CODE_SIGN_IDENTITY = "-";
6366 PRODUCT_NAME = "$(TARGET_NAME)";
6367 };
6368 name = Release;
6369@@ -11077,6 +11346,7 @@
6370 isa = XCBuildConfiguration;
6371 buildSettings = {
6372 CLANG_ENABLE_OBJC_WEAK = YES;
6373+ CODE_SIGN_IDENTITY = "-";
6374 PRODUCT_NAME = "$(TARGET_NAME)";
6375 };
6376 name = Debug;
6377@@ -11085,6 +11355,7 @@
6378 isa = XCBuildConfiguration;
6379 buildSettings = {
6380 CLANG_ENABLE_OBJC_WEAK = YES;
6381+ CODE_SIGN_IDENTITY = "-";
6382 PRODUCT_NAME = "$(TARGET_NAME)";
6383 };
6384 name = Release;
6385@@ -11223,6 +11494,7 @@
6386 isa = XCBuildConfiguration;
6387 buildSettings = {
6388 CLANG_ENABLE_OBJC_WEAK = YES;
6389+ CODE_SIGN_IDENTITY = "-";
6390 INSTALL_PATH = /usr/libexec/cups/filter;
6391 PRODUCT_NAME = "$(TARGET_NAME)";
6392 };
6393@@ -11232,6 +11504,7 @@
6394 isa = XCBuildConfiguration;
6395 buildSettings = {
6396 CLANG_ENABLE_OBJC_WEAK = YES;
6397+ CODE_SIGN_IDENTITY = "-";
6398 INSTALL_PATH = /usr/libexec/cups/filter;
6399 PRODUCT_NAME = "$(TARGET_NAME)";
6400 };
6401@@ -11241,6 +11514,7 @@
6402 isa = XCBuildConfiguration;
6403 buildSettings = {
6404 CLANG_ENABLE_OBJC_WEAK = YES;
6405+ CODE_SIGN_IDENTITY = "-";
6406 INSTALL_PATH = /usr/bin;
6407 PRODUCT_NAME = "$(TARGET_NAME)";
6408 };
6409@@ -11250,6 +11524,7 @@
6410 isa = XCBuildConfiguration;
6411 buildSettings = {
6412 CLANG_ENABLE_OBJC_WEAK = YES;
6413+ CODE_SIGN_IDENTITY = "-";
6414 INSTALL_PATH = /usr/bin;
6415 PRODUCT_NAME = "$(TARGET_NAME)";
6416 };
6417@@ -11259,6 +11534,7 @@
6418 isa = XCBuildConfiguration;
6419 buildSettings = {
6420 CLANG_ENABLE_OBJC_WEAK = YES;
6421+ CODE_SIGN_IDENTITY = "-";
6422 PRODUCT_NAME = "$(TARGET_NAME)";
6423 };
6424 name = Debug;
6425@@ -11267,6 +11543,7 @@
6426 isa = XCBuildConfiguration;
6427 buildSettings = {
6428 CLANG_ENABLE_OBJC_WEAK = YES;
6429+ CODE_SIGN_IDENTITY = "-";
6430 PRODUCT_NAME = "$(TARGET_NAME)";
6431 };
6432 name = Release;
6433@@ -11376,6 +11653,7 @@
6434 isa = XCBuildConfiguration;
6435 buildSettings = {
6436 CLANG_ENABLE_OBJC_WEAK = YES;
6437+ CODE_SIGN_IDENTITY = "-";
6438 INSTALL_PATH = /usr/bin;
6439 PRODUCT_NAME = "ipptool copy";
6440 };
6441@@ -11385,6 +11663,7 @@
6442 isa = XCBuildConfiguration;
6443 buildSettings = {
6444 CLANG_ENABLE_OBJC_WEAK = YES;
6445+ CODE_SIGN_IDENTITY = "-";
6446 INSTALL_PATH = /usr/bin;
6447 PRODUCT_NAME = "ipptool copy";
6448 };
6449@@ -11394,6 +11673,7 @@
6450 isa = XCBuildConfiguration;
6451 buildSettings = {
6452 CLANG_ENABLE_OBJC_WEAK = YES;
6453+ CODE_SIGN_IDENTITY = "-";
6454 INSTALL_PATH = /usr/bin;
6455 PRODUCT_NAME = "$(TARGET_NAME)";
6456 };
6457@@ -11403,6 +11683,7 @@
6458 isa = XCBuildConfiguration;
6459 buildSettings = {
6460 CLANG_ENABLE_OBJC_WEAK = YES;
6461+ CODE_SIGN_IDENTITY = "-";
6462 INSTALL_PATH = /usr/bin;
6463 PRODUCT_NAME = "$(TARGET_NAME)";
6464 };
6465@@ -11784,6 +12065,15 @@
6466 defaultConfigurationIsVisible = 0;
6467 defaultConfigurationName = Release;
6468 };
6469+ 274770DD2345342B0089BC31 /* Build configuration list for PBXNativeTarget "testthreads" */ = {
6470+ isa = XCConfigurationList;
6471+ buildConfigurations = (
6472+ 274770DE2345342B0089BC31 /* Debug */,
6473+ 274770DF2345342B0089BC31 /* Release */,
6474+ );
6475+ defaultConfigurationIsVisible = 0;
6476+ defaultConfigurationName = Release;
6477+ };
6478 274FF5D213332B1F00317ECB /* Build configuration list for PBXNativeTarget "cups-driverd" */ = {
6479 isa = XCConfigurationList;
6480 buildConfigurations = (
6481diff --git a/xcode/config.h b/xcode/config.h
6482index 13198f5bc..38998eee6 100644
6483--- a/xcode/config.h
6484+++ b/xcode/config.h
6485@@ -18,8 +18,8 @@
6486 * Version of software...
6487 */
6488
6489-#define CUPS_SVERSION "CUPS v2.3.0"
6490-#define CUPS_MINIMAL "CUPS/2.3.0"
6491+#define CUPS_SVERSION "CUPS v2.3.1"
6492+#define CUPS_MINIMAL "CUPS/2.3.1"
6493
6494
6495 /*
6496@@ -305,13 +305,6 @@
6497 #define HAVE_SSL 1
6498
6499
6500-/*
6501- * Do we have the gnutls_fips140_set_mode function?
6502- */
6503-
6504-/* #undef HAVE_GNUTLS_FIPS140_SET_MODE */
6505-
6506-
6507 /*
6508 * Do we have the gnutls_transport_set_pull_timeout_function function?
6509 */