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
-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
-IPPTOOL.txt - 2012-11-16
+IPPTOOL.txt - 2013-01-10
------------------------
See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
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.
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.
*
* 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
}
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",
/*
* 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)
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)
{
/*
backendCheckSideChannel(snmp_fd, http->hostaddr);
+ /*
+ * Check printer state...
+ */
+
+ check_printer_state(http, uri, resource, argv[2], version);
+
/*
* Build an IPP_GET_JOB_ATTRIBUTES request...
*/
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 };
/*
*/
globals_t g = { 0 }; /* Globals */
+int Iterating = 0; /* Are we iterating the bus? */
/*
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);
}
mach_port_deallocate(mach_task_self(), masterPort);
}
+
+ Iterating = 0;
}
_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));
* 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;
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,
pthread_mutex_unlock(&g.read_thread_mutex);
}
- if (print_fd)
- close(print_fd);
-
/*
* Close the connection and input file and general clean up...
*/
*/
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)
*/
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 */
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].
printer->origconf = current;
- if ((errcode =
+ if ((errcode =
libusb_get_config_descriptor (printer->device, printer->conf, &confptr))
< 0)
{
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)
{
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPSCGI) $(SYMROOT); \
+ dsymutil $(SYMROOT)/$(LIBCUPSCGI); \
fi
installstatic:
#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
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)
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)
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"
#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
/*
active = NULL;
}
- if (tries >= 0)
+ if (tries >= 100)
{
DEBUG_puts("1cupsCopyDestConflicts: Unable to resolve after 100 tries.");
have_conflicts = -1;
*
* 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
# ifdef HAVE_LIBZ
_http_coding_t coding; /* _HTTP_CODING_xxx */
z_stream stream; /* (De)compression stream */
+ Bytef *dbuffer; /* Decompression buffer */
# endif /* HAVE_LIBZ */
};
*/
#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,
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),
*
* 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
* 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.
/*
- * '_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 */
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.
error));
#endif /* DEBUG */
}
+
+ httpAddrFreeList(addrlist);
}
}
error));
#endif /* DEBUG */
}
+
+ httpAddrFreeList(addrlist);
}
}
* _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.
* 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.
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
DEBUG_printf(("2httpGets(line=%p, length=%d, http=%p)", line, length, http));
- if (http == NULL || line == NULL)
+ if (!http || !line || length <= 1)
return (NULL);
/*
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)
{
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 */
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
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...
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)
{
return (-1);
}
- stream.next_in = (Bytef *)http->buffer;
- stream.avail_in = comp_avail;
stream.next_out = (Bytef *)buffer;
stream.avail_out = length;
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);
}
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);
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);
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...
*/
case _HTTP_CODING_INFLATE :
case _HTTP_CODING_GUNZIP :
inflateEnd(&(http->stream));
+ free(http->dbuffer);
+ http->dbuffer = NULL;
break;
default :
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 :
}
+/*
+ * '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.
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 */
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 */
* '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;
#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)
{
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);
}
* '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);
}
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,
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") ||
!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) /
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)
!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)
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));
_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 :
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;
+ }
+ }
}
/*
*
* 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)
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 \
</TD></TR>
<TR><TD> </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>
<TR><TD> </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>
<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.
<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>
-<!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>
</TD></TR>
<TR><TD> </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>
</TD></TR>
<TR><TD> </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>
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPSIMAGE) $(SYMROOT); \
+ dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
fi
installstatic:
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...
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
.\"
.\" End of "$Id$".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
.\"
.\" End of "$Id$".
.\"
.\"
.\" 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
.\" 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
.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
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
.\"
.\" End of "$Id$".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2012 by Apple Inc.
+Copyright 2007-2013 by Apple Inc.
.\"
.\" End of "$Id$".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
.\"
.\" 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
.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 $".
.\"
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPSPPDC) $(SYMROOT); \
+ dsymutil $(SYMROOT)/$(LIBCUPSPPDC); \
fi
installstatic:
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPSMIME) $(SYMROOT); \
+ dsymutil $(SYMROOT)/$(LIBCUPSMIME); \
fi
installstatic:
# 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 */
/*
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.",
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))
{
*
* 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
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 */
* 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 ++)
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...
*/
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);
/*
*/
if (!RunUser)
- cupsdAddCert(0, "root", NULL);
+ cupsdAddCert(0, "root", cupsdDefaultAuthType());
}
*
* 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
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;
* 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);
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 &&
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 */
/*
*/
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);
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...
* 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__ */
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);
}
/*
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 */
if (srctype)
{
+ /* sscanf return value already checked above */
sscanf(srctype, "%15[^/]/%255s", super, type);
if ((src = mimeType(mime, super, type)) == NULL)
{
return (1);
}
+ /* sscanf return value already checked above */
sscanf(dsttype, "%15[^/]/%255s", super, type);
if (!_cups_strcasecmp(super, "printer"))
dst = printer_type;
* 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)
{
else
unload_job(job);
}
+ else
+ free(job);
}
cupsDirClose(dir);
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;
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;
cupsdStopPrinter(job->printer, 1);
return;
}
- else if (cupsdSetPrinterReasons(job->printer, message))
+ else if (message[0] && cupsdSetPrinterReasons(job->printer, message))
{
event |= CUPSD_EVENT_PRINTER_STATE;
*/
cupsdDeleteCert(0);
- cupsdAddCert(0, "root", NULL);
+ cupsdAddCert(0, "root", cupsdDefaultAuthType());
}
#endif /* !HAVE_AUTHORIZATION_H */
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);
</DIV></TD></TR>
<TR><TD> </TD></TR>
<TR><TD CLASS="trailer">CUPS i el logotip de CUPS són marques registrades per
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS té copyright 2007-2012 Apple
+<A HREF="http://www.apple.com">Apple Inc.</A> CUPS té copyright 2007-2013 Apple
Inc. Tots els drets reservats.</TD></TR>
</TABLE>
</BODY>
<TR><TD> </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>
</DIV></TD></TR>
<TR><TD> </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>
</DIV></TD></TR>
<TR><TD> </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>
#ifdef HAVE_DNSSD
# include <dns_sd.h>
#endif /* HAVE_DNSSD */
+#include <limits.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <poll.h>
*
* 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
{
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 */
_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") &&
* 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)
{
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,
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;
}
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;
}
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;
}
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)
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;