summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES-1.6.txt3
-rw-r--r--CHANGES-IPPTOOL.txt4
-rw-r--r--IPPTOOL.txt2
-rw-r--r--backend/ipp.c14
-rw-r--r--conf/Makefile2
-rw-r--r--conf/cups-files.conf.in98
-rw-r--r--conf/cupsd.conf.in4
-rw-r--r--config-scripts/cups-defaults.m42
-rw-r--r--config-scripts/cups-ssl.m411
-rw-r--r--configure.in2
-rw-r--r--cups/http-addr.c7
-rw-r--r--cups/http-private.h5
-rw-r--r--cups/http.c73
-rw-r--r--cups/versioning.h4
-rw-r--r--doc/Makefile2
-rw-r--r--doc/help/man-ipptoolfile.html12
-rw-r--r--doc/help/ref-cups-files-conf.html.in531
-rw-r--r--doc/help/ref-cupsd-conf.html.in324
-rw-r--r--man/Makefile1
-rw-r--r--man/cups-files.conf.man.in146
-rw-r--r--man/cupsd.conf.man.in143
-rw-r--r--man/ipptoolfile.man11
-rw-r--r--packaging/cups.list.in2
-rw-r--r--packaging/cups.spec.in1
-rw-r--r--scheduler/client.c38
-rw-r--r--scheduler/conf.c744
-rw-r--r--scheduler/conf.h4
-rw-r--r--scheduler/main.c53
-rw-r--r--test/ipptool.c65
-rwxr-xr-xtest/run-stp-tests.sh44
30 files changed, 1488 insertions, 864 deletions
diff --git a/CHANGES-1.6.txt b/CHANGES-1.6.txt
index e5e87ae88..5ace73229 100644
--- a/CHANGES-1.6.txt
+++ b/CHANGES-1.6.txt
@@ -4,6 +4,9 @@ CHANGES-1.6.txt
CHANGES IN CUPS V1.6.2
- Documentation fixes
+ - 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 SNMP backend now tries to work around broken printers that use a
newline to separate key/value pairs.
- The IPP backend did not send a cancel request to printers when a job
diff --git a/CHANGES-IPPTOOL.txt b/CHANGES-IPPTOOL.txt
index 9c4a8038a..a0b9176da 100644
--- a/CHANGES-IPPTOOL.txt
+++ b/CHANGES-IPPTOOL.txt
@@ -1,4 +1,4 @@
-CHANGES-IPPTOOL.txt - 2012-09-15
+CHANGES-IPPTOOL.txt - 2012-11-16
--------------------------------
This file provides a list of changes to the ipptool binary distribution posted
@@ -10,6 +10,8 @@ on cups.org.
- ipptool did not support octetString values.
- 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
diff --git a/IPPTOOL.txt b/IPPTOOL.txt
index 1d1fce704..5aa027f1e 100644
--- a/IPPTOOL.txt
+++ b/IPPTOOL.txt
@@ -1,4 +1,4 @@
-IPPTOOL.txt - 2012-02-06
+IPPTOOL.txt - 2012-11-16
------------------------
See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
diff --git a/backend/ipp.c b/backend/ipp.c
index 180586e05..d3dd8de9c 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -1500,6 +1500,9 @@ main(int argc, /* I - Number of command-line args */
http_status = cupsSendRequest(http, request, resource, length);
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
{
+ if (compression && strcmp(compression, "none"))
+ httpSetField(http, HTTP_FIELD_CONTENT_ENCODING, compression);
+
if (num_files == 1)
{
if ((fd = open(files[0], O_RDONLY)) < 0)
@@ -1537,7 +1540,8 @@ main(int argc, /* I - Number of command-line args */
{
fprintf(stderr, "DEBUG: Read %d bytes...\n", (int)bytes);
- if (cupsWriteRequestData(http, buffer, bytes) != HTTP_CONTINUE)
+ if ((http_status = cupsWriteRequestData(http, buffer, bytes))
+ != HTTP_CONTINUE)
break;
}
else if (bytes == 0 || (errno != EINTR && errno != EAGAIN))
@@ -1545,6 +1549,10 @@ main(int argc, /* I - Number of command-line args */
}
}
+ if (http_status == HTTP_ERROR)
+ fprintf(stderr, "DEBUG: Error writing document data for "
+ "Print-Job: %s\n", strerror(httpError(http)));
+
if (num_files == 1)
close(fd);
}
@@ -1737,6 +1745,10 @@ main(int argc, /* I - Number of command-line args */
close(fd);
}
+ if (http_status == HTTP_ERROR)
+ fprintf(stderr, "DEBUG: Error writing document data for "
+ "Send-Document: %s\n", strerror(httpError(http)));
+
ippDelete(cupsGetResponse(http, resource));
ippDelete(request);
diff --git a/conf/Makefile b/conf/Makefile
index 5114174f1..a68a58b16 100644
--- a/conf/Makefile
+++ b/conf/Makefile
@@ -19,7 +19,7 @@ include ../Makedefs
# Config files...
#
-KEEP = cupsd.conf snmp.conf
+KEEP = cups-files.conf cupsd.conf snmp.conf
REPLACE = mime.convs mime.types
diff --git a/conf/cups-files.conf.in b/conf/cups-files.conf.in
new file mode 100644
index 000000000..8c3a1b58c
--- /dev/null
+++ b/conf/cups-files.conf.in
@@ -0,0 +1,98 @@
+#
+# "$Id$"
+#
+# Sample file/directory/user/group configuration file for the CUPS scheduler.
+# See "man cups-files.conf" for a complete description of this file.
+#
+
+# List of events that are considered fatal errors for the scheduler...
+#FatalErrors @CUPS_FATAL_ERRORS@
+
+# Default user and group for filters/backends/helper programs; this cannot be
+# any user or group that resolves to ID 0 for security reasons...
+#User @CUPS_USER@
+#Group @CUPS_GROUP@
+
+# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
+SystemGroup @CUPS_SYSTEM_GROUPS@
+@CUPS_SYSTEM_AUTHKEY@
+
+# User that is substituted for unauthenticated (remote) root accesses...
+#RemoteRoot remroot
+
+# Do we allow file: device URIs other than to /dev/null?
+#FileDevice No
+
+# Permissions for configuration and log files...
+#ConfigFilePerm @CUPS_CONFIG_FILE_PERM@
+#LogFilePerm @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
+# root directory. Also see the "AccessLogLevel" directive in cupsd.conf.
+AccessLog @CUPS_LOGDIR@/access_log
+
+# Location of cache files used by the scheduler...
+#CacheDir @CUPS_CACHEDIR@
+
+# Location of data files used by the scheduler...
+#DataDir @CUPS_DATADIR@
+
+# Location of the static web content served by the scheduler...
+#DocRoot @CUPS_DOCROOT@
+
+# Location of the file logging all messages produced by the scheduler and any
+# helper programs; may be the name "syslog". If not an absolute path, the value
+# of ServerRoot is used as the root directory. Also see the "LogLevel"
+# directive in cupsd.conf.
+ErrorLog @CUPS_LOGDIR@/error_log
+
+# Location of fonts used by older print filters...
+#FontPath @CUPS_FONTPATH@
+
+# Location of LPD configuration
+#LPDConfigFile @CUPS_DEFAULT_LPD_CONFIG_FILE@
+
+# Location of the file logging all pages printed by the scheduler and any
+# helper programs; may be the name "syslog". If not an absolute path, the value
+# of ServerRoot is used as the root directory. Also see the "PageLogFormat"
+# directive in cupsd.conf.
+PageLog @CUPS_LOGDIR@/page_log
+
+# Location of the file listing all of the local printers...
+#Printcap @CUPS_DEFAULT_PRINTCAP@
+
+# Format of the Printcap file...
+#PrintcapFormat bsd
+#PrintcapFormat plist
+#PrintcapFormat solaris
+
+# Location of all spool files...
+#RequestRoot @CUPS_REQUESTS@
+
+# Location of helper programs...
+#ServerBin @CUPS_SERVERBIN@
+
+# SSL/TLS certificate for the scheduler...
+#ServerCertificate @CUPS_SERVERCERT@
+
+# SSL/TLS private key for the scheduler...
+#ServerKey @CUPS_SERVERKEY@
+
+# Location of other configuration files...
+#ServerRoot @CUPS_SERVERROOT@
+
+# Location of Samba configuration file...
+#SMBConfigFile @CUPS_DEFAULT_SMB_CONFIG_FILE@
+
+# Location of scheduler state files...
+#StateDir @CUPS_STATEDIR@
+
+# Location of scheduler/helper temporary files. This directory is emptied on
+# scheduler startup and cannot be one of the standard (public) temporary
+# directory locations for security reasons...
+#TempDir @CUPS_REQUESTS@/tmp
+
+#
+# End of "$Id$".
+#
diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in
index 8a1e86f25..5ae2c9f02 100644
--- a/conf/cupsd.conf.in
+++ b/conf/cupsd.conf.in
@@ -9,10 +9,6 @@
# for troubleshooting...
LogLevel @CUPS_LOG_LEVEL@
-# Administrator user group...
-SystemGroup @CUPS_SYSTEM_GROUPS@
-@CUPS_SYSTEM_AUTHKEY@
-
# Only listen for connections from the local machine.
Listen localhost:@DEFAULT_IPP_PORT@
@CUPS_LISTEN_DOMAINSOCKET@
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index d236a344a..173cfeac8 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -305,6 +305,7 @@ else
fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE")
+AC_SUBST(CUPS_DEFAULT_LPD_CONFIG_FILE)
dnl Default SMB config file...
AC_ARG_WITH(smbconfigfile, [ --with-smbconfigfile set default SMBConfigFile URI],
@@ -326,6 +327,7 @@ else
fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE")
+AC_SUBST(CUPS_DEFAULT_SMB_CONFIG_FILE)
dnl Default MaxCopies value...
AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ],
diff --git a/config-scripts/cups-ssl.m4 b/config-scripts/cups-ssl.m4
index 0bf9e00c7..03f7530a3 100644
--- a/config-scripts/cups-ssl.m4
+++ b/config-scripts/cups-ssl.m4
@@ -27,6 +27,8 @@ AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenS
SSLFLAGS=""
SSLLIBS=""
have_ssl=0
+CUPS_SERVERCERT=""
+CUPS_SERVERKEY=""
if test x$enable_ssl != xno; then
dnl Look for CDSA...
@@ -36,6 +38,7 @@ if test x$enable_ssl != xno; then
have_ssl=1
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)
+ CUPS_SERVERCERT="/Library/Keychains/System.keychain"
dnl Check for the various security headers...
AC_CHECK_HEADER(Security/SecureTransportPriv.h,
@@ -106,6 +109,9 @@ if test x$enable_ssl != xno; then
fi
if test $have_ssl = 1; then
+ CUPS_SERVERCERT="ssl/server.crt"
+ CUPS_SERVERKEY="ssl/server.key"
+
if $PKGCONFIG --exists gcrypt; then
SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
@@ -148,6 +154,9 @@ if test x$enable_ssl != xno; then
done
if test "x${SSLLIBS}" != "x"; then
+ CUPS_SERVERCERT="ssl/server.crt"
+ CUPS_SERVERKEY="ssl/server.key"
+
LIBS="$SAVELIBS $SSLLIBS"
AC_CHECK_FUNCS(SSL_set_tlsext_host_name)
fi
@@ -165,6 +174,8 @@ elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes -o x$enable_openssl = x
AC_MSG_ERROR([Unable to enable SSL support.])
fi
+AC_SUBST(CUPS_SERVERCERT)
+AC_SUBST(CUPS_SERVERKEY)
AC_SUBST(IPPALIASES)
AC_SUBST(SSLFLAGS)
AC_SUBST(SSLLIBS)
diff --git a/configure.in b/configure.in
index e7c8cd00f..e575f68dd 100644
--- a/configure.in
+++ b/configure.in
@@ -60,6 +60,7 @@ AC_SUBST(INSTALL_LANGUAGES)
AC_SUBST(UNINSTALL_LANGUAGES)
AC_OUTPUT(Makedefs
+ conf/cups-files.conf
conf/cupsd.conf
conf/mime.convs
conf/pam.std
@@ -73,6 +74,7 @@ AC_OUTPUT(Makedefs
man/client.conf.man
man/cups-deviced.man
man/cups-driverd.man
+ man/cups-files.conf.man
man/cups-lpd.man
man/cups-snmp.man
man/cupsaddsmb.man
diff --git a/cups/http-addr.c b/cups/http-addr.c
index 9cb9bee30..3e050e705 100644
--- a/cups/http-addr.c
+++ b/cups/http-addr.c
@@ -382,13 +382,6 @@ httpAddrPort(http_addr_t *addr) /* I - Address */
return (ippPort());
}
-int /* O - Port number */
-_httpAddrPort(http_addr_t *addr) /* I - Address */
-{
- /* TODO: Remove in CUPS 1.8 */
- return (httpAddrPort(addr));
-}
-
/*
* '_httpAddrSetPort()' - Set the port number associated with an address.
diff --git a/cups/http-private.h b/cups/http-private.h
index d6cbeaf83..12ae6ddb9 100644
--- a/cups/http-private.h
+++ b/cups/http-private.h
@@ -403,9 +403,6 @@ extern void _cups_freeifaddrs(struct ifaddrs *addrs);
*/
#define _httpAddrFamily(addrp) (addrp)->addr.sa_family
-extern int _httpAddrPort(http_addr_t *addr)
- _CUPS_DEPRECATED_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,
@@ -422,8 +419,6 @@ extern void _httpDisconnect(http_t *http);
extern char *_httpEncodeURI(char *dst, const char *src,
size_t dstsize);
extern void _httpFreeCredentials(http_tls_credentials_t credentials);
-extern ssize_t _httpPeek(http_t *http, char *buffer, size_t length)
- _CUPS_DEPRECATED_MSG("Use httpPeek instead.");
extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
size_t resolved_size, int options,
int (*cb)(void *context),
diff --git a/cups/http.c b/cups/http.c
index a547c47af..d5099b272 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -996,6 +996,11 @@ httpFlush(http_t *http) /* I - Connection to server */
* Didn't get the data back, so close the current connection.
*/
+#ifdef HAVE_LIBZ
+ if (http->coding)
+ http_content_coding_finish(http);
+#endif /* HAVE_LIBZ */
+
DEBUG_puts("1httpFlush: Setting state to HTTP_STATE_WAITING and closing.");
http->state = HTTP_STATE_WAITING;
@@ -1955,6 +1960,11 @@ httpPeek(http_t *http, /* I - Connection to server */
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->state == HTTP_STATE_POST_RECV)
http->state ++;
else
@@ -2101,15 +2111,6 @@ httpPeek(http_t *http, /* I - Connection to server */
return (bytes);
}
-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 */
-{
- /* TODO: Remove in CUPS 1.8 */
- return (httpPeek(http, buffer, length));
-}
-
/*
* 'httpPost()' - Send a POST request to the server.
@@ -2226,20 +2227,33 @@ httpRead2(http_t *http, /* I - Connection to server */
if (http->data_encoding == HTTP_ENCODING_CHUNKED &&
http->data_remaining <= 0)
{
- DEBUG_puts("2httpRead2: Getting chunk length...");
-
- if (httpGets(len, sizeof(len), http) == NULL)
+ if (!httpGets(len, sizeof(len), http))
{
- DEBUG_puts("1httpRead2: Could not get length!");
+ 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_puts("1httpRead2: Negative chunk length!");
+ 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",
@@ -2553,10 +2567,13 @@ httpRead2(http_t *http, /* I - Connection to server */
return (0);
}
- if (http->data_remaining == 0)
+ if (http->data_remaining <= 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
@@ -3388,17 +3405,17 @@ _httpUpdate(http_t *http, /* I - Connection to server */
switch (http->state)
{
- case HTTP_GET :
- case HTTP_POST :
+ case HTTP_STATE_GET :
+ case HTTP_STATE_POST :
case HTTP_STATE_POST_RECV :
- case HTTP_PUT :
+ case HTTP_STATE_PUT :
http->state ++;
DEBUG_printf(("1_httpUpdate: Set state to %s.",
http_states[http->state + 1]));
- case HTTP_POST_SEND :
- case HTTP_HEAD :
+ case HTTP_STATE_POST_SEND :
+ case HTTP_STATE_HEAD :
break;
default :
@@ -3861,8 +3878,6 @@ httpWrite2(http_t *http, /* I - Connection to server */
* data, go idle...
*/
- DEBUG_puts("2httpWrite2: Changing states.");
-
if (http->wused)
{
if (httpFlushWrite(http) < 0)
@@ -3886,12 +3901,17 @@ httpWrite2(http_t *http, /* I - Connection to server */
}
if (http->state == HTTP_STATE_POST_RECV)
+ {
+#ifdef HAVE_LIBZ
+ if (http->coding)
+ http_content_coding_finish(http);
+#endif /* HAVE_LIBZ */
+
http->state ++;
- else
- http->state = HTTP_STATE_WAITING;
- DEBUG_printf(("2httpWrite2: New state is %s.",
- http_states[http->state + 1]));
+ DEBUG_printf(("2httpWrite2: Changed state to %s.",
+ http_states[http->state + 1]));
+ }
}
DEBUG_printf(("1httpWrite2: Returning " CUPS_LLFMT ".", CUPS_LLCAST bytes));
@@ -4905,6 +4925,7 @@ http_set_length(http_t *http) /* I - Connection */
{
if (http->mode == _HTTP_MODE_SERVER &&
http->state != HTTP_STATE_GET_SEND &&
+ http->state != HTTP_STATE_PUT &&
http->state != HTTP_STATE_POST &&
http->state != HTTP_STATE_POST_SEND)
{
diff --git a/cups/versioning.h b/cups/versioning.h
index f1b02d648..f3fe98114 100644
--- a/cups/versioning.h
+++ b/cups/versioning.h
@@ -59,8 +59,8 @@
# define _CUPS_API_1_3 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
# define _CUPS_API_1_4 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
# define _CUPS_API_1_5 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
-# define _CUPS_API_1_6 AVAILABLE_MAX_OS_X_VERSION_10_8_AND_LATER
-# define _CUPS_API_1_7 AVAILABLE_MAX_OS_X_VERSION_10_9_AND_LATER
+# define _CUPS_API_1_6 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
+# define _CUPS_API_1_7 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
# else
# define _CUPS_API_1_1_19
# define _CUPS_API_1_1_20
diff --git a/doc/Makefile b/doc/Makefile
index 33c1e1d01..55808b70f 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -3,7 +3,7 @@
#
# Documentation makefile for CUPS.
#
-# Copyright 2007-2011 by Apple Inc.
+# Copyright 2007-2012 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
diff --git a/doc/help/man-ipptoolfile.html b/doc/help/man-ipptoolfile.html
index 645fd4a1f..4029f4288 100644
--- a/doc/help/man-ipptoolfile.html
+++ b/doc/help/man-ipptoolfile.html
@@ -171,6 +171,18 @@ character - escape commas using the "" character.
same syntax as regular attributes and can themselves be nested collections.
Multiple collection values can be supplied as needed.
</dd>
+<dt>COMPRESSION deflate
+</dt>
+<dd></dd>
+<dt>COMPRESSION gzip
+</dt>
+<dd></dd>
+<dt>COMPRESSION none
+</dt>
+<dd></dd>
+<dd>Uses the specified compression on the document data following the attributes in
+a Print-Job or Send-Document request.
+</dd>
<dt>DELAY seconds
</dt>
<dd>Specifies a delay before this test will be run.
diff --git a/doc/help/ref-cups-files-conf.html.in b/doc/help/ref-cups-files-conf.html.in
new file mode 100644
index 000000000..eb1e71c05
--- /dev/null
+++ b/doc/help/ref-cups-files-conf.html.in
@@ -0,0 +1,531 @@
+<HTML>
+<!-- SECTION: References -->
+<HEAD>
+ <TITLE>cups-files.conf</TITLE>
+ <LINK REL="STYLESHEET" TYPE="text/css" HREF="../cups-printable.css">
+</HEAD>
+<BODY>
+
+<H1 CLASS="title">cups-files.conf</H1>
+
+<P>The <VAR>/etc/cups/cups-files.conf</VAR> file contains configuration <I>directives</I> that control the files, directories. users. and groups that are used by the CUPS scheduler, <CODE>cupsd(8)</CODE>. Each directive is listed on a line by itself followed by its value. Comments are introduced using the number sign ("#") character at the beginning of a line.</P>
+
+<H2 CLASS="title"><A NAME="AccessLog">AccessLog</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+AccessLog /var/log/cups/access_log
+AccessLog /var/log/cups/access_log-%s
+AccessLog syslog
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>AccessLog</CODE> directive sets the name of the
+access log file. If the filename is not absolute then it is
+assumed to be relative to the <A
+HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
+access log file is stored in "common log format" and can be used
+by any web access reporting tool to generate a report on CUPS
+server activity.</P>
+
+<P>The server name can be included in the filename by using
+<CODE>%s</CODE> in the name.</P>
+
+<P>The special name "syslog" can be used to send the access
+information to the system log instead of a plain file.</P>
+
+<P>The default access log file is
+<VAR>@CUPS_LOGDIR@/access_log</VAR>.</P>
+
+
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.15</SPAN><A NAME="ConfigFilePerm">ConfigFilePerm</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+ConfigFilePerm 0644
+ConfigFilePerm 0640
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>ConfigFilePerm</CODE> directive specifies the permissions to use when the scheduler writes configuration and cache files, typically in response to IPP or HTTP requests. The default is @CUPS_CONFIG_FILE_PERM@.</P>
+
+<BLOCKQUOTE><B>Note:</B>
+
+<P>The permissions for the <VAR>printers.conf</VAR> file are always 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.</P>
+
+</BLOCKQUOTE>
+
+
+<H2 CLASS="title"><A NAME="DataDir">DataDir</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+DataDir /usr/share/cups
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>DataDir</CODE> directive sets the directory to use
+for data files.</P>
+
+
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/OS X 10.5</SPAN><A NAME="DefaultAuthType">DefaultAuthType</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+DefaultAuthType Basic
+DefaultAuthType BasicDigest
+DefaultAuthType Digest
+DefaultAuthType Negotiate
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>DefaultAuthType</CODE> directive specifies the type
+of authentication to use for IPP operations that require a
+username. The default is <CODE>Basic</CODE>.</P>
+
+
+<H2 CLASS="title"><A NAME="DocumentRoot">DocumentRoot</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+DocumentRoot /usr/share/doc/cups
+DocumentRoot /foo/bar/doc/cups
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>DocumentRoot</CODE> directive specifies the location
+of web content for the HTTP server in CUPS. If an absolute path
+is not specified then it is assumed to be relative to the <A
+HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
+default directory is <VAR>@CUPS_DOCROOT@</VAR>.</P>
+
+<P>Documents are first looked up in a sub-directory for the
+primary language requested by the client (e.g.
+<VAR>@CUPS_DOCROOT@/fr/...</VAR>) and then directly under
+the <CODE>DocumentRoot</CODE> directory (e.g.
+<VAR>@CUPS_DOCROOT@/...</VAR>), so it is possible to
+localize the web content by providing subdirectories for each
+language needed.</P>
+
+
+<H2 CLASS="title"><A NAME="ErrorLog">ErrorLog</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+ErrorLog /var/log/cups/error_log
+ErrorLog /var/log/cups/error_log-%s
+ErrorLog syslog
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>ErrorLog</CODE> directive sets the name of the error
+log file. If the filename is not absolute then it is assumed to
+be relative to the <A
+HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
+default error log file is <VAR>@CUPS_LOGDIR@/error_log</VAR>.</P>
+
+<P>The server name can be included in the filename by using
+<CODE>%s</CODE> in the name.</P>
+
+<P>The special name "syslog" can be used to send the error
+information to the system log instead of a plain file.</P>
+
+
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/OS X 10.6</SPAN><A NAME="FatalErrors">FatalErrors</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+FatalErrors none
+FatalErrors all
+FatalErrors browse
+FatalErrors config
+FatalErrors listen
+FatalErrors log
+FatalErrors permissions
+FatalErrors all -permissions
+FatalErrors config permissions log
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>FatalErrors</CODE> directive determines whether certain kinds of
+errors are fatal. The following kinds of errors are currently recognized:</P>
+
+<UL>
+
+ <LI><CODE>none</CODE> - No errors are fatal</LI>
+
+ <LI><CODE>all</CODE> - All of the errors below are fatal</LI>
+
+ <LI><CODE>browse</CODE> - Browsing initialization errors are fatal,
+ for example failed binding to the CUPS browse port or failed connections
+ to LDAP servers</LI>
+
+ <LI><CODE>config</CODE> - Configuration file syntax errors are
+ fatal</LI>
+
+ <LI><CODE>listen</CODE> - Listen or Port errors are fatal, except for
+ IPv6 failures on the loopback or "any" addresses</LI>
+
+ <LI><CODE>log</CODE> - Log file creation or write errors are fatal</LI>
+
+ <LI><CODE>permissions</CODE> - Bad startup file permissions are
+ fatal, for example shared SSL certificate and key files with world-
+ read permissions</LI>
+
+</UL>
+
+<P>Multiple errors can be listed, and the form "-kind" can be used with
+<CODE>all</CODE> to remove specific kinds of errors. The default setting is
+<CODE>@CUPS_FATAL_ERRORS@</CODE>.</P>
+
+
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.18</SPAN><A NAME="FileDevice">FileDevice</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+FileDevice Yes
+FileDevice No
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>FileDevice</CODE> directive determines whether the
+scheduler allows new printers to be added using device URIs of
+the form <CODE>file:/filename</CODE>. File devices are most often
+used to test new printer drivers and do not support raw file
+printing.</P>
+
+<P>The default setting is <CODE>No</CODE>.</P>
+
+<BLOCKQUOTE><B>Note:</B>
+
+<P>File devices are managed by the scheduler. Since the
+scheduler normally runs as the root user, file devices
+can be used to overwrite system files and potentially
+gain unauthorized access to the system. If you must
+create printers using file devices, we recommend that
+you set the <CODE>FileDevice</CODE> directive to
+<CODE>Yes</CODE> for only as long as you need to add the
+printers to the system, and then reset the directive to
+<CODE>No</CODE>.</P>
+
+</BLOCKQUOTE>
+
+
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.3</SPAN><A NAME="FontPath">FontPath</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+FontPath /foo/bar/fonts
+FontPath /usr/share/cups/fonts:/foo/bar/fonts
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>FontPath</CODE> directive specifies the font path to
+use when searching for fonts. The default font path is
+<CODE>/usr/share/cups/fonts</CODE>.</P>
+
+
+<H2 CLASS="title"><A NAME="Group">Group</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+Group lp
+Group nobody
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>Group</CODE> directive specifies the UNIX group that
+filter and CGI programs run as. The default group is
+system-specific but is usually <CODE>lp</CODE> or
+<CODE>nobody</CODE>.</P>
+
+
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.15</SPAN><A NAME="LogFilePerm">LogFilePerm</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+LogFilePerm 0644
+LogFilePerm 0600
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>LogFilePerm</CODE> directive specifies the
+permissions to use when writing log files. The default
+is @CUPS_LOG_FILE_PERM@.</P>
+
+
+<H2 CLASS="title"><A NAME="PageLog">PageLog</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+PageLog /var/log/cups/page_log
+PageLog /var/log/cups/page_log-%s
+PageLog syslog
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>PageLog</CODE> directive sets the name of the page
+log file. If the filename is not absolute then it is assumed to
+be relative to the <A
+HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
+default page log file is <VAR>@CUPS_LOGDIR@/page_log</VAR>.</P>
+
+<P>The server name can be included in the filename by using
+<CODE>%s</CODE> in the name.</P>
+
+<P>The special name "syslog" can be used to send the page
+information to the system log instead of a plain file.</P>
+
+
+<H2 CLASS="title"><A NAME="Printcap">Printcap</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+Printcap
+Printcap /etc/printcap
+Printcap /etc/printers.conf
+Printcap /Library/Preferences/org.cups.printers.plist
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>Printcap</CODE> directive controls whether or not a
+printcap file is automatically generated and updated with a list
+of available printers. If specified with no value, then no
+printcap file will be generated. The default is to generate a
+file named <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>.</P>
+
+<P>When a filename is specified (e.g. <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>),
+the printcap file is written whenever a printer is added or
+removed. The printcap file can then be used by applications that
+are hardcoded to look at the printcap file for the available
+printers.</P>
+
+
+<H2 CLASS="title"><A NAME="PrintcapFormat">PrintcapFormat</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+PrintcapFormat BSD
+PrintcapFormat Solaris
+PrintcapFormat plist
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>PrintcapFormat</CODE> directive controls the output format of the
+printcap file. The default is to generate the plist format on OS X, the
+Solaris format on Solaris, and the BSD format on other operating systems.</P>
+
+
+<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.3</SPAN><A NAME="RemoteRoot">RemoteRoot</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+RemoteRoot remroot
+RemoteRoot root
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>RemoteRoot</CODE> directive sets the username for
+unauthenticated root requests from remote hosts. The default
+username is <VAR>remroot</VAR>. Setting <CODE>RemoteRoot</CODE>
+to <VAR>root</VAR> effectively disables this security
+mechanism.</P>
+
+
+<H2 CLASS="title"><A NAME="RequestRoot">RequestRoot</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+RequestRoot /var/spool/cups
+RequestRoot /foo/bar/spool/cups
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>RequestRoot</CODE> directive sets the directory for
+incoming IPP requests and HTML forms. If an absolute path is not
+provided then it is assumed to be relative to the <A
+HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
+default request directory is <VAR>@CUPS_REQUESTS@</VAR>.</P>
+
+
+<H2 CLASS="title"><A NAME="ServerBin">ServerBin</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+ServerBin /usr/lib/cups
+ServerBin /foo/bar/lib/cups
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>ServerBin</CODE> directive sets the directory for
+server-run executables. If an absolute path is not provided then
+it is assumed to be relative to the <A
+HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
+default executable directory is <VAR>/usr/lib/cups</VAR>,
+<VAR>/usr/lib32/cups</VAR>, or <VAR>/usr/libexec/cups</VAR>
+depending on the operating system.</P>
+
+
+<H2 CLASS="title"><A NAME="ServerCertificate">ServerCertificate</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+ServerCertificate /etc/cups/ssl/server.crt
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>ServerCertificate</CODE> directive specifies the
+location of the SSL certificate file used by the server when
+negotiating encrypted connections. The certificate must not be
+encrypted (password protected) since the scheduler normally runs
+in the background and will be unable to ask for a password.</P>
+
+<P>The default certificate file is
+<VAR>/etc/cups/ssl/server.crt</VAR>.</P>
+
+
+<H2 CLASS="title"><A NAME="ServerKey">ServerKey</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+ServerKey /etc/cups/ssl/server.key
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>ServerKey</CODE> directive specifies the location of
+the SSL private key file used by the server when negotiating
+encrypted connections.</P>
+
+<P>The default key file is
+<VAR>/etc/cups/ssl/server.crt</VAR>.</P>
+
+
+<H2 CLASS="title"><A NAME="ServerRoot">ServerRoot</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+ServerRoot /etc/cups
+ServerRoot /foo/bar/cups
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>ServerRoot</CODE> directive specifies the absolute
+path to the server configuration and state files. It is also used
+to resolve relative paths in the <VAR>cupsd.conf</VAR> file. The
+default server directory is <VAR>/etc/cups</VAR>.</P>
+
+
+<H2 CLASS="title"><A NAME="SystemGroup">SystemGroup</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+SystemGroup lpadmin
+SystemGroup sys
+SystemGroup system
+SystemGroup root
+SystemGroup root lpadmin
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>SystemGroup</CODE> directive specifies the system
+administration group for <CODE>System</CODE> authentication.
+Multiple groups can be listed, separated with spaces. The default
+group list is <CODE>@CUPS_SYSTEM_GROUPS@</CODE>.</P>
+
+
+<H2 CLASS="title"><A NAME="TempDir">TempDir</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+TempDir /var/tmp
+TempDir /foo/bar/tmp
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>TempDir</CODE> directive specifies an absolute path
+for the directory to use for temporary files. The default
+directory is <VAR>@CUPS_REQUESTS@/tmp</VAR>.</P>
+
+<P>Temporary directories must be world-writable and should have
+the "sticky" permission bit enabled so that other users cannot
+delete filter temporary files. The following commands will create
+an appropriate temporary directory called
+<VAR>/foo/bar/tmp</VAR>:</P>
+
+<PRE CLASS="command">
+<KBD>mkdir /foo/bar/tmp</KBD>
+<KBD>chmod a+rwxt /foo/bar/tmp</KBD>
+</PRE>
+
+
+<H2 CLASS="title"><A NAME="User">User</A></H2>
+
+<H3>Examples</H3>
+
+<PRE CLASS="command">
+User lp
+User guest
+</PRE>
+
+<H3>Description</H3>
+
+<P>The <CODE>User</CODE> directive specifies the UNIX user that
+filter and CGI programs run as. The default user is
+<CODE>@CUPS_USER@</CODE>.</P>
+
+<BLOCKQUOTE><B>Note:</B>
+
+<P>You may not use user <CODE>root</CODE>, as that would expose
+the system to unacceptable security risks. The scheduler will
+automatically choose user <CODE>nobody</CODE> if you specify a
+user whose ID is 0.</P>
+
+</BLOCKQUOTE>
+
+
+</BODY>
+</HTML>
diff --git a/doc/help/ref-cupsd-conf.html.in b/doc/help/ref-cupsd-conf.html.in
index 93b0188a6..829809227 100644
--- a/doc/help/ref-cupsd-conf.html.in
+++ b/doc/help/ref-cupsd-conf.html.in
@@ -197,82 +197,6 @@ HREF="#Location"><CODE>Location</CODE></A> or <A
HREF="#Limit"><CODE>Limit</CODE></A> section.</P>
-<H2 CLASS="title"><SPAN CLASS="info">Deprecated</SPAN><A NAME="AuthClass">AuthClass</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-&lt;Location /path&gt;
- ...
- AuthClass Anonymous
- AuthClass User
- AuthClass System
- AuthClass Group
-&lt;/Location&gt;
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>AuthClass</CODE> directive defines what level of
-authentication is required:</P>
-
-<UL>
-
- <LI><CODE>Anonymous</CODE> - No authentication should be
- performed (default)</LI>
-
- <LI><CODE>User</CODE> - A valid username and password is
- required</LI>
-
- <LI><CODE>System</CODE> - A valid username and password
- is required, and the username must belong to the "sys"
- group; this can be changed using the <A
- HREF="#SystemGroup"><CODE>SystemGroup</CODE></A>
- directive</LI>
-
- <LI><CODE>Group</CODE> - A valid username and password is
- required, and the username must belong to the group named
- by the <A
- HREF="#AuthGroupName"><CODE>AuthGroupName</CODE></A>
- directive</LI>
-
-</UL>
-
-<P>The <CODE>AuthClass</CODE> directive must appear inside a <A
-HREF="#Location"><CODE>Location</CODE></A> or <A
-HREF="#Limit"><CODE>Limit</CODE></A> section.</P>
-
-<P><B>This directive is deprecated and will be removed from a
-future release of CUPS.</B> Consider using the more flexible <A
-HREF="#Require"><CODE>Require</CODE></A> directive instead.</P>
-
-
-<H2 CLASS="title"><SPAN CLASS="info">Deprecated</SPAN><A NAME="AuthGroupName">AuthGroupName</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-&lt;Location /path&gt;
- ...
- AuthGroupName mygroup
- AuthGroupName lp
-&lt;/Location&gt;
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>AuthGroupName</CODE> directive sets the group to use
-for <CODE>Group</CODE> authentication.</P>
-
-<P>The <CODE>AuthGroupName</CODE> directive must appear inside a
-<A HREF="#Location"><CODE>Location</CODE></A> or <A
-HREF="#Limit"><CODE>Limit</CODE></A> section.</P>
-
-<P><B>This directive is deprecated and will be removed from a
-future release of CUPS.</B> Consider using the more flexible <A
-HREF="#Require"><CODE>Require</CODE></A> directive instead.</P>
-
-
<H2 CLASS="title"><A NAME="AuthType">AuthType</A></H2>
<H3>Examples</H3>
@@ -2096,49 +2020,6 @@ PreserveJobFiles 604800
</BLOCKQUOTE>
-<H2 CLASS="title"><A NAME="Printcap">Printcap</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-Printcap
-Printcap /etc/printcap
-Printcap /etc/printers.conf
-Printcap /Library/Preferences/org.cups.printers.plist
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>Printcap</CODE> directive controls whether or not a
-printcap file is automatically generated and updated with a list
-of available printers. If specified with no value, then no
-printcap file will be generated. The default is to generate a
-file named <VAR>@CUPS_DEFAUL_PRINTCAP@</VAR>.</P>
-
-<P>When a filename is specified (e.g. <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>),
-the printcap file is written whenever a printer is added or
-removed. The printcap file can then be used by applications that
-are hardcoded to look at the printcap file for the available
-printers.</P>
-
-
-<H2 CLASS="title"><A NAME="PrintcapFormat">PrintcapFormat</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-PrintcapFormat BSD
-PrintcapFormat Solaris
-PrintcapFormat plist
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>PrintcapFormat</CODE> directive controls the output format of the
-printcap file. The default is to generate the plist format on OS X, the
-Solaris format on Solaris, and the BSD format on other operating systems.</P>
-
-
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.21</SPAN><A NAME="ReloadTimeout">ReloadTimeout</A></H2>
<H3>Examples</H3>
@@ -2155,42 +2036,6 @@ of seconds the scheduler will wait for active jobs to complete
before doing a restart. The default is 30 seconds.</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.3</SPAN><A NAME="RemoteRoot">RemoteRoot</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-RemoteRoot remroot
-RemoteRoot root
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>RemoteRoot</CODE> directive sets the username for
-unauthenticated root requests from remote hosts. The default
-username is <VAR>remroot</VAR>. Setting <CODE>RemoteRoot</CODE>
-to <VAR>root</VAR> effectively disables this security
-mechanism.</P>
-
-
-<H2 CLASS="title"><A NAME="RequestRoot">RequestRoot</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-RequestRoot /var/spool/cups
-RequestRoot /foo/bar/spool/cups
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>RequestRoot</CODE> directive sets the directory for
-incoming IPP requests and HTML forms. If an absolute path is not
-provided then it is assumed to be relative to the <A
-HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
-default request directory is <VAR>@CUPS_REQUESTS@</VAR>.</P>
-
-
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.7</SPAN><A NAME="Require">Require</A></H2>
<H3>Examples</H3>
@@ -2343,64 +2188,6 @@ alternate name with a ServerAlias directive instead of using "*".</P>
</BLOCKQUOTE>
-<H2 CLASS="title"><A NAME="ServerBin">ServerBin</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-ServerBin /usr/lib/cups
-ServerBin /foo/bar/lib/cups
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>ServerBin</CODE> directive sets the directory for
-server-run executables. If an absolute path is not provided then
-it is assumed to be relative to the <A
-HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
-default executable directory is <VAR>/usr/lib/cups</VAR>,
-<VAR>/usr/lib32/cups</VAR>, or <VAR>/usr/libexec/cups</VAR>
-depending on the operating system.</P>
-
-
-<H2 CLASS="title"><A NAME="ServerCertificate">ServerCertificate</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-ServerCertificate /etc/cups/ssl/server.crt
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>ServerCertificate</CODE> directive specifies the
-location of the SSL certificate file used by the server when
-negotiating encrypted connections. The certificate must not be
-encrypted (password protected) since the scheduler normally runs
-in the background and will be unable to ask for a password.</P>
-
-<P>The default certificate file is
-<VAR>/etc/cups/ssl/server.crt</VAR>.</P>
-
-
-<H2 CLASS="title"><A NAME="ServerKey">ServerKey</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-ServerKey /etc/cups/ssl/server.key
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>ServerKey</CODE> directive specifies the location of
-the SSL private key file used by the server when negotiating
-encrypted connections.</P>
-
-<P>The default key file is
-<VAR>/etc/cups/ssl/server.crt</VAR>.</P>
-
-
<H2 CLASS="title"><A NAME="ServerName">ServerName</A></H2>
<H3>Examples</H3>
@@ -2417,23 +2204,6 @@ that is reported to clients. By default the server name is the
hostname.</P>
-<H2 CLASS="title"><A NAME="ServerRoot">ServerRoot</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-ServerRoot /etc/cups
-ServerRoot /foo/bar/cups
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>ServerRoot</CODE> directive specifies the absolute
-path to the server configuration and state files. It is also used
-to resolve relative paths in the <VAR>cupsd.conf</VAR> file. The
-default server directory is <VAR>/etc/cups</VAR>.</P>
-
-
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.21</SPAN><A NAME="ServerTokens">ServerTokens</A></H2>
<H3>Examples</H3>
@@ -2629,53 +2399,6 @@ subscription values to make private. The "default" values are "notify-events",
HREF="#Policy"><CODE>Policy</CODE></A> section.</P>
-<H2 CLASS="title"><A NAME="SystemGroup">SystemGroup</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-SystemGroup lpadmin
-SystemGroup sys
-SystemGroup system
-SystemGroup root
-SystemGroup root lpadmin
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>SystemGroup</CODE> directive specifies the system
-administration group for <CODE>System</CODE> authentication.
-Multiple groups can be listed, separated with spaces. The default
-group list is <CODE>@CUPS_SYSTEM_GROUPS@</CODE>.</P>
-
-
-<H2 CLASS="title"><A NAME="TempDir">TempDir</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-TempDir /var/tmp
-TempDir /foo/bar/tmp
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>TempDir</CODE> directive specifies an absolute path
-for the directory to use for temporary files. The default
-directory is <VAR>@CUPS_REQUESTS@/tmp</VAR>.</P>
-
-<P>Temporary directories must be world-writable and should have
-the "sticky" permission bit enabled so that other users cannot
-delete filter temporary files. The following commands will create
-an appropriate temporary directory called
-<VAR>/foo/bar/tmp</VAR>:</P>
-
-<PRE CLASS="command">
-<KBD>mkdir /foo/bar/tmp</KBD>
-<KBD>chmod a+rwxt /foo/bar/tmp</KBD>
-</PRE>
-
-
<H2 CLASS="title"><A NAME="Timeout">Timeout</A></H2>
<H3>Examples</H3>
@@ -2696,53 +2419,6 @@ to wait before an active HTTP or IPP request times out in seconds (no suffix), m
<P>The default timeout is <CODE>5m</CODE> (five minutes).</P>
-<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.2/OS X 10.5</SPAN><A NAME="UseNetworkDefault">UseNetworkDefault</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-UseNetworkDefault yes
-UseNetworkDefault no
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>UseNetworkDefault</CODE> directive controls whether
-the client will use a network/remote printer as a default
-printer. If enabled, the default printer of a server is used as
-the default printer on a client. When multiple servers are
-advertising a default printer, the client's default printer is
-set to the first discovered printer, or to the implicit class for
-the same printer available from multiple servers.</P>
-
-<P>The default is <CODE>@CUPS_USE_NETWORK_DEFAULT@</CODE>.</P>
-
-
-<H2 CLASS="title"><A NAME="User">User</A></H2>
-
-<H3>Examples</H3>
-
-<PRE CLASS="command">
-User lp
-User guest
-</PRE>
-
-<H3>Description</H3>
-
-<P>The <CODE>User</CODE> directive specifies the UNIX user that
-filter and CGI programs run as. The default user is
-<CODE>@CUPS_USER@</CODE>.</P>
-
-<BLOCKQUOTE><B>Note:</B>
-
-<P>You may not use user <CODE>root</CODE>, as that would expose
-the system to unacceptable security risks. The scheduler will
-automatically choose user <CODE>nobody</CODE> if you specify a
-user whose ID is 0.</P>
-
-</BLOCKQUOTE>
-
-
<H2 CLASS="title"><SPAN CLASS="INFO">CUPS 1.5</SPAN><A NAME="WebInterface">WebInterface</A></H2>
<H3>Examples</H3>
diff --git a/man/Makefile b/man/Makefile
index db4893b3d..f7930411c 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -39,6 +39,7 @@ MAN1 = cancel.$(MAN1EXT) \
ppdpo.$(MAN1EXT)
MAN5 = classes.conf.$(MAN5EXT) \
client.conf.$(MAN5EXT) \
+ cups-files.conf.$(MAN5EXT) \
cups-snmp.conf.$(MAN5EXT) \
cupsd.conf.$(MAN5EXT) \
ipptoolfile.$(MAN5EXT) \
diff --git a/man/cups-files.conf.man.in b/man/cups-files.conf.man.in
new file mode 100644
index 000000000..d873d537b
--- /dev/null
+++ b/man/cups-files.conf.man.in
@@ -0,0 +1,146 @@
+.\"
+.\" "$Id$"
+.\"
+.\" cupsd.conf man page for CUPS.
+.\"
+.\" Copyright 2007-2012 by Apple Inc.
+.\" Copyright 1997-2006 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/".
+.\"
+.TH cups-files.conf 5 "CUPS" "19 November 2012" "Apple Inc."
+.SH NAME
+cups-files.conf \- file and directory configuration file for cups
+.SH DESCRIPTION
+The \fIcups-file.conf\fR file configures the files and directories used by the
+CUPS scheduler, \fIcupsd(8)\fR. It is normally located in the
+\fI@CUPS_SERVERROOT@\fR directory.
+.LP
+Each line in the file can be a configuration directive, a blank line,
+or a comment. Comment lines start with the # character.
+.SH DIRECTIVES
+The following directives are understood by \fIcupsd(8)\fR. Consult the
+on-line help for detailed descriptions:
+.TP 5
+AccessLog filename
+.TP 5
+AccessLog syslog
+.br
+Defines the access log filename.
+.TP 5
+ConfigFilePerm mode
+.br
+Specifies the permissions for all configuration files that the scheduler
+writes.
+.TP 5
+DataDir path
+.br
+Specified the directory where data files can be found.
+.TP 5
+DocumentRoot directory
+.br
+Specifies the root directory for the internal web server documents.
+.TP 5
+ErrorLog filename
+.TP 5
+ErrorLog syslog
+.br
+Specifies the error log filename.
+.TP 5
+FatalErrors none
+.TP 5
+FatalErrors all -kind [... -kind]
+.TP 5
+FatalErrors kind [... kind]
+.br
+Specifies which errors are fatal, causing the scheduler to exit. "Kind" is
+"browse", "config", "listen", "log", or "permissions".
+.TP 5
+FileDevice Yes
+.TP 5
+FileDevice No
+.br
+Specifies whether the file pseudo-device can be used for new
+printer queues.
+.TP 5
+FontPath directory[:directory:...]
+.br
+Specifies the search path for fonts.
+.TP 5
+Group group-name-or-number
+.br
+Specifies the group name or ID that will be used when executing
+external programs.
+.TP 5
+LogFilePerm mode
+.br
+Specifies the permissions for all log files that the scheduler writes.
+.TP 5
+PageLog filename
+.TP 5
+PageLog syslog
+.br
+Specifies the page log filename.
+.TP 5
+Printcap
+.TP 5
+Printcap filename
+.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.
+.TP 5
+RemoteRoot user-name
+.br
+Specifies the username that is associated with unauthenticated root
+accesses.
+.TP 5
+RequestRoot directory
+.br
+Specifies the directory to store print jobs and other HTTP request
+data.
+.TP 5
+ServerBin directory
+.br
+Specifies the directory where backends, CGIs, daemons, and filters may
+be found.
+.TP 5
+ServerCertificate filename
+.br
+Specifies the encryption certificate to use.
+.TP 5
+ServerKey filename
+.br
+Specifies the encryption key to use.
+.TP 5
+ServerRoot directory
+.br
+Specifies the directory where the server configuration files can be found.
+.TP 5
+SystemGroup group-name [group-name ...]
+.br
+Specifies the group(s) to use for System class authentication.
+.TP 5
+TempDir directory
+.br
+Specifies the directory where temporary files are stored.
+.TP 5
+User user-name
+.br
+Specifies the user name or ID that is used when running external programs.
+.SH SEE ALSO
+\fIclasses.conf(5)\fR, \fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fImime.convs(5)\fR,
+\fImime.types(5)\fR, \fIprinters.conf(5)\fR,
+\fIsubscriptions.conf(5)\fR,
+.br
+http://localhost:631/help
+.SH COPYRIGHT
+Copyright 2007-2012 by Apple Inc.
+.\"
+.\" End of "$Id$".
+.\"
diff --git a/man/cupsd.conf.man.in b/man/cupsd.conf.man.in
index fd0768fd1..7d8ebc883 100644
--- a/man/cupsd.conf.man.in
+++ b/man/cupsd.conf.man.in
@@ -12,12 +12,15 @@
.\" 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 cupsd.conf 5 "CUPS" "18 May 2012" "Apple Inc."
+.TH cupsd.conf 5 "CUPS" "19 November 2012" "Apple Inc."
.SH NAME
cupsd.conf \- server configuration file for cups
.SH DESCRIPTION
The \fIcupsd.conf\fR file configures the CUPS scheduler, \fIcupsd(8)\fR. It
-is normally located in the \fI@CUPS_SERVERROOT@\fR directory.
+is normally located in the \fI@CUPS_SERVERROOT@\fR directory. \fBNote:\fR
+File, directory, and user configuration directives that used to be allowed in
+the \fIcupsd.conf\fR file are now stored in the \fIcups-files.conf(5)\fR instead
+in order to prevent certain types of privilege escalation attacks.
.LP
Each line in the file can be a configuration directive, a blank line,
or a comment. Comment lines start with the # character. The
@@ -27,12 +30,6 @@ popular Apache web server software and are described below.
The following directives are understood by \fIcupsd(8)\fR. Consult the
on-line help for detailed descriptions:
.TP 5
-AccessLog filename
-.TP 5
-AccessLog syslog
-.br
-Defines the access log filename.
-.TP 5
AccessLogLevel config
.TP 5
AccessLogLevel actions
@@ -61,20 +58,6 @@ Allow @LOCAL
.br
Allows access from the named hosts or addresses.
.TP 5
-AuthClass User
-.TP 5
-AuthClass Group
-.TP 5
-AuthClass System
-.br
-Specifies the authentication class (User, Group, System) -
-\fBthis directive is deprecated\fR.
-.TP 5
-AuthGroupName group-name
-.br
-Specifies the authentication group - \fBthis directive is
-deprecated\fR.
-.TP 5
AuthType None
.TP 5
AuthType Basic
@@ -108,7 +91,7 @@ Browsing Yes
.TP 5
Browsing No
.br
-Specifies whether or not remote printer browsing should be enabled.
+Specifies whether or not shared printers should be advertised.
.TP 5
Classification banner
.br
@@ -121,15 +104,6 @@ ClassifyOverride No
Specifies whether to allow users to override the classification
of individual print jobs.
.TP 5
-ConfigFilePerm mode
-.br
-Specifies the permissions for all configuration files that the scheduler
-writes.
-.TP 5
-DataDir path
-.br
-Specified the directory where data files can be found.
-.TP 5
DefaultAuthType Basic
.TP 5
DefaultAuthType BasicDigest
@@ -197,10 +171,6 @@ Specifies the delay for updating of configuration and state files. A value of 0
causes the update to happen as soon as possible, typically within a few
milliseconds.
.TP 5
-DocumentRoot directory
-.br
-Specifies the root directory for the internal web server documents.
-.TP 5
Encryption IfRequested
.TP 5
Encryption Never
@@ -210,28 +180,6 @@ Encryption Required
Specifies the level of encryption that is required for a particular
location.
.TP 5
-ErrorLog filename
-.TP 5
-ErrorLog syslog
-.br
-Specifies the error log filename.
-.TP 5
-FatalErrors none
-.TP 5
-FatalErrors all -kind [... -kind]
-.TP 5
-FatalErrors kind [... kind]
-.br
-Specifies which errors are fatal, causing the scheduler to exit. "Kind" is
-"browse", "config", "listen", "log", or "permissions".
-.TP 5
-FileDevice Yes
-.TP 5
-FileDevice No
-.br
-Specifies whether the file pseudo-device can be used for new
-printer queues.
-.TP 5
FilterLimit limit
.br
Specifies the maximum cost of filters that are run concurrently.
@@ -241,15 +189,6 @@ FilterNice nice-value
Specifies the scheduling priority ("nice" value) of filters that
are run to print a job.
.TP 5
-FontPath directory[:directory:...]
-.br
-Specifies the search path for fonts.
-.TP 5
-Group group-name-or-number
-.br
-Specifies the group name or ID that will be used when executing
-external programs.
-.TP 5
GSSServiceName name
.br
Specifies the service name when using Kerberos authentication. The default
@@ -341,10 +280,6 @@ LogDebugHistory #-messages
Specifies the number of debugging messages that are logged when an error
occurs in a print job.
.TP 5
-LogFilePerm mode
-.br
-Specifies the permissions for all log files that the scheduler writes.
-.TP 5
LogLevel alert
.TP 5
LogLevel crit
@@ -429,12 +364,6 @@ Order deny,allow
.br
Specifies the order of HTTP access control (allow,deny or deny,allow)
.TP 5
-PageLog filename
-.TP 5
-PageLog syslog
-.br
-Specifies the page log filename.
-.TP 5
PageLogFormat format string
.br
Specifies the format of page log lines.
@@ -464,15 +393,6 @@ PreserveJobHistory No
Specifies whether or not to preserve the job history after they are
printed.
.TP 5
-Printcap
-.TP 5
-Printcap filename
-.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.
-.TP 5
PrintcapFormat bsd
.TP 5
PrintcapFormat plist
@@ -481,29 +401,11 @@ PrintcapFormat solaris
.br
Specifies the format of the printcap file.
.TP 5
-PrintcapGUI
-.TP 5
-PrintcapGUI gui-program-filename
-.br
-Specifies whether to generate option panel definition files on
-some operating systems. When provided with no program filename,
-disables option panel definition files.
-.TP 5
ReloadTimeout seconds
.br
Specifies the amount of time to wait for job completion before
restarting the scheduler.
.TP 5
-RemoteRoot user-name
-.br
-Specifies the username that is associated with unauthenticated root
-accesses.
-.TP 5
-RequestRoot directory
-.br
-Specifies the directory to store print jobs and other HTTP request
-data.
-.TP 5
Require group group-name-list
.TP 5
Require user user-name-list
@@ -535,27 +437,10 @@ ServerAlias *
Specifies an alternate name that the server is known by. The special name "*"
allows any name to be used.
.TP 5
-ServerBin directory
-.br
-Specifies the directory where backends, CGIs, daemons, and filters may
-be found.
-.TP 5
-ServerCertificate filename
-.br
-Specifies the encryption certificate to use.
-.TP 5
-ServerKey filename
-.br
-Specifies the encryption key to use.
-.TP 5
ServerName hostname-or-ip-address
.br
Specifies the fully-qualified hostname of the server.
.TP 5
-ServerRoot directory
-.br
-Specifies the directory where the server configuration files can be found.
-.TP 5
ServerTokens Full
.TP 5
ServerTokens Major
@@ -619,29 +504,17 @@ Specifies the list of job values to make private. The "default" values are
"notify-events", "notify-pull-method", "notify-recipient-uri",
"notify-subscriber-user-name", and "notify-user-data".
.TP 5
-SystemGroup group-name [group-name ...]
-.br
-Specifies the group(s) to use for System class authentication.
-.TP 5
-TempDir directory
-.br
-Specifies the directory where temporary files are stored.
-.TP 5
Timeout seconds
.br
Specifies the HTTP request timeout in seconds.
.TP 5
-User user-name
-.br
-Specifies the user name or ID that is used when running external programs.
-.TP 5
WebInterface yes
.TP 5
WebInterface no
Specifies whether the web interface is enabled.
.SH SEE ALSO
-\fIclasses.conf(5)\fR, \fIcupsd(8)\fR, \fImime.convs(5)\fR,
-\fImime.types(5)\fR, \fIprinters.conf(5)\fR,
+\fIclasses.conf(5)\fR, \fIcups-files.conf(5)\fR, \fIcupsd(8)\fR,
+\fImime.convs(5)\fR, \fImime.types(5)\fR, \fIprinters.conf(5)\fR,
\fIsubscriptions.conf(5)\fR,
.br
http://localhost:631/help
diff --git a/man/ipptoolfile.man b/man/ipptoolfile.man
index 0d6452ea4..da60b843c 100644
--- a/man/ipptoolfile.man
+++ b/man/ipptoolfile.man
@@ -11,7 +11,7 @@
.\" which should have been included with this file. If this file is
.\" file is missing or damaged, see the license at "http://www.cups.org/".
.\"
-.TH ipptoolfile 5 "CUPS" "11 May 2012" "Apple Inc."
+.TH ipptoolfile 5 "CUPS" "16 November 2012" "Apple Inc."
.SH NAME
ipptoolfile \- ipptool file format
@@ -151,6 +151,15 @@ Adds a collection attribute to the test request. Member attributes follow the
same syntax as regular attributes and can themselves be nested collections.
Multiple collection values can be supplied as needed.
.TP 5
+COMPRESSION deflate
+.TP 5
+COMPRESSION gzip
+.TP 5
+COMPRESSION none
+.br
+Uses the specified compression on the document data following the attributes in
+a Print-Job or Send-Document request.
+.TP 5
DELAY seconds
Specifies a delay before this test will be run.
.TP 5
diff --git a/packaging/cups.list.in b/packaging/cups.list.in
index e915037e0..0c4ba904c 100644
--- a/packaging/cups.list.in
+++ b/packaging/cups.list.in
@@ -528,6 +528,8 @@ d 0755 root $CUPS_GROUP $SERVERROOT -
d 0755 root $CUPS_GROUP $SERVERROOT/interfaces -
d 0755 root $CUPS_GROUP $SERVERROOT/ppd -
d 0700 root $CUPS_GROUP $SERVERROOT/ssl -
+c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf conf/cups-files.conf
+f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf.default conf/cups-files.conf
c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf conf/cupsd.conf
f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf.default conf/cupsd.conf
c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/snmp.conf conf/snmp.conf
diff --git a/packaging/cups.spec.in b/packaging/cups.spec.in
index b3576e850..4ff0a7ed6 100644
--- a/packaging/cups.spec.in
+++ b/packaging/cups.spec.in
@@ -135,6 +135,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root)
%dir /etc/cups
%config(noreplace) /etc/cups/*.conf
+/etc/cups/cups-files.conf.default
/etc/cups/cupsd.conf.default
%dir /etc/cups/interfaces
%dir /etc/cups/ppd
diff --git a/scheduler/client.c b/scheduler/client.c
index e3c35658a..89bda38d7 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -32,7 +32,7 @@
* compare_clients() - Compare two client connections.
* data_ready() - Check whether data is available from a client.
* get_file() - Get a filename and state info.
- * install_conf_file() - Install a configuration file.
+ * install_cupsd_conf() - Install a configuration file.
* is_cgi() - Is the resource a CGI script/program?
* is_path_absolute() - Is a path absolute and free of relative elements
* (i.e. "..").
@@ -98,7 +98,7 @@ static int compare_clients(cupsd_client_t *a, cupsd_client_t *b,
static int data_ready(cupsd_client_t *con);
static char *get_file(cupsd_client_t *con, struct stat *filestats,
char *filename, int len);
-static http_status_t install_conf_file(cupsd_client_t *con);
+static http_status_t install_cupsd_conf(cupsd_client_t *con);
static int is_cgi(cupsd_client_t *con, const char *filename,
struct stat *filestats, mime_type_t *type);
static int is_path_absolute(const char *path);
@@ -181,6 +181,7 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
con->http.activity = time(NULL);
con->http.hostaddr = &(con->clientaddr);
con->http.wait_value = 10000;
+ con->http.mode = _HTTP_MODE_SERVER;
/*
* Accept the client and get the remote address...
@@ -1669,17 +1670,14 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
* Validate the resource name...
*/
- if (strncmp(con->uri, "/admin/conf/", 12) ||
- strchr(con->uri + 12, '/') ||
- strlen(con->uri) == 12)
+ if (strcmp(con->uri, "/admin/conf/cupsd.conf"))
{
/*
- * PUT can only be done to configuration files under
- * /admin/conf...
+ * PUT can only be done to the cupsd.conf file...
*/
cupsdLogMessage(CUPSD_LOG_ERROR,
- "[Client %d] Request for subdirectory \"%s\".",
+ "[Client %d] Disallowed PUT request for \"%s\".",
con->http.fd, con->uri);
if (!cupsdSendError(con, HTTP_FORBIDDEN, CUPSD_AUTH_NONE))
@@ -2051,7 +2049,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
* Install the configuration file...
*/
- status = install_conf_file(con);
+ status = install_cupsd_conf(con);
/*
* Return the status to the client...
@@ -3310,14 +3308,13 @@ get_file(cupsd_client_t *con, /* I - Client connection */
/*
- * 'install_conf_file()' - Install a configuration file.
+ * 'install_cupsd_conf()' - Install a configuration file.
*/
static http_status_t /* O - Status */
-install_conf_file(cupsd_client_t *con) /* I - Connection */
+install_cupsd_conf(cupsd_client_t *con) /* I - Connection */
{
char filename[1024]; /* Configuration filename */
- mode_t mode; /* Permissions */
cups_file_t *in, /* Input file */
*out; /* Output file */
char buffer[16384]; /* Copy buffer */
@@ -3339,13 +3336,8 @@ install_conf_file(cupsd_client_t *con) /* I - Connection */
* Open the new config file...
*/
- snprintf(filename, sizeof(filename), "%s%s", ServerRoot, con->uri + 11);
- if (!strcmp(con->uri, "/admin/conf/printers.conf"))
- mode = ConfigFilePerm & 0600;
- else
- mode = ConfigFilePerm;
-
- if ((out = cupsdCreateConfFile(filename, mode)) == NULL)
+ snprintf(filename, sizeof(filename), "%s/cupsd.conf", ServerRoot);
+ if ((out = cupsdCreateConfFile(filename, ConfigFilePerm)) == NULL)
{
cupsFileClose(in);
return (HTTP_SERVER_ERROR);
@@ -3390,14 +3382,10 @@ install_conf_file(cupsd_client_t *con) /* I - Connection */
cupsdClearString(&con->filename);
/*
- * If the cupsd.conf file was updated, set the NeedReload flag...
+ * Set the NeedReload flag...
*/
- if (!strcmp(con->uri, "/admin/conf/cupsd.conf"))
- NeedReload = RELOAD_CUPSD;
- else
- NeedReload = RELOAD_ALL;
-
+ NeedReload = RELOAD_CUPSD;
ReloadTime = time(NULL);
/*
diff --git a/scheduler/conf.c b/scheduler/conf.c
index 3c9fcaf33..68b97611d 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -14,23 +14,25 @@
*
* Contents:
*
- * cupsdAddAlias() - Add a host alias.
+ * cupsdAddAlias() - Add a host alias.
* cupsdCheckPermissions() - Fix the mode and ownership of a file or
- * directory.
+ * directory.
* cupsdDefaultAuthType() - Get the default AuthType.
* cupsdFreeAliases() - Free all of the alias entries.
* cupsdReadConfiguration() - Read the cupsd.conf file.
- * get_address() - Get an address + port number from a line.
+ * get_address() - Get an address + port number from a line.
* get_addr_and_mask() - Get an IP address and netmask.
- * mime_error_cb() - Log a MIME error.
- * parse_aaa() - Parse authentication, authorization, and access
- * control lines.
+ * mime_error_cb() - Log a MIME error.
+ * parse_aaa() - Parse authentication, authorization, and access
+ * control lines.
* parse_fatal_errors() - Parse FatalErrors values in a string.
- * parse_groups() - Parse system group names in a string.
- * parse_protocols() - Parse browse protocols in a string.
- * read_configuration() - Read a configuration file.
- * read_location() - Read a <Location path> definition.
- * read_policy() - Read a <Policy name> definition.
+ * parse_groups() - Parse system group names in a string.
+ * parse_protocols() - Parse browse protocols in a string.
+ * parse_variable() - Parse a variable line.
+ * read_cupsd_conf() - Read the cupsd.conf configuration file.
+ * read_cups_files_conf() - Read the cups-files.conf configuration file.
+ * read_location() - Read a <Location path> definition.
+ * read_policy() - Read a <Policy name> definition.
* set_policy_defaults() - Set default policy values as needed.
*/
@@ -83,35 +85,25 @@ typedef struct
* Local globals...
*/
-static int default_auth_type = CUPSD_AUTH_AUTO;
- /* Default AuthType, if not specified */
-static const cupsd_var_t variables[] =
+static const cupsd_var_t cupsd_vars[] =
{
- { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING },
{ "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN },
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
{ "BrowseDNSSDSubTypes", &DNSSDSubTypes, CUPSD_VARTYPE_STRING },
#endif /* HAVE_DNSSD || HAVE_AVAHI */
{ "BrowseWebIF", &BrowseWebIF, CUPSD_VARTYPE_BOOLEAN },
{ "Browsing", &Browsing, CUPSD_VARTYPE_BOOLEAN },
- { "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING },
{ "Classification", &Classification, CUPSD_VARTYPE_STRING },
{ "ClassifyOverride", &ClassifyOverride, CUPSD_VARTYPE_BOOLEAN },
- { "ConfigFilePerm", &ConfigFilePerm, CUPSD_VARTYPE_INTEGER },
- { "DataDir", &DataDir, CUPSD_VARTYPE_STRING },
{ "DefaultLanguage", &DefaultLanguage, CUPSD_VARTYPE_STRING },
{ "DefaultLeaseDuration", &DefaultLeaseDuration, CUPSD_VARTYPE_TIME },
{ "DefaultPaperSize", &DefaultPaperSize, CUPSD_VARTYPE_STRING },
{ "DefaultPolicy", &DefaultPolicy, CUPSD_VARTYPE_STRING },
{ "DefaultShared", &DefaultShared, CUPSD_VARTYPE_BOOLEAN },
{ "DirtyCleanInterval", &DirtyCleanInterval, CUPSD_VARTYPE_TIME },
- { "DocumentRoot", &DocumentRoot, CUPSD_VARTYPE_STRING },
- { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING },
{ "ErrorPolicy", &ErrorPolicy, CUPSD_VARTYPE_STRING },
- { "FileDevice", &FileDevice, CUPSD_VARTYPE_BOOLEAN },
{ "FilterLimit", &FilterLimit, CUPSD_VARTYPE_INTEGER },
{ "FilterNice", &FilterNice, CUPSD_VARTYPE_INTEGER },
- { "FontPath", &FontPath, CUPSD_VARTYPE_STRING },
#ifdef HAVE_GSSAPI
{ "GSSServiceName", &GSSServiceName, CUPSD_VARTYPE_STRING },
#endif /* HAVE_GSSAPI */
@@ -126,8 +118,6 @@ static const cupsd_var_t variables[] =
{ "LimitRequestBody", &MaxRequestSize, CUPSD_VARTYPE_INTEGER },
{ "ListenBackLog", &ListenBackLog, CUPSD_VARTYPE_INTEGER },
{ "LogDebugHistory", &LogDebugHistory, CUPSD_VARTYPE_INTEGER },
- { "LogFilePerm", &LogFilePerm, CUPSD_VARTYPE_INTEGER },
- { "LPDConfigFile", &LPDConfigFile, CUPSD_VARTYPE_STRING },
{ "MaxActiveJobs", &MaxActiveJobs, CUPSD_VARTYPE_INTEGER },
{ "MaxClients", &MaxClients, CUPSD_VARTYPE_INTEGER },
{ "MaxClientsPerHost", &MaxClientsPerHost, CUPSD_VARTYPE_INTEGER },
@@ -146,17 +136,34 @@ static const cupsd_var_t variables[] =
{ "MaxSubscriptionsPerPrinter",&MaxSubscriptionsPerPrinter, CUPSD_VARTYPE_INTEGER },
{ "MaxSubscriptionsPerUser", &MaxSubscriptionsPerUser, CUPSD_VARTYPE_INTEGER },
{ "MultipleOperationTimeout", &MultipleOperationTimeout, CUPSD_VARTYPE_TIME },
- { "PageLog", &PageLog, CUPSD_VARTYPE_STRING },
{ "PageLogFormat", &PageLogFormat, CUPSD_VARTYPE_STRING },
{ "PreserveJobFiles", &JobFiles, CUPSD_VARTYPE_TIME },
{ "PreserveJobHistory", &JobHistory, CUPSD_VARTYPE_TIME },
- { "Printcap", &Printcap, CUPSD_VARTYPE_STRING },
{ "ReloadTimeout", &ReloadTimeout, CUPSD_VARTYPE_TIME },
{ "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING },
- { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING },
{ "RIPCache", &RIPCache, CUPSD_VARTYPE_STRING },
{ "RootCertDuration", &RootCertDuration, CUPSD_VARTYPE_TIME },
{ "ServerAdmin", &ServerAdmin, CUPSD_VARTYPE_STRING },
+ { "ServerName", &ServerName, CUPSD_VARTYPE_STRING },
+ { "StrictConformance", &StrictConformance, CUPSD_VARTYPE_BOOLEAN },
+ { "Timeout", &Timeout, CUPSD_VARTYPE_TIME },
+ { "WebInterface", &WebInterface, CUPSD_VARTYPE_BOOLEAN }
+};
+static const cupsd_var_t cupsfiles_vars[] =
+{
+ { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING },
+ { "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING },
+ { "ConfigFilePerm", &ConfigFilePerm, CUPSD_VARTYPE_INTEGER },
+ { "DataDir", &DataDir, CUPSD_VARTYPE_STRING },
+ { "DocumentRoot", &DocumentRoot, CUPSD_VARTYPE_STRING },
+ { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING },
+ { "FileDevice", &FileDevice, CUPSD_VARTYPE_BOOLEAN },
+ { "FontPath", &FontPath, CUPSD_VARTYPE_STRING },
+ { "LogFilePerm", &LogFilePerm, CUPSD_VARTYPE_INTEGER },
+ { "LPDConfigFile", &LPDConfigFile, CUPSD_VARTYPE_STRING },
+ { "PageLog", &PageLog, CUPSD_VARTYPE_STRING },
+ { "Printcap", &Printcap, CUPSD_VARTYPE_STRING },
+ { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING },
{ "ServerBin", &ServerBin, CUPSD_VARTYPE_PATHNAME },
#ifdef HAVE_SSL
{ "ServerCertificate", &ServerCertificate, CUPSD_VARTYPE_PATHNAME },
@@ -164,20 +171,17 @@ static const cupsd_var_t variables[] =
{ "ServerKey", &ServerKey, CUPSD_VARTYPE_PATHNAME },
# endif /* HAVE_LIBSSL || HAVE_GNUTLS */
#endif /* HAVE_SSL */
- { "ServerName", &ServerName, CUPSD_VARTYPE_STRING },
{ "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME },
{ "SMBConfigFile", &SMBConfigFile, CUPSD_VARTYPE_STRING },
{ "StateDir", &StateDir, CUPSD_VARTYPE_STRING },
- { "StrictConformance", &StrictConformance, CUPSD_VARTYPE_BOOLEAN },
#ifdef HAVE_AUTHORIZATION_H
{ "SystemGroupAuthKey", &SystemGroupAuthKey, CUPSD_VARTYPE_STRING },
#endif /* HAVE_AUTHORIZATION_H */
- { "TempDir", &TempDir, CUPSD_VARTYPE_PATHNAME },
- { "Timeout", &Timeout, CUPSD_VARTYPE_TIME },
- { "WebInterface", &WebInterface, CUPSD_VARTYPE_BOOLEAN }
+ { "TempDir", &TempDir, CUPSD_VARTYPE_PATHNAME }
};
-#define NUM_VARS (sizeof(variables) / sizeof(variables[0]))
+static int default_auth_type = CUPSD_AUTH_AUTO;
+ /* Default AuthType, if not specified */
static const unsigned ones[4] =
{
@@ -202,7 +206,12 @@ static int parse_aaa(cupsd_location_t *loc, char *line,
static int parse_fatal_errors(const char *s);
static int parse_groups(const char *s);
static int parse_protocols(const char *s);
-static int read_configuration(cups_file_t *fp);
+static int parse_variable(const char *filename, int linenum,
+ const char *line, const char *value,
+ size_t num_vars,
+ const cupsd_var_t *vars);
+static int read_cupsd_conf(cups_file_t *fp);
+static int read_cups_files_conf(cups_file_t *fp);
static int read_location(cups_file_t *fp, char *name, int linenum);
static int read_policy(cups_file_t *fp, char *name, int linenum);
static void set_policy_defaults(cupsd_policy_t *pol);
@@ -778,22 +787,48 @@ cupsdReadConfiguration(void)
cupsdInitEnv();
/*
- * Read the configuration file...
+ * Read the cups-files.conf file...
+ */
+
+ if ((fp = cupsFileOpen(CupsFilesFile, "r")) != NULL)
+ {
+ status = read_cups_files_conf(fp);
+
+ cupsFileClose(fp);
+
+ if (!status)
+ return (0);
+ }
+ else if (errno == ENOENT)
+ cupsdLogMessage(CUPSD_LOG_INFO, "No %s, using defaults.", CupsFilesFile);
+ else
+ {
+ cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", CupsFilesFile,
+ strerror(errno));
+ return (0);
+ }
+
+ if (!ErrorLog)
+ cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log");
+
+ /*
+ * Read the cupsd.conf file...
*/
if ((fp = cupsFileOpen(ConfigurationFile, "r")) == NULL)
+ {
+ cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", ConfigurationFile,
+ strerror(errno));
return (0);
+ }
- status = read_configuration(fp);
+ status = read_cupsd_conf(fp);
cupsFileClose(fp);
if (!status)
return (0);
- if (!ErrorLog)
- cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log");
-
RunUser = getuid();
cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.",
@@ -2548,13 +2583,244 @@ parse_protocols(const char *s) /* I - Space-delimited protocols */
/*
- * 'read_configuration()' - Read a configuration file.
+ * 'parse_variable()' - Parse a variable line.
*/
static int /* O - 1 on success, 0 on failure */
-read_configuration(cups_file_t *fp) /* I - File to read from */
+parse_variable(
+ const char *filename, /* I - Name of configuration file */
+ int linenum, /* I - Line in configuration file */
+ const char *line, /* I - Line from configuration file */
+ const char *value, /* I - Value from configuration file */
+ size_t num_vars, /* I - Number of variables */
+ const cupsd_var_t *vars) /* I - Variables */
+{
+ size_t i; /* Looping var */
+ const cupsd_var_t *var; /* Variables */
+ char temp[1024]; /* Temporary string */
+
+
+ for (i = num_vars, var = vars; i > 0; i --, var ++)
+ if (!_cups_strcasecmp(line, var->name))
+ break;
+
+ if (i == 0)
+ {
+ /*
+ * Unknown directive! Output an error message and continue...
+ */
+
+ if (!value)
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value for %s on line %d of %s.",
+ line, linenum, filename);
+ else
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d of %s.",
+ line, linenum, filename);
+
+ return (0);
+ }
+
+ switch (var->type)
+ {
+ case CUPSD_VARTYPE_INTEGER :
+ if (!value)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Missing integer value for %s on line %d of %s.",
+ line, linenum, filename);
+ return (0);
+ }
+ else if (!isdigit(*value & 255))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Bad integer value for %s on line %d of %s.",
+ line, linenum, filename);
+ return (0);
+ }
+ else
+ {
+ int n; /* Number */
+ char *units; /* Units */
+
+ n = strtol(value, &units, 0);
+
+ if (units && *units)
+ {
+ if (tolower(units[0] & 255) == 'g')
+ n *= 1024 * 1024 * 1024;
+ else if (tolower(units[0] & 255) == 'm')
+ n *= 1024 * 1024;
+ else if (tolower(units[0] & 255) == 'k')
+ n *= 1024;
+ else if (tolower(units[0] & 255) == 't')
+ n *= 262144;
+ else
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown integer value for %s on line %d of %s.",
+ line, linenum, filename);
+ return (0);
+ }
+ }
+
+ if (n < 0)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Bad negative integer value for %s on line %d of "
+ "%s.", line, linenum, filename);
+ return (0);
+ }
+ else
+ {
+ *((int *)var->ptr) = n;
+ }
+ }
+ break;
+
+ case CUPSD_VARTYPE_TIME :
+ if (!value)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Missing time interval value for %s on line %d of "
+ "%s.", line, linenum, filename);
+ return (0);
+ }
+ else if (!_cups_strncasecmp(line, "PreserveJob", 11) &&
+ (!_cups_strcasecmp(value, "true") ||
+ !_cups_strcasecmp(value, "on") ||
+ !_cups_strcasecmp(value, "enabled") ||
+ !_cups_strcasecmp(value, "yes")))
+ {
+ *((int *)var->ptr) = INT_MAX;
+ }
+ else if (!_cups_strcasecmp(value, "false") ||
+ !_cups_strcasecmp(value, "off") ||
+ !_cups_strcasecmp(value, "disabled") ||
+ !_cups_strcasecmp(value, "no"))
+ {
+ *((int *)var->ptr) = 0;
+ }
+ else if (!isdigit(*value & 255))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown time interval value for %s on line %d of "
+ "%s.", line, linenum, filename);
+ return (0);
+ }
+ else
+ {
+ double n; /* Number */
+ char *units; /* Units */
+
+ n = strtod(value, &units);
+
+ if (units && *units)
+ {
+ if (tolower(units[0] & 255) == 'w')
+ n *= 7 * 24 * 60 * 60;
+ else if (tolower(units[0] & 255) == 'd')
+ n *= 24 * 60 * 60;
+ else if (tolower(units[0] & 255) == 'h')
+ n *= 60 * 60;
+ else if (tolower(units[0] & 255) == 'm')
+ n *= 60;
+ else
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown time interval value for %s on line "
+ "%d of %s.", line, linenum, filename);
+ return (0);
+ }
+ }
+
+ if (n < 0.0 || n > INT_MAX)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Bad time value for %s on line %d of %s.",
+ line, linenum, filename);
+ return (0);
+ }
+ else
+ {
+ *((int *)var->ptr) = (int)n;
+ }
+ }
+ break;
+
+ case CUPSD_VARTYPE_BOOLEAN :
+ if (!value)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Missing boolean value for %s on line %d of %s.",
+ line, linenum, filename);
+ return (0);
+ }
+ else if (!_cups_strcasecmp(value, "true") ||
+ !_cups_strcasecmp(value, "on") ||
+ !_cups_strcasecmp(value, "enabled") ||
+ !_cups_strcasecmp(value, "yes") ||
+ atoi(value) != 0)
+ {
+ *((int *)var->ptr) = TRUE;
+ }
+ else if (!_cups_strcasecmp(value, "false") ||
+ !_cups_strcasecmp(value, "off") ||
+ !_cups_strcasecmp(value, "disabled") ||
+ !_cups_strcasecmp(value, "no") ||
+ !_cups_strcasecmp(value, "0"))
+ {
+ *((int *)var->ptr) = FALSE;
+ }
+ else
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown boolean value %s on line %d of %s.",
+ value, linenum, filename);
+ return (0);
+ }
+ break;
+
+ case CUPSD_VARTYPE_PATHNAME :
+ if (!value)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Missing pathname value for %s on line %d of %s.",
+ line, linenum, filename);
+ return (0);
+ }
+
+ if (value[0] == '/')
+ strlcpy(temp, value, sizeof(temp));
+ else
+ snprintf(temp, sizeof(temp), "%s/%s", ServerRoot, value);
+
+ if (access(temp, 0))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "File or directory for \"%s %s\" on line %d of %s "
+ "does not exist.", line, value, linenum, filename);
+ return (0);
+ }
+
+ cupsdSetString((char **)var->ptr, temp);
+ break;
+
+ case CUPSD_VARTYPE_STRING :
+ cupsdSetString((char **)var->ptr, value);
+ break;
+ }
+
+ return (1);
+}
+
+
+/*
+ * 'read_cupsd_conf()' - Read the cupsd.conf configuration file.
+ */
+
+static int /* O - 1 on success, 0 on failure */
+read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
{
- int i; /* Looping var */
int linenum; /* Current line number */
char line[HTTP_MAX_BUFFER],
/* Line from file */
@@ -2563,12 +2829,10 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
*value, /* Pointer to value */
*valueptr; /* Pointer into value */
int valuelen; /* Length of value */
- cupsd_var_t const *var; /* Current variable */
http_addrlist_t *addrlist, /* Address list */
*addr; /* Current address */
cups_file_t *incfile; /* Include file */
char incname[1024]; /* Include filename */
- struct group *group; /* Group */
/*
@@ -2600,7 +2864,7 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
incname, strerror(errno));
else
{
- read_configuration(incfile);
+ read_cupsd_conf(incfile);
cupsFileClose(incfile);
}
}
@@ -2624,8 +2888,6 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
if (linenum == 0)
return (0);
}
- else if (!_cups_strcasecmp(line, "FatalErrors"))
- FatalErrors = parse_fatal_errors(value);
else if (!_cups_strcasecmp(line, "FaxRetryInterval") && value)
{
JobRetryInterval = atoi(value);
@@ -2769,10 +3031,10 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
BrowseLocalProtocols = protocols;
}
- else if (!_cups_strcasecmp(line, "default_auth_type") && value)
+ else if (!_cups_strcasecmp(line, "DefaultAuthType") && value)
{
/*
- * default_auth_type {basic,digest,basicdigest,negotiate}
+ * DefaultAuthType {basic,digest,basicdigest,negotiate}
*/
if (!_cups_strcasecmp(value, "none"))
@@ -2821,81 +3083,6 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
}
}
#endif /* HAVE_SSL */
- else if (!_cups_strcasecmp(line, "User") && value)
- {
- /*
- * User ID to run as...
- */
-
- if (isdigit(value[0] & 255))
- {
- int uid = atoi(value);
-
- if (!uid)
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Will not use User 0 as specified on line %d "
- "for security reasons. You must use a non-"
- "privileged account instead.",
- linenum);
- else
- User = atoi(value);
- }
- else
- {
- struct passwd *p; /* Password information */
-
- endpwent();
- p = getpwnam(value);
-
- if (p)
- {
- if (!p->pw_uid)
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Will not use User %s (UID=0) as specified on line "
- "%d for security reasons. You must use a non-"
- "privileged account instead.",
- value, linenum);
- else
- User = p->pw_uid;
- }
- else
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown User \"%s\" on line %d, ignoring.",
- value, linenum);
- }
- }
- else if (!_cups_strcasecmp(line, "Group") && value)
- {
- /*
- * Group ID to run as...
- */
-
- if (isdigit(value[0]))
- Group = atoi(value);
- else
- {
- endgrent();
- group = getgrnam(value);
-
- if (group != NULL)
- Group = group->gr_gid;
- else
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown Group \"%s\" on line %d, ignoring.",
- value, linenum);
- }
- }
- else if (!_cups_strcasecmp(line, "SystemGroup") && value)
- {
- /*
- * SystemGroup (admin) group(s)...
- */
-
- if (!parse_groups(value))
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown SystemGroup \"%s\" on line %d, ignoring.",
- value, linenum);
- }
else if (!_cups_strcasecmp(line, "HostNameLookups") && value)
{
/*
@@ -2974,22 +3161,6 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d.",
value, linenum);
}
- else if (!_cups_strcasecmp(line, "PrintcapFormat") && value)
- {
- /*
- * Format of printcap file?
- */
-
- if (!_cups_strcasecmp(value, "bsd"))
- PrintcapFormat = PRINTCAP_BSD;
- else if (!_cups_strcasecmp(value, "plist"))
- PrintcapFormat = PRINTCAP_PLIST;
- else if (!_cups_strcasecmp(value, "solaris"))
- PrintcapFormat = PRINTCAP_SOLARIS;
- else
- cupsdLogMessage(CUPSD_LOG_WARN, "Unknown PrintcapFormat %s on line %d.",
- value, linenum);
- }
else if (!_cups_strcasecmp(line, "ServerTokens") && value)
{
/*
@@ -3116,181 +3287,158 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
}
#endif /* HAVE_SSL */
else
+ parse_variable(ConfigurationFile, linenum, line, value,
+ sizeof(cupsd_vars) / sizeof(cupsd_vars[0]), cupsd_vars);
+ }
+
+ return (1);
+}
+
+
+/*
+ * 'read_cups_files_conf()' - Read the cups-files.conf configuration file.
+ */
+
+static int /* O - 1 on success, 0 on failure */
+read_cups_files_conf(cups_file_t *fp) /* I - File to read from */
+{
+ int linenum; /* Current line number */
+ char line[HTTP_MAX_BUFFER], /* Line from file */
+ *value; /* Value from line */
+ struct group *group; /* Group */
+
+
+ /*
+ * Loop through each line in the file...
+ */
+
+ linenum = 0;
+
+ while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
+ {
+ if (!_cups_strcasecmp(line, "FatalErrors"))
+ FatalErrors = parse_fatal_errors(value);
+ else if (!_cups_strcasecmp(line, "Group") && value)
{
/*
- * Find a simple variable in the list...
+ * Group ID to run as...
*/
- for (i = NUM_VARS, var = variables; i > 0; i --, var ++)
- if (!_cups_strcasecmp(line, var->name))
- break;
-
- if (i == 0)
+ if (isdigit(value[0]))
+ Group = atoi(value);
+ else
{
- /*
- * Unknown directive! Output an error message and continue...
- */
+ endgrent();
+ group = getgrnam(value);
- if (!value)
- cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value for %s on line %d.",
- line, linenum);
+ if (group != NULL)
+ Group = group->gr_gid;
else
- cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d.",
- line, linenum);
- continue;
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown Group \"%s\" on line %d of %s.", value,
+ linenum, CupsFilesFile);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
}
+ }
+ else if (!_cups_strcasecmp(line, "PrintcapFormat") && value)
+ {
+ /*
+ * Format of printcap file?
+ */
- switch (var->type)
+ if (!_cups_strcasecmp(value, "bsd"))
+ PrintcapFormat = PRINTCAP_BSD;
+ else if (!_cups_strcasecmp(value, "plist"))
+ PrintcapFormat = PRINTCAP_PLIST;
+ else if (!_cups_strcasecmp(value, "solaris"))
+ PrintcapFormat = PRINTCAP_SOLARIS;
+ else
{
- case CUPSD_VARTYPE_INTEGER :
- if (!value)
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Missing integer value for %s on line %d.",
- line, linenum);
- else if (!isdigit(*value & 255))
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad integer value for %s on line %d.",
- line, linenum);
- else
- {
- int n; /* Number */
- char *units; /* Units */
-
- n = strtol(value, &units, 0);
-
- if (units && *units)
- {
- if (tolower(units[0] & 255) == 'g')
- n *= 1024 * 1024 * 1024;
- else if (tolower(units[0] & 255) == 'm')
- n *= 1024 * 1024;
- else if (tolower(units[0] & 255) == 'k')
- n *= 1024;
- else if (tolower(units[0] & 255) == 't')
- n *= 262144;
- else
- {
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown integer value for %s on line %d.",
- line, linenum);
- break;
- }
- }
-
- if (n < 0)
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad negative integer value for %s on line %d.",
- line, linenum);
- else
- *((int *)var->ptr) = n;
- }
- break;
-
- case CUPSD_VARTYPE_TIME :
- if (!value)
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Missing time interval value for %s on line %d.",
- line, linenum);
- else if (!_cups_strncasecmp(line, "PreserveJob", 11) &&
- (!_cups_strcasecmp(value, "true") ||
- !_cups_strcasecmp(value, "on") ||
- !_cups_strcasecmp(value, "enabled") ||
- !_cups_strcasecmp(value, "yes")))
- *((int *)var->ptr) = INT_MAX;
- else if (!_cups_strcasecmp(value, "false") ||
- !_cups_strcasecmp(value, "off") ||
- !_cups_strcasecmp(value, "disabled") ||
- !_cups_strcasecmp(value, "no"))
- *((int *)var->ptr) = 0;
- else if (!isdigit(*value & 255))
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown time interval value for %s on line %d.",
- line, linenum);
- else
- {
- double n; /* Number */
- char *units; /* Units */
-
- n = strtod(value, &units);
-
- if (units && *units)
- {
- if (tolower(units[0] & 255) == 'w')
- n *= 7 * 24 * 60 * 60;
- else if (tolower(units[0] & 255) == 'd')
- n *= 24 * 60 * 60;
- else if (tolower(units[0] & 255) == 'h')
- n *= 60 * 60;
- else if (tolower(units[0] & 255) == 'm')
- n *= 60;
- else
- {
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown time interval value for %s on line "
- "%d.", line, linenum);
- break;
- }
- }
-
- if (n < 0.0 || n > INT_MAX)
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Bad time value for %s on line %d.",
- line, linenum);
- else
- *((int *)var->ptr) = (int)n;
- }
- break;
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown PrintcapFormat \"%s\" on line %d of %s.",
+ value, linenum, CupsFilesFile);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
+ }
+ else if (!_cups_strcasecmp(line, "SystemGroup") && value)
+ {
+ /*
+ * SystemGroup (admin) group(s)...
+ */
- case CUPSD_VARTYPE_BOOLEAN :
- if (!value)
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Missing boolean value for %s on line %d.",
- line, linenum);
- else if (!_cups_strcasecmp(value, "true") ||
- !_cups_strcasecmp(value, "on") ||
- !_cups_strcasecmp(value, "enabled") ||
- !_cups_strcasecmp(value, "yes") ||
- atoi(value) != 0)
- *((int *)var->ptr) = TRUE;
- else if (!_cups_strcasecmp(value, "false") ||
- !_cups_strcasecmp(value, "off") ||
- !_cups_strcasecmp(value, "disabled") ||
- !_cups_strcasecmp(value, "no") ||
- !_cups_strcasecmp(value, "0"))
- *((int *)var->ptr) = FALSE;
- else
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Unknown boolean value %s on line %d.",
- value, linenum);
- break;
+ if (!parse_groups(value))
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown SystemGroup \"%s\" on line %d of %s.", value,
+ linenum, CupsFilesFile);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
+ }
+ else if (!_cups_strcasecmp(line, "User") && value)
+ {
+ /*
+ * User ID to run as...
+ */
- case CUPSD_VARTYPE_PATHNAME :
- if (!value)
- {
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "Missing pathname value for %s on line %d.",
- line, linenum);
- break;
- }
+ if (isdigit(value[0] & 255))
+ {
+ int uid = atoi(value);
- if (value[0] == '/')
- strlcpy(temp, value, sizeof(temp));
- else
- snprintf(temp, sizeof(temp), "%s/%s", ServerRoot, value);
+ if (!uid)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Will not use User 0 as specified on line %d of %s "
+ "for security reasons. You must use a non-"
+ "privileged account instead.",
+ linenum, CupsFilesFile);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
+ else
+ User = atoi(value);
+ }
+ else
+ {
+ struct passwd *p; /* Password information */
- if (access(temp, 0))
- {
- cupsdLogMessage(CUPSD_LOG_ERROR,
- "File or directory for \"%s %s\" on line %d "
- "does not exist.", line, value, linenum);
- break;
- }
+ endpwent();
+ p = getpwnam(value);
- case CUPSD_VARTYPE_STRING :
- cupsdSetString((char **)var->ptr, value);
- break;
+ if (p)
+ {
+ if (!p->pw_uid)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Will not use User %s (UID=0) as specified on line "
+ "%d of %s for security reasons. You must use a "
+ "non-privileged account instead.",
+ value, linenum, CupsFilesFile);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
+ else
+ User = p->pw_uid;
+ }
+ else
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Unknown User \"%s\" on line %d of %s.",
+ value, linenum, CupsFilesFile);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
}
}
+ else if (!parse_variable(CupsFilesFile, linenum, line, value,
+ sizeof(cupsfiles_vars) / sizeof(cupsfiles_vars[0]),
+ cupsfiles_vars) &&
+ (FatalErrors & CUPSD_FATAL_CONFIG))
+ return (0);
}
return (1);
diff --git a/scheduler/conf.h b/scheduler/conf.h
index 51783eecb..714661eb0 100644
--- a/scheduler/conf.h
+++ b/scheduler/conf.h
@@ -97,7 +97,9 @@ typedef struct
*/
VAR char *ConfigurationFile VALUE(NULL),
- /* Configuration file to use */
+ /* cupsd.conf file to use */
+ *CupsFilesFile VALUE(NULL),
+ /* cups-files.conf file to use */
*ServerName VALUE(NULL),
/* FQDN for server */
*ServerAdmin VALUE(NULL),
diff --git a/scheduler/main.c b/scheduler/main.c
index b0185e1ab..0f6098963 100644
--- a/scheduler/main.c
+++ b/scheduler/main.c
@@ -208,7 +208,6 @@ main(int argc, /* I - Number of command-line args */
char *current; /* Current directory */
-
/*
* Allocate a buffer for the current working directory to
* reduce run-time stack usage; this approximates the
@@ -234,6 +233,35 @@ main(int argc, /* I - Number of command-line args */
cupsdSetStringf(&ConfigurationFile, "%s/%s", current, argv[i]);
free(current);
}
+
+ if (!CupsFilesFile)
+ {
+ char *filename, /* Copy of cupsd.conf filename */
+ *slash; /* Final slash in cupsd.conf filename */
+ size_t len; /* Size of buffer */
+
+ len = strlen(ConfigurationFile) + 15;
+ if ((filename = malloc(len)) == NULL)
+ {
+ _cupsLangPrintf(stderr,
+ _("cupsd: Unable to get path to "
+ "cups-files.conf file."));
+ return (1);
+ }
+
+ strlcpy(filename, ConfigurationFile, len);
+ if ((slash = strrchr(filename, '/')) == NULL)
+ {
+ _cupsLangPrintf(stderr,
+ _("cupsd: Unable to get path to "
+ "cups-files.conf file."));
+ return (1);
+ }
+
+ strlcpy(slash, "/cups-files.conf", len - (slash - filename));
+ cupsdSetString(&CupsFilesFile, filename);
+ free(filename);
+ }
break;
case 'f' : /* Run in foreground... */
@@ -272,6 +300,29 @@ main(int argc, /* I - Number of command-line args */
UseProfiles = 0;
break;
+ case 's' : /* Set cups-files.conf location */
+ i ++;
+ if (i >= argc)
+ {
+ _cupsLangPuts(stderr, _("cupsd: Expected cups-files.conf "
+ "filename after \"-s\" option."));
+ usage(1);
+ }
+
+ if (argv[i][0] != '/')
+ {
+ /*
+ * Relative filename not allowed...
+ */
+
+ _cupsLangPuts(stderr, _("cupsd: Relative cups-files.conf "
+ "filename not allowed."));
+ usage(1);
+ }
+
+ cupsdSetString(&CupsFilesFile, argv[i]);
+ break;
+
#ifdef __APPLE__
case 'S' : /* Disable system management functions */
fputs("cupsd: -S (disable system management) for internal "
diff --git a/test/ipptool.c b/test/ipptool.c
index 3882ef647..e2cbc962e 100644
--- a/test/ipptool.c
+++ b/test/ipptool.c
@@ -765,7 +765,8 @@ do_tests(_cups_vars_t *vars, /* I - Variables */
token[1024], /* Token from file */
*tokenptr, /* Pointer into token */
temp[1024], /* Temporary string */
- buffer[8192]; /* Copy buffer */
+ buffer[8192], /* Copy buffer */
+ compression[16]; /* COMPRESSION value */
ipp_t *request = NULL, /* IPP request */
*response = NULL; /* IPP response */
size_t length; /* Length of IPP request */
@@ -1146,17 +1147,18 @@ do_tests(_cups_vars_t *vars, /* I - Variables */
strlcpy(resource, vars->resource, sizeof(resource));
request_id ++;
- request = ippNew();
- op = (ipp_op_t)0;
- group = IPP_TAG_ZERO;
- ignore_errors = IgnoreErrors;
- last_expect = NULL;
- last_status = NULL;
- filename[0] = '\0';
- skip_previous = 0;
- skip_test = 0;
- version = Version;
- transfer = Transfer;
+ request = ippNew();
+ op = (ipp_op_t)0;
+ group = IPP_TAG_ZERO;
+ ignore_errors = IgnoreErrors;
+ last_expect = NULL;
+ last_status = NULL;
+ filename[0] = '\0';
+ skip_previous = 0;
+ skip_test = 0;
+ version = Version;
+ transfer = Transfer;
+ compression[0] = '\0';
strlcpy(name, testfile, sizeof(name));
if (strrchr(name, '.') != NULL)
@@ -1243,6 +1245,40 @@ do_tests(_cups_vars_t *vars, /* I - Variables */
goto test_exit;
}
}
+ else if (!strcmp(token, "COMPRESSION"))
+ {
+ /*
+ * COMPRESSION none
+ * COMPRESSION deflate
+ * COMPRESSION gzip
+ */
+
+ if (get_token(fp, temp, sizeof(temp), &linenum))
+ {
+ expand_variables(vars, compression, temp, sizeof(compression));
+#ifdef HAVE_LIBZ
+ if (strcmp(compression, "none") && strcmp(compression, "deflate") &&
+ strcmp(compression, "gzip"))
+#else
+ if (strcmp(compression, "none"))
+#endif /* HAVE_LIBZ */
+ {
+ print_fatal_error("Unsupported COMPRESSION value '%s' on line %d.",
+ compression, linenum);
+ pass = 0;
+ goto test_exit;
+ }
+
+ if (!strcmp(compression, "none"))
+ compression[0] = '\0';
+ }
+ else
+ {
+ print_fatal_error("Missing COMPRESSION value on line %d.", linenum);
+ pass = 0;
+ goto test_exit;
+ }
+ }
else if (!strcmp(token, "DEFINE"))
{
/*
@@ -2327,6 +2363,11 @@ do_tests(_cups_vars_t *vars, /* I - Variables */
{
status = cupsSendRequest(http, request, resource, length);
+#ifdef HAVE_LIBZ
+ if (compression[0])
+ httpSetField(http, HTTP_FIELD_CONTENT_ENCODING, compression);
+#endif /* HAVE_LIBZ */
+
if (!Cancel && status == HTTP_CONTINUE &&
request->state == IPP_DATA && filename[0])
{
diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh
index 4a1174e3d..3c19b2030 100755
--- a/test/run-stp-tests.sh
+++ b/test/run-stp-tests.sh
@@ -252,16 +252,16 @@ echo ""
case "$usedebugprintfs" in
Y* | y*)
- echo "Enabling debug printfs; log files can be found in /tmp/cups-$user/log..."
+ echo "Enabling debug printfs (level 5); log files can be found in /tmp/cups-$user/log..."
CUPS_DEBUG_LOG="/tmp/cups-$user/log/debug_printfs.%d"; export CUPS_DEBUG_LOG
CUPS_DEBUG_LEVEL=5; export CUPS_DEBUG_LEVEL
CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend).*$'; export CUPS_DEBUG_FILTER
;;
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)
- echo "Enabling debug printfs; log files can be found in /tmp/cups-$user/log..."
+ echo "Enabling debug printfs (level $usedebugprintfs); log files can be found in /tmp/cups-$user/log..."
CUPS_DEBUG_LOG="/tmp/cups-$user/log/debug_printfs.%d"; export CUPS_DEBUG_LOG
- CUPS_DEBUG_LEVEL=$usedebugprintf; export CUPS_DEBUG_LEVEL
+ CUPS_DEBUG_LEVEL="$usedebugprintfs"; export CUPS_DEBUG_LEVEL
CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend).*$'; export CUPS_DEBUG_FILTER
;;
@@ -390,26 +390,11 @@ fi
cat >/tmp/cups-$user/cupsd.conf <<EOF
StrictConformance Yes
Browsing Off
-FileDevice yes
-Printcap
Listen localhost:$port
-User $user
-ServerRoot /tmp/cups-$user
-StateDir /tmp/cups-$user
-ServerBin /tmp/cups-$user/bin
-CacheDir /tmp/cups-$user/share
-DataDir /tmp/cups-$user/share
-FontPath /tmp/cups-$user/share/fonts
PassEnv LOCALEDIR
PassEnv DYLD_INSERT_LIBRARIES
-DocumentRoot $root/doc
-RequestRoot /tmp/cups-$user/spool
-TempDir /tmp/cups-$user/spool/temp
MaxSubscriptions 3
MaxLogSize 0
-AccessLog /tmp/cups-$user/log/access_log
-ErrorLog /tmp/cups-$user/log/error_log
-PageLog /tmp/cups-$user/log/page_log
AccessLogLevel actions
LogLevel debug2
LogTimeFormat usecs
@@ -422,6 +407,24 @@ $encryption
</Policy>
EOF
+cat >/tmp/cups-$user/cups-files.conf <<EOF
+FileDevice yes
+Printcap
+User $user
+ServerRoot /tmp/cups-$user
+StateDir /tmp/cups-$user
+ServerBin /tmp/cups-$user/bin
+CacheDir /tmp/cups-$user/share
+DataDir /tmp/cups-$user/share
+FontPath /tmp/cups-$user/share/fonts
+DocumentRoot $root/doc
+RequestRoot /tmp/cups-$user/spool
+TempDir /tmp/cups-$user/spool/temp
+AccessLog /tmp/cups-$user/log/access_log
+ErrorLog /tmp/cups-$user/log/error_log
+PageLog /tmp/cups-$user/log/page_log
+EOF
+
#
# Setup lots of test queues - half with PPD files, half without...
#
@@ -567,6 +570,11 @@ if test "x$testtype" = x0; then
echo "LD_PRELOAD=\"$LD_PRELOAD\"; export LD_PRELOAD" >>$runcups
echo "LOCALEDIR=\"$LOCALEDIR\"; export LOCALEDIR" >>$runcups
echo "SHLIB_PATH=\"$SHLIB_PATH\"; export SHLIB_PATH" >>$runcups
+ if test "x$CUPS_DEBUG_LEVEL" != x; then
+ echo "CUPS_DEBUG_FILTER='$CUPS_DEBUG_FILTER'; export CUPS_DEBUG_FILTER" >>$runcups
+ echo "CUPS_DEBUG_LEVEL=$CUPS_DEBUG_LEVEL; export CUPS_DEBUG_LEVEL" >>$runcups
+ echo "CUPS_DEBUG_LOG='$CUPS_DEBUG_LOG'; export CUPS_DEBUG_LOG" >>$runcups
+ fi
echo "" >>$runcups
echo "# Run command..." >>$runcups
echo "exec \"\$@\"" >>$runcups