]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Do compression to a separate 64k buffer for larger chunks.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 8 May 2014 17:51:12 +0000 (17:51 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 8 May 2014 17:51:12 +0000 (17:51 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11853 a1ca3aef-8c08-0410-bb20-df032aa958be

cups/http-private.h
cups/http.c
doc/help/man-client.conf.html
doc/help/man-cups-files.conf.html
doc/help/man-cupsd.conf.html
doc/help/man-cupsd.html
test/ippserver.c

index 5b1d9f5d733b936e271c2d2298fb58d376244be7..248462926f10918c94454def76f7e0adce8a390d 100644 (file)
@@ -151,6 +151,7 @@ extern "C" {
  */
 
 
+#define _HTTP_MAX_SBUFFER      65536   /* Size of (de)compression buffer */
 #define _HTTP_RESOLVE_DEFAULT  0       /* Just resolve with default options */
 #define _HTTP_RESOLVE_STDERR   1       /* Log resolve progress to stderr */
 #define _HTTP_RESOLVE_FQDN     2       /* Resolve to a FQDN */
@@ -317,7 +318,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 */
+  Bytef                        *sbuffer;       /* (De)compression buffer */
 #  endif /* HAVE_LIBZ */
 };
 #  endif /* !_HTTP_NO_PRIVATE */
index 246c5ca7dd930f2d8e4d7650bc1717bec8480699..377610e7867d0256c2aa06fb4aa487af471d4a69 100644 (file)
@@ -1777,10 +1777,10 @@ httpPeek(http_t *http,                  /* I - HTTP connection */
                                        /* 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->sbuffer)
+        memmove(http->sbuffer, http->stream.next_in, http->stream.avail_in);
 
-      http->stream.next_in = http->dbuffer;
+      http->stream.next_in = http->sbuffer;
 
       if (buflen > (size_t)http->data_remaining)
         buflen = (size_t)http->data_remaining;
@@ -1791,7 +1791,7 @@ httpPeek(http_t *http,                    /* I - HTTP connection */
       DEBUG_printf(("1httpPeek: Copying %d more bytes of data into "
                    "decompression buffer.", (int)buflen));
 
-      memcpy(http->dbuffer + http->stream.avail_in, http->buffer, buflen);
+      memcpy(http->sbuffer + http->stream.avail_in, http->buffer, buflen);
       http->stream.avail_in += buflen;
       http->used            -= buflen;
       http->data_remaining  -= buflen;
@@ -1820,7 +1820,7 @@ httpPeek(http_t *http,                    /* I - HTTP connection */
     {
       DEBUG_printf(("2httpPeek: zerr=%d", zerr));
 #ifdef DEBUG
-      http_debug_hex("2httpPeek", (char *)http->dbuffer, (int)http->stream.avail_in);
+      http_debug_hex("2httpPeek", (char *)http->sbuffer, (int)http->stream.avail_in);
 #endif /* DEBUG */
 
       http->error = EIO;
@@ -2015,7 +2015,7 @@ httpRead2(http_t *http,                   /* I - HTTP connection */
        {
          DEBUG_printf(("2httpRead2: zerr=%d", zerr));
 #ifdef DEBUG
-          http_debug_hex("2httpRead2", (char *)http->dbuffer, (int)http->stream.avail_in);
+          http_debug_hex("2httpRead2", (char *)http->sbuffer, (int)http->stream.avail_in);
 #endif /* DEBUG */
 
          http->error = EIO;
@@ -2039,10 +2039,10 @@ httpRead2(http_t *http,                 /* I - HTTP connection */
         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->sbuffer)
+            memmove(http->sbuffer, http->stream.next_in, http->stream.avail_in);
 
-         http->stream.next_in = http->dbuffer;
+         http->stream.next_in = http->sbuffer;
 
           DEBUG_printf(("1httpRead2: Reading up to %d more bytes of data into "
                         "decompression buffer.", (int)buflen));
@@ -2052,10 +2052,10 @@ httpRead2(http_t *http,                 /* I - HTTP connection */
            if (buflen > http->data_remaining)
              buflen = (ssize_t)http->data_remaining;
 
-           bytes = http_read_buffered(http, (char *)http->dbuffer + http->stream.avail_in, (size_t)buflen);
+           bytes = http_read_buffered(http, (char *)http->sbuffer + http->stream.avail_in, (size_t)buflen);
           }
           else if (http->data_encoding == HTTP_ENCODING_CHUNKED)
-            bytes = http_read_chunk(http, (char *)http->dbuffer + http->stream.avail_in, (size_t)buflen);
+            bytes = http_read_chunk(http, (char *)http->sbuffer + http->stream.avail_in, (size_t)buflen);
           else
             bytes = 0;
 
@@ -3323,30 +3323,51 @@ httpWrite2(http_t     *http,            /* I - HTTP connection */
     }
     else
     {
+      size_t   slen;                   /* Bytes to write */
+      ssize_t  sret;                   /* Bytes written */
+
       http->stream.next_in   = (Bytef *)buffer;
       http->stream.avail_in  = (uInt)length;
-      http->stream.next_out  = (Bytef *)http->wbuffer + http->wused;
-      http->stream.avail_out = (uInt)(sizeof(http->wbuffer) - (size_t)http->wused);
+      http->stream.next_out  = (Bytef *)http->sbuffer;
+      http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
 
       while (deflate(&(http->stream), Z_NO_FLUSH) == Z_OK)
       {
-       http->wused = (int)(sizeof(http->wbuffer) - (size_t)http->stream.avail_out);
+       slen = _HTTP_MAX_SBUFFER - http->stream.avail_out;
 
-        if (http->stream.avail_out == 0)
-        {
-         if (httpFlushWrite(http) < 0)
-         {
-           DEBUG_puts("1httpWrite2: Unable to flush, returning -1.");
-           return (-1);
-         }
+       if (slen > 0 && http->data_encoding == HTTP_ENCODING_CHUNKED)
+         sret = http_write_chunk(http, (char *)http->sbuffer, slen);
+       else if (slen > 0)
+         sret = http_write(http, (char *)http->sbuffer, slen);
+       else
+         sret = 0;
 
-         http->stream.next_out  = (Bytef *)http->wbuffer;
-         http->stream.avail_out = sizeof(http->wbuffer);
+        if (sret < 0)
+       {
+         DEBUG_puts("1httpWrite2: Unable to write, returning -1.");
+         return (-1);
        }
+
+       http->stream.next_out  = (Bytef *)http->sbuffer;
+       http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
+      }
+
+      slen = _HTTP_MAX_SBUFFER - http->stream.avail_out;
+
+      if (slen > 0 && http->data_encoding == HTTP_ENCODING_CHUNKED)
+       sret = http_write_chunk(http, (char *)http->sbuffer, slen);
+      else if (slen > 0)
+       sret = http_write(http, (char *)http->sbuffer, slen);
+      else
+       sret = 0;
+
+      if (sret < 0)
+      {
+       DEBUG_puts("1httpWrite2: Unable to write, returning -1.");
+       return (-1);
       }
 
-      http->wused = (int)(sizeof(http->wbuffer) - (size_t)http->stream.avail_out);
-      bytes       = (ssize_t)length;
+      bytes = (ssize_t)length;
     }
   }
   else
@@ -3667,8 +3688,9 @@ static void
 http_content_coding_finish(
     http_t *http)                      /* I - HTTP connection */
 {
-  int  zerr;                           /* Compression status */
-  Byte dummy[1];                       /* Dummy read buffer */
+  int          zerr;                   /* Compression status */
+  Byte         dummy[1];               /* Dummy read buffer */
+  size_t       bytes;                  /* Number of bytes to write */
 
 
   switch (http->coding)
@@ -3680,19 +3702,24 @@ http_content_coding_finish(
 
         do
         {
-          http->stream.next_out  = (Bytef *)http->wbuffer + http->wused;
-          http->stream.avail_out = (uInt)(sizeof(http->wbuffer) - (size_t)http->wused);
+          http->stream.next_out  = (Bytef *)http->sbuffer;
+          http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
 
-          zerr = deflate(&(http->stream), Z_FINISH);
+          zerr  = deflate(&(http->stream), Z_FINISH);
+         bytes = _HTTP_MAX_SBUFFER - http->stream.avail_out;
 
-          http->wused = (int)(sizeof(http->wbuffer) - (size_t)http->stream.avail_out);
-          if (http->wused == sizeof(http->wbuffer))
-            httpFlushWrite(http);
+          if (bytes > 0 && http->data_encoding == HTTP_ENCODING_CHUNKED)
+           http_write_chunk(http, (char *)http->sbuffer, bytes);
+         else if (bytes > 0)
+           http_write(http, (char *)http->sbuffer, bytes);
         }
         while (zerr == Z_OK);
 
         deflateEnd(&(http->stream));
 
+        free(http->sbuffer);
+        http->sbuffer = NULL;
+
         if (http->wused)
           httpFlushWrite(http);
         break;
@@ -3700,8 +3727,8 @@ http_content_coding_finish(
     case _HTTP_CODING_INFLATE :
     case _HTTP_CODING_GUNZIP :
         inflateEnd(&(http->stream));
-        free(http->dbuffer);
-        http->dbuffer = NULL;
+        free(http->sbuffer);
+        http->sbuffer = NULL;
         break;
 
     default :
@@ -3781,6 +3808,13 @@ http_content_coding_start(
         if (http->wused)
           httpFlushWrite(http);
 
+        if ((http->sbuffer = malloc(_HTTP_MAX_SBUFFER)) == NULL)
+        {
+          http->status = HTTP_STATUS_ERROR;
+          http->error  = errno;
+          return;
+        }
+
        /*
         * Window size for compression is 11 bits - optimal based on PWG Raster
         * sample files on pwg.org.  -11 is raw deflate, 27 is gzip, per ZLIB
@@ -3800,7 +3834,7 @@ http_content_coding_start(
 
     case _HTTP_CODING_INFLATE :
     case _HTTP_CODING_GUNZIP :
-        if ((http->dbuffer = malloc(HTTP_MAX_BUFFER)) == NULL)
+        if ((http->sbuffer = malloc(_HTTP_MAX_SBUFFER)) == NULL)
         {
           http->status = HTTP_STATUS_ERROR;
           http->error  = errno;
@@ -3816,15 +3850,15 @@ http_content_coding_start(
                                  coding == _HTTP_CODING_INFLATE ? -15 : 31))
                < Z_OK)
         {
-          free(http->dbuffer);
-          http->dbuffer = NULL;
+          free(http->sbuffer);
+          http->sbuffer = NULL;
           http->status  = HTTP_STATUS_ERROR;
           http->error   = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
           return;
         }
 
         http->stream.avail_in = 0;
-        http->stream.next_in  = http->dbuffer;
+        http->stream.next_in  = http->sbuffer;
         break;
 
     default :
index ec11b96f5bd7111e8ac47d8cb1a6cbb3ab9887f8..a25435927cbec4879baf9efff5a80e137d804c1c 100644 (file)
@@ -8,46 +8,50 @@
 <body>
 <h1 class="title">client.conf(5)</h1>
 <h2 class="title"><a name="NAME">Name</a></h2>
-client.conf - client configuration file for cups
+client.conf - client configuration file for cups (deprecated)
 <h2 class="title"><a name="DESCRIPTION">Description</a></h2>
-The <i>client.conf</i> file configures the CUPS client and is
-normally located in the <i>/etc/cups</i> or <i>~/.cups</i>
-directory. Each line in the file can be a configuration
-directive, a blank line, or a comment. Comment lines start with
-the # character.
-<h2 class="title"><a name="DIRECTIVES">Directives</a></h2>
-The following directives are understood by the client. Consult the
-on-line help for detailed descriptions:
+The <b>client.conf</b> file configures the CUPS client and is normally located in the <i>/etc/cups</i> and/or <i>~/.cups</i> directories.
+Each line in the file can be a configuration directive, a blank line, or a comment. Comment lines start with the # character.
+<p><b>Note:</b> Starting with OS X 10.7, this file is only used by command-line and X11 applications.
+The <b>ServerName</b> directive is not supported on OS X at all.
+<h3><a name="DIRECTIVES">Directives</a></h3>
+The following directives are understood by the client. Consult the online help for detailed descriptions:
 <dl class="man">
-<dt>Encryption IfRequested
-<dd style="margin-left: 5.0em"><dt>Encryption Never
-<dd style="margin-left: 5.0em"><dt>Encryption Required
-<dd style="margin-left: 5.0em"><br>
-Specifies the level of encryption that is required for a particular
-location.
-<dt>GSSServiceName name
-<dd style="margin-left: 5.0em">Specifies the Kerberos service name that is used for authentication, typically
-"host", "http", or "ipp". CUPS adds the remote hostname
-("name@server.example.com") for you. The default name is
-"http".
-<dt>ServerName hostname-or-ip-address[:port]
-<dd style="margin-left: 5.0em"><dt>ServerName /domain/socket
-<dd style="margin-left: 5.0em"><br>
-Specifies the address and optionally the port to use when connecting to the
-server. <b>Note: Not supported on OS X 10.7 or later.</b>
-<dt>ServerName hostname-or-ip-address[:port]/version=1.1
-<dd style="margin-left: 5.0em"><br>
-Specifies the address and optionally the port to use when connecting to a
-server running CUPS 1.3.12 and earlier. <b>Note: Not supported on OS X 10.7 or
-later.</b>
-<dt>User name
-<dd style="margin-left: 5.0em"><br>
-Specifies the default user name to use for requests.
+<dt><b>AllowAnyRoot Yes</b>
+<dd style="margin-left: 5.0em"><dt><b>AllowAnyRoot No</b>
+<dd style="margin-left: 5.0em">Specifies whether to allow TLS with certificates that have not been signed by a trusted Certificate Authority.
+The default is "Yes".
+<dt><b>AllowExpiredCerts Yes</b>
+<dd style="margin-left: 5.0em"><dt><b>AllowExpiredCerts No</b>
+<dd style="margin-left: 5.0em">Specifies whether to allow TLS with expired certificates.
+The default is "Yes".
+<dt><b>Encryption IfRequested</b>
+<dd style="margin-left: 5.0em"><dt><b>Encryption Never</b>
+<dd style="margin-left: 5.0em"><dt><b>Encryption Required</b>
+<dd style="margin-left: 5.0em">Specifies the level of encryption that should be used.
+<dt><b>GSSServiceName </b><i>name</i>
+<dd style="margin-left: 5.0em">Specifies the Kerberos service name that is used for authentication, typically "host", "http", or "ipp".
+CUPS adds the remote hostname ("name@server.example.com") for you. The default name is "http".
+<dt><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]
+<dd style="margin-left: 5.0em"><dt><b>ServerName </b><i>/domain/socket</i>
+<dd style="margin-left: 5.0em">Specifies the address and optionally the port to use when connecting to the server.
+<b>Note: This directive it not supported on OS X 10.7 or later.</b>
+<dt><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]<b>/version=1.1</b>
+<dd style="margin-left: 5.0em">Specifies the address and optionally the port to use when connecting to a server running CUPS 1.3.12 and earlier.
+<dt><b>User </b><i>name</i>
+<dd style="margin-left: 5.0em">Specifies the default user name to use for requests.
+<dt><b>ValidateCerts Yes</b>
+<dd style="margin-left: 5.0em"><dt><b>ValidateCerts No</b>
+<dd style="margin-left: 5.0em">Specifies whether to only allow TLS with certificates whose common name matches the hostname.
+The default is "No".
 </dl>
+<h2 class="title"><a name="NOTES">Notes</a></h2>
+The <b>client.conf</b> file is deprecated and will no longer be supported in a future version of CUPS.
 <h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
-<a href="http://localhost:631/help">http://localhost:631/help</a>
+<a href="man-cups.html?TOPIC=Man+Pages"><b>cups</b>(1),</a>
+CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright 2007-2013 by Apple Inc.
+Copyright &copy; 2007-2014 by Apple Inc.
 
 </body>
 </html>
index f23cbdbd08c704326d19d96d01590a867d219599..b4778bfdb2e6df4c0dd54ebf9a7df4cad8cdc505 100644 (file)
 <h2 class="title"><a name="NAME">Name</a></h2>
 cups-files.conf - file and directory configuration file for cups
 <h2 class="title"><a name="DESCRIPTION">Description</a></h2>
-The <i>cups-files.conf</i> file configures the files and directories used by the
-CUPS scheduler, <i>cupsd(8)</i>.  It is normally located in the
-<i>/etc/cups</i> directory.
-<p>Each line in the file can be a configuration directive, a blank line,
-or a comment. Comment lines start with the # character.
-<h2 class="title"><a name="DIRECTIVES">Directives</a></h2>
-The following directives are understood by <i>cupsd(8)</i>. Consult the
-on-line help for detailed descriptions:
+The <b>cups-files.conf</b> file configures the files and directories used by the CUPS scheduler,
+<a href="man-cupsd.html?TOPIC=Man+Pages"><b>cupsd</b>(8).</a>
+It is normally located in the <i>/etc/cups</i> directory.
+<p>Each line in the file can be a configuration directive, a blank line, or a comment.
+Comment lines start with the # character.
+<h3><a name="DIRECTIVES">Directives</a></h3>
+The following directives are understood by
+<a href="man-cupsd.html?TOPIC=Man+Pages"><b>cupsd</b>(8):</a>
 <dl class="man">
-<dt>AccessLog filename
-<dd style="margin-left: 5.0em"><dt>AccessLog syslog
-<dd style="margin-left: 5.0em"><br>
-Defines the access log filename.
-<dt>ConfigFilePerm mode
-<dd style="margin-left: 5.0em"><br>
-Specifies the permissions for all configuration files that the scheduler
-writes.
-<dt>DataDir path
-<dd style="margin-left: 5.0em"><br>
-Specified the directory where data files can be found.
-<dt>DocumentRoot directory
-<dd style="margin-left: 5.0em"><br>
-Specifies the root directory for the internal web server documents.
-<dt>ErrorLog filename
-<dd style="margin-left: 5.0em"><dt>ErrorLog syslog
-<dd style="margin-left: 5.0em"><br>
-Specifies the error log filename.
-<dt>FatalErrors none
-<dd style="margin-left: 5.0em"><dt>FatalErrors all -kind [... -kind]
-<dd style="margin-left: 5.0em"><dt>FatalErrors kind [... kind]
-<dd style="margin-left: 5.0em"><br>
-Specifies which errors are fatal, causing the scheduler to exit. "Kind" is
-"browse", "config", "listen", "log", or "permissions".
-<dt>FileDevice Yes
-<dd style="margin-left: 5.0em"><dt>FileDevice No
-<dd style="margin-left: 5.0em"><br>
-Specifies whether the file pseudo-device can be used for new
-printer queues.
-<dt>FontPath directory[:directory:...]
-<dd style="margin-left: 5.0em"><br>
-Specifies the search path for fonts.
-<dt>Group group-name-or-number
-<dd style="margin-left: 5.0em"><br>
-Specifies the group name or ID that will be used when executing
-external programs.
-<dt>LogFilePerm mode
-<dd style="margin-left: 5.0em"><br>
-Specifies the permissions for all log files that the scheduler writes.
-<dt>PageLog filename
-<dd style="margin-left: 5.0em"><dt>PageLog syslog
-<dd style="margin-left: 5.0em"><br>
-Specifies the page log filename.
-<dt>Printcap
-<dd style="margin-left: 5.0em"><dt>Printcap filename
-<dd style="margin-left: 5.0em"><br>
-Specifies the filename for a printcap file that is updated
-automatically with a list of available printers (needed for
-legacy applications); specifying Printcap with no filename
-disables printcap generation.
-<dt>RemoteRoot user-name
-<dd style="margin-left: 5.0em"><br>
-Specifies the username that is associated with unauthenticated root
-accesses.
-<dt>RequestRoot directory
-<dd style="margin-left: 5.0em"><br>
-Specifies the directory to store print jobs and other HTTP request
-data.
-<dt>Sandboxing off
-<dd style="margin-left: 5.0em"><dt>Sandboxing relaxed
-<dd style="margin-left: 5.0em"><dt>Sandboxing strict
-<dd style="margin-left: 5.0em">Specifies the level of security sandboxing that is applied to print filters, backends, and other child processes of the scheduler. The default is "strict". (OS X only)
-<dt>ServerBin directory
-<dd style="margin-left: 5.0em"><br>
-Specifies the directory where backends, CGIs, daemons, and filters may
-be found.
-<dt>ServerKeychain path
-<dd style="margin-left: 5.0em"><br>
-Specifies the location of TLS certificates and private keys.
-<dt>ServerRoot directory
-<dd style="margin-left: 5.0em"><br>
-Specifies the directory where the server configuration files can be found.
-<dt>SyncOnClose Yes
-<dd style="margin-left: 5.0em"><dt>SyncOnClose No
-<dd style="margin-left: 5.0em">Specifies whether the scheduler calls <i>fsync(2)</i> after writing configuration
-or state files. The default is No.
-<dt>SystemGroup group-name [group-name ...]
-<dd style="margin-left: 5.0em"><br>
-Specifies the group(s) to use for System class authentication.
-<dt>TempDir directory
-<dd style="margin-left: 5.0em"><br>
-Specifies the directory where temporary files are stored.
-<dt>User user-name
-<dd style="margin-left: 5.0em"><br>
-Specifies the user name or ID that is used when running external programs.
+<dt><b>AccessLog </b><i>filename</i>
+<dd style="margin-left: 5.0em"><dt><b>AccessLog </b>[ <i>filename</i> ]
+<dd style="margin-left: 5.0em"><dt><b>AccessLog syslog</b>
+<dd style="margin-left: 5.0em">Defines the access log filename.
+The value "syslog" causes log entries to be sent to the system log daemon.
+Specifying a blank filename disables access log generation.
+The server name may be included in filenames using the string "%s", for example:
+<pre class="man">
+
+    AccessLog /var/log/cups/%s-access_log
+
+</pre>
+<dt><b>ConfigFilePerm </b><i>mode</i>
+<dd style="margin-left: 5.0em">Specifies the permissions for all configuration files that the scheduler writes.
+The default is 0644 on OS X and 0640 on all other operating systems.
+<b>Note:</b> The permissions for the printers.conf file are currently masked to only allow access from the scheduler user (typically root).
+This is done because printer device URIs sometimes contain sensitive authentication information that should not be generally known on the system.
+There is no way to disable this security feature.
+<dt><b>DataDir </b><i>path</i>
+<dd style="margin-left: 5.0em">Specifies the directory where data files can be found. The default is usually <i>/usr/share/cups</i>.
+<dt><b>DocumentRoot </b><i>directory</i>
+<dd style="margin-left: 5.0em">Specifies the root directory for the CUPS web interface content. The default is usually <i>/usr/share/doc/cups</i>.
+<dt><b>ErrorLog </b>[ <i>filename</i> ]
+<dd style="margin-left: 5.0em"><dt><b>ErrorLog syslog</b>
+<dd style="margin-left: 5.0em">Defines the error log filename.
+The value "syslog" causes log entries to be sent to the system log daemon.
+Specifying a blank filename disables error log generation.
+The server name may be included in filenames using the string "%s", for example:
+<pre class="man">
+
+    ErrorLog /var/log/cups/%s-error_log
+
+</pre>
+<dt><b>FatalErrors none</b>
+<dd style="margin-left: 5.0em"><dt><b>FatalErrors all </b><i>-kind </i>[ <i>... -kind </i>]
+<dd style="margin-left: 5.0em"><dt><b>FatalErrors </b><i>kind </i>[ <i>... kind </i>]
+<dd style="margin-left: 5.0em">Specifies which errors are fatal, causing the scheduler to exit.
+The default setting is "config".
+The <i>kind</i> strings are:
+<div style="margin-left: 0.0em;">
+<dl class="man">
+<dt><b>none</b>
+<dd style="margin-left: 5.0em">No errors are fatal.
+<dt><b>all</b>
+<dd style="margin-left: 5.0em">All of the errors below are fatal.
+<dt><b>browse</b>
+<dd style="margin-left: 5.0em">Browsing initialization errors are fatal, for example failed connections to the DNS-SD daemon.
+<dt><b>config</b>
+<dd style="margin-left: 5.0em">Configuration file syntax errors are fatal.
+<dt><b>listen</b>
+<dd style="margin-left: 5.0em">Listen or Port errors are fatal, except for IPv6 failures on the loopback or "any" addresses.
+<dt><b>log</b>
+<dd style="margin-left: 5.0em">Log file creation or write errors are fatal.
+<dt><b>permissions</b>
+<dd style="margin-left: 5.0em">Bad startup file permissions are fatal, for example shared TLS certificate and key files with world-read permissions.
+</div>
+<dt><b>FileDevice Yes</b>
+<dd style="margin-left: 5.0em"><dt><b>FileDevice No</b>
+<dd style="margin-left: 5.0em">Specifies whether the file pseudo-device can be used for new printer queues.
+The URI "file:///dev/null" is always allowed.
+<dt><b>FontPath </b><i>directory</i>[:<i>...</i>:<i>directory</i>]
+<dd style="margin-left: 5.0em">Specifies the search path for fonts.
+<b>This directive is deprecated and will no longer be supported in a future release of CUPS.</b>
+<dt><b>Group </b><i>group-name-or-number</i>
+<dd style="margin-left: 5.0em">Specifies the group name or ID that will be used when executing external programs.
+The default group is operating system specific but is usually <i>lp</i> or <i>nobody</i>.
+<dt><b>LogFilePerm </b><i>mode</i>
+<dd style="margin-left: 5.0em">Specifies the permissions of all log files that the scheduler writes. The default is 0644.
+<dt><b>PageLog </b>[ <i>filename</i> ]
+<dd style="margin-left: 5.0em"><dt><b>PageLog syslog</b>
+<dd style="margin-left: 5.0em">Defines the page log filename.
+The value "syslog" causes log entries to be sent to the system log daemon.
+Specifying a blank filename disables page log generation.
+The server name may be included in filenames using the string "%s", for example:
+<pre class="man">
+
+    PageLog /var/log/cups/%s-page_log
+
+</pre>
+<dt><b>Printcap </b>[ <i>filename</i> ]
+<dd style="margin-left: 5.0em">Defines the printcap filename that the scheduler automatically updates with the current list of available printers, which is sometimes used by legacy applications.
+Specifying a blank filename disables printcap generation.
+<b>This directive is deprecated and will no longer be supported in a future release of CUPS.</b>
+<dt><b>RemoteRoot </b><i>username</i>
+<dd style="margin-left: 5.0em">Specifies the username that is associated with unauthenticated accesses by clients claiming to be the root user.
+<dt><b>RequestRoot </b><i>directory</i>
+<dd style="margin-left: 5.0em">Specifies the directory that contains print jobs and other HTTP request data.
+<dt><b>Sandboxing off</b>
+<dd style="margin-left: 5.0em"><dt><b>Sandboxing relaxed</b>
+<dd style="margin-left: 5.0em"><dt><b>Sandboxing strict</b>
+<dd style="margin-left: 5.0em">Specifies the level of security sandboxing that is applied to print filters, backends, and other child processes of the scheduler.
+The default is "strict".
+This directive is currently only used on OS X.
+<dt><b>ServerBin </b><i>directory</i>
+<dd style="margin-left: 5.0em">Specifies the directory containing the backends, CGI programs, filters, helper programs, notifiers, and port monitors.
+<dt><b>ServerKeychain </b><i>path</i>
+<dd style="margin-left: 5.0em">Specifies the location of TLS certificates and private keys.
+<dt><b>ServerRoot </b><i>directory</i>
+<dd style="margin-left: 5.0em">Specifies the directory containing the server configuration files.
+<dt><b>SyncOnClose Yes</b>
+<dd style="margin-left: 5.0em"><dt><b>SyncOnClose No</b>
+<dd style="margin-left: 5.0em">Specifies whether the scheduler calls
+<b>fsync</b>(2)
+after writing configuration or state files. The default is No.
+<dt><b>SystemGroup </b><i>group-name </i>[ <i>... group-name</i> ]
+<dd style="margin-left: 5.0em">Specifies the group(s) to use for <i>@SYSTEM</i> group authentication.
+<dt><b>TempDir </b><i>directory</i>
+<dd style="margin-left: 5.0em">Specifies the directory where temporary files are stored.
+<dt><b>User </b><i>username</i>
+<dd style="margin-left: 5.0em">Specifies the user name or ID that is used when running external programs.
 </dl>
 <h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
-<i>classes.conf(5)</i>, <i>cupsd(8)</i>, <i>cupsd.conf(5)</i>, <i>mime.convs(5)</i>,
-<i>mime.types(5)</i>, <i>printers.conf(5)</i>,
-<i>subscriptions.conf(5)</i>,
-<br>
-<a href="http://localhost:631/help">http://localhost:631/help</a>
+<a href="man-classes.conf.html?TOPIC=Man+Pages"><b>classes.conf</b>(5),</a>
+<a href="man-cups.html?TOPIC=Man+Pages"><b>cups</b>(1),</a>
+<a href="man-cupsd.html?TOPIC=Man+Pages"><b>cupsd</b>(8),</a>
+<a href="man-cupsd.conf.html?TOPIC=Man+Pages"><b>cupsd.conf</b>(5),</a>
+<a href="man-mime.convs.html?TOPIC=Man+Pages"><b>mime.convs</b>(5),</a>
+<a href="man-mime.types.html?TOPIC=Man+Pages"><b>mime.types</b>(5),</a>
+<a href="man-printers.conf.html?TOPIC=Man+Pages"><b>printers.conf</b>(5),</a>
+<a href="man-subscriptions.conf.html?TOPIC=Man+Pages"><b>subscriptions.conf</b>(5),</a>
+CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright 2007-2014 by Apple Inc.
+Copyright &copy; 2007-2014 by Apple Inc.
 
 </body>
 </html>
index bdc544a129ee59c102611d5cae16b30793a02bd4..c6c71fe6266f8ab6a6cd58e0b89dc8226a0cd0aa 100644 (file)
@@ -14,7 +14,9 @@ The
 <i>cupsd.conf</i>
 file configures the CUPS scheduler,
 <a href="man-cupsd.html?TOPIC=Man+Pages"><b>cupsd</b>(8).</a>
-It is normally located in the <i>/etc/cups</i> directory. <b>Note:</b> File, directory, and user configuration directives that used to be allowed in the <i>cupsd.conf</i> file are now stored in the <i>cups-files.conf(5)</i> instead in order to prevent certain types of privilege escalation attacks.
+It is normally located in the
+<i>/etc/cups</i>
+directory. <b>Note:</b> File, directory, and user configuration directives that used to be allowed in the <i>cupsd.conf</i> file are now stored in the <i>cups-files.conf(5)</i> instead in order to prevent certain types of privilege escalation attacks.
 <p>Each line in the file can be a configuration directive, a blank line, or a comment. Comment lines start with the # character. The configuration directives are intentionally similar to those used by the popular Apache web server software and are described below.
 <h2 class="title"><a name="TOP_LEVEL_DIRECTIVES">Top-level Directives</a></h2>
 The following directives are understood by
index 7f8242408b6eb0fb1145e2f044e6a55394449b1b..1050d3a525a1200b7690ef53622a35db7cc141c0 100644 (file)
 cupsd - cups scheduler
 <h2 class="title"><a name="SYNOPSIS">Synopsis</a></h2>
 <b>cupsd</b>
-[ -c
+[
+<b>-c</b>
 <i>config-file</i>
-] [ -f ] [ -F ] [ -h ] [ -l ] [ -t ]
+] [ 
+<b>-f</b>
+] [
+<b>-F</b>
+] [
+<b>-h</b>
+] [
+<b>-l</b>
+] [
+<b>-t</b>
+]
 <h2 class="title"><a name="DESCRIPTION">Description</a></h2>
 <b>cupsd</b>
 is the scheduler for CUPS. It implements a printing system based upon the Internet Printing Protocol, version 2.1. If no options are specified on the command-line then the default configuration file
@@ -21,33 +32,83 @@ is the scheduler for CUPS. It implements a printing system based upon the Intern
 will be used.
 <h2 class="title"><a name="OPTIONS">Options</a></h2>
 <dl class="man">
-<dt>-c config-file
+<dt><b>-c</b><i> config-file</i>
 <dd style="margin-left: 5.0em">Uses the named configuration file.
-<dt>-f
+<dt><b>-f</b>
 <dd style="margin-left: 5.0em">Run
 <b>cupsd</b>
 in the foreground; the default is to run in the background as a "daemon".
-<dt>-F
+<dt><b>-F</b>
 <dd style="margin-left: 5.0em">Run
 <b>cupsd</b>
 in the foreground but detach the process from the controlling terminal and current directory. This is useful for running
-<b>cupsd</b>from<b>init</b>(8).
-<dt>-h
+<b>cupsd</b>
+from
+<b>init</b>(8).
+<dt><b>-h</b>
 <dd style="margin-left: 5.0em">Shows the program usage.
-<dt>-l
+<dt><b>-l</b>
 <dd style="margin-left: 5.0em">This option is passed to
 <b>cupsd</b>
 when it is run from
-<b>launchd</b>(8).
-<dt>-t
+<b>launchd</b>(8)
+or
+<b>systemd</b>(8).
+<dt><b>-t</b>
 <dd style="margin-left: 5.0em">Test the configuration file for syntax errors.
 </dl>
-<h2 class="title"><a name="COMPATIBILITY">Compatibility</a></h2>
+<h2 class="title"><a name="FILES">Files</a></h2>
+<pre class="man">
+<i>/etc/cups/classes.conf</i>
+<i>/etc/cups/cups-files.conf</i>
+<i>/etc/cups/cupsd.conf</i>
+<i>/usr/share/cups/mime/mime.convs</i>
+<i>/usr/share/cups/mime/mime.types</i>
+<i>/etc/cups/printers.conf</i>
+</pre>
+<h2 class="title"><a name="CONFORMING_TO">Conforming To</a></h2>
+<b>cupsd</b>
+implements all of the required IPP/2.1 attributes and operations. It also implements several CUPS-specific administrative operations.
+<h2 class="title"><a name="EXAMPLES">Examples</a></h2>
+Run
+<b>cupsd</b>
+in the background with the default configuration file:
+<pre class="man">
+
+    cupsd
+
+</pre>
+Test a configuration file called
+<i>test.conf</i>:
+<pre class="man">
+
+    cupsd -t -c test.conf
+
+</pre>
+Run
 <b>cupsd</b>
-implements all of the required IPP/2.1 attributes and operations. It also implements several CUPS-specific administration operations.
+in the foreground with a test configuration file called
+<i>test.conf</i>:
+<pre class="man">
+
+    cupsd -f -c test.conf
+
+</pre>
 <h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
-<a href="man-backend.html?TOPIC=Man+Pages"><b>backend</b>(7),</a><a href="man-classes.conf.html?TOPIC=Man+Pages"><b>classes.conf</b>(5),</a><b>cups-deviced</b>(8),<b>cups-driverd</b>(8),<a href="man-cups-lpd.html?TOPIC=Man+Pages"><b>cups-lpd</b>(8),</a><a href="man-cupsd.conf.html?TOPIC=Man+Pages"><b>cupsd.conf</b>(5),</a><a href="man-filter.html?TOPIC=Man+Pages"><b>filter</b>(7),</a><b>launchd</b>(8),<a href="man-mime.convs.html?TOPIC=Man+Pages"><b>mime.convs</b>(5),</a><a href="man-mime.types.html?TOPIC=Man+Pages"><b>mime.types</b>(5),</a><a href="man-printers.conf.html?TOPIC=Man+Pages"><b>printers.conf</b>(5),</a>
-<a href="http://localhost:631/help">http://localhost:631/help</a>
+<a href="man-backend.html?TOPIC=Man+Pages"><b>backend</b>(7),</a>
+<a href="man-classes.conf.html?TOPIC=Man+Pages"><b>classes.conf</b>(5),</a>
+<a href="man-cups.html?TOPIC=Man+Pages"><b>cups</b>(1),</a>
+<b>cups-deviced</b>(8),
+<b>cups-driverd</b>(8),
+<a href="man-cups-lpd.html?TOPIC=Man+Pages"><b>cups-lpd</b>(8),</a>
+<a href="man-cupsd.conf.html?TOPIC=Man+Pages"><b>cupsd.conf</b>(5),</a>
+<a href="man-filter.html?TOPIC=Man+Pages"><b>filter</b>(7),</a>
+<b>launchd</b>(8),
+<a href="man-mime.convs.html?TOPIC=Man+Pages"><b>mime.convs</b>(5),</a>
+<a href="man-mime.types.html?TOPIC=Man+Pages"><b>mime.types</b>(5),</a>
+<a href="man-printers.conf.html?TOPIC=Man+Pages"><b>printers.conf</b>(5),</a>
+<b>systemd</b>(8),
+CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
 Copyright &copy; 2007-2014 by Apple Inc.
 
index 9bd717ee6ffaa71c96537e8da794275053f10d1d..5695b262238e220be03adcdcd912581cfcc88a53 100644 (file)
@@ -2679,6 +2679,9 @@ ipp_print_job(_ipp_client_t *client)      /* I - Client */
     snprintf(filename, sizeof(filename), "%s/%d.prn",
              client->printer->directory, job->id);
 
+  if (Verbosity)
+    fprintf(stderr, "Creating job file \"%s\", format \"%s\".\n", filename, job->format);
+
   if ((job->fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0)
   {
     job->state = IPP_JSTATE_ABORTED;
@@ -3166,8 +3169,7 @@ ipp_send_document(_ipp_client_t *client)/* I - Client */
 
   _cupsRWLockWrite(&(client->printer->rwlock));
 
-  if ((attr = ippFindAttribute(job->attrs, "document-format",
-                               IPP_TAG_MIMETYPE)) != NULL)
+  if ((attr = ippFindAttribute(client->request, "document-format", IPP_TAG_MIMETYPE)) != NULL)
     job->format = ippGetString(attr, 0, NULL);
   else
     job->format = "application/octet-stream";
@@ -3192,6 +3194,9 @@ ipp_send_document(_ipp_client_t *client)/* I - Client */
     snprintf(filename, sizeof(filename), "%s/%d.prn",
              client->printer->directory, job->id);
 
+  if (Verbosity)
+    fprintf(stderr, "Creating job file \"%s\", format \"%s\".\n", filename, job->format);
+
   job->fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
 
   _cupsRWUnlock(&(client->printer->rwlock));