]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.7svn-r10791.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 10 Jan 2013 17:01:44 +0000 (17:01 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 10 Jan 2013 17:01:44 +0000 (17:01 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@4120 a1ca3aef-8c08-0410-bb20-df032aa958be

94 files changed:
CHANGES-1.6.txt
CHANGES-IPPTOOL.txt
IPPTOOL.txt
README.txt
backend/ipp.c
backend/usb-darwin.c
backend/usb-libusb.c
cgi-bin/Makefile
conf/cups-files.conf.in
config-scripts/cups-common.m4
config-scripts/cups-gssapi.m4
config.h.in
cups/dest-options.c
cups/http-private.h
cups/http-support.c
cups/http.c
cups/http.h
cups/ipp-support.c
cups/ipp.c
cups/request.c
cups/versioning.h
doc/Makefile
doc/ca/index.html.in
doc/es/index.html.in
doc/help/man-ipptoolfile.html
doc/help/spec-browsing.html
doc/index.html.in
doc/ja/index.html.in
filter/Makefile
filter/pstops.c
man/backend.man
man/cancel.man
man/classes.conf.man
man/client.conf.man.in
man/cups-config.man
man/cups-deviced.man.in
man/cups-driverd.man.in
man/cups-files.conf.man.in
man/cups-lpd.man.in
man/cups-snmp.conf.man
man/cups-snmp.man.in
man/cupsaccept.man
man/cupsaddsmb.man.in
man/cupsctl.man
man/cupsd.conf.man.in
man/cupsd.man.in
man/cupsenable.man
man/cupsfilter.man
man/cupstestdsc.man
man/cupstestppd.man
man/filter.man
man/ipptool.man
man/ipptoolfile.man
man/lp.man
man/lpadmin.man
man/lpc.man
man/lpinfo.man
man/lpmove.man
man/lpoptions.man.in
man/lppasswd.man
man/lpq.man
man/lpr.man
man/lprm.man
man/lpstat.man
man/mailto.conf.man
man/mime.convs.man
man/mime.types.man
man/notifier.man
man/ppdc.man
man/ppdcfile.man
man/ppdhtml.man
man/ppdi.man
man/ppdmerge.man
man/ppdpo.man
man/printers.conf.man
man/subscriptions.conf.man
ppdc/Makefile
scheduler/Makefile
scheduler/auth.c
scheduler/cert.c
scheduler/cert.h
scheduler/client.c
scheduler/colorman.c
scheduler/conf.c
scheduler/cupsd.h
scheduler/cupsfilter.c
scheduler/job.c
scheduler/main.c
templates/ca/trailer.tmpl
templates/es/trailer.tmpl
templates/ja/trailer.tmpl
templates/trailer.tmpl
test/ippserver.c
test/ipptool.c

index c59c1ca548fbc7f48ad4cebf3130e5a12808c8c6..57cb441e1dd36d4199f286b8d06e1d1478185a8e 100644 (file)
@@ -3,10 +3,23 @@ CHANGES-1.6.txt
 
 CHANGES IN CUPS V1.6.2
 
-       - Documentation fixes (STR #4239)
+       - Documentation fixes (STR #4239, STR #4234)
        - Security: All file, directory, user, and group settings are now stored
          in a separate cups-files.conf configuration file that cannot be set
          through the CUPS web interface or APIs (STR #4223)
+       - The ipptool program now supports DEFINE-MATCH and DEFINE-NO-MATCH
+         predicates for STATUS directives.
+       - Fixed a problem with local Kerberos authentication (STR #4140)
+       - Coverity scan: fixed some minor issues (STR #4242)
+       - The scheduler did not remove color profiles after deleting a printer
+         (STR #4232)
+       - The CUPS library did not always detect a timed out connection to the
+         server which could cause temporary loss of printing from applications
+         (STR #4187)
+       - The ipptool program now supports variable substitution in OPERATION
+         and DELAY directives (STR #4175)
+       - The IPP backend now stops queues when the server configuration
+         prevents successful job submission (STR #4125)
        - The XML output of ipptool contained empty dictionaries (STR #4136)
        - The scheduler did not delete job control backup files (STR #4244)
        - cupsGetPPD3 could return a local PPD instead of the correct remote
index a0b9176daa8f5b73ca127553179d902485f19450..22264c5190b8be212db149a23b7b75495b179608 100644 (file)
@@ -1,17 +1,19 @@
-CHANGES-IPPTOOL.txt - 2012-11-16
+CHANGES-IPPTOOL.txt - 2013-01-10
 --------------------------------
 
 This file provides a list of changes to the ipptool binary distribution posted
 on cups.org.
 
 
-2012-MM-DD
+2013-MM-DD
 
-       - ipptool did not support octetString values.
+       - Added support for DEFINE-MATCH and DEFINE-NO-MATCH as STATUS
+         predicates.
+       - Added support for octetString values.
+       - Added support for document compression in Print-Job and Send-Document
+         requests.
        - Fixed REPEAT-MATCH for STATUS and EXPECT - was incorrectly erroring
          out.
-       - ipptool did not support compressing documents in Print-Job or
-         Send-Document requests.
 
 
 2012-02-28
index 5aa027f1e5cd0237656f7626e44e80d63c76592a..93eda28c0579c1b29414b71d392d96daa1d12984 100644 (file)
@@ -1,4 +1,4 @@
-IPPTOOL.txt - 2012-11-16
+IPPTOOL.txt - 2013-01-10
 ------------------------
 
 See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
@@ -174,7 +174,7 @@ REPORTING BUGS
 
 LEGAL STUFF
 
-    CUPS is Copyright 2007-2012 by Apple Inc.  CUPS and the CUPS logo are
+    CUPS is Copyright 2007-2013 by Apple Inc.  CUPS and the CUPS logo are
     trademarks of Apple Inc.
 
     The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
index fede61b6ec1ae962e9e3a26a9d67fd4ccb1feee2..024b7f23e29828f642dc8f21b37023e237af659c 100644 (file)
@@ -150,7 +150,7 @@ PRINTING FILES
 
 LEGAL STUFF
 
-    CUPS is Copyright 2007-2012 by Apple Inc.  CUPS and the CUPS logo are
+    CUPS is Copyright 2007-2013 by Apple Inc.  CUPS and the CUPS logo are
     trademarks of Apple Inc.
 
     The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
index d3dd8de9cd71f15707f9dcc19bd399aae07647f1..19ce3f2d325e61285892a038a978ccd1a6840826 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   IPP backend for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -1066,10 +1066,10 @@ main(int  argc,                         /* I - Number of command-line args */
       }
       else if (!compression)
       {
-        if (ippContainsString(compression_sup, "deflate"))
-          compression = "deflate";
-        else if (ippContainsString(compression_sup, "gzip"))
+        if (ippContainsString(compression_sup, "gzip"))
           compression = "gzip";
+        else if (ippContainsString(compression_sup, "deflate"))
+          compression = "deflate";
 
         if (compression)
           fprintf(stderr, "DEBUG: Automatically using \"%s\" compression.\n",
@@ -1354,8 +1354,9 @@ main(int  argc,                           /* I - Number of command-line args */
  /*
   * If the printer only claims to support IPP/1.0, or if the user specifically
   * included version=1.0 in the URI, then do not try to use Create-Job or
-  * Send-Document.  This is another dreaded compatibility hack, but unfortunately
-  * there are enough broken printers out there that we need this for now...
+  * Send-Document.  This is another dreaded compatibility hack, but
+  * unfortunately there are enough broken printers out there that we need
+  * this for now...
   */
 
   if (version == 10)
@@ -1812,6 +1813,27 @@ main(int  argc,                          /* I - Number of command-line args */
 
       goto cleanup;
     }
+    else if (ipp_status == IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED)
+    {
+     /*
+      * Server is configured incorrectly; the policy for Create-Job and
+      * Send-Document has to be the same (auth or no auth, encryption or
+      * no encryption).  Force the queue to stop since printing will never
+      * work.
+      */
+
+      fputs("DEBUG: The server or printer is configured incorrectly.\n",
+            stderr);
+      fputs("DEBUG: The policy for Create-Job and Send-Document must have the "
+            "same authentication and encryption requirements.\n", stderr);
+
+      ipp_status = IPP_STATUS_ERROR_INTERNAL;
+
+      if (job_id > 0)
+       cancel_job(http, uri, job_id, resource, argv[2], version);
+
+      goto cleanup;
+    }
     else if (ipp_status == IPP_NOT_FOUND)
     {
      /*
@@ -1850,6 +1872,12 @@ main(int  argc,                          /* I - Number of command-line args */
 
       backendCheckSideChannel(snmp_fd, http->hostaddr);
 
+     /*
+      * Check printer state...
+      */
+
+      check_printer_state(http, uri, resource, argv[2], version);
+
      /*
       * Build an IPP_GET_JOB_ATTRIBUTES request...
       */
index 98cf9804a0b3e90c379aae062d71821ec103e25c..33f1fb6480d42e43dfe090120f4d71abeff46ec0 100644 (file)
@@ -151,9 +151,9 @@ struct crashreporter_annotations_t {
        uint64_t dialog_mode;           // unsigned int
 };
 
-CRASH_REPORTER_CLIENT_HIDDEN 
-struct crashreporter_annotations_t gCRAnnotations 
-       __attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION))) 
+CRASH_REPORTER_CLIENT_HIDDEN
+struct crashreporter_annotations_t gCRAnnotations
+       __attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION)))
        = { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0 };
 
 /*
@@ -280,6 +280,7 @@ typedef struct globals_s
  */
 
 globals_t g = { 0 };                   /* Globals */
+int Iterating = 0;                     /* Are we iterating the bus? */
 
 
 /*
@@ -1106,6 +1107,8 @@ sidechannel_thread(void *reference)
 static void iterate_printers(iterator_callback_t callBack,
                             void *userdata)
 {
+  Iterating = 1;
+
   mach_port_t  masterPort = 0x0;
   kern_return_t kr = IOMasterPort (bootstrap_port, &masterPort);
 
@@ -1143,6 +1146,8 @@ static void iterate_printers(iterator_callback_t callBack,
     }
     mach_port_deallocate(mach_task_self(), masterPort);
   }
+
+  Iterating = 0;
 }
 
 
@@ -1431,7 +1436,7 @@ static kern_return_t load_classdriver(CFStringRef     driverPath,
 
   _cups_fc_result_t result = _cupsFileCheck(bundlestr,
                                             _CUPS_FILE_CHECK_DIRECTORY, 1,
-                                            _cupsFileCheckFilter, NULL);
+                                            Iterating ? NULL : _cupsFileCheckFilter, NULL);
 
   if (result && driverPath)
     return (load_classdriver(NULL, interface, printerDriver));
index da7e0cce9d8436c50646352ad6cc117189598a99..0d472ed259dddac0702465f796506c47c6939b36 100644 (file)
@@ -672,10 +672,10 @@ print_device(const char *uri,             /* I - Device URI */
        * If it didn't exit abort the pending read and wait an additional
        * second...
        */
-  
+
       if (!g.read_thread_done)
       {
-       fputs("DEBUG: Read thread still active, aborting the pending read...\n", 
+       fputs("DEBUG: Read thread still active, aborting the pending read...\n",
              stderr);
 
        g.wait_eof = 0;
@@ -683,7 +683,7 @@ print_device(const char *uri,               /* I - Device URI */
        gettimeofday(&tv, NULL);
        cond_timeout.tv_sec  = tv.tv_sec + 1;
        cond_timeout.tv_nsec = tv.tv_usec * 1000;
-  
+
        while (!g.read_thread_done)
        {
          if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
@@ -696,9 +696,6 @@ print_device(const char *uri,               /* I - Device URI */
     pthread_mutex_unlock(&g.read_thread_mutex);
   }
 
-  if (print_fd)
-    close(print_fd);
-
  /*
   * Close the connection and input file and general clean up...
   */
@@ -758,7 +755,7 @@ close_device(usb_printer_t *printer)        /* I - Printer */
       */
       if (printer->origconf > 0 && printer->origconf != number2)
       {
-       fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n", 
+       fprintf(stderr, "DEBUG: Restoring USB device configuration: %d -> %d\n",
                number2, printer->origconf);
        if ((errcode = libusb_set_configuration(printer->handle,
                                                printer->origconf)) < 0)
@@ -919,7 +916,7 @@ find_device(usb_cb_t   cb,          /* I - Callback function */
            */
 
            if (((altptr->bInterfaceClass != LIBUSB_CLASS_PRINTER ||
-                 altptr->bInterfaceSubClass != 1) && 
+                 altptr->bInterfaceSubClass != 1) &&
                 ((printer.quirks & USBLP_QUIRK_BAD_CLASS) == 0)) ||
                (altptr->bInterfaceProtocol != 1 &&     /* Unidirectional */
                 altptr->bInterfaceProtocol != 2) ||    /* Bidirectional */
@@ -997,7 +994,7 @@ find_device(usb_cb_t   cb,          /* I - Callback function */
                                            bEndpointAddress;
                }
                else
-                 fprintf(stderr, "DEBUG: Uni-directional USB communication " 
+                 fprintf(stderr, "DEBUG: Uni-directional USB communication "
                          "only!\n");
                printer.write_endp = confptr->interface[printer.iface].
                                           altsetting[printer.altset].
@@ -1376,7 +1373,7 @@ open_device(usb_printer_t *printer,       /* I - Printer */
 
   printer->origconf = current;
 
-  if ((errcode = 
+  if ((errcode =
        libusb_get_config_descriptor (printer->device, printer->conf, &confptr))
       < 0)
   {
@@ -1388,7 +1385,7 @@ open_device(usb_printer_t *printer,       /* I - Printer */
 
   if (number1 != current)
   {
-    fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n", 
+    fprintf(stderr, "DEBUG: Switching USB device configuration: %d -> %d\n",
            current, number1);
     if ((errcode = libusb_set_configuration(printer->handle, number1)) < 0)
     {
index 15260420263bb5ed66e6ab608a7c1484933db1ae..e9c682c02a672dc1fdeb4e3976bba12fb3972540 100644 (file)
@@ -154,6 +154,7 @@ install-libs: $(INSTALLSTATIC)
        if test "x$(SYMROOT)" != "x"; then \
                $(INSTALL_DIR) $(SYMROOT); \
                cp $(LIBCUPSCGI) $(SYMROOT); \
+               dsymutil $(SYMROOT)/$(LIBCUPSCGI); \
        fi
 
 installstatic:
index 01ee93317a0b7836877e6c845ef8217ed98eaf04..123812cf87aecf805e09d840e7a36bbc8e86f211 100644 (file)
@@ -24,8 +24,8 @@ SystemGroup @CUPS_SYSTEM_GROUPS@
 #FileDevice No
 
 # Permissions for configuration and log files...
-#ConfigFilePerm @CUPS_CONFIG_FILE_PERM@
-#LogFilePerm @CUPS_LOG_FILE_PERM@
+#ConfigFilePerm 0@CUPS_CONFIG_FILE_PERM@
+#LogFilePerm 0@CUPS_LOG_FILE_PERM@
 
 # Location of the file logging all access to the scheduler; may be the name
 # "syslog". If not an absolute path, the value of ServerRoot is used as the
index d5a22ce67752d4a131f0d5bf9b239d1936b3f296..60614de0119452b3bcee4b009a6cc53c6b7f29ea 100644 (file)
@@ -403,8 +403,8 @@ case $uname in
                if test $uversion -ge 100; then
                        AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
                fi
-               if test $uversion -ge 110; then
-                       # Broken public headers in 10.7...
+               if test $uversion -ge 110 -a $uversion -lt 120; then
+                       # Broken public headers in 10.7.x...
                        AC_MSG_CHECKING(for sandbox/private.h presence)
                        if test -f /usr/local/include/sandbox/private.h; then
                                AC_MSG_RESULT(yes)
index 36c878cf07a109a77c96443279088faa3c1255e8..d378bbfabb6d9a48d7400d23bffcbf89e8186819 100644 (file)
@@ -86,13 +86,6 @@ if test x$enable_gssapi != xno; then
                        else
                                AC_MSG_RESULT(no)
                        fi
-                       AC_MSG_CHECKING(for GSS/gssapi_krb5.h presence)
-                       if test -f $gssdir/Headers/gssapi_krb5.h; then
-                               AC_DEFINE(HAVE_GSSAPI_KRB5_H)
-                               AC_MSG_RESULT(yes)
-                       else
-                               AC_MSG_RESULT(no)
-                       fi
                        AC_MSG_CHECKING(for GSS/gssapi_spi.h presence)
                        if test -f $gssdir/PrivateHeaders/gssapi_spi.h; then
                                AC_MSG_RESULT(yes)
@@ -105,16 +98,14 @@ if test x$enable_gssapi != xno; then
                                fi
                        else
                                AC_MSG_RESULT(no)
-                               if test $uversion -ge 110; then
-                                       # Broken public headers in 10.7...
+                               if test $uversion -ge 110 -a $uversion -lt 120; then
+                                       # Broken public headers in 10.7.x...
                                        AC_MSG_ERROR(Run 'sudo mkdir -p $gssdir/PrivateHeaders' and 'sudo touch $gssdir/PrivateHeaders/gssapi_spi.h' to build CUPS.)
                                fi
                        fi
                else
                        AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H))
                        AC_CHECK_HEADER(gssapi/gssapi.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_H))
-                       AC_CHECK_HEADER(gssapi/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GENERIC_H))
-                       AC_CHECK_HEADER(gssapi/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_KRB5_H))
                fi
 
                SAVELIBS="$LIBS"
index 34af9141cb5b01f917ef9d1276073fa1847c4e6f..d054fc3fa3650e2ab5e9e6b5c13db208992f71bf 100644 (file)
 #undef HAVE_GSS_GSSAPI_H
 #undef HAVE_GSS_GSSAPI_SPI_H
 #undef HAVE_GSSAPI
-#undef HAVE_GSSAPI_GENERIC_H
 #undef HAVE_GSSAPI_GSSAPI_H
 #undef HAVE_GSSAPI_H
-#undef HAVE_GSSAPI_KRB5_H
-#undef HAVE_KRB5_H
 
 
 /*
index d8eff72e5b568888b7783074df34f153d25700df..8477ab30ab8849d1d7f597979629c2a7d1baf4c4 100644 (file)
@@ -485,7 +485,7 @@ cupsCopyDestConflicts(
     active = NULL;
   }
 
-  if (tries >= 0)
+  if (tries >= 100)
   {
     DEBUG_puts("1cupsCopyDestConflicts: Unable to resolve after 100 tries.");
     have_conflicts = -1;
index a789917de0155d0bb16d110d3b46be434bfac42e..9259b1f4a7d98c0ce18fae6390399f9cbdcfeab1 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Private HTTP definitions for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
 #  ifdef HAVE_GSSAPI
 #    ifdef HAVE_GSS_GSSAPI_H
 #      include <GSS/gssapi.h>
-#      ifdef HAVE_GSSAPI_GENERIC_H
-#        include <GSS/gssapi_generic.h>
-#      endif /* HAVE_GSSAPI_GENERIC_H */
-#      ifdef HAVE_GSSAPI_KRB5_H
-#        include <GSS/gssapi_krb5.h>
-#      endif /* HAVE_GSSAPI_KRB5_H */
 #    elif defined(HAVE_GSSAPI_GSSAPI_H)
 #      include <gssapi/gssapi.h>
-#      ifdef HAVE_GSSAPI_GENERIC_H
-#        include <gssapi/gssapi_generic.h>
-#      endif /* HAVE_GSSAPI_GENERIC_H */
-#      ifdef HAVE_GSSAPI_KRB5_H
-#        include <gssapi/gssapi_krb5.h>
-#      endif /* HAVE_GSSAPI_KRB5_H */
 #    elif defined(HAVE_GSSAPI_H)
 #      include <gssapi.h>
 #    endif /* HAVE_GSS_GSSAPI_H */
 #    ifndef HAVE_GSS_C_NT_HOSTBASED_SERVICE
 #      define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
 #    endif /* !HAVE_GSS_C_NT_HOSTBASED_SERVICE */
-#    ifdef HAVE_KRB5_H
-#      include <krb5.h>
-#    endif /* HAVE_KRB5_H */
 #  endif /* HAVE_GSSAPI */
 
 #  ifdef HAVE_AUTHORIZATION_H
@@ -341,6 +326,7 @@ struct _http_s                              /**** HTTP connection structure ****/
 #  ifdef HAVE_LIBZ
   _http_coding_t       coding;         /* _HTTP_CODING_xxx */
   z_stream             stream;         /* (De)compression stream */
+  Bytef                        *dbuffer;       /* Decompression buffer */
 #  endif /* HAVE_LIBZ */
 };
 
@@ -407,14 +393,18 @@ extern void       _cups_freeifaddrs(struct ifaddrs *addrs);
  */
 
 #define                        _httpAddrFamily(addrp) (addrp)->addr.sa_family
+extern int             _httpAddrPort(http_addr_t *addr)
+                                     _CUPS_INTERNAL_MSG("Use httpAddrPort instead.");
 extern void            _httpAddrSetPort(http_addr_t *addr, int port);
 extern char            *_httpAssembleUUID(const char *server, int port,
                                           const char *name, int number,
-                                          char *buffer, size_t bufsize);
+                                          char *buffer, size_t bufsize)
+                                          _CUPS_INTERNAL_MSG("Use httpAssembleUUID instead.");
 extern http_t          *_httpCreate(const char *host, int port,
                                     http_addrlist_t *addrlist, int family,
                                     http_encryption_t encryption,
-                                    int blocking, _http_mode_t mode);
+                                    int blocking, _http_mode_t mode)
+                                    _CUPS_INTERNAL_MSG("Use httpConnect2 or httpAccept instead.");
 extern http_tls_credentials_t
                        _httpCreateCredentials(cups_array_t *credentials);
 extern char            *_httpDecodeURI(char *dst, const char *src,
@@ -423,6 +413,8 @@ extern void         _httpDisconnect(http_t *http);
 extern char            *_httpEncodeURI(char *dst, const char *src,
                                        size_t dstsize);
 extern void            _httpFreeCredentials(http_tls_credentials_t credentials);
+extern ssize_t         _httpPeek(http_t *http, char *buffer, size_t length)
+                                 _CUPS_INTERNAL_MSG("Use httpPeek instead.");
 extern const char      *_httpResolveURI(const char *uri, char *resolved_uri,
                                         size_t resolved_size, int options,
                                         int (*cb)(void *context),
index d0f36c3e151c1a9d1543b2872cec0fe45a214f46..cd1565ded13c359671766b89ab3833588819cc33 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   HTTP support routines for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -20,7 +20,8 @@
  *                         components.
  *   httpAssembleURIf()   - Assemble a uniform resource identifier from its
  *                         components with a formatted resource.
- *   _httpAssembleUUID()  - Make a UUID URI conforming to RFC 4122.
+ *   httpAssembleUUID()   - Assemble a name-based UUID URN conforming to RFC
+ *                          4122.
  *   httpDecode64()      - Base64-decode a string.
  *   httpDecode64_2()    - Base64-decode a string.
  *   httpEncode64()      - Base64-encode a string.
@@ -466,18 +467,22 @@ httpAssembleURIf(
 
 
 /*
- * '_httpAssembleUUID()' - Make a UUID URI conforming to RFC 4122.
+ * 'httpAssembleUUID()' - Assemble a name-based UUID URN conforming to RFC 4122.
+ *
+ * This function creates a unique 128-bit identifying number using the server
+ * name, port number, random data, and optionally an object name and/or object
+ * number.  The result is formatted as a UUID URN as defined in RFC 4122.
  *
  * The buffer needs to be at least 46 bytes in size.
  */
 
 char *                                 /* I - UUID string */
-_httpAssembleUUID(const char *server,  /* I - Server name */
-                  int        port,     /* I - Port number */
-                 const char *name,     /* I - Object name or NULL */
-                  int        number,   /* I - Object number or 0 */
-                 char       *buffer,   /* I - String buffer */
-                 size_t     bufsize)   /* I - Size of buffer */
+httpAssembleUUID(const char *server,   /* I - Server name */
+                int        port,       /* I - Port number */
+                const char *name,      /* I - Object name or NULL */
+                int        number,     /* I - Object number or 0 */
+                char       *buffer,    /* I - String buffer */
+                size_t     bufsize)    /* I - Size of buffer */
 {
   char                 data[1024];     /* Source string for MD5 */
   _cups_md5_state_t    md5state;       /* MD5 state */
@@ -514,6 +519,13 @@ _httpAssembleUUID(const char *server,      /* I - Server name */
   return (buffer);
 }
 
+/* For OS X 10.8 and earlier */
+char *_httpAssembleUUID(const char *server, int port, const char *name,
+                       int number, char *buffer, size_t bufsize)
+{
+  return (httpAssembleUUID(server, port, name, number, buffer, bufsize));
+}
+
 
 /*
  * 'httpDecode64()' - Base64-decode a string.
@@ -2064,6 +2076,8 @@ http_resolve_cb(
                        error));
 #endif /* DEBUG */
       }
+
+      httpAddrFreeList(addrlist);
     }
   }
 
@@ -2279,6 +2293,8 @@ http_resolve_cb(
                        error));
 #endif /* DEBUG */
       }
+
+      httpAddrFreeList(addrlist);
     }
   }
 
index 12e7338ad8263b20d9d3043a3a5b9d1a044431cd..35b2799dd26d6a633e7d846c40329a22f032968f 100644 (file)
  *   _httpFreeCredentials()      - Free internal credentials.
  *   httpFreeCredentials()       - Free an array of credentials.
  *   httpGet()                   - Send a GET request to the server.
- *   httpGetContentEncoding()     - Get a common content encoding, if any,
- *                                  between the client and server.
+ *   httpGetContentEncoding()    - Get a common content encoding, if any,
+ *                                 between the client and server.
  *   httpGetAuthString()         - Get the current authorization string.
  *   httpGetBlocking()           - Get the blocking/non-block state of a
  *                                 connection.
  *   httpGetCookie()             - Get any cookie data from the response.
- *   httpGetExpect()              - Get the value of the Expect header, if any.
+ *   httpGetExpect()             - Get the value of the Expect header, if any.
  *   httpGetFd()                 - Get the file descriptor associated with a
  *                                 connection.
  *   httpGetField()              - Get a field value from a request/response.
@@ -89,6 +89,7 @@
  *   httpSetCredentials()        - Set the credentials associated with an
  *                                 encrypted connection.
  *   httpSetCookie()             - Set the cookie value(s).
+ *   httpSetDefaultField()       - Set the default value of an HTTP header.
  *   httpSetExpect()             - Set the Expect: header in a request.
  *   httpSetField()              - Set the value of an HTTP header.
  *   httpSetLength()             - Set the content-length and
  *   http_content_coding_start()  - Start doing content encoding.
  *   http_debug_hex()            - Do a hex dump of a buffer.
  *   http_field()                - Return the field index for a field name.
+ *   http_read()                 - Read a buffer from a HTTP connection.
+ *   http_read_buffered()        - Do a buffered read from a HTTP connection.
+ *   http_read_chunk()           - Read a chunk from a HTTP connection.
  *   http_read_ssl()             - Read from a SSL/TLS connection.
  *   http_send()                 - Send a request with all fields and the
  *                                 trailing blank line.
  *   http_set_credentials()      - Set the SSL/TLS credentials.
- *   http_set_length()            - Set the data_encoding and data_remaining
- *                                  values.
+ *   http_set_length()           - Set the data_encoding and data_remaining
+ *                                 values.
  *   http_set_timeout()          - Set the socket timeout values.
  *   http_set_wait()             - Set the default wait value for reads.
  *   http_setup_ssl()            - Set up SSL/TLS support on a connection.
@@ -168,12 +172,15 @@ static void               http_debug_hex(const char *prefix, const char *buffer,
                                       int bytes);
 #endif /* DEBUG */
 static http_field_t    http_field(const char *name);
+static ssize_t         http_read(http_t *http, char *buffer, size_t length);
+static ssize_t         http_read_buffered(http_t *http, char *buffer, size_t length);
+static ssize_t         http_read_chunk(http_t *http, char *buffer, size_t length);
 static int             http_send(http_t *http, http_state_t request,
                                  const char *uri);
-static int             http_write(http_t *http, const char *buffer,
-                                  int length);
-static int             http_write_chunk(http_t *http, const char *buffer,
-                                        int length);
+static ssize_t         http_write(http_t *http, const char *buffer,
+                                  size_t length);
+static ssize_t         http_write_chunk(http_t *http, const char *buffer,
+                                        size_t length);
 #ifdef HAVE_SSL
 static int             http_read_ssl(http_t *http, char *buf, int len);
 #  ifdef HAVE_CDSASSL
@@ -1449,7 +1456,7 @@ httpGets(char   *line,                    /* I - Line to read into */
 
   DEBUG_printf(("2httpGets(line=%p, length=%d, http=%p)", line, length, http));
 
-  if (http == NULL || line == NULL)
+  if (!http || !line || length <= 1)
     return (NULL);
 
  /*
@@ -1493,20 +1500,10 @@ httpGets(char   *line,                  /* I - Line to read into */
         return (NULL);
       }
 
-#ifdef HAVE_SSL
-      if (http->tls)
-       bytes = http_read_ssl(http, http->buffer + http->used,
-                             HTTP_MAX_BUFFER - http->used);
-      else
-#endif /* HAVE_SSL */
-        bytes = recv(http->fd, http->buffer + http->used,
-                    HTTP_MAX_BUFFER - http->used, 0);
+      bytes = http_read(http, http->buffer + http->used,
+                        HTTP_MAX_BUFFER - http->used);
 
-      DEBUG_printf(("4httpGets: read %d bytes...", bytes));
-
-#ifdef DEBUG
-      http_debug_hex("httpGets", http->buffer + http->used, bytes);
-#endif /* DEBUG */
+      DEBUG_printf(("4httpGets: read %d bytes.", bytes));
 
       if (bytes < 0)
       {
@@ -1918,8 +1915,8 @@ httpOptions(http_t     *http,             /* I - Connection to server */
 
 ssize_t                                        /* O - Number of bytes copied */
 httpPeek(http_t *http,                 /* I - Connection to server */
-          char   *buffer,              /* I - Buffer for data */
-         size_t length)                /* I - Maximum number of bytes */
+         char   *buffer,               /* I - Buffer for data */
+        size_t length)                 /* I - Maximum number of bytes */
 {
   ssize_t      bytes;                  /* Bytes read */
   char         len[32];                /* Length string */
@@ -1959,21 +1956,21 @@ httpPeek(http_t *http,                  /* I - Connection to server */
   DEBUG_printf(("2httpPeek: data_remaining=" CUPS_LLFMT,
                 CUPS_LLCAST http->data_remaining));
 
-  if (http->data_remaining <= 0)
+  if (http->data_remaining <= 0 && http->data_encoding != HTTP_ENCODING_FIELDS)
   {
    /*
     * A zero-length chunk ends a transfer; unless we are reading POST
     * data, go idle...
     */
 
-    if (http->data_encoding == HTTP_ENCODING_CHUNKED)
-      httpGets(len, sizeof(len), http);
-
 #ifdef HAVE_LIBZ
     if (http->coding)
       http_content_coding_finish(http);
 #endif /* HAVE_LIBZ */
 
+    if (http->data_encoding == HTTP_ENCODING_CHUNKED)
+      httpGets(len, sizeof(len), http);
+
     if (http->state == HTTP_STATE_POST_RECV)
       http->state ++;
     else
@@ -1990,12 +1987,15 @@ httpPeek(http_t *http,                  /* I - Connection to server */
 
     return (0);
   }
-  else if ((http->data_encoding == HTTP_ENCODING_LENGTH ||
-            http->coding == _HTTP_CODING_IDENTITY) &&
-           length > (size_t)http->data_remaining)
+  else if (length > (size_t)http->data_remaining)
     length = (size_t)http->data_remaining;
 
+#ifdef HAVE_LIBZ
+  if (http->used == 0 &&
+      (http->coding == _HTTP_CODING_IDENTITY || http->stream.avail_in == 0))
+#else
   if (http->used == 0)
+#endif /* HAVE_LIBZ */
   {
    /*
     * Buffer small reads for better performance...
@@ -2084,16 +2084,39 @@ httpPeek(http_t *http,                  /* I - Connection to server */
   if (http->coding)
   {
     int                zerr;                   /* Decompressor error */
-    off_t      comp_avail;             /* Maximum bytes for decompression */
     z_stream   stream;                 /* Copy of decompressor stream */
 
-    if (http->used > http->data_remaining)
-      comp_avail = http->data_remaining;
-    else
-      comp_avail = http->used;
+    if (http->used > 0 && http->stream.avail_in < HTTP_MAX_BUFFER)
+    {
+      size_t buflen = buflen = HTTP_MAX_BUFFER - http->stream.avail_in;
+                                       /* Number of bytes to copy */
+
+      if (http->stream.avail_in > 0 &&
+         http->stream.next_in > http->dbuffer)
+        memmove(http->dbuffer, http->stream.next_in, http->stream.avail_in);
+
+      http->stream.next_in = http->dbuffer;
+
+      if (buflen > http->data_remaining)
+        buflen = http->data_remaining;
+
+      if (buflen > http->used)
+        buflen = http->used;
+
+      DEBUG_printf(("1httpPeek: Copying %d more bytes of data into "
+                   "decompression buffer.", (int)buflen));
+
+      memcpy(http->dbuffer + http->stream.avail_in, http->buffer, buflen);
+      http->stream.avail_in += buflen;
+      http->used            -= buflen;
+      http->data_remaining  -= buflen;
+
+      if (http->used > 0)
+        memmove(http->buffer, http->buffer + buflen, http->used);
+    }
 
     DEBUG_printf(("2httpPeek: length=%d, avail_in=%d", (int)length,
-                  (int)comp_avail));
+                  (int)http->stream.avail_in));
 
     if (inflateCopy(&stream, &(http->stream)) != Z_OK)
     {
@@ -2102,8 +2125,6 @@ httpPeek(http_t *http,                    /* I - Connection to server */
       return (-1);
     }
 
-    stream.next_in   = (Bytef *)http->buffer;
-    stream.avail_in  = comp_avail;
     stream.next_out  = (Bytef *)buffer;
     stream.avail_out = length;
 
@@ -2113,6 +2134,11 @@ httpPeek(http_t *http,                   /* I - Connection to server */
     if (zerr < Z_OK)
     {
       DEBUG_printf(("2httpPeek: zerr=%d", zerr));
+#ifdef DEBUG
+      http_debug_hex("2httpPeek", (char *)http->dbuffer,
+                    http->stream.avail_in);
+#endif /* DEBUG */
+
       http->error = EIO;
       return (-1);
     }
@@ -2264,12 +2290,12 @@ httpRead2(http_t *http,                 /* I - Connection to server */
          size_t length)                /* I - Maximum number of bytes */
 {
   ssize_t      bytes;                  /* Bytes read */
-  char         len[32];                /* Length string */
 
 
   DEBUG_printf(("httpRead2(http=%p, buffer=%p, length=" CUPS_LLFMT
-                ") coding=%d", http, buffer, CUPS_LLCAST length,
-                http->coding));
+                ") coding=%d data_encoding=%d data_remaining=" CUPS_LLFMT,
+                http, buffer, CUPS_LLCAST length, http->coding,
+                http->data_encoding, CUPS_LLCAST http->data_remaining));
 
   if (http == NULL || buffer == NULL)
     return (-1);
@@ -2280,371 +2306,135 @@ httpRead2(http_t *http,                       /* I - Connection to server */
   if (length <= 0)
     return (0);
 
-  if (http->data_encoding == HTTP_ENCODING_CHUNKED &&
-      http->data_remaining <= 0)
-  {
-    if (!httpGets(len, sizeof(len), http))
-    {
-      DEBUG_puts("1httpRead2: Could not get chunk length.");
-      return (0);
-    }
-
-    if (!len[0])
-    {
-      DEBUG_puts("1httpRead2: Blank chunk length, trying again...");
-      if (!httpGets(len, sizeof(len), http))
-      {
-       DEBUG_puts("1httpRead2: Could not get chunk length.");
-       return (0);
-      }
-    }
-
-    http->data_remaining = strtoll(len, NULL, 16);
-
-    if (http->data_remaining < 0)
-    {
-      DEBUG_printf(("1httpRead2: Negative chunk length \"%s\" (" CUPS_LLFMT ")",
-                    len, CUPS_LLCAST http->data_remaining));
-      return (0);
-    }
-
-    DEBUG_printf(("2httpRead2: Got chunk length \"%s\" (" CUPS_LLFMT ")", len,
-                  CUPS_LLCAST http->data_remaining));
-  }
-
-  DEBUG_printf(("2httpRead2: data_remaining=" CUPS_LLFMT ", used=%d",
-                CUPS_LLCAST http->data_remaining, http->used));
-
-  if (http->data_remaining <= 0 && http->data_encoding != HTTP_ENCODING_FIELDS)
-  {
-   /*
-    * A zero-length chunk ends a transfer; unless we are reading POST
-    * data, go idle...
-    */
-
 #ifdef HAVE_LIBZ
-    if (http->coding)
-      http_content_coding_finish(http);
-#endif /* HAVE_LIBZ */
-
-    if (http->data_encoding == HTTP_ENCODING_CHUNKED)
-      httpGets(len, sizeof(len), http);
-
-    if (http->state == HTTP_STATE_POST_RECV)
-      http->state ++;
-    else
-      http->state = HTTP_STATE_WAITING;
-
-    DEBUG_printf(("1httpRead2: 0-length chunk, set state to %s.",
-                  http_states[http->state + 1]));
-
-   /*
-    * Prevent future reads for this request...
-    */
-
-    http->data_encoding = HTTP_ENCODING_FIELDS;
-
-    return (0);
-  }
-  else if ((http->data_encoding == HTTP_ENCODING_LENGTH ||
-            http->coding == _HTTP_CODING_IDENTITY) &&
-           length > (size_t)http->data_remaining)
-    length = (size_t)http->data_remaining;
-
-#ifdef HAVE_LIBZ
-  if (http->used == 0 && (length <= 256 || http->coding))
-#else
-  if (http->used == 0 && length <= 256)
-#endif /* HAVE_LIBZ */
+  if (http->coding)
   {
-   /*
-    * Buffer small/compressed reads for better performance...
-    */
-
-    ssize_t    buflen;                 /* Length of read for buffer */
-
-    if (!http->blocking)
+    do
     {
-      while (!httpWait(http, http->wait_value))
+      if (http->stream.avail_in > 0)
       {
-       if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
-         continue;
+       int     zerr;                   /* Decompressor error */
 
-       return (0);
-      }
-    }
+       DEBUG_printf(("2httpRead2: avail_in=%d, avail_out=%d",
+                     (int)http->stream.avail_in, (int)length));
 
-    if (http->data_remaining > sizeof(http->buffer))
-      buflen = sizeof(http->buffer);
-    else
-      buflen = http->data_remaining;
-
-    DEBUG_printf(("2httpRead2: Reading %d bytes into buffer.", (int)buflen));
+       http->stream.next_out  = (Bytef *)buffer;
+       http->stream.avail_out = length;
 
-    do
-    {
-#ifdef HAVE_SSL
-      if (http->tls)
-       bytes = http_read_ssl(http, http->buffer, buflen);
-      else
-#endif /* HAVE_SSL */
-      bytes = recv(http->fd, http->buffer, buflen, 0);
-
-      if (bytes < 0)
-      {
-#ifdef WIN32
-       if (WSAGetLastError() != WSAEINTR)
-       {
-         http->error = WSAGetLastError();
-         return (-1);
-       }
-       else if (WSAGetLastError() == WSAEWOULDBLOCK)
+       if ((zerr = inflate(&(http->stream), Z_SYNC_FLUSH)) < Z_OK)
        {
-         if (!http->timeout_cb ||
-             !(*http->timeout_cb)(http, http->timeout_data))
-         {
-           http->error = WSAEWOULDBLOCK;
-           return (-1);
-         }
-       }
-#else
-       if (errno == EWOULDBLOCK || errno == EAGAIN)
-       {
-         if (http->timeout_cb && !(*http->timeout_cb)(http, http->timeout_data))
-         {
-           http->error = errno;
-           return (-1);
-         }
-         else if (!http->timeout_cb && errno != EAGAIN)
-         {
-           http->error = errno;
-           return (-1);
-         }
-       }
-       else if (errno != EINTR)
-       {
-         http->error = errno;
-         return (-1);
-       }
-#endif /* WIN32 */
-      }
-    }
-    while (bytes < 0);
-
-    DEBUG_printf(("2httpRead2: Read " CUPS_LLFMT " bytes into buffer.",
-                  CUPS_LLCAST bytes));
+         DEBUG_printf(("2httpRead2: zerr=%d", zerr));
 #ifdef DEBUG
-    http_debug_hex("httpRead2", http->buffer, (int)bytes);
+          http_debug_hex("2httpRead2", (char *)http->dbuffer,
+                         http->stream.avail_in);
 #endif /* DEBUG */
 
-    http->used = bytes;
-  }
-
-#ifdef HAVE_LIBZ
-  if (http->coding)
-  {
-    int                zerr;                   /* Decompressor error */
-    off_t      comp_avail,             /* Maximum bytes for decompression */
-               comp_bytes;             /* Compressed bytes "used" */
-
-    if (http->used > http->data_remaining)
-      comp_avail = http->data_remaining;
-    else
-      comp_avail = http->used;
-
-    DEBUG_printf(("2httpRead2: length=%d, avail_in=%d", (int)length,
-                  (int)comp_avail));
+         http->error = EIO;
+         return (-1);
+       }
 
-    http->stream.next_in   = (Bytef *)http->buffer;
-    http->stream.avail_in  = comp_avail;
-    http->stream.next_out  = (Bytef *)buffer;
-    http->stream.avail_out = length;
+       bytes = length - http->stream.avail_out;
 
-    if ((zerr = inflate(&(http->stream), Z_SYNC_FLUSH)) < Z_OK)
-    {
-      DEBUG_printf(("2httpRead2: zerr=%d", zerr));
-      http->error = EIO;
-      return (-1);
-    }
-
-    bytes      = length - http->stream.avail_out;
-    comp_bytes = comp_avail - http->stream.avail_in;
+       DEBUG_printf(("2httpRead2: avail_in=%d, avail_out=%d, bytes=%d",
+                     http->stream.avail_in, http->stream.avail_out,
+                     (int)bytes));
+      }
+      else
+        bytes = 0;
 
-    DEBUG_printf(("2httpRead2: avail_in=%d, avail_out=%d, bytes=%d, "
-                  "comp_bytes=%d", http->stream.avail_in,
-                  http->stream.avail_out, (int)bytes, (int)comp_bytes));
+      if (bytes == 0)
+      {
+        ssize_t buflen = HTTP_MAX_BUFFER - http->stream.avail_in;
+                                       /* Additional bytes for buffer */
 
-    if ((http->used - comp_bytes) > 0)
-    {
-      http->used -= comp_bytes;
-      memmove(http->buffer, http->stream.next_in, http->used);
+        if (buflen > 0)
+        {
+          if (http->stream.avail_in > 0 &&
+              http->stream.next_in > http->dbuffer)
+            memmove(http->dbuffer, http->stream.next_in, http->stream.avail_in);
+
+         http->stream.next_in = http->dbuffer;
+
+          DEBUG_printf(("1httpRead2: Reading up to %d more bytes of data into "
+                        "decompression buffer.", (int)buflen));
+
+          if (http->data_remaining > 0)
+          {
+           if (buflen > http->data_remaining)
+             buflen = http->data_remaining;
+
+           bytes = http_read_buffered(http,
+                                      (char *)http->dbuffer +
+                                              http->stream.avail_in, buflen);
+          }
+          else if (http->data_encoding == HTTP_ENCODING_CHUNKED)
+            bytes = http_read_chunk(http,
+                                   (char *)http->dbuffer +
+                                       http->stream.avail_in, buflen);
+          else
+            bytes = 0;
+
+          if (bytes < 0)
+            return (bytes);
+          else if (bytes == 0)
+            break;
+
+          http->data_remaining  -= bytes;
+          http->stream.avail_in += bytes;
+        }
+        else
+          return (0);
+      }
     }
-    else
-      http->used = 0;
-
-   /*
-    * Adjust remaining bytes since chunk/content lengths are compressed while
-    * CUPS HTTP APIs return uncompressed sizes...
-    */
-
-    http->data_remaining += bytes - comp_bytes;
+    while (bytes == 0);
   }
   else
 #endif /* HAVE_LIBZ */
-  if (http->used > 0)
+  if (http->data_remaining == 0 && http->data_encoding == HTTP_ENCODING_CHUNKED)
   {
-    if (length > (size_t)http->used)
-      length = (size_t)http->used;
-
-    bytes = (ssize_t)length;
-
-    DEBUG_printf(("2httpRead2: grabbing %d bytes from input buffer...",
-                  (int)bytes));
-
-    memcpy(buffer, http->buffer, length);
-    http->used -= (int)length;
-
-    if (http->used > 0)
-      memmove(http->buffer, http->buffer + length, http->used);
+    if ((bytes = http_read_chunk(http, buffer, length)) > 0)
+      http->data_remaining -= bytes;
   }
-#ifdef HAVE_SSL
-  else if (http->tls)
+  else if (http->data_remaining <= 0)
   {
-    if (!http->blocking)
-    {
-      while (!httpWait(http, http->wait_value))
-      {
-       if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
-         continue;
-
-       return (0);
-      }
-    }
+   /*
+    * No more data to read...
+    */
 
-    while ((bytes = (ssize_t)http_read_ssl(http, buffer, (int)length)) < 0)
-    {
-#ifdef WIN32
-      if (WSAGetLastError() == WSAEWOULDBLOCK)
-      {
-        if (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data))
-         break;
-      }
-      else if (WSAGetLastError() != WSAEINTR)
-        break;
-#else
-      if (errno == EWOULDBLOCK || errno == EAGAIN)
-      {
-        if (http->timeout_cb && !(*http->timeout_cb)(http, http->timeout_data))
-         break;
-        else if (!http->timeout_cb && errno != EAGAIN)
-         break;
-      }
-      else if (errno != EINTR)
-        break;
-#endif /* WIN32 */
-    }
+    return (0);
   }
-#endif /* HAVE_SSL */
   else
   {
-    if (!http->blocking)
-    {
-      while (!httpWait(http, http->wait_value))
-      {
-       if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
-         continue;
-
-       return (0);
-      }
-    }
-
-    DEBUG_printf(("2httpRead2: reading " CUPS_LLFMT " bytes from socket...",
-                  CUPS_LLCAST length));
-
-#ifdef WIN32
-    while ((bytes = (ssize_t)recv(http->fd, buffer, (int)length, 0)) < 0)
-    {
-      if (WSAGetLastError() == WSAEWOULDBLOCK)
-      {
-        if (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data))
-         break;
-      }
-      else if (WSAGetLastError() != WSAEINTR)
-        break;
-    }
-#else
-    while ((bytes = recv(http->fd, buffer, length, 0)) < 0)
-    {
-      if (errno == EWOULDBLOCK || errno == EAGAIN)
-      {
-        if (http->timeout_cb && !(*http->timeout_cb)(http, http->timeout_data))
-         break;
-        else if (!http->timeout_cb && errno != EAGAIN)
-         break;
-      }
-      else if (errno != EINTR)
-        break;
-    }
-#endif /* WIN32 */
-
-    DEBUG_printf(("2httpRead2: read " CUPS_LLFMT " bytes from socket...",
-                  CUPS_LLCAST bytes));
-#ifdef DEBUG
-    http_debug_hex("httpRead2", buffer, (int)bytes);
-#endif /* DEBUG */
-  }
+    DEBUG_printf(("1httpRead2: Reading up to %d bytes into buffer.",
+                  (int)length));
 
-  if (bytes > 0)
-  {
-    http->data_remaining -= bytes;
+    if (length > http->data_remaining)
+      length = http->data_remaining;
 
-    if (http->data_remaining <= INT_MAX)
-      http->_data_remaining = (int)http->data_remaining;
-    else
-      http->_data_remaining = INT_MAX;
-  }
-  else if (bytes < 0)
-  {
-#ifdef WIN32
-    if (WSAGetLastError() == WSAEINTR)
-      bytes = 0;
-    else
-      http->error = WSAGetLastError();
-#else
-    if (errno == EINTR || (errno == EAGAIN && !http->timeout_cb))
-      bytes = 0;
-    else
-      http->error = errno;
-#endif /* WIN32 */
-  }
-  else
-  {
-    http->error = EPIPE;
-    return (0);
+    if ((bytes = http_read_buffered(http, buffer, length)) > 0)
+      http->data_remaining -= bytes;
   }
 
-  if (http->data_remaining <= 0)
+  if (
+#ifdef HAVE_LIBZ
+      (http->coding == _HTTP_CODING_IDENTITY || http->stream.avail_in == 0) &&
+#endif /* HAVE_LIBZ */
+      ((http->data_remaining <= 0 &&
+        http->data_encoding == HTTP_ENCODING_LENGTH) ||
+       (http->data_encoding == HTTP_ENCODING_CHUNKED && bytes == 0)))
   {
-    if (http->data_encoding == HTTP_ENCODING_CHUNKED)
-    {
-      DEBUG_puts("1httpRead2: Reading trailing line for chunk.");
-      httpGets(len, sizeof(len), http);
-    }
-    else
-    {
 #ifdef HAVE_LIBZ
-      if (http->coding)
-       http_content_coding_finish(http);
+    if (http->coding)
+      http_content_coding_finish(http);
 #endif /* HAVE_LIBZ */
 
-      if (http->state == HTTP_STATE_POST_RECV)
-        http->state ++;
-      else
-        http->state = HTTP_STATE_WAITING;
+    if (http->state == HTTP_STATE_POST_RECV)
+      http->state ++;
+    else
+      http->state = HTTP_STATE_WAITING;
 
-      DEBUG_printf(("1httpRead2: End of content, set state to %s.",
-                    http_states[http->state + 1]));
-    }
+    DEBUG_printf(("1httpRead2: End of content, set state to %s.",
+                 http_states[http->state + 1]));
   }
 
   return (bytes);
@@ -3809,6 +3599,14 @@ httpWait(http_t *http,                   /* I - Connection to server */
     return (1);
   }
 
+#ifdef HAVE_LIBZ
+  if (http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in > 0)
+  {
+    DEBUG_puts("3httpWait: Returning 1 since there is buffered data ready.");
+    return (1);
+  }
+#endif /* HAVE_LIBZ */
+
  /*
   * Flush pending data, if any...
   */
@@ -4475,6 +4273,8 @@ http_content_coding_finish(
     case _HTTP_CODING_INFLATE :
     case _HTTP_CODING_GUNZIP :
         inflateEnd(&(http->stream));
+        free(http->dbuffer);
+        http->dbuffer = NULL;
         break;
 
     default :
@@ -4563,12 +4363,26 @@ http_content_coding_start(
 
     case _HTTP_CODING_INFLATE :
     case _HTTP_CODING_GUNZIP :
-        if ((zerr = inflateInit2(&(http->stream), 32 + 15)) < Z_OK)
+        if ((http->dbuffer = malloc(HTTP_MAX_BUFFER)) == NULL)
         {
           http->status = HTTP_ERROR;
-          http->error  = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
+          http->error  = errno;
           return;
         }
+
+        if ((zerr = inflateInit2(&(http->stream),
+                                 coding == _HTTP_CODING_INFLATE ? 15 : 31))
+               < Z_OK)
+        {
+          free(http->dbuffer);
+          http->dbuffer = NULL;
+          http->status  = HTTP_ERROR;
+          http->error   = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
+          return;
+        }
+
+        http->stream.avail_in = 0;
+        http->stream.next_in  = http->dbuffer;
         break;
 
     default :
@@ -4658,6 +4472,231 @@ http_field(const char *name)            /* I - String name */
 }
 
 
+/*
+ * 'http_read()' - Read a buffer from a HTTP connection.
+ *
+ * This function does the low-level read from the socket, retrying and timing
+ * out as needed.
+ */
+
+static ssize_t                         /* O - Number of bytes read or -1 on error */
+http_read(http_t *http,                        /* I - Connection to server */
+          char   *buffer,              /* I - Buffer */
+          size_t length)               /* I - Maximum bytes to read */
+{
+  ssize_t      bytes;                  /* Bytes read */
+
+
+  DEBUG_printf(("http_read(http=%p, buffer=%p, length=" CUPS_LLFMT ")", http,
+                buffer, CUPS_LLCAST length));
+
+  if (!http->blocking)
+  {
+    while (!httpWait(http, http->wait_value))
+    {
+      if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
+       continue;
+
+      DEBUG_puts("2http_read: Timeout.");
+      return (0);
+    }
+  }
+
+  DEBUG_printf(("2http_read: Reading %d bytes into buffer.", (int)length));
+
+  do
+  {
+#ifdef HAVE_SSL
+    if (http->tls)
+      bytes = http_read_ssl(http, buffer, length);
+    else
+#endif /* HAVE_SSL */
+    bytes = recv(http->fd, buffer, length, 0);
+
+    if (bytes < 0)
+    {
+#ifdef WIN32
+      if (WSAGetLastError() != WSAEINTR)
+      {
+       http->error = WSAGetLastError();
+       return (-1);
+      }
+      else if (WSAGetLastError() == WSAEWOULDBLOCK)
+      {
+       if (!http->timeout_cb ||
+           !(*http->timeout_cb)(http, http->timeout_data))
+       {
+         http->error = WSAEWOULDBLOCK;
+         return (-1);
+       }
+      }
+#else
+      DEBUG_printf(("2http_read: %s", strerror(errno)));
+
+      if (errno == EWOULDBLOCK || errno == EAGAIN)
+      {
+       if (http->timeout_cb && !(*http->timeout_cb)(http, http->timeout_data))
+       {
+         http->error = errno;
+         return (-1);
+       }
+       else if (!http->timeout_cb && errno != EAGAIN)
+       {
+         http->error = errno;
+         return (-1);
+       }
+      }
+      else if (errno != EINTR)
+      {
+       http->error = errno;
+       return (-1);
+      }
+#endif /* WIN32 */
+    }
+  }
+  while (bytes < 0);
+
+  DEBUG_printf(("2http_read: Read " CUPS_LLFMT " bytes into buffer.",
+               CUPS_LLCAST bytes));
+#ifdef DEBUG
+  if (bytes > 0)
+    http_debug_hex("http_read", http->buffer, (int)bytes);
+#endif /* DEBUG */
+
+  if (bytes < 0)
+  {
+#ifdef WIN32
+    if (WSAGetLastError() == WSAEINTR)
+      bytes = 0;
+    else
+      http->error = WSAGetLastError();
+#else
+    if (errno == EINTR || (errno == EAGAIN && !http->timeout_cb))
+      bytes = 0;
+    else
+      http->error = errno;
+#endif /* WIN32 */
+  }
+  else if (bytes == 0)
+  {
+    http->error = EPIPE;
+    return (0);
+  }
+
+  return (bytes);
+}
+
+
+/*
+ * 'http_read_buffered()' - Do a buffered read from a HTTP connection.
+ *
+ * This function reads data from the HTTP buffer or from the socket, as needed.
+ */
+
+static ssize_t                         /* O - Number of bytes read or -1 on error */
+http_read_buffered(http_t *http,       /* I - Connection to server */
+                   char   *buffer,     /* I - Buffer */
+                   size_t length)      /* I - Maximum bytes to read */
+{
+  ssize_t      bytes;                  /* Bytes read */
+
+
+  DEBUG_printf(("http_read_buffered(http=%p, buffer=%p, length=" CUPS_LLFMT
+                ") used=%d",
+                http, buffer, CUPS_LLCAST length, http->used));
+
+  if (http->used > 0)
+  {
+    if (length > (size_t)http->used)
+      bytes = (size_t)http->used;
+    else
+      bytes = length;
+
+    DEBUG_printf(("2http_read: Grabbing %d bytes from input buffer.",
+                  (int)bytes));
+
+    memcpy(buffer, http->buffer, bytes);
+    http->used -= (int)bytes;
+
+    if (http->used > 0)
+      memmove(http->buffer, http->buffer + bytes, http->used);
+  }
+  else
+    bytes = http_read(http, buffer, length);
+
+  return (bytes);
+}
+
+
+/*
+ * 'http_read_chunk()' - Read a chunk from a HTTP connection.
+ *
+ * This function reads and validates the chunk length, then does a buffered read
+ * returning the number of bytes placed in the buffer.
+ */
+
+static ssize_t                         /* O - Number of bytes read or -1 on error */
+http_read_chunk(http_t *http,          /* I - Connection to server */
+               char   *buffer,         /* I - Buffer */
+               size_t length)          /* I - Maximum bytes to read */
+{
+  DEBUG_printf(("http_read_chunk(http=%p, buffer=%p, length=" CUPS_LLFMT ")",
+                http, buffer, CUPS_LLCAST length));
+
+  if (http->data_remaining <= 0)
+  {
+    char       len[32];                /* Length string */
+
+    if (!httpGets(len, sizeof(len), http))
+    {
+      DEBUG_puts("1http_read_chunk: Could not get chunk length.");
+      return (0);
+    }
+
+    if (!len[0])
+    {
+      DEBUG_puts("1http_read_chunk: Blank chunk length, trying again...");
+      if (!httpGets(len, sizeof(len), http))
+      {
+       DEBUG_puts("1http_read_chunk: Could not get chunk length.");
+       return (0);
+      }
+    }
+
+    http->data_remaining = strtoll(len, NULL, 16);
+
+    if (http->data_remaining < 0)
+    {
+      DEBUG_printf(("1http_read_chunk: Negative chunk length \"%s\" ("
+                    CUPS_LLFMT ")", len, CUPS_LLCAST http->data_remaining));
+      return (0);
+    }
+
+    DEBUG_printf(("2http_read_chunk: Got chunk length \"%s\" (" CUPS_LLFMT ")",
+                  len, CUPS_LLCAST http->data_remaining));
+
+    if (http->data_remaining == 0)
+    {
+     /*
+      * 0-length chunk, grab trailing blank line...
+      */
+
+      httpGets(len, sizeof(len), http);
+    }
+  }
+
+  DEBUG_printf(("2http_read_chunk: data_remaining=" CUPS_LLFMT,
+                CUPS_LLCAST http->data_remaining));
+
+  if (http->data_remaining <= 0)
+    return (0);
+  else if (length > (size_t)http->data_remaining)
+    length = (size_t)http->data_remaining;
+
+  return (http_read_buffered(http, buffer, length));
+}
+
+
 #ifdef HAVE_SSL
 /*
  * 'http_read_ssl()' - Read from a SSL/TLS connection.
@@ -5124,8 +5163,6 @@ http_set_wait(http_t *http)               /* I - Connection to server */
 static int                             /* O - 0 on success, -1 on failure */
 http_setup_ssl(http_t *http)           /* I - Connection to server */
 {
-  _cups_globals_t      *cg = _cupsGlobals();
-                                       /* Pointer to library globals */
   char                 hostname[256],  /* Hostname */
                        *hostptr;       /* Pointer into hostname */
 
@@ -5138,6 +5175,8 @@ http_setup_ssl(http_t *http)              /* I - Connection to server */
   gnutls_certificate_client_credentials *credentials;
                                        /* TLS credentials */
 #  elif defined(HAVE_CDSASSL)
+  _cups_globals_t      *cg = _cupsGlobals();
+                                       /* Pointer to library globals */
   OSStatus             error;          /* Error code */
   const char           *message = NULL;/* Error message */
   cups_array_t         *credentials;   /* Credentials array */
@@ -5667,17 +5706,17 @@ http_upgrade(http_t *http)              /* I - Connection to server */
  * 'http_write()' - Write a buffer to a HTTP connection.
  */
 
-static int                             /* O - Number of bytes written */
+static ssize_t                         /* O - Number of bytes written */
 http_write(http_t     *http,           /* I - Connection to server */
            const char *buffer,         /* I - Buffer for data */
-          int        length)           /* I - Number of bytes to write */
+          size_t     length)           /* I - Number of bytes to write */
 {
-  int  tbytes,                         /* Total bytes sent */
-       bytes;                          /* Bytes sent */
+  ssize_t      tbytes,                 /* Total bytes sent */
+               bytes;                  /* Bytes sent */
 
 
-  DEBUG_printf(("2http_write(http=%p, buffer=%p, length=%d)", http, buffer,
-                length));
+  DEBUG_printf(("2http_write(http=%p, buffer=%p, length=" CUPS_LLFMT ")", http,
+                buffer, CUPS_LLCAST length));
   http->error = 0;
   tbytes      = 0;
 
@@ -5749,8 +5788,8 @@ http_write(http_t     *http,              /* I - Connection to server */
 #endif /* HAVE_SSL */
     bytes = send(http->fd, buffer, length, 0);
 
-    DEBUG_printf(("3http_write: Write of %d bytes returned %d.", (int)length,
-                  (int)bytes));
+    DEBUG_printf(("3http_write: Write of " CUPS_LLFMT " bytes returned "
+                  CUPS_LLFMT ".", CUPS_LLCAST length, CUPS_LLCAST bytes));
 
     if (bytes < 0)
     {
@@ -5805,7 +5844,7 @@ http_write(http_t     *http,              /* I - Connection to server */
   http_debug_hex("http_write", buffer - tbytes, tbytes);
 #endif /* DEBUG */
 
-  DEBUG_printf(("3http_write: Returning %d.", tbytes));
+  DEBUG_printf(("3http_write: Returning " CUPS_LLFMT ".", CUPS_LLCAST tbytes));
 
   return (tbytes);
 }
@@ -5815,38 +5854,38 @@ http_write(http_t     *http,            /* I - Connection to server */
  * 'http_write_chunk()' - Write a chunked buffer.
  */
 
-static int                             /* O - Number bytes written */
+static ssize_t                         /* O - Number bytes written */
 http_write_chunk(http_t     *http,     /* I - Connection to server */
                  const char *buffer,   /* I - Buffer to write */
-                int        length)     /* I - Length of buffer */
+                size_t        length)  /* I - Length of buffer */
 {
-  char header[255];                    /* Chunk header */
-  int  bytes;                          /* Bytes written */
+  char         header[16];             /* Chunk header */
+  ssize_t      bytes;                  /* Bytes written */
 
 
-  DEBUG_printf(("7http_write_chunk(http=%p, buffer=%p, length=%d)",
-                http, buffer, length));
+  DEBUG_printf(("7http_write_chunk(http=%p, buffer=%p, length=" CUPS_LLFMT ")",
+                http, buffer, CUPS_LLCAST length));
 
  /*
   * Write the chunk header, data, and trailer.
   */
 
-  sprintf(header, "%x\r\n", length);
-  if (http_write(http, header, (int)strlen(header)) < 0)
+  snprintf(header, sizeof(header), "%x\r\n", (unsigned)length);
+  if (http_write(http, header, strlen(header)) < 0)
   {
-    DEBUG_puts("8http_write_chunk: http_write of length failed!");
+    DEBUG_puts("8http_write_chunk: http_write of length failed.");
     return (-1);
   }
 
   if ((bytes = http_write(http, buffer, length)) < 0)
   {
-    DEBUG_puts("8http_write_chunk: http_write of buffer failed!");
+    DEBUG_puts("8http_write_chunk: http_write of buffer failed.");
     return (-1);
   }
 
   if (http_write(http, "\r\n", 2) < 0)
   {
-    DEBUG_puts("8http_write_chunk: http_write of CR LF failed!");
+    DEBUG_puts("8http_write_chunk: http_write of CR LF failed.");
     return (-1);
   }
 
index de782aaa3c0b18e173cecb27b6b2290ca1e7a484..345bf27f98aabcaef75b55e2093ca5c29ecf2b5e 100644 (file)
@@ -591,6 +591,10 @@ extern http_addrlist_t     *httpAddrCopyList(http_addrlist_t *src) _CUPS_API_1_7;
 extern int             httpAddrListen(http_addr_t *addr, int port)
                                       _CUPS_API_1_7;
 extern int             httpAddrPort(http_addr_t *addr) _CUPS_API_1_7;
+extern char            *httpAssembleUUID(const char *server, int port,
+                                         const char *name, int number,
+                                         char *buffer, size_t bufsize)
+                                         _CUPS_API_1_7;
 extern http_t          *httpConnect2(const char *host, int port,
                                      http_addrlist_t *addrlist,
                                      int family, http_encryption_t encryption,
index dfe610352a32a87acc2d240c74280da6087fca90..28abbba005abe5678d5be8068d53dfd60b7d234c 100644 (file)
@@ -777,8 +777,8 @@ ippEnumString(const char *attrname, /* I - Attribute name */
 
   if (!strcmp(attrname, "document-state") &&
       enumvalue >= 3 &&
-      enumvalue <= (3 + (int)(sizeof(ipp_document_states) /
-                              sizeof(ipp_document_states[0]))))
+      enumvalue < (3 + (int)(sizeof(ipp_document_states) /
+                            sizeof(ipp_document_states[0]))))
     return (ipp_document_states[enumvalue - 3]);
   else if (!strcmp(attrname, "finishings") ||
           !strcmp(attrname, "finishings-actual") ||
@@ -787,8 +787,8 @@ ippEnumString(const char *attrname, /* I - Attribute name */
           !strcmp(attrname, "finishings-supported"))
   {
     if (enumvalue >= 3 &&
-        enumvalue <= (3 + (int)(sizeof(ipp_finishings) /
-                                sizeof(ipp_finishings[0]))))
+        enumvalue < (3 + (int)(sizeof(ipp_finishings) /
+                              sizeof(ipp_finishings[0]))))
       return (ipp_finishings[enumvalue - 3]);
     else if (enumvalue >= 0x40000000 &&
              enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) /
@@ -798,8 +798,8 @@ ippEnumString(const char *attrname, /* I - Attribute name */
   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]))))
+           enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) /
+                                 sizeof(ipp_job_collation_types[0]))))
     return (ipp_job_collation_types[enumvalue - 3]);
   else if (!strcmp(attrname, "job-state") &&
           enumvalue >= IPP_JOB_PENDING && enumvalue <= IPP_JOB_COMPLETED)
@@ -811,16 +811,16 @@ ippEnumString(const char *attrname,       /* I - Attribute name */
             !strcmp(attrname, "orientation-requested-default") ||
             !strcmp(attrname, "orientation-requested-supported")) &&
            enumvalue >= 3 &&
-           enumvalue <= (3 + (int)(sizeof(ipp_orientation_requesteds) /
-                                   sizeof(ipp_orientation_requesteds[0]))))
+           enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) /
+                                 sizeof(ipp_orientation_requesteds[0]))))
     return (ipp_orientation_requesteds[enumvalue - 3]);
   else if ((!strcmp(attrname, "print-quality") ||
             !strcmp(attrname, "print-quality-actual") ||
             !strcmp(attrname, "print-quality-default") ||
             !strcmp(attrname, "print-quality-supported")) &&
            enumvalue >= 3 &&
-           enumvalue <= (3 + (int)(sizeof(ipp_print_qualities) /
-                                   sizeof(ipp_print_qualities[0]))))
+           enumvalue < (3 + (int)(sizeof(ipp_print_qualities) /
+                                 sizeof(ipp_print_qualities[0]))))
     return (ipp_print_qualities[enumvalue - 3]);
   else if (!strcmp(attrname, "printer-state") &&
            enumvalue >= IPP_PRINTER_IDLE && enumvalue <= IPP_PRINTER_STOPPED)
index 76ee409d369d6ecedaefcd9be1ab542412131655..28b8961d7749a26f51455ea3619c2c12a1f73a5c 100644 (file)
@@ -3239,6 +3239,13 @@ ippReadIO(void       *src,               /* I - Data source */
              ipp->prev = ipp->current;
 
            attr = ipp->current = ipp_add_attr(ipp, NULL, ipp->curtag, IPP_TAG_ZERO, 1);
+           if (!attr)
+           {
+             _cupsSetHTTPError(HTTP_ERROR);
+             DEBUG_puts("1ippReadIO: unable to allocate attribute.");
+             _cupsBufferRelease((char *)buffer);
+             return (IPP_ERROR);
+           }
 
            DEBUG_printf(("2ippReadIO: membername, ipp->current=%p, ipp->prev=%p",
                          ipp->current, ipp->prev));
@@ -6364,6 +6371,7 @@ ipp_free_values(ipp_attribute_t *attr,    /* I - Attribute to free values from */
            _cupsStrFree(attr->values[0].string.language);
            attr->values[0].string.language = NULL;
          }
+         /* Fall through to other string values */
 
       case IPP_TAG_TEXT :
       case IPP_TAG_NAME :
index 01b8764ef967a819c00282066f9060b4130fc362..c1fbb5a040885edb4114c8984150b26c5ec06c5e 100644 (file)
@@ -1007,6 +1007,25 @@ _cupsConnect(void)
       httpClose(cg->http);
       cg->http = NULL;
     }
+    else
+    {
+     /*
+      * Same server, see if the connection is still established...
+      */
+
+      char ch;                         /* Connection check byte */
+
+      if (recv(cg->http->fd, &ch, 1, MSG_PEEK | MSG_DONTWAIT) < 0 &&
+          errno != EWOULDBLOCK)
+      {
+       /*
+        * Nope, close the connection...
+        */
+
+       httpClose(cg->http);
+       cg->http = NULL;
+      }
+    }
   }
 
  /*
index 808a10c2eb456a8b920e517069dea45262437e17..a9aab7246e441e8cafe9c64f162ba309537f914a 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   API versioning definitions for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Apple Inc. and are protected by Federal copyright
 
 /*
  * This header defines several constants - _CUPS_DEPRECATED,
- * _CUPS_API_1_1, _CUPS_API_1_1_19, _CUPS_API_1_1_20, _CUPS_API_1_1_21,
- * _CUPS_API_1_2, _CUPS_API_1_3, _CUPS_API_1_4, _CUPS_API_1_5, _CUPS_API_1_6,
- * and _CUPS_API_1_7 - which add compiler-specific attributes that flag
- * functions that are deprecated or added in particular releases.
+ * _CUPS_DEPRECATED_MSG, _CUPS_INTERNAL_MSG, _CUPS_API_1_1, _CUPS_API_1_1_19,
+ * _CUPS_API_1_1_20, _CUPS_API_1_1_21, _CUPS_API_1_2, _CUPS_API_1_3,
+ * _CUPS_API_1_4, _CUPS_API_1_5, _CUPS_API_1_6, and _CUPS_API_1_7 - which add
+ * compiler-specific attributes that flag functions that are deprecated, added
+ * in particular releases, or internal to CUPS.
  *
  * On OS X, the _CUPS_API_* constants are defined based on the values of
  * the MAC_OS_X_VERSION_MIN_ALLOWED and MAC_OS_X_VERSION_MAX_ALLOWED constants
 #  endif /* __APPLE__ && !_CUPS_SOURCE */
 
 /*
- * With GCC 3.0 and higher, we can mark old APIs "deprecated" so you get
- * a warning at compile-time.
+ * With GCC and Clang we can mark old APIs as "deprecated" or "unavailable" with
+ * messages so you get warnings/errors are compile-time...
  */
 
-#  if defined(__GNUC__) && __GNUC__ > 2
-#    ifndef __has_extension
-#      define __has_extension(x) 0
-#    endif /* !__has_extension */
-#    if __has_extension(attribute_unavailable_with_message) && defined(_CUPS_NO_DEPRECATED)
-#      define _CUPS_DEPRECATED __attribute__ ((unavailable))
-#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m)))
-#    elif !defined(_CUPS_SOURCE) || defined(_CUPS_NO_DEPRECATED)
-#      define _CUPS_DEPRECATED __attribute__ ((deprecated))
-#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m)))
-#    else
-#      define _CUPS_DEPRECATED
-#      define _CUPS_DEPRECATED_MSG(m)
-#    endif /* !_CUPS_SOURCE || _CUPS_NO_DEPRECATED */
-#  else
+#  ifdef __has_extension               /* Clang */
+#    define _CUPS_HAS_DEPRECATED
+#    if __has_extension(attribute_deprecated_with_message)
+#      define _CUPS_HAS_DEPRECATED_WITH_MESSAGE
+#    endif
+#    if __has_extension(attribute_unavailable_with_message)
+#      define _CUPS_HAS_UNAVAILABLE_WITH_MESSAGE
+#    endif
+#  elif defined(__GNUC__)              /* GCC and compatible */
+#    if __GNUC__ >= 3                  /* GCC 3.0 or higher */
+#      define _CUPS_HAS_DEPRECATED
+#    endif /* __GNUC__ >= 3 */
+#    if __GNUC__ >= 5                  /* GCC 5.x */
+#      define _CUPS_HAS_DEPRECATED_WITH_MESSAGE
+#    elif __GNUC__ == 4 && __GNUC_MINOR__ >= 5
+                                       /* GCC 4.5 or higher */
+#      define _CUPS_HAS_DEPRECATED_WITH_MESSAGE
+#    endif /* __GNUC__ >= 5 */
+#  endif /* __has_extension */
+
+#  if !defined(_CUPS_HAS_DEPRECATED) || (defined(_CUPS_SOURCE) && !defined(_CUPS_NO_DEPRECATED))
+    /*
+     * Don't mark functions deprecated if the compiler doesn't support it
+     * or we are building CUPS source that doesn't care.
+     */
 #    define _CUPS_DEPRECATED
 #    define _CUPS_DEPRECATED_MSG(m)
-#  endif /* __GNUC__ && __GNUC__ > 2 */
+#    define _CUPS_INTERNAL_MSG(m)
+#  elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE) && defined(_CUPS_NO_DEPRECATED)
+    /*
+     * Compiler supports the unsupported attribute, so use it when the code
+     * wants to exclude the use of deprecated API.
+     */
+#    define _CUPS_DEPRECATED __attribute__ ((unavailable))
+#    define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m)))
+#    define _CUPS_INTERNAL_MSG(m) __attribute__ ((unavailable(m)))
+#  else
+    /*
+     * Compiler supports the deprecated attribute, so use it.
+     */
+#    define _CUPS_DEPRECATED __attribute__ ((deprecated))
+#    ifdef _CUPS_HAS_DEPRECATED_WITH_MESSAGE
+#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m)))
+#    else
+#      define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated))
+#    endif /* _CUPS_HAS_DEPRECATED_WITH_MESSAGE */
+#    ifdef _CUPS_SOURCE
+#      define _CUPS_INTERNAL_MSG(m)
+#    elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE)
+#      define _CUPS_INTERNAL_MSG(m) __attribute__ ((unavailable(m)))
+#    elif defined(_CUPS_HAS_DEPRECATED_WITH_MESSAGE)
+#      define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated(m)))
+#    else
+#      define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated))
+#    endif /* _CUPS_SOURCE */
+#  endif /* !_CUPS_HAS_DEPRECATED || (_CUPS_SOURCE && !_CUPS_NO_DEPRECATED) */
 
 #  ifndef __GNUC__
 #    define __attribute__(x)
index ae01094853b93ae43d291ad3524c50761b8c3130..be7fe3d6a7f2b20e309e5586a4c5385d8f09e420 100644 (file)
@@ -116,7 +116,6 @@ HELPFILES   =       \
                        help/security.html \
                        help/sharing.html \
                        help/spec-banner.html \
-                       help/spec-browsing.html \
                        help/spec-cmp.html \
                        help/spec-command.html \
                        help/spec-design.html \
index 3cd2c33fce0b4335665b28d178bc855e89059fbc..77542d3bab7d60d0c88beac60b2b7e72a5378e36 100644 (file)
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
 </TD></TR>
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS i el seu logotip són marques registrades de
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS té copyright 2007-2012 d'Apple
+<A HREF="http://www.apple.com">Apple Inc.</A> CUPS té copyright 2007-2013 d'Apple
 Inc. Tots els drets reservats.</TD></TR>
 </TABLE>
 </BODY>
index 4c57ed5a8a72b403fee093b4869467fc7e69bb6f..d4ef79759c04e15b59d5c0efba5f3c010674d514 100644 (file)
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS y el logo de CUPS son
 marcas registradas de <A HREF="http://www.apple.com">Apple Inc.</A> Los derechos
-de copia de CUPS 2007-2012 son de Apple Inc. Todos los derechos reservados.</TD></TR>
+de copia de CUPS 2007-2013 son de Apple Inc. Todos los derechos reservados.</TD></TR>
 </TABLE>
 </BODY>
 </HTML>
index 1c7c75b9e94633bd190f1e01130ad211f5a21a03..7011a973084b4bc37ec11dbd31ef552eed12186a 100644 (file)
@@ -414,6 +414,14 @@ parallel attribute.
 <h2 class="title"><a name="STATUS_PREDICATES">Status Predicates</a></h2>
 The following predicates are understood following the STATUS test directive:
 <dl>
+<dt>DEFINE-MATCH variable-name
+</dt>
+<dd>Defines the variable to "1" when the STATUS matches. A side-effect of this predicate is that this STATUS will never fail a test.
+</dd>
+<dt>DEFINE-NO-MATCH variable-name
+</dt>
+<dd>Defines the variable to "1" when the STATUS does not match. A side-effect of this predicate is that this STATUS will never fail a test.
+</dd>
 <dt>IF-DEFINED variable-name
 </dt>
 <dd>Makes the STATUS apply only if the specified variable is defined.
@@ -674,7 +682,7 @@ no notify-subscription-id has been seen.
 <a href='http://localhost:631/help'>http://localhost:631/help</a>
 
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 
 </body>
 </html>
index 92c0259ee29b17a1a9edc2a6d2173c750821f74c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,118 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<!-- SECTION: Specifications -->
-<head>
-       <title>CUPS Browse Protocol</title>
-       <meta name='keywords' content='Programming'>
-       <LINK REL="STYLESHEET" TYPE="text/css" HREF="../cups-printable.css">
-</head>
-<body>
-<!--
-  "$Id$"
-
-  CUPS Browse Protocol specification for CUPS.
-
-  Copyright 2008-2011 by Apple Inc.
-  Copyright 1997-2005 by Easy Software Products.
-
-  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/".
--->
-
-<BLOCKQUOTE><B>Note:</B>
-
-<P>The CUPS Browse Protocol is deprecated and will no longer be used in a future release of CUPS.</P>
-
-</BLOCKQUOTE>
-
-<H1 CLASS="title">CUPS Browse Protocol</H1>
-
-<h2><a name='INTRO'>Introduction</a></h2>
-
-<p>This specification describes the CUPS browsing protocol which is used for
-printer sharing. The protocol is a UDP/IP-based broadcast service that
-operates on IP service port 631 by default. Each broadcast packet describes
-a single printer or class being shared.</p>
-
-<p>For simple networks with a single subnet, a CUPS system sharing a printer
-(the <em>server</em>) will periodically broadcast that printer's availability
-and status information to the subnet. Every other CUPS system on the subnet
-(the <em>clients</em>) will receive the broadcast and make that printer
-available to local users. If a client stops receiving broadcasts from the
-server, or if the server sends a special "deleted" broadcast message, the
-client will remove its copy of the printer.</p>
-
-<p>For larger networks with multiple subnets, a relay configuration can be used
-where one or more client systems poll the server and then broadcast the
-availability and status information for the server's shared printers to the
-clients' local subnets.</p>
-
-<p>A key feature of CUPS printer sharing is support for <em>implicit
-classes</em>, which are automatically-created classes for printers that are
-shared by multiple servers. These implicit classes provide automatic load
-balancing and fail-safe printing functionality transparently to the user.</p>
-
-
-<h2><a name='SECURITY'>Security Considerations</a></h2>
-
-<p>Like most discovery protocols, CUPS browse packets are not encrypted or
-signed, so it is possible for malicious systems on a network to advertise
-or remove printers on that network to cause denial of service or information
-disclosure. In order to combat this, CUPS logs incoming browse packets and
-provides access controls to limit browse packet reception to known hosts.</p>
-
-
-<h2><a name='FORMAT'>Browse Packet Format</a></h2>
-
-<p>Each broadcast packet is an ASCII text string of up to 1450 bytes ending
-with a line feed (0x0a). The general format is:</p>
-
-<p class='summary'>
-printer-type printer-state printer-uri "printer-location" "printer-info"
-"printer-make-and-model" name=value name2=value2 ...
-</p>
-
-<p>Each of the fields contains the value of the corresponding IPP attribute.
-The trailing "name=value" information is used to convey default job template
-attribute values (job-sheets-default, media-default, etc.), authentication
-requirements (auth-info-required), and additional IPP URI options that are
-requested by the server (ipp-options).</p>
-
-<h3>ABNF Definition</h3>
-
-<p>The following ABNF definition [RFC4234, RFC3986] defines the format of each
-browse packet:</p>
-
-<pre class='command'>
-PACKET         = TYPE WSP STATE WSP URI WSP LOCATION WSP INFO WSP
-                 MAKE-AND-MODEL WSP *[ WSP ATTR-NAME "=" ATTR-VALUE ] LF
-
-TYPE           = 1*HEXDIG
-
-STATE          = "3" / "4" / "5"
-
-URI            = "ipp://" ( 1*NAMECHAR / IP-literal / IPv4address )
-                 [ ":" 1*DIGIT ] ( "/printers/" / "/classes/" ) 1*NAMECHAR
-NAMECHAR       = %x21.22.24.26-2E.30-7E / %x25 HEXDIG HEXDIG
-IP-literal     = See RFC 3986
-IPv4address    = See RFC 3986
-
-LOCATION       = QUOTED-STRING
-INFO           = QUOTED-STRING
-MAKE-AND-MODEL = QUOTED-STRING
-
-ATTR-NAME      = 1*( ALPHA / DIGIT / "-" / "." )
-ATTR-VALUE     = QUOTED-STRING / 1*UNQUOTE-CHAR
-
-QUOTED-STRING  = DQUOTE *QUOTED-CHAR DQUOTE
-QUOTED-CHAR    = %x20.21.23-5B.5D-7E / UTF8-CHAR / %x5C %x5C / %x5C %x22
-UNQUOTE-CHAR   = %x21.23-26.28-5B.5D-7E / UTF8-CHAR
-UTF8-CHAR      = %xC0.DF %x80.BF / %xE0.EF %x80.BF %x80.BF /
-                 %xF0.F7 %x80.BF %x80.BF %x80.BF
-</pre>
-
-</body>
-</html>
index 2691b8541004ec58dcc169d37190deadb82bd7f9..857a4304906a23ff23e9ba0098b2df03f861488c 100644 (file)
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
 </TD></TR>
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
+<A HREF="http://www.apple.com">Apple Inc.</A> Copyright 2007-2013 Apple
 Inc. All rights reserved.</TD></TR>
 </TABLE>
 </BODY>
index d43a2ac7f966dcaceda5e49d3ddcaf618afc8e22..e62d8f1e91d74dba6316bb78dc3331a60fa746ee 100644 (file)
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
 </TD></TR>
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
+<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2013 Apple
 Inc. All rights reserved.</TD></TR>
 </TABLE>
 </BODY>
index 85f9d8a337af6328508a8f1a1a72b66a4ca14871..5360c16548fd52cbeaafe1d5ecbce9f36b55e4a0 100644 (file)
@@ -139,6 +139,7 @@ install-libs: $(INSTALLSTATIC)
        if test "x$(SYMROOT)" != "x"; then \
                $(INSTALL_DIR) $(SYMROOT); \
                cp $(LIBCUPSIMAGE) $(SYMROOT); \
+               dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
        fi
 
 installstatic:
index bcc8d2b4d22611133c856d0d7a92f3833b4f9763..8f406fe577a2fc2f2df88dfce30e483da6bde76d 100644 (file)
@@ -1303,7 +1303,8 @@ copy_page(cups_file_t  *fp,               /* I - File to read from */
 
   if (doc->ap_input_slot || doc->ap_manual_feed)
   {
-    if (doc->page == 1)
+    if ((doc->page == 1 && (!doc->slow_order || !Duplex)) ||
+        (doc->page == 2 && doc->slow_order && Duplex))
     {
      /*
       * First page/sheet gets AP_FIRSTPAGE_* options...
index 156e061741d0c23c7b65eaac1404dca945532930..b97ab4ae9ecdbb04ebcbb796ba112e1f29cbad38 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   Backend man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -166,7 +166,7 @@ All other exit code values are reserved.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: backend.man 7810 2008-07-29 01:11:15Z mike $".
 .\"
index b9a6fd2317d31ee7149dc1670bebbafd45ca6874..5134d1fef93acd78f86646e818000b9c51bd8dc8 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cancel man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -69,7 +69,7 @@ Cancel-Jobs operations in \fIcupsd.conf(5)\fR.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cancel.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 269ddc4d9e0a7f4f11cddbda219c9623f28f28b3..8149d153970651426f2849b406efe628eeba1096 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   classes.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -104,7 +104,7 @@ Specifies the date/time associated with the state.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: classes.conf.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index ef5233fb9353df7be7fcf4ab488128d1809c6e3c..dc120677f90da3849f0801fb1fd36335ed44f90e 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   client.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -53,7 +53,7 @@ Specifies the default user name to use for requests.
 .SH SEE ALSO
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: client.conf.man.in 6649 2007-07-11 21:46:42Z mike $".
 .\"
index 44c8857dfdfb654eb50c750755a08285c9e6d71e..c13e935792b35b417396e71290a5673226942e01 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cups-config man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -111,7 +111,7 @@ Displays the full version number of the CUPS installation
 .SH SEE ALSO
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cups-config.man 7646 2008-06-16 17:26:20Z mike $".
 .\"
index a89cf056b07c9fd4d433cfad0e443d85599946b7..ab9a871a231a01b8e2c1b33f9040ad72a292ecb4 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cups-deviced man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -38,7 +38,7 @@ backend(7), cupsd(8), cupsd.conf(5),
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cups-deviced.man.in 7646 2008-06-16 17:26:20Z mike $".
 .\"
index 93d779337780843fdf8daf433ad9b12df3d86f4b..3f015a437d604c14f2cb98e2809e2e8bd51a52f1 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cups-driverd man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -116,7 +116,7 @@ cupsd(8), cupsd.conf(5), cupstestppd(1), lpinfo(8),
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cups-driverd.man.in 7662 2008-06-17 14:34:20Z mike $".
 .\"
index d873d537b7b855607c7e10b328438a1c9fa9e66b..58da102d016de83dc6fe892b4ae34e398573e6db 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupsd.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -140,7 +140,7 @@ Specifies the user name or ID that is used when running external programs.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id$".
 .\"
index 6e16dca7b34d1c2a34546e43d7bcaf6f111dadb9..4289962b46604f96c18fab317fe0a69316108c87 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cups-lpd man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -118,7 +118,7 @@ clients may be unreliable.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cups-lpd.man.in 7835 2008-08-09 06:37:04Z mike $".
 .\"
index f951b646c9222f11ac7003b79859ec5e4353a079..608a2b5bca32d998b3bd49e69aa5b76ed5a5966d 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   snmp.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -72,7 +72,7 @@ cups-snmp(8),
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cups-snmp.conf.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index f34170db45778333df224328bdc60a3f3a26e865..e6f6c7448a03214c2ff97886c3f53b16a66747b3 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   SNMP backend man page for CUPS.
 .\"
-.\"   Copyright 2012 by Apple Inc.
+.\"   Copyright 2012-2013 by Apple Inc.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
 .\"   property of Apple Inc. and are protected by Federal copyright
@@ -53,7 +53,7 @@ environment variable.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id$".
 .\"
index a03ae5d50a32ab6a0b6cb88386c66b6530f27c48..0c8ba03be85554450be46ed16bd180d49ca0529a 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   accept/reject man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -73,7 +73,7 @@ require the root user to execute these commands.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupsaccept.man 7930 2008-09-10 22:25:54Z mike $".
 .\"
index a8134142d690c63dcea29e8506a85cad1e279dcb..75598ab694c4983bedb67f233aded719c85b51e3 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupsaddsmb man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -208,7 +208,7 @@ http://localhost:631/help
 http://www.cups.org/windows/
 
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupsaddsmb.man.in 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 50517a251547f184e36a0df1c3708f5ef570f922..ef1a3fb1e0b6c306e1dd62e8bf412bec090005f6 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupsctl man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -91,7 +91,7 @@ You cannot set the Listen or Port directives using \fIcupsctl\fR.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupsctl.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 7d8ebc88319f7eb81e086e19828cc5644e884984..a29d36c1382af97b8c8c8a401f9cb4ebc5ac7182 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupsd.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -519,7 +519,7 @@ Specifies whether the web interface is enabled.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupsd.conf.man.in 7935 2008-09-11 01:54:11Z mike $".
 .\"
index 2e4b8cd12f8bbcf32020ac172d34f4095db4e716..3ab21e7274b4db7c2daa71d03adb3113659d5230 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupsd man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -66,7 +66,7 @@ operations.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupsd.man.in 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 6ed5ee846cf7feb762ef7acae5379366f6ff9523..482a1e32dcb73f8ba21d78e0f68b0dd6064a4d55 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupsenable/cupsdisable man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -86,7 +86,7 @@ require the root user to execute these commands.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 
 .\"
 .\" End of "$Id: cupsenable.man 7600 2008-05-20 21:06:23Z mike $".
index f39a7fdf31e3edd32917bede2067bf525f750edd..5a67e4da5839987a099f94d543e1dc3d67801f30 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupsfilter man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
 .\"   property of Apple Inc. and are protected by Federal copyright
@@ -103,7 +103,7 @@ Delete the PPD file after conversion.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupsfilter.man 7936 2008-09-11 03:12:59Z mike $".
 .\"
index 62bc25bc949594208e5e702674a1c7bc56fd063e..ec08797a5ee64e654d56149383dbf932f79e278d 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupstestdsc man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -44,7 +44,7 @@ http://localhost:631/help
 Adobe PostScript Language Document Structuring Conventions
 Specification, Version 3.0.
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupstestdsc.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index f1d90f258bb84406fef02360ec0e2eaba2f0bcc2..2d66116fd1a17b50e218dc237e49b38549ed9290 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   cupstestppd man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -159,7 +159,7 @@ http://localhost:631/help
 .br
 Adobe PostScript Printer Description File Format Specification, Version 4.3.
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: cupstestppd.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 1acff4b4ea7f4463b4fd26b03934ef03438091d2..9a79dbd24c024c4e5d7c810aca21c9740da2acfc 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   filter man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -232,7 +232,7 @@ only filter.  Typically the interface script will be provided via the
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: filter.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 3fb0f8f448722eaba96944dfc74e95be21b5216a..16b12764b1038e1d210b281e8b13b7f0d181fd1f 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ipptool man page for CUPS.
 .\"
-.\"   Copyright 2010-2012 by Apple Inc.
+.\"   Copyright 2010-2013 by Apple Inc.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
 .\"   property of Apple Inc. and are protected by Federal copyright
@@ -137,7 +137,7 @@ The following standard files are available:
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id$".
 .\"
index aea8d80cda29bbf8cf99c2df972d7ed29221a681..a4bba335e1595d1634b80dabbd05cf743f781cca 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ipptoolfile man page for CUPS.
 .\"
-.\"   Copyright 2010-2012 by Apple Inc.
+.\"   Copyright 2010-2013 by Apple Inc.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
 .\"   property of Apple Inc. and are protected by Federal copyright
@@ -11,7 +11,7 @@
 .\"   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" "3 December 2012" "Apple Inc."
+.TH ipptoolfile 5 "CUPS" "10 January 2013" "Apple Inc."
 .SH NAME
 ipptoolfile \- ipptool file format
 
@@ -332,6 +332,12 @@ Requires that at least one value of the EXPECT attribute matches the regular exp
 .SH STATUS PREDICATES
 The following predicates are understood following the STATUS test directive:
 .TP 5
+DEFINE-MATCH variable-name
+Defines the variable to "1" when the STATUS matches. A side-effect of this predicate is that this STATUS will never fail a test.
+.TP 5
+DEFINE-NO-MATCH variable-name
+Defines the variable to "1" when the STATUS does not match. A side-effect of this predicate is that this STATUS will never fail a test.
+.TP 5
 IF-DEFINED variable-name
 Makes the STATUS apply only if the specified variable is defined.
 .TP 5
@@ -571,7 +577,7 @@ Inserts the username from the URI provided to \fIipptool\fR, if any.
 http://localhost:631/help
 
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id$".
 .\"
index 2ef61cabf6a5ef773428ba0e97480d2ecb4bdf72..98466240caeb07b507c328bc1b1484dd25cff28b 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lp man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -246,7 +246,7 @@ is highest priority).
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lp.man 7889 2008-08-29 22:03:35Z mike $".
 .\"
index d2ebbbec7914222087375d86cceaf3bbf33ce128..0ec81b0125cf35966c9a898e1797be6e140d9d2d 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpadmin man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -221,7 +221,7 @@ System V or Solaris printing system configuration options.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpadmin.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index d3801199173879d44b571ba7003843abbe94248d..8d5245c6d03ef3640f474aea4bfc7a478d814ade 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpc man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -65,7 +65,7 @@ standard Berkeley or LPRng commands.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpc.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 4a8324228bc09cf9c41c2a296eabedbe8a0894fe..e45a7f35d3ab8455694564aaa0b042367b90fab1 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpinfo man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -109,7 +109,7 @@ The \fIlpinfo\fR command is unique to CUPS.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpinfo.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 2100e0a30bb9b53307319723adef5a9afad1330c..23ea0987d390e90c6452f29a6f241bcf11bc53d8 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpmove man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -60,7 +60,7 @@ Specifies an alternate server.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpmove.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 3658f8f5ecb543b0af414cc06a48c6fafa11400d..6007071c979e0d3fa4ce8cf1e757e5c339df8ef1 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpoptions man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -129,7 +129,7 @@ created by the root user.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpoptions.man.in 7889 2008-08-29 22:03:35Z mike $".
 .\"
index b64d642d8e727e8c0dabc9c3008bf3f3905ca630..1edb0d8b91bdaf7b01dd956497c7b699e2c16060 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpadmin man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -62,7 +62,7 @@ accounts managed by PAM instead.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lppasswd.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index f1d87ae01b58887948b6f414d1f0db30790f6562..97630e9199319169955aae1277247c270e31aeb5 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpq man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -66,7 +66,7 @@ Requests a more verbose (long) reporting format.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpq.man 7646 2008-06-16 17:26:20Z mike $".
 .\"
index 1dcc937d0483ebf3340b1efc307d7f8039b007de..c6392c77c2e99f3a64e6002ccacab1a0fdcac4c5 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpr man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -116,7 +116,7 @@ are not supported by CUPS and produce a warning message if used.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpr.man 7889 2008-08-29 22:03:35Z mike $".
 .\"
index 36e90841fbe93ba6d68515113f0b6eaf9e766880..3d3f30f27f94977ac4b55acb7c83d9574e6637c5 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lprm man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -59,7 +59,7 @@ Berkeley \fIlprm\fR command.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lprm.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 92f611283976491364e66597db027214fa48df80..37c39d767593ff1b8a5929c017bcbfd4536c5396 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   lpstat man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -137,7 +137,7 @@ The Solaris "-f", "-P", and "-S" options are silently ignored.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: lpstat.man 7921 2008-09-10 15:42:24Z mike $".
 .\"
index d603dd0dda8c5b236e79312bfaee37850223e328..aa60386861496b0e7791cc03ca9127a71e33d5a4 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   mailto.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -54,7 +54,7 @@ Specifies a prefix string for the subject line of an email notification.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: mailto.conf.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 14622a9922bd55cc72d14b60961fe05c45d0fc61..311353a6df02494f03c8f0a0f5e4e4c9a75fa493 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   mime.convs man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -40,7 +40,7 @@ application/postscript application/vnd.cups-raster 50 pstoraster
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: mime.convs.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 5ed9ebdf69e16814e7a3206b315790ef9c725b99..bf1dd9b73e0265ed2ca24cdff40663aae5b13d70 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   mime.types man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -109,7 +109,7 @@ higher priority than "text/bar", "text/foo" will be chosen instead.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: mime.types.man 7670 2008-06-17 22:42:08Z mike $".
 .\"
index cc6e800c203f002c4f8ef233446a1dc74224ecb2..411287868713721c51a9c045a279542e84821fdb 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   notifier man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -151,7 +151,7 @@ file for the current setting.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id$".
 .\"
index 8f30bfb568d01fbb46cfbd0f0c1f8175560859f5..933e7d1181907e9e8c28663b48b394d74910dc96 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ppdc man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -75,7 +75,7 @@ ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1), ppdcfile(5)
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: ppdc.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 571acaa977f4905f1b0feef7e83ba258b4314323..a7a56a8d9cf2e96964db0741c5da239995bb4bd1 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ppdcfile man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -164,7 +164,7 @@ ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdpo(1)
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: ppdcfile.man 7607 2008-05-21 01:06:23Z mike $".
 .\"
index bb3d57a26f7749d66d25cf8d716fa44831ff0266..78df7d392fe592f29775704878c2aea2dccc8120 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ppdhtml man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -40,7 +40,7 @@ ppdc(1), ppdcfile(5), ppdi(1), ppdmerge(1), ppdpo(1)
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: ppdhtml.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index dea64ec74cebb22aaff87b1d266ace844c39a416..38658e02e1df515507522353e91e9ed9cdf04171 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ppdi man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -40,7 +40,7 @@ ppdc(1), ppdhtml(1), ppdmerge(1), ppdpo(1), ppdcfile(5)
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: ppdi.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index fcd495fd4fe353f6a6fa838e387289b84a54d1ea..397314eca19b32c7d105bfe3b97ea6705f3b377f 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ppdmerge man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -41,7 +41,7 @@ cupsprofile(1), ppdc(1), ppdhtml(1), ppdi(1), ppdpo(1), ppdcfile(5)
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: ppdmerge.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 8e6c5f544cbb7273aaf71b8279dd129b38769ec4..c6378bc41e7a5e72950f91882590612e998a1f9c 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   ppdpo man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2007 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -46,7 +46,7 @@ ppdc(1), ppdhtml(1), ppdi(1), ppdmerge(1), ppdcfile(5)
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: ppdpo.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index d6902f7e83ac3a30b914025b8bddf5822f732f17..6d8609fcb223cf8379333a76a0add9d7bd2b94a3 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   printers.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 1997-2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -118,7 +118,7 @@ Specifies the date/time associated with the state.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: printers.conf.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index 2642ee7d8cef0d878ff844d382591014ea2cd2a6..5531c6a5fa5b131139b141f9b3ca9822a60b96cf 100644 (file)
@@ -3,7 +3,7 @@
 .\"
 .\"   subscriptions.conf man page for CUPS.
 .\"
-.\"   Copyright 2007-2012 by Apple Inc.
+.\"   Copyright 2007-2013 by Apple Inc.
 .\"   Copyright 2006 by Easy Software Products.
 .\"
 .\"   These coded instructions, statements, and computer programs are the
@@ -83,7 +83,7 @@ is typically the "from" address in mailto: notifications.
 .br
 http://localhost:631/help
 .SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
 .\"
 .\" End of "$Id: subscriptions.conf.man 7600 2008-05-20 21:06:23Z mike $".
 .\"
index c1fbb8f67101c7b77d96191089c944c3a9380a3f..c038a5f58c95d8e4645540ff02e687753c47fece 100644 (file)
@@ -178,6 +178,7 @@ install-libs: $(INSTALLSTATIC)
        if test "x$(SYMROOT)" != "x"; then \
                $(INSTALL_DIR) $(SYMROOT); \
                cp $(LIBCUPSPPDC) $(SYMROOT); \
+               dsymutil $(SYMROOT)/$(LIBCUPSPPDC); \
        fi
 
 installstatic:
index d6035e0aa19773bdea880bc836c93d21a1bb12cd..094505f6265f0c85b4c89c60996a43b0b028facd 100644 (file)
@@ -257,6 +257,7 @@ install-libs: $(INSTALLSTATIC)
        if test "x$(SYMROOT)" != "x"; then \
                $(INSTALL_DIR) $(SYMROOT); \
                cp $(LIBCUPSMIME) $(SYMROOT); \
+               dsymutil $(SYMROOT)/$(LIBCUPSMIME); \
        fi
 
 installstatic:
index 8aff4f21e20be6e9a074131f7f8d5cbc5cba9c7f..c8e89b9ce990ae77f86f8724158d760edbbb10a4 100644 (file)
@@ -96,11 +96,6 @@ typedef struct sockpeercred cupsd_ucred_t;
 #  endif
 #  define CUPSD_UCRED_UID(c) (c).uid
 #endif /* HAVE_SYS_UCRED_H */
-#ifdef HAVE_KRB5_IPC_CLIENT_SET_TARGET_UID
-/* Not in public headers... */
-extern void    krb5_ipc_client_set_target_uid(uid_t);
-extern void    krb5_ipc_client_clear_target(void);
-#endif /* HAVE_KRB5_IPC_CLIENT_SET_TARGET_UID */
 
 
 /*
@@ -597,15 +592,7 @@ cupsdAuthorize(cupsd_client_t *con)        /* I - Client connection */
     while (isspace(*authorization & 255))
       authorization ++;
 
-    if ((localuser = cupsdFindCert(authorization)) != NULL)
-    {
-      strlcpy(username, localuser->username, sizeof(username));
-
-      cupsdLogMessage(CUPSD_LOG_DEBUG,
-                     "[Client %d] Authorized as %s using Local", con->http.fd,
-                     username);
-    }
-    else
+    if ((localuser = cupsdFindCert(authorization)) == NULL)
     {
       cupsdLogMessage(CUPSD_LOG_ERROR,
                       "[Client %d] Local authentication certificate not found.",
@@ -613,12 +600,12 @@ cupsdAuthorize(cupsd_client_t *con)       /* I - Client connection */
       return;
     }
 
-#ifdef HAVE_GSSAPI
-    if (localuser->ccache)
-      con->type = CUPSD_AUTH_NEGOTIATE;
-    else
-#endif /* HAVE_GSSAPI */
-      con->type = CUPSD_AUTH_BASIC;
+    strlcpy(username, localuser->username, sizeof(username));
+    con->type = localuser->type;
+
+    cupsdLogMessage(CUPSD_LOG_DEBUG,
+                   "[Client %d] Authorized as %s using Local", con->http.fd,
+                   username);
   }
   else if (!strncmp(authorization, "Basic", 5))
   {
index a25f3092a6884ab094309268e4232ecd9b679878..fa956034a528806301b29c820f47340a4188d73c 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Authentication certificate routines for the CUPS scheduler.
  *
- *   Copyright 2007-2011 by Apple Inc.
+ *   Copyright 2007-2012 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -42,7 +42,7 @@
 void
 cupsdAddCert(int        pid,           /* I - Process ID */
              const char *username,     /* I - Username */
-             void       *ccache)       /* I - Kerberos credentials or NULL */
+             int        type)          /* I - AuthType for username */
 {
   int          i;                      /* Looping var */
   cupsd_cert_t *cert;                  /* Current certificate */
@@ -66,7 +66,8 @@ cupsdAddCert(int        pid,          /* I - Process ID */
   * Fill in the certificate information...
   */
 
-  cert->pid = pid;
+  cert->pid  = pid;
+  cert->type = type;
   strlcpy(cert->username, username, sizeof(cert->username));
 
   for (i = 0; i < 32; i ++)
@@ -259,16 +260,6 @@ cupsdAddCert(int        pid,               /* I - Process ID */
   write(fd, cert->certificate, strlen(cert->certificate));
   close(fd);
 
- /*
-  * Add Kerberos credentials as needed...
-  */
-
-#ifdef HAVE_GSSAPI
-  cert->ccache = (krb5_ccache)ccache;
-#else
-  (void)ccache;
-#endif /* HAVE_GSSAPI */
-
  /*
   * Insert the certificate at the front of the list...
   */
@@ -308,15 +299,6 @@ cupsdDeleteCert(int pid)           /* I - Process ID */
       else
         prev->next = cert->next;
 
-#ifdef HAVE_GSSAPI
-     /*
-      * Release Kerberos credentials as needed...
-      */
-
-      if (cert->ccache)
-       krb5_cc_destroy(KerberosContext, cert->ccache);
-#endif /* HAVE_GSSAPI */
-
       free(cert);
 
      /*
@@ -449,7 +431,7 @@ cupsdInitCerts(void)
   */
 
   if (!RunUser)
-    cupsdAddCert(0, "root", NULL);
+    cupsdAddCert(0, "root", cupsdDefaultAuthType());
 }
 
 
index 444897ebd96d51bd099963881e19d57b2dbb0701..d479b2ec9c4a5cea15078f0d7f8c869d6a19e358 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Authentication certificate definitions for the CUPS scheduler.
  *
- *   Copyright 2007-2010 by Apple Inc.
+ *   Copyright 2007-2012 by Apple Inc.
  *   Copyright 1997-2005 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -23,9 +23,7 @@ typedef struct cupsd_cert_s
   int          pid;                    /* Process ID (0 for root certificate) */
   char         certificate[33];        /* 32 hex characters, or 128 bits */
   char         username[33];           /* Authenticated username */
-#ifdef HAVE_GSSAPI
-  krb5_ccache  ccache;                 /* Kerberos credential cache */
-#endif /* HAVE_GSSAPI */
+  int          type;                   /* AuthType for username */
 } cupsd_cert_t;
 
 
@@ -43,8 +41,7 @@ VAR time_t            RootCertTime    /* Root certificate update time */
  * Prototypes...
  */
 
-extern void            cupsdAddCert(int pid, const char *username,
-                                    void *ccache);
+extern void            cupsdAddCert(int pid, const char *username, int type);
 extern void            cupsdDeleteCert(int pid);
 extern void            cupsdDeleteAllCerts(void);
 extern cupsd_cert_t    *cupsdFindCert(const char *certificate);
index 89bda38d749927765fcaf0cdaf03bd1e1f402830..9c84252b878db545c7c541e81e5edb287f8c1388 100644 (file)
@@ -2580,14 +2580,7 @@ cupsdSendHeader(
               con->http.hostname);
 #ifdef HAVE_GSSAPI
     else if (auth_type == CUPSD_AUTH_NEGOTIATE)
-    {
-#  ifdef AF_LOCAL
-      if (_httpAddrFamily(con->http.hostaddr) == AF_LOCAL)
-        strlcpy(auth_str, "Basic realm=\"CUPS\"", sizeof(auth_str));
-      else
-#  endif /* AF_LOCAL */
       strlcpy(auth_str, "Negotiate", sizeof(auth_str));
-    }
 #endif /* HAVE_GSSAPI */
 
     if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE &&
@@ -3618,7 +3611,6 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
                server_name[1024],      /* SERVER_NAME environment variable */
                server_port[1024];      /* SERVER_PORT environment variable */
   ipp_attribute_t *attr;               /* attributes-natural-language attribute */
-  void         *ccache = NULL;         /* Kerberos credentials */
 
 
  /*
@@ -3970,7 +3962,7 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
     */
 
     if (con->username[0])
-      cupsdAddCert(pid, con->username, ccache);
+      cupsdAddCert(pid, con->username, con->type);
 
     cupsdLogMessage(CUPSD_LOG_DEBUG, "[CGI] Started %s (PID %d)", command, pid);
 
index ddb7a6fce3c30fc577c1ca1648d5df022fd28a3c..53cd03d8a5580320166d86c157da2bfacaa49740 100644 (file)
@@ -1128,7 +1128,7 @@ colord_delete_device(
   message = COLORD_DBUS_MSG(COLORD_DBUS_PATH, "DeleteDevice");
 
   dbus_message_iter_init_append(message, &args);
-  dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &device_id);
+  dbus_message_iter_append_basic(&args, DBUS_TYPE_OBJECT_PATH, &device_id);
 
  /*
   * Send the DeleteDevice request synchronously...
index 68b97611da65179ec91054f676b58069572a6c19..f32baa0601f76be64a87a1f6f98ca83fb216be2c 100644 (file)
@@ -1116,11 +1116,20 @@ cupsdReadConfiguration(void)
   * Update TempDir to the default if it hasn't been set already...
   */
 
+#ifdef __APPLE__
+  if (TempDir && !RunUser &&
+      (!strncmp(TempDir, "/private/tmp", 12) || !strncmp(TempDir, "/tmp", 4)))
+  {
+    cupsdLogMessage(CUPSD_LOG_ERROR, "Cannot use %s for TempDir.", TempDir);
+    cupsdClearString(&TempDir);
+  }
+#endif /* __APPLE__ */
+
   if (!TempDir)
   {
 #ifdef __APPLE__
     if ((tmpdir = getenv("TMPDIR")) != NULL &&
-        strncmp(tmpdir, "/private/tmp", 12))
+        strncmp(tmpdir, "/private/tmp", 12) && strncmp(tmpdir, "/tmp", 4))
 #else
     if ((tmpdir = getenv("TMPDIR")) != NULL)
 #endif /* __APPLE__ */
@@ -1143,13 +1152,13 @@ cupsdReadConfiguration(void)
       else
         cupsdSetString(&TempDir, tmpdir);
     }
+  }
 
-    if (!TempDir)
-    {
-      cupsdLogMessage(CUPSD_LOG_INFO, "Using default TempDir of %s/tmp...",
-                     RequestRoot);
-      cupsdSetStringf(&TempDir, "%s/tmp", RequestRoot);
-    }
+  if (!TempDir)
+  {
+    cupsdLogMessage(CUPSD_LOG_INFO, "Using default TempDir of %s/tmp...",
+                   RequestRoot);
+    cupsdSetStringf(&TempDir, "%s/tmp", RequestRoot);
   }
 
  /*
index b15336b518fa56b59e7984a54139d4d478e9af4d..8a6ffd97f40fa475d910d740d51b3b40ca30bd06 100644 (file)
@@ -160,13 +160,6 @@ VAR int                    NeedReload      VALUE(RELOAD_ALL),
 VAR void               *DefaultProfile VALUE(0);
                                        /* Default security profile */
 
-#ifdef HAVE_GSSAPI
-VAR int                        KerberosInitialized     VALUE(0);
-                                       /* Has Kerberos been initialized? */
-VAR krb5_context       KerberosContext VALUE(NULL);
-                                       /* Kerberos context for credentials */
-#endif /* HAVE_GSSAPI */
-
 #ifdef HAVE_LAUNCH_H
 VAR int                        Launchd         VALUE(0);
                                        /* Running from launchd */
index 60f522c28c236ba02b9e84838c889a2688840f90..aa15702df8ccc8da6f59ff2179e9f2f092085d3d 100644 (file)
@@ -409,6 +409,7 @@ main(int  argc,                             /* I - Number of command-line args */
 
   if (srctype)
   {
+   /* sscanf return value already checked above */
     sscanf(srctype, "%15[^/]/%255s", super, type);
     if ((src = mimeType(mime, super, type)) == NULL)
     {
@@ -426,6 +427,7 @@ main(int  argc,                             /* I - Number of command-line args */
     return (1);
   }
 
+ /* sscanf return value already checked above */
   sscanf(dsttype, "%15[^/]/%255s", super, type);
   if (!_cups_strcasecmp(super, "printer"))
     dst = printer_type;
index 72ef3e8690e3818c9b9e60f4081de1b00e6d4fe9..3ef050f80b2b2b2633467d5f91cc2da67a9de197 100644 (file)
@@ -2469,8 +2469,10 @@ cupsdSetJobState(
   * Set the new job state...
   */
 
-  job->state->values[0].integer = newstate;
-  job->state_value              = newstate;
+  job->state_value = newstate;
+
+  if (job->state)
+    job->state->values[0].integer = newstate;
 
   switch (newstate)
   {
@@ -4286,6 +4288,8 @@ load_request_root(void)
        else
          unload_job(job);
       }
+      else
+        free(job);
     }
 
   cupsDirClose(dir);
@@ -4377,7 +4381,7 @@ set_time(cupsd_job_t *job,                /* I - Job to update */
 
   if (!strcmp(name, "time-at-completed"))
   {
-    if (JobHistory < INT_MAX)
+    if (JobHistory < INT_MAX && attr)
       job->history_time = attr->values[0].integer + JobHistory;
     else
       job->history_time = INT_MAX;
@@ -4385,7 +4389,7 @@ set_time(cupsd_job_t *job,                /* I - Job to update */
     if (job->history_time < JobHistoryUpdate || !JobHistoryUpdate)
       JobHistoryUpdate = job->history_time;
 
-    if (JobFiles < INT_MAX)
+    if (JobFiles < INT_MAX && attr)
       job->file_time = attr->values[0].integer + JobFiles;
     else
       job->file_time = INT_MAX;
@@ -4728,7 +4732,7 @@ update_job(cupsd_job_t *job)              /* I - Job to check */
         cupsdStopPrinter(job->printer, 1);
        return;
       }
-      else if (cupsdSetPrinterReasons(job->printer, message))
+      else if (message[0] && cupsdSetPrinterReasons(job->printer, message))
       {
        event |= CUPSD_EVENT_PRINTER_STATE;
 
index 0f6098963387af30531ff1b0d1c6f37cdc9efd3e..43a4c87c293ff733bac9b29fa4e962e0fa4820ca 100644 (file)
@@ -952,7 +952,7 @@ main(int  argc,                             /* I - Number of command-line args */
       */
 
       cupsdDeleteCert(0);
-      cupsdAddCert(0, "root", NULL);
+      cupsdAddCert(0, "root", cupsdDefaultAuthType());
     }
 #endif /* !HAVE_AUTHORIZATION_H */
 
@@ -1144,23 +1144,6 @@ main(int  argc,                          /* I - Number of command-line args */
     cupsdStopSystemMonitor();
 #endif /* __APPLE__ */
 
-#ifdef HAVE_GSSAPI
- /*
-  * Free the scheduler's Kerberos context...
-  */
-
-#  ifdef __APPLE__
- /*
-  * If the weak-linked GSSAPI/Kerberos library is not present, don't try
-  * to use it...
-  */
-
-  if (krb5_init_context != NULL)
-#  endif /* __APPLE__ */
-  if (KerberosContext)
-    krb5_free_context(KerberosContext);
-#endif /* HAVE_GSSAPI */
-
   cupsdStopSelect();
 
   return (!stop_scheduler);
index 655c068d792afc41632874ab67a0a431940947e4..1c07cd0de5c834b8391b8e3e0fb878a5dab1a40a 100644 (file)
@@ -1,7 +1,7 @@
 </DIV></TD></TR>
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS i el logotip de CUPS s&oacute;n marques registrades per
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS t&eacute; copyright 2007-2012 Apple
+<A HREF="http://www.apple.com">Apple Inc.</A> CUPS t&eacute; copyright 2007-2013 Apple
 Inc. Tots els drets reservats.</TD></TR>
 </TABLE>
 </BODY>
index 335afd36e6390b708fd1cad6d606d014a4240f14..6f41b666911a9e02c7ce7e1d0ede0246f042f288 100644 (file)
@@ -2,7 +2,7 @@
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS y el logo de CUPS son marcas registradas de
 <A HREF="http://www.apple.com">Apple, Inc.</A> Los derechos de copia de CUPS
-2007-2012 son de Apple Inc. Todos los derechos reservados.</TD></TR>
+2007-2013 son de Apple Inc. Todos los derechos reservados.</TD></TR>
 </TABLE>
 </BODY>
 </HTML>
index 14412f1ca3d7bbb828d5134fa22402f493690c64..47743e152f3536212665ce95e25c9862ce44c362 100644 (file)
@@ -1,7 +1,7 @@
 </DIV></TD></TR>
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
+<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2013 Apple
 Inc. All rights reserved.</TD></TR>
 </TABLE>
 </BODY>
index 14412f1ca3d7bbb828d5134fa22402f493690c64..12217d7f51c2f7bc47822bc0b7dd0bf3d72e3b61 100644 (file)
@@ -1,7 +1,7 @@
 </DIV></TD></TR>
 <TR><TD>&nbsp;</TD></TR>
 <TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
+<A HREF="http://www.apple.com">Apple Inc.</A> Copyright 2007-2013 Apple
 Inc. All rights reserved.</TD></TR>
 </TABLE>
 </BODY>
index 3b85ad6f1875778406ec992c80d56c05d9b8bc27..eae5b7e75fff979946fa24158f524be68ab2be23 100644 (file)
@@ -93,6 +93,7 @@
 #ifdef HAVE_DNSSD
 #  include <dns_sd.h>
 #endif /* HAVE_DNSSD */
+#include <limits.h>
 #include <sys/stat.h>
 #include <sys/fcntl.h>
 #include <poll.h>
index 56d56df676d1649c50cce3dd35eab89d3b60365f..07c0b043518cfa5ffb82794d134c1898b3784527 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   ipptool command for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -113,7 +113,10 @@ typedef struct _cups_status_s              /**** Status info ****/
 {
   ipp_status_t status;                 /* Expected status code */
   char         *if_defined,            /* Only if variable is defined */
-               *if_not_defined;        /* Only if variable is not defined */
+               *if_not_defined,        /* Only if variable is not defined */
+               *define_match,          /* Variable to define on match */
+               *define_no_match,       /* Variable to define on no-match */
+               *define_value;          /* Variable to define with value */
   int          repeat_limit,           /* Maximum number of times to repeat */
                repeat_match,           /* Repeat the test when it does not match */
                repeat_no_match;        /* Repeat the test when it matches */
@@ -1185,7 +1188,9 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
           _cups_strcasecmp(token, "WITH-VALUE"))
         last_expect = NULL;
 
-      if (_cups_strcasecmp(token, "IF-DEFINED") &&
+      if (_cups_strcasecmp(token, "DEFINE-MATCH") &&
+          _cups_strcasecmp(token, "DEFINE-NO-MATCH") &&
+         _cups_strcasecmp(token, "IF-DEFINED") &&
           _cups_strcasecmp(token, "IF-NOT-DEFINED") &&
           _cups_strcasecmp(token, "REPEAT-LIMIT") &&
           _cups_strcasecmp(token, "REPEAT-MATCH") &&
@@ -1494,13 +1499,15 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
         * Operation...
        */
 
-       if (!get_token(fp, token, sizeof(token), &linenum))
+       if (!get_token(fp, temp, sizeof(temp), &linenum))
        {
          print_fatal_error("Missing OPERATION code on line %d.", linenum);
          pass = 0;
          goto test_exit;
        }
 
+       expand_variables(vars, token, temp, sizeof(token));
+
        if ((op = ippOpValue(token)) == (ipp_op_t)-1 &&
            (op = strtol(token, NULL, 0)) == 0)
        {
@@ -1543,13 +1550,15 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
 
         double delay;
 
-       if (!get_token(fp, token, sizeof(token), &linenum))
+       if (!get_token(fp, temp, sizeof(temp), &linenum))
        {
          print_fatal_error("Missing DELAY value on line %d.", linenum);
          pass = 0;
          goto test_exit;
        }
 
+       expand_variables(vars, token, temp, sizeof(token));
+
        if ((delay = _cupsStrScand(token, NULL, localeconv())) <= 0.0)
        {
          print_fatal_error("Bad DELAY value \"%s\" on line %d.", token,
@@ -1932,10 +1941,12 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
 
        if (last_expect)
          last_expect->define_match = strdup(token);
+       else if (last_status)
+         last_status->define_match = strdup(token);
        else
        {
-         print_fatal_error("DEFINE-MATCH without a preceding EXPECT on line "
-                           "%d.", linenum);
+         print_fatal_error("DEFINE-MATCH without a preceding EXPECT or STATUS "
+                           "on line %d.", linenum);
          pass = 0;
          goto test_exit;
        }
@@ -1952,10 +1963,12 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
 
        if (last_expect)
          last_expect->define_no_match = strdup(token);
+       else if (last_status)
+         last_status->define_no_match = strdup(token);
        else
        {
-         print_fatal_error("DEFINE-NO-MATCH without a preceding EXPECT on "
-                           "line %d.", linenum);
+         print_fatal_error("DEFINE-NO-MATCH without a preceding EXPECT or "
+                           "STATUS on line %d.", linenum);
          pass = 0;
          goto test_exit;
        }
@@ -1974,8 +1987,8 @@ do_tests(_cups_vars_t *vars,              /* I - Variables */
          last_expect->define_value = strdup(token);
        else
        {
-         print_fatal_error("DEFINE-VALUE without a preceding EXPECT on line "
-                           "%d.", linenum);
+         print_fatal_error("DEFINE-VALUE without a preceding EXPECT on "
+                           "line %d.", linenum);
          pass = 0;
          goto test_exit;
        }
@@ -2703,11 +2716,23 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
                repeat_count < statuses[i].repeat_limit)
              repeat_test = 1;
 
-           break;
+            if (statuses[i].define_match)
+              set_variable(vars, statuses[i].define_match, "1");
+
+            break;
          }
-         else if (statuses[i].repeat_no_match &&
-                  repeat_count < statuses[i].repeat_limit)
-           repeat_test = 1;
+         else
+         {
+           if (statuses[i].repeat_no_match &&
+               repeat_count < statuses[i].repeat_limit)
+             repeat_test = 1;
+
+            if (statuses[i].define_no_match)
+            {
+              set_variable(vars, statuses[i].define_no_match, "1");
+              break;
+            }
+          }
        }
 
        if (i == num_statuses && num_statuses > 0)
@@ -3058,6 +3083,10 @@ do_tests(_cups_vars_t *vars,             /* I - Variables */
         free(statuses[i].if_defined);
       if (statuses[i].if_not_defined)
         free(statuses[i].if_not_defined);
+      if (statuses[i].define_match)
+        free(statuses[i].define_match);
+      if (statuses[i].define_no_match)
+        free(statuses[i].define_no_match);
     }
     num_statuses = 0;