From: msweet Date: Thu, 27 Feb 2014 15:57:59 +0000 (+0000) Subject: Mirror changes from trunk. X-Git-Tag: release-2.1.4~16^2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35929e590c9d4fe21973f55c7568582d31ac3f0b;p=thirdparty%2Fcups.git Mirror changes from trunk. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.7@11642 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES.txt b/CHANGES.txt index 4ce1a1b375..db26a4c3e1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,10 +1,21 @@ -CHANGES.txt - 1.7.2 - 2014-02-19 +CHANGES.txt - 1.7.2 - 2014-02-24 -------------------------------- CHANGES IN CUPS V1.7.2 - Security: The scheduler now blocks URLs containing embedded HTML (STR #4356) + - Documentation fixes (STR #3259, STR #4346) + - "lp -i job-id -H hold" did not work (STR #nnn) + - CUPS didn't compile on older platforms (STR #4338) + - Several libcups files did not have the Apple license exception + notice (STR #4361) + - Fixed a D-BUS threading issue that caused the scheduler to crash + (STR #4347) + - The scheduler now automatically reconnects to Avahi as needed + (STR #4370) + - The scheduler did not handle GET requests for the log files properly + (STR #3265) - The dnssd backend did not always report all discovered printers using Avahi (STR #4365) - The Zebra printer driver did not properly handle negative "label top" diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index e7a52ee153..d570588697 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -303,16 +303,11 @@ fi LIBS="$SAVELIBS" dnl Check for DBUS support -if test -d /etc/dbus-1; then - DBUSDIR="/etc/dbus-1" -else - DBUSDIR="" -fi - AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support]) AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ], DBUSDIR="$withval") +DBUSDIR="" DBUS_NOTIFIER="" DBUS_NOTIFIERLIBS="" @@ -329,7 +324,12 @@ if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then LIBS="$LIBS $DBUS_NOTIFIERLIBS" AC_CHECK_FUNC(dbus_message_iter_init_append, AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND)) + AC_CHECK_FUNC(dbus_threads_init, + AC_DEFINE(HAVE_DBUS_THREADS_INIT)) LIBS="$SAVELIBS" + if test -d /etc/dbus-1; then + DBUSDIR="/etc/dbus-1" + fi else AC_MSG_RESULT(no) fi diff --git a/config.h.in b/config.h.in index e708598aca..09c4d058de 100644 --- a/config.h.in +++ b/config.h.in @@ -535,6 +535,7 @@ #undef HAVE_DBUS #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND +#undef HAVE_DBUS_THREADS_INIT /* diff --git a/cups/encode.c b/cups/encode.c index 64b21f3c84..efdb4f7ad4 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -43,6 +43,8 @@ static const ipp_op_t ipp_job_creation[] = IPP_OP_PRINT_URI, IPP_OP_VALIDATE_JOB, IPP_OP_CREATE_JOB, + IPP_OP_HOLD_JOB, + IPP_OP_SET_JOB_ATTRIBUTES, IPP_OP_CUPS_NONE }; @@ -52,6 +54,8 @@ static const ipp_op_t ipp_doc_creation[] = IPP_OP_PRINT_URI, IPP_OP_SEND_DOCUMENT, IPP_OP_SEND_URI, + IPP_OP_SET_JOB_ATTRIBUTES, + IPP_OP_SET_DOCUMENT_ATTRIBUTES, IPP_OP_CUPS_NONE }; diff --git a/cups/file-private.h b/cups/file-private.h index 60a2501488..64e6a92656 100644 --- a/cups/file-private.h +++ b/cups/file-private.h @@ -16,6 +16,8 @@ * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_FILE_PRIVATE_H_ diff --git a/cups/file.c b/cups/file.c index c76758d9d1..293cfea7bc 100644 --- a/cups/file.c +++ b/cups/file.c @@ -16,6 +16,8 @@ * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. */ /* diff --git a/cups/file.h b/cups/file.h index a3defede14..1a58dc57a4 100644 --- a/cups/file.h +++ b/cups/file.h @@ -16,6 +16,8 @@ * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_FILE_H_ diff --git a/cups/http-addr.c b/cups/http-addr.c index 747837228e..47db9ac96b 100644 --- a/cups/http-addr.c +++ b/cups/http-addr.c @@ -11,6 +11,8 @@ * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. */ /* diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index 013e15c680..66c5721358 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -11,6 +11,8 @@ * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. */ /* diff --git a/cups/thread-private.h b/cups/thread-private.h index b16eec187d..d7e170b6c0 100644 --- a/cups/thread-private.h +++ b/cups/thread-private.h @@ -10,6 +10,8 @@ * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_THREAD_PRIVATE_H_ diff --git a/cups/thread.c b/cups/thread.c index da1882e9de..848e861070 100644 --- a/cups/thread.c +++ b/cups/thread.c @@ -11,6 +11,8 @@ * which should have been included with this file. If this file is * file is missing or damaged, see the license at "http://www.cups.org/". * + * This file is subject to the Apple OS-Developed Software exception. + * * Contents: * * _cupsMutexInit() - Initialize a mutex. diff --git a/cups/usersys.c b/cups/usersys.c index 16617e900c..695138d822 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -703,7 +703,10 @@ _cupsGetPassword(const char *prompt) /* I - Prompt string */ while ((passbytes = read(tty, &passch, 1)) == 1) { - if (passch == noecho.c_cc[VEOL] || passch == noecho.c_cc[VEOL2] || + if (passch == noecho.c_cc[VEOL] || +# ifdef VEOL2 + passch == noecho.c_cc[VEOL2] || +# endif /* VEOL2 */ passch == 0x0A || passch == 0x0D) { /* diff --git a/man/ipptool.man b/man/ipptool.man index 75567c11b8..33e30f010f 100644 --- a/man/ipptool.man +++ b/man/ipptool.man @@ -1,17 +1,17 @@ .\" .\" "$Id$" .\" -.\" ipptool man page for CUPS. +.\" ipptool man page for CUPS. .\" -.\" Copyright 2010-2013 by Apple Inc. +.\" Copyright 2010-2014 by Apple Inc. .\" -.\" These coded instructions, statements, and computer programs are the -.\" property of Apple Inc. and are protected by Federal copyright -.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" -.\" which should have been included with this file. If this file is -.\" file is missing or damaged, see the license at "http://www.cups.org/". +.\" These coded instructions, statements, and computer programs are the +.\" property of Apple Inc. and are protected by Federal copyright +.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" +.\" which should have been included with this file. If this file is +.\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH ipptool 1 "CUPS" "13 May 2013" "Apple Inc." +.TH ipptool 1 "CUPS" "20 February 2014" "Apple Inc." .SH NAME ipptool - perform internet printing protocol requests .SH SYNOPSIS @@ -42,8 +42,10 @@ The following options are recognized by \fIipptool\fR: .TP 5 --help Shows program help. +.TP 5 --stop-after-include-error Tells \fIipptool\fR to stop if an error occurs in an included file. Normally \fIipptool\fR will continue with subsequent tests after the INCLUDE directive. +.TP 5 --version Shows the version of \fIipptool\fR being used. .TP 5 @@ -150,11 +152,15 @@ The following standard files are available: validate-job.test .fi .SH SEE ALSO -\fIipptoolfile(5)\fR, +\fIipptoolfile(5)\fR, RFC 2911, .br http://localhost:631/help +.br +http://www.iana.org/assignments/ipp-registrations +.br +http://www.pwg.org/ipp .SH COPYRIGHT -Copyright 2007-2013 by Apple Inc. +Copyright 2007-2014 by Apple Inc. .\" .\" End of "$Id$". .\" diff --git a/man/ipptoolfile.man b/man/ipptoolfile.man index d3fbfb6724..4b0246fbfa 100644 --- a/man/ipptoolfile.man +++ b/man/ipptoolfile.man @@ -1,17 +1,17 @@ .\" .\" "$Id$" .\" -.\" ipptoolfile man page for CUPS. +.\" ipptoolfile man page for CUPS. .\" -.\" Copyright 2010-2013 by Apple Inc. +.\" Copyright 2010-2014 by Apple Inc. .\" -.\" These coded instructions, statements, and computer programs are the -.\" property of Apple Inc. and are protected by Federal copyright -.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" -.\" which should have been included with this file. If this file is -.\" file is missing or damaged, see the license at "http://www.cups.org/". +.\" These coded instructions, statements, and computer programs are the +.\" property of Apple Inc. and are protected by Federal copyright +.\" law. Distribution and use rights are outlined in the file "LICENSE.txt" +.\" which should have been included with this file. If this file is +.\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH ipptoolfile 5 "CUPS" "13 May 2013" "Apple Inc." +.TH ipptoolfile 5 "CUPS" "20 February 2014" "Apple Inc." .SH NAME ipptoolfile \- ipptool file format @@ -152,7 +152,7 @@ The following directives are understood in a test: .TP 5 ATTR tag attribute-name value(s) Adds an attribute to the test request. Values are separated by the comma (",") -character - escape commas using the "\" character. +character - escape commas using the "\" character. Common attributes and values are listed in the IANA IPP registry - see references below. .TP 5 ATTR collection attribute-name { MEMBER tag member-name value(s) ... } [ ... { ... } ] Adds a collection attribute to the test request. Member attributes follow the @@ -614,12 +614,15 @@ $username Inserts the username from the URI provided to \fIipptool\fR, if any. .SH SEE ALSO -\fIipptool(1)\fR, +\fIipptool(1)\fR, RFC 2911, .br http://localhost:631/help - +.br +http://www.iana.org/assignments/ipp-registrations +.br +http://www.pwg.org/ipp .SH COPYRIGHT -Copyright 2007-2013 by Apple Inc. +Copyright 2007-2014 by Apple Inc. .\" .\" End of "$Id$". .\" diff --git a/scheduler/client.c b/scheduler/client.c index d453bbef08..b86625d0dc 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -1,46 +1,19 @@ /* * "$Id$" * - * Client routines for the CUPS scheduler. + * Client routines for the CUPS scheduler. * - * Copyright 2007-2013 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products, all rights reserved. + * Copyright 2007-2014 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products, all rights reserved. * - * This file contains Kerberos support code, copyright 2006 by - * Jelmer Vernooij. + * This file contains Kerberos support code, copyright 2006 by + * Jelmer Vernooij. * - * These coded instructions, statements, and computer programs are the - * property of Apple Inc. and are protected by Federal copyright - * law. Distribution and use rights are outlined in the file "LICENSE.txt" - * which should have been included with this file. If this file is - * file is missing or damaged, see the license at "http://www.cups.org/". - * - * Contents: - * - * cupsdAcceptClient() - Accept a new client. - * cupsdCloseAllClients() - Close all remote clients immediately. - * cupsdCloseClient() - Close a remote client. - * cupsdFlushHeader() - Flush the header fields to the client. - * cupsdReadClient() - Read data from a client. - * cupsdSendCommand() - Send output from a command via HTTP. - * cupsdSendError() - Send an error message via HTTP. - * cupsdSendHeader() - Send an HTTP request. - * cupsdUpdateCGI() - Read status messages from CGI scripts and - * programs. - * cupsdWriteClient() - Write data to a client as needed. - * check_if_modified() - Decode an "If-Modified-Since" line. - * compare_clients() - Compare two client connections. - * data_ready() - Check whether data is available from a client. - * get_file() - Get a filename and state info. - * install_cupsd_conf() - Install a configuration file. - * is_cgi() - Is the resource a CGI script/program? - * is_path_absolute() - Is a path absolute and free of relative elements - * (i.e. ".."). - * pipe_command() - Pipe the output of a command to the remote - * client. - * valid_host() - Is the Host: field valid? - * write_file() - Send a file via HTTP. - * write_pipe() - Flag that data is available on the CGI pipe. + * These coded instructions, statements, and computer programs are the + * property of Apple Inc. and are protected by Federal copyright + * law. Distribution and use rights are outlined in the file "LICENSE.txt" + * which should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". */ /* @@ -2884,6 +2857,17 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */ con->file_ready = 0; } + bytes = (ssize_t)(sizeof(con->header) - (size_t)con->header_used); + + if (!con->pipe_pid && bytes > con->http.data_remaining) + { + /* + * Limit GET bytes to original size of file (STR #3265)... + */ + + bytes = (ssize_t)con->http.data_remaining; + } + if (con->response && con->response->state != IPP_DATA) { int wused = con->http.wused; /* Previous write buffer use */ @@ -2926,8 +2910,7 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */ con->http.fd, (int)bytes, con->http.state, CUPS_LLCAST con->http.data_remaining); } - else if ((bytes = read(con->file, con->header + con->header_used, - sizeof(con->header) - con->header_used)) > 0) + else if ((bytes = read(con->file, con->header + con->header_used, (size_t)bytes)) > 0) { con->header_used += bytes; diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index f372c00c89..9a2d2b56d1 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -223,8 +223,7 @@ cupsdStartBrowsing(void) { int error; /* Error code, if any */ - DNSSDClient = avahi_client_new(avahi_threaded_poll_get(DNSSDMaster), 0, - NULL, NULL, &error); + DNSSDClient = avahi_client_new(avahi_threaded_poll_get(DNSSDMaster), AVAHI_CLIENT_NO_FAIL, NULL, NULL, &error); if (DNSSDClient == NULL) { diff --git a/scheduler/main.c b/scheduler/main.c index 5a8da815e5..7fd89257f8 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -506,6 +506,14 @@ main(int argc, /* I - Number of command-line args */ setlocale(LC_TIME, ""); #endif /* LC_TIME */ +#ifdef HAVE_DBUS_THREADS_INIT + /* + * Enable threading support for D-BUS... + */ + + dbus_threads_init(); +#endif /* HAVE_DBUS_THREADS_INIT */ + /* * Set the maximum number of files... */