Ticket #3754: CVE-2012-5519.patch

File CVE-2012-5519.patch, 82.8 KB (added by Fernando de Oliveira, 11 years ago)
  • conf/Makefile

    Description: fix privilege escalation via config file editing
    Origin: upstream, r10710 and r10713 in 1.6 branch + other small fixes
    Bug: https://www.cups.org/str.php?L4223
    Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=692791
    
    old new  
    1919# Config files...
    2020#
    2121
    22 KEEP    =       cupsd.conf snmp.conf
     22KEEP    =       cups-files.conf cupsd.conf snmp.conf
    2323REPLACE =       mime.convs mime.types
    2424
    2525
  • new file cups-1.6.1/conf/cups-files.conf.in

    - +  
     1#
     2# "$Id$"
     3#
     4# Sample file/directory/user/group configuration file for the CUPS scheduler.
     5# See "man cups-files.conf" for a complete description of this file.
     6#
     7
     8# List of events that are considered fatal errors for the scheduler...
     9#FatalErrors @CUPS_FATAL_ERRORS@
     10
     11# Default user and group for filters/backends/helper programs; this cannot be
     12# any user or group that resolves to ID 0 for security reasons...
     13#User @CUPS_USER@
     14#Group @CUPS_GROUP@
     15
     16# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
     17SystemGroup @CUPS_SYSTEM_GROUPS@
     18@CUPS_SYSTEM_AUTHKEY@
     19
     20# User that is substituted for unauthenticated (remote) root accesses...
     21#RemoteRoot remroot
     22
     23# Do we allow file: device URIs other than to /dev/null?
     24#FileDevice No
     25
     26# Permissions for configuration and log files...
     27#ConfigFilePerm @CUPS_CONFIG_FILE_PERM@
     28#LogFilePerm @CUPS_LOG_FILE_PERM@
     29
     30# Location of the file logging all access to the scheduler; may be the name
     31# "syslog". If not an absolute path, the value of ServerRoot is used as the
     32# root directory.  Also see the "AccessLogLevel" directive in cupsd.conf.
     33AccessLog @CUPS_LOGDIR@/access_log
     34
     35# Location of cache files used by the scheduler...
     36#CacheDir @CUPS_CACHEDIR@
     37
     38# Location of data files used by the scheduler...
     39#DataDir @CUPS_DATADIR@
     40
     41# Location of the static web content served by the scheduler...
     42#DocumentRoot @CUPS_DOCROOT@
     43
     44# Location of the file logging all messages produced by the scheduler and any
     45# helper programs; may be the name "syslog". If not an absolute path, the value
     46# of ServerRoot is used as the root directory.  Also see the "LogLevel"
     47# directive in cupsd.conf.
     48ErrorLog @CUPS_LOGDIR@/error_log
     49
     50# Location of fonts used by older print filters...
     51#FontPath @CUPS_FONTPATH@
     52
     53# Location of LPD configuration
     54#LPDConfigFile @CUPS_DEFAULT_LPD_CONFIG_FILE@
     55
     56# Location of the file logging all pages printed by the scheduler and any
     57# helper programs; may be the name "syslog". If not an absolute path, the value
     58# of ServerRoot is used as the root directory.  Also see the "PageLogFormat"
     59# directive in cupsd.conf.
     60PageLog @CUPS_LOGDIR@/page_log
     61
     62# Location of the file listing all of the local printers...
     63#Printcap @CUPS_DEFAULT_PRINTCAP@
     64
     65# Format of the Printcap file...
     66#PrintcapFormat bsd
     67#PrintcapFormat plist
     68#PrintcapFormat solaris
     69
     70# Location of all spool files...
     71#RequestRoot @CUPS_REQUESTS@
     72
     73# Location of helper programs...
     74#ServerBin @CUPS_SERVERBIN@
     75
     76# SSL/TLS certificate for the scheduler...
     77#ServerCertificate @CUPS_SERVERCERT@
     78
     79# SSL/TLS private key for the scheduler...
     80#ServerKey @CUPS_SERVERKEY@
     81
     82# Location of other configuration files...
     83#ServerRoot @CUPS_SERVERROOT@
     84
     85# Location of Samba configuration file...
     86#SMBConfigFile @CUPS_DEFAULT_SMB_CONFIG_FILE@
     87
     88# Location of scheduler state files...
     89#StateDir @CUPS_STATEDIR@
     90
     91# Location of scheduler/helper temporary files. This directory is emptied on
     92# scheduler startup and cannot be one of the standard (public) temporary
     93# directory locations for security reasons...
     94#TempDir @CUPS_REQUESTS@/tmp
     95
     96#
     97# End of "$Id$".
     98#
  • config-scripts/cups-defaults.m4

    old new  
    372372fi
    373373
    374374AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE")
     375AC_SUBST(CUPS_DEFAULT_LPD_CONFIG_FILE)
    375376
    376377dnl Default SMB config file...
    377378AC_ARG_WITH(smbconfigfile, [  --with-smbconfigfile    set default SMBConfigFile URI],
     
    393394fi
    394395
    395396AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE")
     397AC_SUBST(CUPS_DEFAULT_SMB_CONFIG_FILE)
    396398
    397399dnl Default MaxCopies value...
    398400AC_ARG_WITH(max-copies, [  --with-max-copies       set default max copies value, default=9999 ],
  • config-scripts/cups-ssl.m4

    old new  
    2727SSLFLAGS=""
    2828SSLLIBS=""
    2929have_ssl=0
     30CUPS_SERVERCERT=""
     31CUPS_SERVERKEY=""
    3032
    3133if test x$enable_ssl != xno; then
    3234    dnl Look for CDSA...
     
    3638                have_ssl=1
    3739                AC_DEFINE(HAVE_SSL)
    3840                AC_DEFINE(HAVE_CDSASSL)
     41                CUPS_SERVERCERT="/Library/Keychains/System.keychain"
    3942
    4043                dnl Check for the various security headers...
    4144                AC_CHECK_HEADER(Security/SecureTransportPriv.h,
     
    106109        fi
    107110
    108111        if test $have_ssl = 1; then
     112            CUPS_SERVERCERT="ssl/server.crt"
     113            CUPS_SERVERKEY="ssl/server.key"
     114
    109115            if $PKGCONFIG --exists gcrypt; then
    110116                SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
    111117                SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
     
    148154            done
    149155
    150156            if test "x${SSLLIBS}" != "x"; then
     157                CUPS_SERVERCERT="ssl/server.crt"
     158                CUPS_SERVERKEY="ssl/server.key"
     159
    151160                LIBS="$SAVELIBS $SSLLIBS"
    152161                AC_CHECK_FUNCS(SSL_set_tlsext_host_name)
    153162            fi
     
    165174    AC_MSG_ERROR([Unable to enable SSL support.])
    166175fi
    167176
     177AC_SUBST(CUPS_SERVERCERT)
     178AC_SUBST(CUPS_SERVERKEY)
    168179AC_SUBST(IPPALIASES)
    169180AC_SUBST(SSLFLAGS)
    170181AC_SUBST(SSLLIBS)
  • configure.in

    old new  
    6060AC_SUBST(UNINSTALL_LANGUAGES)
    6161
    6262AC_OUTPUT(Makedefs
     63          conf/cups-files.conf
    6364          conf/cupsd.conf
    6465          conf/mime.convs
    6566          conf/pam.std
     
    7374          man/client.conf.man
    7475          man/cups-deviced.man
    7576          man/cups-driverd.man
     77          man/cups-files.conf.man
    7678          man/cups-lpd.man
    7779          man/cups-snmp.man
    7880          man/cupsaddsmb.man
  • new file cups-1.6.1/doc/help/ref-cups-files-conf.html.in

    - +  
     1<HTML>
     2<!-- SECTION: References -->
     3<HEAD>
     4        <TITLE>cups-files.conf</TITLE>
     5        <LINK REL="STYLESHEET" TYPE="text/css" HREF="../cups-printable.css">
     6</HEAD>
     7<BODY>
     8
     9<H1 CLASS="title">cups-files.conf</H1>
     10
     11<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>
     12
     13<H2 CLASS="title"><A NAME="AccessLog">AccessLog</A></H2>
     14
     15<H3>Examples</H3>
     16
     17<PRE CLASS="command">
     18AccessLog /var/log/cups/access_log
     19AccessLog /var/log/cups/access_log-%s
     20AccessLog syslog
     21</PRE>
     22
     23<H3>Description</H3>
     24
     25<P>The <CODE>AccessLog</CODE> directive sets the name of the
     26access log file. If the filename is not absolute then it is
     27assumed to be relative to the <A
     28HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
     29access log file is stored in "common log format" and can be used
     30by any web access reporting tool to generate a report on CUPS
     31server activity.</P>
     32
     33<P>The server name can be included in the filename by using
     34<CODE>%s</CODE> in the name.</P>
     35
     36<P>The special name "syslog" can be used to send the access
     37information to the system log instead of a plain file.</P>
     38
     39<P>The default access log file is
     40<VAR>@CUPS_LOGDIR@/access_log</VAR>.</P>
     41
     42
     43<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.15</SPAN><A NAME="ConfigFilePerm">ConfigFilePerm</A></H2>
     44
     45<H3>Examples</H3>
     46
     47<PRE CLASS="command">
     48ConfigFilePerm 0644
     49ConfigFilePerm 0640
     50</PRE>
     51
     52<H3>Description</H3>
     53
     54<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>
     55
     56<BLOCKQUOTE><B>Note:</B>
     57
     58<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>
     59
     60</BLOCKQUOTE>
     61
     62
     63<H2 CLASS="title"><A NAME="DataDir">DataDir</A></H2>
     64
     65<H3>Examples</H3>
     66
     67<PRE CLASS="command">
     68DataDir /usr/share/cups
     69</PRE>
     70
     71<H3>Description</H3>
     72
     73<P>The <CODE>DataDir</CODE> directive sets the directory to use
     74for data files.</P>
     75
     76
     77<H2 CLASS="title"><A NAME="DocumentRoot">DocumentRoot</A></H2>
     78
     79<H3>Examples</H3>
     80
     81<PRE CLASS="command">
     82DocumentRoot /usr/share/doc/cups
     83DocumentRoot /foo/bar/doc/cups
     84</PRE>
     85
     86<H3>Description</H3>
     87
     88<P>The <CODE>DocumentRoot</CODE> directive specifies the location
     89of web content for the HTTP server in CUPS. If an absolute path
     90is not specified then it is assumed to be relative to the <A
     91HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
     92default directory is <VAR>@CUPS_DOCROOT@</VAR>.</P>
     93
     94<P>Documents are first looked up in a sub-directory for the
     95primary language requested by the client (e.g.
     96<VAR>@CUPS_DOCROOT@/fr/...</VAR>) and then directly under
     97the <CODE>DocumentRoot</CODE> directory (e.g.
     98<VAR>@CUPS_DOCROOT@/...</VAR>), so it is possible to
     99localize the web content by providing subdirectories for each
     100language needed.</P>
     101
     102
     103<H2 CLASS="title"><A NAME="ErrorLog">ErrorLog</A></H2>
     104
     105<H3>Examples</H3>
     106
     107<PRE CLASS="command">
     108ErrorLog /var/log/cups/error_log
     109ErrorLog /var/log/cups/error_log-%s
     110ErrorLog syslog
     111</PRE>
     112
     113<H3>Description</H3>
     114
     115<P>The <CODE>ErrorLog</CODE> directive sets the name of the error
     116log file. If the filename is not absolute then it is assumed to
     117be relative to the <A
     118HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
     119default error log file is <VAR>@CUPS_LOGDIR@/error_log</VAR>.</P>
     120
     121<P>The server name can be included in the filename by using
     122<CODE>%s</CODE> in the name.</P>
     123
     124<P>The special name "syslog" can be used to send the error
     125information to the system log instead of a plain file.</P>
     126
     127
     128<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4/OS X 10.6</SPAN><A NAME="FatalErrors">FatalErrors</A></H2>
     129
     130<H3>Examples</H3>
     131
     132<PRE CLASS="command">
     133FatalErrors none
     134FatalErrors all
     135FatalErrors browse
     136FatalErrors config
     137FatalErrors listen
     138FatalErrors log
     139FatalErrors permissions
     140FatalErrors all -permissions
     141FatalErrors config permissions log
     142</PRE>
     143
     144<H3>Description</H3>
     145
     146<P>The <CODE>FatalErrors</CODE> directive determines whether certain kinds of
     147errors are fatal. The following kinds of errors are currently recognized:</P>
     148
     149<UL>
     150
     151        <LI><CODE>none</CODE> - No errors are fatal</LI>
     152
     153        <LI><CODE>all</CODE> - All of the errors below are fatal</LI>
     154
     155        <LI><CODE>browse</CODE> - Browsing initialization errors are fatal,
     156        for example failed binding to the CUPS browse port or failed connections
     157        to LDAP servers</LI>
     158
     159        <LI><CODE>config</CODE> - Configuration file syntax errors are
     160        fatal</LI>
     161
     162        <LI><CODE>listen</CODE> - Listen or Port errors are fatal, except for
     163        IPv6 failures on the loopback or "any" addresses</LI>
     164
     165        <LI><CODE>log</CODE> - Log file creation or write errors are fatal</LI>
     166
     167        <LI><CODE>permissions</CODE> - Bad startup file permissions are
     168        fatal, for example shared SSL certificate and key files with world-
     169        read permissions</LI>
     170
     171</UL>
     172
     173<P>Multiple errors can be listed, and the form "-kind" can be used with
     174<CODE>all</CODE> to remove specific kinds of errors. The default setting is
     175<CODE>@CUPS_FATAL_ERRORS@</CODE>.</P>
     176
     177
     178<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.18</SPAN><A NAME="FileDevice">FileDevice</A></H2>
     179
     180<H3>Examples</H3>
     181
     182<PRE CLASS="command">
     183FileDevice Yes
     184FileDevice No
     185</PRE>
     186
     187<H3>Description</H3>
     188
     189<P>The <CODE>FileDevice</CODE> directive determines whether the
     190scheduler allows new printers to be added using device URIs of
     191the form <CODE>file:/filename</CODE>. File devices are most often
     192used to test new printer drivers and do not support raw file
     193printing.</P>
     194
     195<P>The default setting is <CODE>No</CODE>.</P>
     196
     197<BLOCKQUOTE><B>Note:</B>
     198
     199<P>File devices are managed by the scheduler. Since the
     200scheduler normally runs as the root user, file devices
     201can be used to overwrite system files and potentially
     202gain unauthorized access to the system. If you must
     203create printers using file devices, we recommend that
     204you set the <CODE>FileDevice</CODE> directive to
     205<CODE>Yes</CODE> for only as long as you need to add the
     206printers to the system, and then reset the directive to
     207<CODE>No</CODE>.</P>
     208
     209</BLOCKQUOTE>
     210
     211
     212<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.3</SPAN><A NAME="FontPath">FontPath</A></H2>
     213
     214<H3>Examples</H3>
     215
     216<PRE CLASS="command">
     217FontPath /foo/bar/fonts
     218FontPath /usr/share/cups/fonts:/foo/bar/fonts
     219</PRE>
     220
     221<H3>Description</H3>
     222
     223<P>The <CODE>FontPath</CODE> directive specifies the font path to
     224use when searching for fonts. The default font path is
     225<CODE>/usr/share/cups/fonts</CODE>.</P>
     226
     227
     228<H2 CLASS="title"><A NAME="Group">Group</A></H2>
     229
     230<H3>Examples</H3>
     231
     232<PRE CLASS="command">
     233Group lp
     234Group nobody
     235</PRE>
     236
     237<H3>Description</H3>
     238
     239<P>The <CODE>Group</CODE> directive specifies the UNIX group that
     240filter and CGI programs run as. The default group is
     241system-specific but is usually <CODE>lp</CODE> or
     242<CODE>nobody</CODE>.</P>
     243
     244
     245<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.15</SPAN><A NAME="LogFilePerm">LogFilePerm</A></H2>
     246
     247<H3>Examples</H3>
     248
     249<PRE CLASS="command">
     250LogFilePerm 0644
     251LogFilePerm 0600
     252</PRE>
     253
     254<H3>Description</H3>
     255
     256<P>The <CODE>LogFilePerm</CODE> directive specifies the
     257permissions to use when writing log files. The default
     258is @CUPS_LOG_FILE_PERM@.</P>
     259
     260
     261<H2 CLASS="title"><A NAME="PageLog">PageLog</A></H2>
     262
     263<H3>Examples</H3>
     264
     265<PRE CLASS="command">
     266PageLog /var/log/cups/page_log
     267PageLog /var/log/cups/page_log-%s
     268PageLog syslog
     269</PRE>
     270
     271<H3>Description</H3>
     272
     273<P>The <CODE>PageLog</CODE> directive sets the name of the page
     274log file. If the filename is not absolute then it is assumed to
     275be relative to the <A
     276HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
     277default page log file is <VAR>@CUPS_LOGDIR@/page_log</VAR>.</P>
     278
     279<P>The server name can be included in the filename by using
     280<CODE>%s</CODE> in the name.</P>
     281
     282<P>The special name "syslog" can be used to send the page
     283information to the system log instead of a plain file.</P>
     284
     285
     286<H2 CLASS="title"><A NAME="Printcap">Printcap</A></H2>
     287
     288<H3>Examples</H3>
     289
     290<PRE CLASS="command">
     291Printcap
     292Printcap /etc/printcap
     293Printcap /etc/printers.conf
     294Printcap /Library/Preferences/org.cups.printers.plist
     295</PRE>
     296
     297<H3>Description</H3>
     298
     299<P>The <CODE>Printcap</CODE> directive controls whether or not a
     300printcap file is automatically generated and updated with a list
     301of available printers. If specified with no value, then no
     302printcap file will be generated. The default is to generate a
     303file named <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>.</P>
     304
     305<P>When a filename is specified (e.g. <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>),
     306the printcap file is written whenever a printer is added or
     307removed. The printcap file can then be used by applications that
     308are hardcoded to look at the printcap file for the available
     309printers.</P>
     310
     311
     312<H2 CLASS="title"><A NAME="PrintcapFormat">PrintcapFormat</A></H2>
     313
     314<H3>Examples</H3>
     315
     316<PRE CLASS="command">
     317PrintcapFormat BSD
     318PrintcapFormat Solaris
     319PrintcapFormat plist
     320</PRE>
     321
     322<H3>Description</H3>
     323
     324<P>The <CODE>PrintcapFormat</CODE> directive controls the output format of the
     325printcap file. The default is to generate the plist format on OS X, the
     326Solaris format on Solaris, and the BSD format on other operating systems.</P>
     327
     328
     329<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.3</SPAN><A NAME="RemoteRoot">RemoteRoot</A></H2>
     330
     331<H3>Examples</H3>
     332
     333<PRE CLASS="command">
     334RemoteRoot remroot
     335RemoteRoot root
     336</PRE>
     337
     338<H3>Description</H3>
     339
     340<P>The <CODE>RemoteRoot</CODE> directive sets the username for
     341unauthenticated root requests from remote hosts. The default
     342username is <VAR>remroot</VAR>. Setting <CODE>RemoteRoot</CODE>
     343to <VAR>root</VAR> effectively disables this security
     344mechanism.</P>
     345
     346
     347<H2 CLASS="title"><A NAME="RequestRoot">RequestRoot</A></H2>
     348
     349<H3>Examples</H3>
     350
     351<PRE CLASS="command">
     352RequestRoot /var/spool/cups
     353RequestRoot /foo/bar/spool/cups
     354</PRE>
     355
     356<H3>Description</H3>
     357
     358<P>The <CODE>RequestRoot</CODE> directive sets the directory for
     359incoming IPP requests and HTML forms. If an absolute path is not
     360provided then it is assumed to be relative to the <A
     361HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
     362default request directory is <VAR>@CUPS_REQUESTS@</VAR>.</P>
     363
     364
     365<H2 CLASS="title"><A NAME="ServerBin">ServerBin</A></H2>
     366
     367<H3>Examples</H3>
     368
     369<PRE CLASS="command">
     370ServerBin /usr/lib/cups
     371ServerBin /foo/bar/lib/cups
     372</PRE>
     373
     374<H3>Description</H3>
     375
     376<P>The <CODE>ServerBin</CODE> directive sets the directory for
     377server-run executables. If an absolute path is not provided then
     378it is assumed to be relative to the <A
     379HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
     380default executable directory is <VAR>/usr/lib/cups</VAR>,
     381<VAR>/usr/lib32/cups</VAR>, or <VAR>/usr/libexec/cups</VAR>
     382depending on the operating system.</P>
     383
     384
     385<H2 CLASS="title"><A NAME="ServerCertificate">ServerCertificate</A></H2>
     386
     387<H3>Examples</H3>
     388
     389<PRE CLASS="command">
     390ServerCertificate /etc/cups/ssl/server.crt
     391</PRE>
     392
     393<H3>Description</H3>
     394
     395<P>The <CODE>ServerCertificate</CODE> directive specifies the
     396location of the SSL certificate file used by the server when
     397negotiating encrypted connections. The certificate must not be
     398encrypted (password protected) since the scheduler normally runs
     399in the background and will be unable to ask for a password.</P>
     400
     401<P>The default certificate file is
     402<VAR>/etc/cups/ssl/server.crt</VAR>.</P>
     403
     404
     405<H2 CLASS="title"><A NAME="ServerKey">ServerKey</A></H2>
     406
     407<H3>Examples</H3>
     408
     409<PRE CLASS="command">
     410ServerKey /etc/cups/ssl/server.key
     411</PRE>
     412
     413<H3>Description</H3>
     414
     415<P>The <CODE>ServerKey</CODE> directive specifies the location of
     416the SSL private key file used by the server when negotiating
     417encrypted connections.</P>
     418
     419<P>The default key file is
     420<VAR>/etc/cups/ssl/server.crt</VAR>.</P>
     421
     422
     423<H2 CLASS="title"><A NAME="ServerRoot">ServerRoot</A></H2>
     424
     425<H3>Examples</H3>
     426
     427<PRE CLASS="command">
     428ServerRoot /etc/cups
     429ServerRoot /foo/bar/cups
     430</PRE>
     431
     432<H3>Description</H3>
     433
     434<P>The <CODE>ServerRoot</CODE> directive specifies the absolute
     435path to the server configuration and state files. It is also used
     436to resolve relative paths in the <VAR>cupsd.conf</VAR> file. The
     437default server directory is <VAR>/etc/cups</VAR>.</P>
     438
     439
     440<H2 CLASS="title"><A NAME="SystemGroup">SystemGroup</A></H2>
     441
     442<H3>Examples</H3>
     443
     444<PRE CLASS="command">
     445SystemGroup lpadmin
     446SystemGroup sys
     447SystemGroup system
     448SystemGroup root
     449SystemGroup root lpadmin
     450</PRE>
     451
     452<H3>Description</H3>
     453
     454<P>The <CODE>SystemGroup</CODE> directive specifies the system
     455administration group for <CODE>System</CODE> authentication.
     456Multiple groups can be listed, separated with spaces. The default
     457group list is <CODE>@CUPS_SYSTEM_GROUPS@</CODE>.</P>
     458
     459
     460<H2 CLASS="title"><A NAME="TempDir">TempDir</A></H2>
     461
     462<H3>Examples</H3>
     463
     464<PRE CLASS="command">
     465TempDir /var/tmp
     466TempDir /foo/bar/tmp
     467</PRE>
     468
     469<H3>Description</H3>
     470
     471<P>The <CODE>TempDir</CODE> directive specifies an absolute path
     472for the directory to use for temporary files. The default
     473directory is <VAR>@CUPS_REQUESTS@/tmp</VAR>.</P>
     474
     475<P>Temporary directories must be world-writable and should have
     476the "sticky" permission bit enabled so that other users cannot
     477delete filter temporary files. The following commands will create
     478an appropriate temporary directory called
     479<VAR>/foo/bar/tmp</VAR>:</P>
     480
     481<PRE CLASS="command">
     482<KBD>mkdir /foo/bar/tmp</KBD>
     483<KBD>chmod a+rwxt /foo/bar/tmp</KBD>
     484</PRE>
     485
     486
     487<H2 CLASS="title"><A NAME="User">User</A></H2>
     488
     489<H3>Examples</H3>
     490
     491<PRE CLASS="command">
     492User lp
     493User guest
     494</PRE>
     495
     496<H3>Description</H3>
     497
     498<P>The <CODE>User</CODE> directive specifies the UNIX user that
     499filter and CGI programs run as. The default user is
     500<CODE>@CUPS_USER@</CODE>.</P>
     501
     502<BLOCKQUOTE><B>Note:</B>
     503
     504<P>You may not use user <CODE>root</CODE>, as that would expose
     505the system to unacceptable security risks. The scheduler will
     506automatically choose user <CODE>nobody</CODE> if you specify a
     507user whose ID is 0.</P>
     508
     509</BLOCKQUOTE>
     510
     511
     512</BODY>
     513</HTML>
  • doc/help/ref-cupsd-conf.html.in

    old new  
    197197HREF="#Limit"><CODE>Limit</CODE></A> section.</P>
    198198
    199199
    200 <H2 CLASS="title"><SPAN CLASS="info">Deprecated</SPAN><A NAME="AuthClass">AuthClass</A></H2>
    201 
    202 <H3>Examples</H3>
    203 
    204 <PRE CLASS="command">
    205 &lt;Location /path&gt;
    206   ...
    207   AuthClass Anonymous
    208   AuthClass User
    209   AuthClass System
    210   AuthClass Group
    211 &lt;/Location&gt;
    212 </PRE>
    213 
    214 <H3>Description</H3>
    215 
    216 <P>The <CODE>AuthClass</CODE> directive defines what level of
    217 authentication is required:</P>
    218 
    219 <UL>
    220 
    221         <LI><CODE>Anonymous</CODE> - No authentication should be
    222         performed (default)</LI>
    223 
    224         <LI><CODE>User</CODE> - A valid username and password is
    225         required</LI>
    226 
    227         <LI><CODE>System</CODE> - A valid username and password
    228         is required, and the username must belong to the "sys"
    229         group; this can be changed using the <A
    230         HREF="#SystemGroup"><CODE>SystemGroup</CODE></A>
    231         directive</LI>
    232 
    233         <LI><CODE>Group</CODE> - A valid username and password is
    234         required, and the username must belong to the group named
    235         by the <A
    236         HREF="#AuthGroupName"><CODE>AuthGroupName</CODE></A>
    237         directive</LI>
    238 
    239 </UL>
    240 
    241 <P>The <CODE>AuthClass</CODE> directive must appear inside a <A
    242 HREF="#Location"><CODE>Location</CODE></A> or <A
    243 HREF="#Limit"><CODE>Limit</CODE></A> section.</P>
    244 
    245 <P><B>This directive is deprecated and will be removed from a
    246 future release of CUPS.</B> Consider using the more flexible <A
    247 HREF="#Require"><CODE>Require</CODE></A> directive instead.</P>
    248 
    249 
    250 <H2 CLASS="title"><SPAN CLASS="info">Deprecated</SPAN><A NAME="AuthGroupName">AuthGroupName</A></H2>
    251 
    252 <H3>Examples</H3>
    253 
    254 <PRE CLASS="command">
    255 &lt;Location /path&gt;
    256   ...
    257   AuthGroupName mygroup
    258   AuthGroupName lp
    259 &lt;/Location&gt;
    260 </PRE>
    261 
    262 <H3>Description</H3>
    263 
    264 <P>The <CODE>AuthGroupName</CODE> directive sets the group to use
    265 for <CODE>Group</CODE> authentication.</P>
    266 
    267 <P>The <CODE>AuthGroupName</CODE> directive must appear inside a
    268 <A HREF="#Location"><CODE>Location</CODE></A> or <A
    269 HREF="#Limit"><CODE>Limit</CODE></A> section.</P>
    270 
    271 <P><B>This directive is deprecated and will be removed from a
    272 future release of CUPS.</B> Consider using the more flexible <A
    273 HREF="#Require"><CODE>Require</CODE></A> directive instead.</P>
    274 
    275 
    276200<H2 CLASS="title"><A NAME="AuthType">AuthType</A></H2>
    277201
    278202<H3>Examples</H3>
     
    25102434</BLOCKQUOTE>
    25112435
    25122436
    2513 <H2 CLASS="title"><A NAME="Printcap">Printcap</A></H2>
    2514 
    2515 <H3>Examples</H3>
    2516 
    2517 <PRE CLASS="command">
    2518 Printcap
    2519 Printcap /etc/printcap
    2520 Printcap /etc/printers.conf
    2521 Printcap /Library/Preferences/org.cups.printers.plist
    2522 </PRE>
    2523 
    2524 <H3>Description</H3>
    2525 
    2526 <P>The <CODE>Printcap</CODE> directive controls whether or not a
    2527 printcap file is automatically generated and updated with a list
    2528 of available printers. If specified with no value, then no
    2529 printcap file will be generated. The default is to generate a
    2530 file named <VAR>@CUPS_DEFAUL_PRINTCAP@</VAR>.</P>
    2531 
    2532 <P>When a filename is specified (e.g. <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>),
    2533 the printcap file is written whenever a printer is added or
    2534 removed. The printcap file can then be used by applications that
    2535 are hardcoded to look at the printcap file for the available
    2536 printers.</P>
    2537 
    2538 
    2539 <H2 CLASS="title"><A NAME="PrintcapFormat">PrintcapFormat</A></H2>
    2540 
    2541 <H3>Examples</H3>
    2542 
    2543 <PRE CLASS="command">
    2544 PrintcapFormat BSD
    2545 PrintcapFormat Solaris
    2546 PrintcapFormat plist
    2547 </PRE>
    2548 
    2549 <H3>Description</H3>
    2550 
    2551 <P>The <CODE>PrintcapFormat</CODE> directive controls the output format of the
    2552 printcap file. The default is to generate the plist format on OS X, the
    2553 Solaris format on Solaris, and the BSD format on other operating systems.</P>
    2554 
    2555 
    2556 <H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.13</SPAN><A NAME="PrintcapGUI">PrintcapGUI</A></H2>
    2557 
    2558 <H3>Examples</H3>
    2559 
    2560 <PRE CLASS="command">
    2561 PrintGUI /usr/bin/glpoptions
    2562 </PRE>
    2563 
    2564 <H3>Description</H3>
    2565 
    2566 <P>The <CODE>PrintcapGUI</CODE> directive sets the program to
    2567 associate with the IRIX printer GUI interface script which is
    2568 used by IRIX applications to display printer-specific options.
    2569 There is no default program.</P>
    2570 
    2571 
    25722437<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.21</SPAN><A NAME="ReloadTimeout">ReloadTimeout</A></H2>
    25732438
    25742439<H3>Examples</H3>
     
    25852450before doing a restart. The default is 30 seconds.</P>
    25862451
    25872452
    2588 <H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.3</SPAN><A NAME="RemoteRoot">RemoteRoot</A></H2>
    2589 
    2590 <H3>Examples</H3>
    2591 
    2592 <PRE CLASS="command">
    2593 RemoteRoot remroot
    2594 RemoteRoot root
    2595 </PRE>
    2596 
    2597 <H3>Description</H3>
    2598 
    2599 <P>The <CODE>RemoteRoot</CODE> directive sets the username for
    2600 unauthenticated root requests from remote hosts. The default
    2601 username is <VAR>remroot</VAR>. Setting <CODE>RemoteRoot</CODE>
    2602 to <VAR>root</VAR> effectively disables this security
    2603 mechanism.</P>
    2604 
    2605 
    2606 <H2 CLASS="title"><A NAME="RequestRoot">RequestRoot</A></H2>
    2607 
    2608 <H3>Examples</H3>
    2609 
    2610 <PRE CLASS="command">
    2611 RequestRoot /var/spool/cups
    2612 RequestRoot /foo/bar/spool/cups
    2613 </PRE>
    2614 
    2615 <H3>Description</H3>
    2616 
    2617 <P>The <CODE>RequestRoot</CODE> directive sets the directory for
    2618 incoming IPP requests and HTML forms. If an absolute path is not
    2619 provided then it is assumed to be relative to the <A
    2620 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
    2621 default request directory is <VAR>@CUPS_REQUESTS@</VAR>.</P>
    2622 
    2623 
    26242453<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.7</SPAN><A NAME="Require">Require</A></H2>
    26252454
    26262455<H3>Examples</H3>
     
    27732602</BLOCKQUOTE>
    27742603
    27752604
    2776 <H2 CLASS="title"><A NAME="ServerBin">ServerBin</A></H2>
    2777 
    2778 <H3>Examples</H3>
    2779 
    2780 <PRE CLASS="command">
    2781 ServerBin /usr/lib/cups
    2782 ServerBin /foo/bar/lib/cups
    2783 </PRE>
    2784 
    2785 <H3>Description</H3>
    2786 
    2787 <P>The <CODE>ServerBin</CODE> directive sets the directory for
    2788 server-run executables. If an absolute path is not provided then
    2789 it is assumed to be relative to the <A
    2790 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
    2791 default executable directory is <VAR>/usr/lib/cups</VAR>,
    2792 <VAR>/usr/lib32/cups</VAR>, or <VAR>/usr/libexec/cups</VAR>
    2793 depending on the operating system.</P>
    2794 
    2795 
    2796 <H2 CLASS="title"><A NAME="ServerCertificate">ServerCertificate</A></H2>
    2797 
    2798 <H3>Examples</H3>
    2799 
    2800 <PRE CLASS="command">
    2801 ServerCertificate /etc/cups/ssl/server.crt
    2802 </PRE>
    2803 
    2804 <H3>Description</H3>
    2805 
    2806 <P>The <CODE>ServerCertificate</CODE> directive specifies the
    2807 location of the SSL certificate file used by the server when
    2808 negotiating encrypted connections. The certificate must not be
    2809 encrypted (password protected) since the scheduler normally runs
    2810 in the background and will be unable to ask for a password.</P>
    2811 
    2812 <P>The default certificate file is
    2813 <VAR>/etc/cups/ssl/server.crt</VAR>.</P>
    2814 
    2815 
    2816 <H2 CLASS="title"><A NAME="ServerKey">ServerKey</A></H2>
    2817 
    2818 <H3>Examples</H3>
    2819 
    2820 <PRE CLASS="command">
    2821 ServerKey /etc/cups/ssl/server.key
    2822 </PRE>
    2823 
    2824 <H3>Description</H3>
    2825 
    2826 <P>The <CODE>ServerKey</CODE> directive specifies the location of
    2827 the SSL private key file used by the server when negotiating
    2828 encrypted connections.</P>
    2829 
    2830 <P>The default key file is
    2831 <VAR>/etc/cups/ssl/server.crt</VAR>.</P>
    2832 
    2833 
    28342605<H2 CLASS="title"><A NAME="ServerName">ServerName</A></H2>
    28352606
    28362607<H3>Examples</H3>
     
    28472618hostname.</P>
    28482619
    28492620
    2850 <H2 CLASS="title"><A NAME="ServerRoot">ServerRoot</A></H2>
    2851 
    2852 <H3>Examples</H3>
    2853 
    2854 <PRE CLASS="command">
    2855 ServerRoot /etc/cups
    2856 ServerRoot /foo/bar/cups
    2857 </PRE>
    2858 
    2859 <H3>Description</H3>
    2860 
    2861 <P>The <CODE>ServerRoot</CODE> directive specifies the absolute
    2862 path to the server configuration and state files. It is also used
    2863 to resolve relative paths in the <VAR>cupsd.conf</VAR> file. The
    2864 default server directory is <VAR>/etc/cups</VAR>.</P>
    2865 
    2866 
    28672621<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.21</SPAN><A NAME="ServerTokens">ServerTokens</A></H2>
    28682622
    28692623<H3>Examples</H3>
     
    30592813HREF="#Policy"><CODE>Policy</CODE></A> section.</P>
    30602814
    30612815
    3062 <H2 CLASS="title"><A NAME="SystemGroup">SystemGroup</A></H2>
    3063 
    3064 <H3>Examples</H3>
    3065 
    3066 <PRE CLASS="command">
    3067 SystemGroup lpadmin
    3068 SystemGroup sys
    3069 SystemGroup system
    3070 SystemGroup root
    3071 SystemGroup root lpadmin
    3072 </PRE>
    3073 
    3074 <H3>Description</H3>
    3075 
    3076 <P>The <CODE>SystemGroup</CODE> directive specifies the system
    3077 administration group for <CODE>System</CODE> authentication.
    3078 Multiple groups can be listed, separated with spaces. The default
    3079 group list is <CODE>@CUPS_SYSTEM_GROUPS@</CODE>.</P>
    3080 
    3081 
    3082 <H2 CLASS="title"><A NAME="TempDir">TempDir</A></H2>
    3083 
    3084 <H3>Examples</H3>
    3085 
    3086 <PRE CLASS="command">
    3087 TempDir /var/tmp
    3088 TempDir /foo/bar/tmp
    3089 </PRE>
    3090 
    3091 <H3>Description</H3>
    3092 
    3093 <P>The <CODE>TempDir</CODE> directive specifies an absolute path
    3094 for the directory to use for temporary files. The default
    3095 directory is <VAR>@CUPS_REQUESTS@/tmp</VAR>.</P>
    3096 
    3097 <P>Temporary directories must be world-writable and should have
    3098 the "sticky" permission bit enabled so that other users cannot
    3099 delete filter temporary files. The following commands will create
    3100 an appropriate temporary directory called
    3101 <VAR>/foo/bar/tmp</VAR>:</P>
    3102 
    3103 <PRE CLASS="command">
    3104 <KBD>mkdir /foo/bar/tmp</KBD>
    3105 <KBD>chmod a+rwxt /foo/bar/tmp</KBD>
    3106 </PRE>
    3107 
    3108 
    31092816<H2 CLASS="title"><A NAME="Timeout">Timeout</A></H2>
    31102817
    31112818<H3>Examples</H3>
     
    31482855<P>The default is <CODE>@CUPS_USE_NETWORK_DEFAULT@</CODE>.</P>
    31492856
    31502857
    3151 <H2 CLASS="title"><A NAME="User">User</A></H2>
    3152 
    3153 <H3>Examples</H3>
    3154 
    3155 <PRE CLASS="command">
    3156 User lp
    3157 User guest
    3158 </PRE>
    3159 
    3160 <H3>Description</H3>
    3161 
    3162 <P>The <CODE>User</CODE> directive specifies the UNIX user that
    3163 filter and CGI programs run as. The default user is
    3164 <CODE>@CUPS_USER@</CODE>.</P>
    3165 
    3166 <BLOCKQUOTE><B>Note:</B>
    3167 
    3168 <P>You may not use user <CODE>root</CODE>, as that would expose
    3169 the system to unacceptable security risks. The scheduler will
    3170 automatically choose user <CODE>nobody</CODE> if you specify a
    3171 user whose ID is 0.</P>
    3172 
    3173 </BLOCKQUOTE>
    3174 
    3175 
    31762858<H2 CLASS="title"><SPAN CLASS="INFO">CUPS 1.5</SPAN><A NAME="WebInterface">WebInterface</A></H2>
    31772859
    31782860<H3>Examples</H3>
  • man/Makefile

    old new  
    3939                ppdpo.$(MAN1EXT)
    4040MAN5    =       classes.conf.$(MAN5EXT) \
    4141                client.conf.$(MAN5EXT) \
     42                cups-files.conf.$(MAN5EXT) \
    4243                cups-snmp.conf.$(MAN5EXT) \
    4344                cupsd.conf.$(MAN5EXT) \
    4445                ipptoolfile.$(MAN5EXT) \
  • new file cups-1.6.1/man/cups-files.conf.man.in

    - +  
     1.\"
     2.\" "$Id$"
     3.\"
     4.\"   cupsd.conf man page for CUPS.
     5.\"
     6.\"   Copyright 2007-2012 by Apple Inc.
     7.\"   Copyright 1997-2006 by Easy Software Products.
     8.\"
     9.\"   These coded instructions, statements, and computer programs are the
     10.\"   property of Apple Inc. and are protected by Federal copyright
     11.\"   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
     12.\"   which should have been included with this file.  If this file is
     13.\"   file is missing or damaged, see the license at "http://www.cups.org/".
     14.\"
     15.TH cups-files.conf 5 "CUPS" "19 November 2012" "Apple Inc."
     16.SH NAME
     17cups-files.conf \- file and directory configuration file for cups
     18.SH DESCRIPTION
     19The \fIcups-file.conf\fR file configures the files and directories used by the
     20CUPS scheduler, \fIcupsd(8)\fR.  It is normally located in the
     21\fI@CUPS_SERVERROOT@\fR directory.
     22.LP
     23Each line in the file can be a configuration directive, a blank line,
     24or a comment. Comment lines start with the # character.
     25.SH DIRECTIVES
     26The following directives are understood by \fIcupsd(8)\fR. Consult the
     27on-line help for detailed descriptions:
     28.TP 5
     29AccessLog filename
     30.TP 5
     31AccessLog syslog
     32.br
     33Defines the access log filename.
     34.TP 5
     35ConfigFilePerm mode
     36.br
     37Specifies the permissions for all configuration files that the scheduler
     38writes.
     39.TP 5
     40DataDir path
     41.br
     42Specified the directory where data files can be found.
     43.TP 5
     44DocumentRoot directory
     45.br
     46Specifies the root directory for the internal web server documents.
     47.TP 5
     48ErrorLog filename
     49.TP 5
     50ErrorLog syslog
     51.br
     52Specifies the error log filename.
     53.TP 5
     54FatalErrors none
     55.TP 5
     56FatalErrors all -kind [... -kind]
     57.TP 5
     58FatalErrors kind [... kind]
     59.br
     60Specifies which errors are fatal, causing the scheduler to exit. "Kind" is
     61"browse", "config", "listen", "log", or "permissions".
     62.TP 5
     63FileDevice Yes
     64.TP 5
     65FileDevice No
     66.br
     67Specifies whether the file pseudo-device can be used for new
     68printer queues.
     69.TP 5
     70FontPath directory[:directory:...]
     71.br
     72Specifies the search path for fonts.
     73.TP 5
     74Group group-name-or-number
     75.br
     76Specifies the group name or ID that will be used when executing
     77external programs.
     78.TP 5
     79LogFilePerm mode
     80.br
     81Specifies the permissions for all log files that the scheduler writes.
     82.TP 5
     83PageLog filename
     84.TP 5
     85PageLog syslog
     86.br
     87Specifies the page log filename.
     88.TP 5
     89Printcap
     90.TP 5
     91Printcap filename
     92.br
     93Specifies the filename for a printcap file that is updated
     94automatically with a list of available printers (needed for
     95legacy applications); specifying Printcap with no filename
     96disables printcap generation.
     97.TP 5
     98RemoteRoot user-name
     99.br
     100Specifies the username that is associated with unauthenticated root
     101accesses.
     102.TP 5
     103RequestRoot directory
     104.br
     105Specifies the directory to store print jobs and other HTTP request
     106data.
     107.TP 5
     108ServerBin directory
     109.br
     110Specifies the directory where backends, CGIs, daemons, and filters may
     111be found.
     112.TP 5
     113ServerCertificate filename
     114.br
     115Specifies the encryption certificate to use.
     116.TP 5
     117ServerKey filename
     118.br
     119Specifies the encryption key to use.
     120.TP 5
     121ServerRoot directory
     122.br
     123Specifies the directory where the server configuration files can be found.
     124.TP 5
     125SystemGroup group-name [group-name ...]
     126.br
     127Specifies the group(s) to use for System class authentication.
     128.TP 5
     129TempDir directory
     130.br
     131Specifies the directory where temporary files are stored.
     132.TP 5
     133User user-name
     134.br
     135Specifies the user name or ID that is used when running external programs.
     136.SH SEE ALSO
     137\fIclasses.conf(5)\fR, \fIcupsd(8)\fR, \fIcupsd.conf(5)\fR, \fImime.convs(5)\fR,
     138\fImime.types(5)\fR, \fIprinters.conf(5)\fR,
     139\fIsubscriptions.conf(5)\fR,
     140.br
     141http://localhost:631/help
     142.SH COPYRIGHT
     143Copyright 2007-2012 by Apple Inc.
     144.\"
     145.\" End of "$Id$".
     146.\"
  • man/cupsd.conf.man.in

    old new  
    1212.\"   which should have been included with this file.  If this file is
    1313.\"   file is missing or damaged, see the license at "http://www.cups.org/".
    1414.\"
    15 .TH cupsd.conf 5 "CUPS" "18 May 2012" "Apple Inc."
     15.TH cupsd.conf 5 "CUPS" "19 November 2012" "Apple Inc."
    1616.SH NAME
    1717cupsd.conf \- server configuration file for cups
    1818.SH DESCRIPTION
    1919The \fIcupsd.conf\fR file configures the CUPS scheduler, \fIcupsd(8)\fR.  It
    20 is normally located in the \fI@CUPS_SERVERROOT@\fR directory.
     20is normally located in the \fI@CUPS_SERVERROOT@\fR directory. \fBNote:\fR
     21File, directory, and user configuration directives that used to be allowed in
     22the \fIcupsd.conf\fR file are now stored in the \fIcups-files.conf(5)\fR instead
     23in order to prevent certain types of privilege escalation attacks.
    2124.LP
    2225Each line in the file can be a configuration directive, a blank line,
    2326or a comment. Comment lines start with the # character. The
     
    2730The following directives are understood by \fIcupsd(8)\fR. Consult the
    2831on-line help for detailed descriptions:
    2932.TP 5
    30 AccessLog filename
    31 .TP 5
    32 AccessLog syslog
    33 .br
    34 Defines the access log filename.
    35 .TP 5
    3633AccessLogLevel config
    3734.TP 5
    3835AccessLogLevel actions
     
    6158.br
    6259Allows access from the named hosts or addresses.
    6360.TP 5
    64 AuthClass User
    65 .TP 5
    66 AuthClass Group
    67 .TP 5
    68 AuthClass System
    69 .br
    70 Specifies the authentication class (User, Group, System) -
    71 \fBthis directive is deprecated\fR.
    72 .TP 5
    73 AuthGroupName group-name
    74 .br
    75 Specifies the authentication group - \fBthis directive is
    76 deprecated\fR.
    77 .TP 5
    7861AuthType None
    7962.TP 5
    8063AuthType Basic
     
    200183.TP 5
    201184Browsing No
    202185.br
    203 Specifies whether or not remote printer browsing should be enabled.
     186Specifies whether or not shared printers should be advertised.
    204187.TP 5
    205188Classification banner
    206189.br
     
    213196Specifies whether to allow users to override the classification
    214197of individual print jobs.
    215198.TP 5
    216 ConfigFilePerm mode
    217 .br
    218 Specifies the permissions for all configuration files that the scheduler
    219 writes.
    220 .TP 5
    221 DataDir path
    222 .br
    223 Specified the directory where data files can be found.
    224 .TP 5
    225199DefaultAuthType Basic
    226200.TP 5
    227201DefaultAuthType BasicDigest
     
    289263causes the update to happen as soon as possible, typically within a few
    290264milliseconds.
    291265.TP 5
    292 DocumentRoot directory
    293 .br
    294 Specifies the root directory for the internal web server documents.
    295 .TP 5
    296266Encryption IfRequested
    297267.TP 5
    298268Encryption Never
     
    302272Specifies the level of encryption that is required for a particular
    303273location.
    304274.TP 5
    305 ErrorLog filename
    306 .TP 5
    307 ErrorLog syslog
    308 .br
    309 Specifies the error log filename.
    310 .TP 5
    311 FatalErrors none
    312 .TP 5
    313 FatalErrors all -kind [... -kind]
    314 .TP 5
    315 FatalErrors kind [... kind]
    316 .br
    317 Specifies which errors are fatal, causing the scheduler to exit. "Kind" is
    318 "browse", "config", "listen", "log", or "permissions".
    319 .TP 5
    320 FileDevice Yes
    321 .TP 5
    322 FileDevice No
    323 .br
    324 Specifies whether the file pseudo-device can be used for new
    325 printer queues.
    326 .TP 5
    327275FilterLimit limit
    328276.br
    329277Specifies the maximum cost of filters that are run concurrently.
     
    333281Specifies the scheduling priority ("nice" value) of filters that
    334282are run to print a job.
    335283.TP 5
    336 FontPath directory[:directory:...]
    337 .br
    338 Specifies the search path for fonts.
    339 .TP 5
    340 Group group-name-or-number
    341 .br
    342 Specifies the group name or ID that will be used when executing
    343 external programs.
    344 .TP 5
    345284GSSServiceName name
    346285.br
    347286Specifies the service name when using Kerberos authentication. The default
     
    454393Specifies the number of debugging messages that are logged when an error
    455394occurs in a print job.
    456395.TP 5
    457 LogFilePerm mode
    458 .br
    459 Specifies the permissions for all log files that the scheduler writes.
    460 .TP 5
    461396LogLevel alert
    462397.TP 5
    463398LogLevel crit
     
    542477.br
    543478Specifies the order of HTTP access control (allow,deny or deny,allow)
    544479.TP 5
    545 PageLog filename
    546 .TP 5
    547 PageLog syslog
    548 .br
    549 Specifies the page log filename.
    550 .TP 5
    551480PageLogFormat format string
    552481.br
    553482Specifies the format of page log lines.
     
    577506Specifies whether or not to preserve the job history after they are
    578507printed.
    579508.TP 5
    580 Printcap
    581 .TP 5
    582 Printcap filename
    583 .br
    584 Specifies the filename for a printcap file that is updated
    585 automatically with a list of available printers (needed for
    586 legacy applications); specifying Printcap with no filename
    587 disables printcap generation.
    588 .TP 5
    589509PrintcapFormat bsd
    590510.TP 5
    591511PrintcapFormat plist
     
    594514.br
    595515Specifies the format of the printcap file.
    596516.TP 5
    597 PrintcapGUI
    598 .TP 5
    599 PrintcapGUI gui-program-filename
    600 .br
    601 Specifies whether to generate option panel definition files on
    602 some operating systems. When provided with no program filename,
    603 disables option panel definition files.
    604 .TP 5
    605517ReloadTimeout seconds
    606518.br
    607519Specifies the amount of time to wait for job completion before
    608520restarting the scheduler.
    609521.TP 5
    610 RemoteRoot user-name
    611 .br
    612 Specifies the username that is associated with unauthenticated root
    613 accesses.
    614 .TP 5
    615 RequestRoot directory
    616 .br
    617 Specifies the directory to store print jobs and other HTTP request
    618 data.
    619 .TP 5
    620522Require group group-name-list
    621523.TP 5
    622524Require user user-name-list
     
    648550Specifies an alternate name that the server is known by. The special name "*"
    649551allows any name to be used.
    650552.TP 5
    651 ServerBin directory
    652 .br
    653 Specifies the directory where backends, CGIs, daemons, and filters may
    654 be found.
    655 .TP 5
    656 ServerCertificate filename
    657 .br
    658 Specifies the encryption certificate to use.
    659 .TP 5
    660 ServerKey filename
    661 .br
    662 Specifies the encryption key to use.
    663 .TP 5
    664553ServerName hostname-or-ip-address
    665554.br
    666555Specifies the fully-qualified hostname of the server.
    667556.TP 5
    668 ServerRoot directory
    669 .br
    670 Specifies the directory where the server configuration files can be found.
    671 .TP 5
    672557ServerTokens Full
    673558.TP 5
    674559ServerTokens Major
     
    732617"notify-events", "notify-pull-method", "notify-recipient-uri",
    733618"notify-subscriber-user-name", and "notify-user-data".
    734619.TP 5
    735 SystemGroup group-name [group-name ...]
    736 .br
    737 Specifies the group(s) to use for System class authentication.
    738 .TP 5
    739 TempDir directory
    740 .br
    741 Specifies the directory where temporary files are stored.
    742 .TP 5
    743620Timeout seconds
    744621.br
    745622Specifies the HTTP request timeout in seconds.
    746623.TP 5
    747 User user-name
    748 .br
    749 Specifies the user name or ID that is used when running external programs.
    750 .TP 5
    751624WebInterface yes
    752625.TP 5
    753626WebInterface no
    754627Specifies whether the web interface is enabled.
    755628.SH SEE ALSO
    756 \fIclasses.conf(5)\fR, \fIcupsd(8)\fR, \fImime.convs(5)\fR,
    757 \fImime.types(5)\fR, \fIprinters.conf(5)\fR,
     629\fIclasses.conf(5)\fR, \fIcups-files.conf(5)\fR, \fIcupsd(8)\fR,
     630\fImime.convs(5)\fR, \fImime.types(5)\fR, \fIprinters.conf(5)\fR,
    758631\fIsubscriptions.conf(5)\fR,
    759632.br
    760633http://localhost:631/help
  • packaging/cups.list.in

    old new  
    534534d 0755 root $CUPS_GROUP $SERVERROOT/interfaces -
    535535d 0755 root $CUPS_GROUP $SERVERROOT/ppd -
    536536d 0700 root $CUPS_GROUP $SERVERROOT/ssl -
     537c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf conf/cups-files.conf
     538f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf.default conf/cups-files.conf
    537539c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf conf/cupsd.conf
    538540f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf.default conf/cupsd.conf
    539541c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/snmp.conf conf/snmp.conf
  • packaging/cups.spec.in

    old new  
    135135%defattr(-,root,root)
    136136%dir /etc/cups
    137137%config(noreplace) /etc/cups/*.conf
     138/etc/cups/cups-files.conf.default
    138139/etc/cups/cupsd.conf.default
    139140%dir /etc/cups/interfaces
    140141%dir /etc/cups/ppd
  • scheduler/client.c

    old new  
    3232 *   compare_clients()      - Compare two client connections.
    3333 *   data_ready()           - Check whether data is available from a client.
    3434 *   get_file()             - Get a filename and state info.
    35  *   install_conf_file()    - Install a configuration file.
     35 *   install_cupsd_conf()    - Install a configuration file.
    3636 *   is_cgi()               - Is the resource a CGI script/program?
    3737 *   is_path_absolute()     - Is a path absolute and free of relative elements
    3838 *                            (i.e. "..").
     
    9595static int              data_ready(cupsd_client_t *con);
    9696static char             *get_file(cupsd_client_t *con, struct stat *filestats,
    9797                                  char *filename, int len);
    98 static http_status_t    install_conf_file(cupsd_client_t *con);
     98static http_status_t    install_cupsd_conf(cupsd_client_t *con);
    9999static int              is_cgi(cupsd_client_t *con, const char *filename,
    100100                               struct stat *filestats, mime_type_t *type);
    101101static int              is_path_absolute(const char *path);
     
    16661666            * Validate the resource name...
    16671667            */
    16681668
    1669             if (strncmp(con->uri, "/admin/conf/", 12) ||
    1670                 strchr(con->uri + 12, '/') ||
    1671                 strlen(con->uri) == 12)
     1669            if (strcmp(con->uri, "/admin/conf/cupsd.conf"))
    16721670            {
    16731671             /*
    1674               * PUT can only be done to configuration files under
    1675               * /admin/conf...
     1672              * PUT can only be done to the cupsd.conf file...
    16761673              */
    16771674
    16781675              cupsdLogMessage(CUPSD_LOG_ERROR,
    1679                               "[Client %d] Request for subdirectory \"%s\".",
     1676                              "[Client %d] Disallowed PUT request for \"%s\".",
    16801677                              con->http.fd, con->uri);
    16811678
    16821679              if (!cupsdSendError(con, HTTP_FORBIDDEN, CUPSD_AUTH_NONE))
     
    20442041          * Install the configuration file...
    20452042          */
    20462043
    2047           status = install_conf_file(con);
     2044          status = install_cupsd_conf(con);
    20482045
    20492046         /*
    20502047          * Return the status to the client...
     
    33013298
    33023299
    33033300/*
    3304  * 'install_conf_file()' - Install a configuration file.
     3301 * 'install_cupsd_conf()' - Install a configuration file.
    33053302 */
    33063303
    33073304static http_status_t                    /* O - Status */
    3308 install_conf_file(cupsd_client_t *con)  /* I - Connection */
     3305install_cupsd_conf(cupsd_client_t *con) /* I - Connection */
    33093306{
    33103307  char          filename[1024];         /* Configuration filename */
    3311   mode_t        mode;                   /* Permissions */
    33123308  cups_file_t   *in,                    /* Input file */
    33133309                *out;                   /* Output file */
    33143310  char          buffer[16384];          /* Copy buffer */
     
    33303326  * Open the new config file...
    33313327  */
    33323328
    3333   snprintf(filename, sizeof(filename), "%s%s", ServerRoot, con->uri + 11);
    3334   if (!strcmp(con->uri, "/admin/conf/printers.conf"))
    3335     mode = ConfigFilePerm & 0600;
    3336   else
    3337     mode = ConfigFilePerm;
    3338 
    3339   if ((out = cupsdCreateConfFile(filename, mode)) == NULL)
     3329  snprintf(filename, sizeof(filename), "%s/cupsd.conf", ServerRoot);
     3330  if ((out = cupsdCreateConfFile(filename, ConfigFilePerm)) == NULL)
    33403331  {
    33413332    cupsFileClose(in);
    33423333    return (HTTP_SERVER_ERROR);
     
    33813372  cupsdClearString(&con->filename);
    33823373
    33833374 /*
    3384   * If the cupsd.conf file was updated, set the NeedReload flag...
     3375  * Set the NeedReload flag...
    33853376  */
    33863377
    3387   if (!strcmp(con->uri, "/admin/conf/cupsd.conf"))
    3388     NeedReload = RELOAD_CUPSD;
    3389   else
    3390     NeedReload = RELOAD_ALL;
    3391 
     3378  NeedReload = RELOAD_CUPSD;
    33923379  ReloadTime = time(NULL);
    33933380
    33943381 /*
  • scheduler/conf.c

    old new  
    1414 *
    1515 * Contents:
    1616 *
    17  *   cupsdAddAlias()          - Add a host alias.
     17 *   cupsdAddAlias()          - Add a host alias.
    1818 *   cupsdCheckPermissions()  - Fix the mode and ownership of a file or
    19  *                              directory.
     19 *                              directory.
    2020 *   cupsdDefaultAuthType()   - Get the default AuthType.
    2121 *   cupsdFreeAliases()       - Free all of the alias entries.
    2222 *   cupsdReadConfiguration() - Read the cupsd.conf file.
    23  *   get_address()            - Get an address + port number from a line.
     23 *   get_address()            - Get an address + port number from a line.
    2424 *   get_addr_and_mask()      - Get an IP address and netmask.
    25  *   mime_error_cb()          - Log a MIME error.
    26  *   parse_aaa()              - Parse authentication, authorization, and access
    27  *                              control lines.
     25 *   mime_error_cb()          - Log a MIME error.
     26 *   parse_aaa()              - Parse authentication, authorization, and access
     27 *                              control lines.
    2828 *   parse_fatal_errors()     - Parse FatalErrors values in a string.
    29  *   parse_groups()           - Parse system group names in a string.
    30  *   parse_protocols()        - Parse browse protocols in a string.
    31  *   read_configuration()     - Read a configuration file.
    32  *   read_location()          - Read a <Location path> definition.
    33  *   read_policy()            - Read a <Policy name> definition.
     29 *   parse_groups()           - Parse system group names in a string.
     30 *   parse_protocols()        - Parse browse protocols in a string.
     31 *   parse_variable()         - Parse a variable line.
     32 *   read_cupsd_conf()        - Read the cupsd.conf configuration file.
     33 *   read_cups_files_conf()   - Read the cups-files.conf configuration file.
     34 *   read_location()          - Read a <Location path> definition.
     35 *   read_policy()            - Read a <Policy name> definition.
    3436 *   set_policy_defaults()    - Set default policy values as needed.
    3537 */
    3638
     
    8385 * Local globals...
    8486 */
    8587
    86 static int                      default_auth_type       = CUPSD_AUTH_AUTO;
    87                                         /* Default AuthType, if not specified */
    88 static const cupsd_var_t        variables[] =
     88static const cupsd_var_t        cupsd_vars[] =
    8989{
    90   { "AccessLog",                &AccessLog,             CUPSD_VARTYPE_STRING },
    9190  { "AutoPurgeJobs",            &JobAutoPurge,          CUPSD_VARTYPE_BOOLEAN },
    9291#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
    9392  { "BrowseDNSSDSubTypes",      &DNSSDSubTypes,         CUPSD_VARTYPE_STRING },
     
    10099  { "BrowseTimeout",            &BrowseTimeout,         CUPSD_VARTYPE_INTEGER },
    101100  { "BrowseWebIF",              &BrowseWebIF,           CUPSD_VARTYPE_BOOLEAN },
    102101  { "Browsing",                 &Browsing,              CUPSD_VARTYPE_BOOLEAN },
    103   { "CacheDir",                 &CacheDir,              CUPSD_VARTYPE_STRING },
    104102  { "Classification",           &Classification,        CUPSD_VARTYPE_STRING },
    105103  { "ClassifyOverride",         &ClassifyOverride,      CUPSD_VARTYPE_BOOLEAN },
    106   { "ConfigFilePerm",           &ConfigFilePerm,        CUPSD_VARTYPE_INTEGER },
    107   { "DataDir",                  &DataDir,               CUPSD_VARTYPE_STRING },
    108104  { "DefaultLanguage",          &DefaultLanguage,       CUPSD_VARTYPE_STRING },
    109105  { "DefaultLeaseDuration",     &DefaultLeaseDuration,  CUPSD_VARTYPE_TIME },
    110106  { "DefaultPaperSize",         &DefaultPaperSize,      CUPSD_VARTYPE_STRING },
    111107  { "DefaultPolicy",            &DefaultPolicy,         CUPSD_VARTYPE_STRING },
    112108  { "DefaultShared",            &DefaultShared,         CUPSD_VARTYPE_BOOLEAN },
    113109  { "DirtyCleanInterval",       &DirtyCleanInterval,    CUPSD_VARTYPE_TIME },
    114   { "DocumentRoot",             &DocumentRoot,          CUPSD_VARTYPE_STRING },
    115   { "ErrorLog",                 &ErrorLog,              CUPSD_VARTYPE_STRING },
    116110  { "ErrorPolicy",              &ErrorPolicy,           CUPSD_VARTYPE_STRING },
    117   { "FileDevice",               &FileDevice,            CUPSD_VARTYPE_BOOLEAN },
    118111  { "FilterLimit",              &FilterLimit,           CUPSD_VARTYPE_INTEGER },
    119112  { "FilterNice",               &FilterNice,            CUPSD_VARTYPE_INTEGER },
    120   { "FontPath",                 &FontPath,              CUPSD_VARTYPE_STRING },
    121113#ifdef HAVE_GSSAPI
    122114  { "GSSServiceName",           &GSSServiceName,        CUPSD_VARTYPE_STRING },
    123115#endif /* HAVE_GSSAPI */
     
    135127  { "LimitRequestBody",         &MaxRequestSize,        CUPSD_VARTYPE_INTEGER },
    136128  { "ListenBackLog",            &ListenBackLog,         CUPSD_VARTYPE_INTEGER },
    137129  { "LogDebugHistory",          &LogDebugHistory,       CUPSD_VARTYPE_INTEGER },
    138   { "LogFilePerm",              &LogFilePerm,           CUPSD_VARTYPE_INTEGER },
    139   { "LPDConfigFile",            &LPDConfigFile,         CUPSD_VARTYPE_STRING },
    140130  { "MaxActiveJobs",            &MaxActiveJobs,         CUPSD_VARTYPE_INTEGER },
    141131  { "MaxClients",               &MaxClients,            CUPSD_VARTYPE_INTEGER },
    142132  { "MaxClientsPerHost",        &MaxClientsPerHost,     CUPSD_VARTYPE_INTEGER },
     
    155145  { "MaxSubscriptionsPerPrinter",&MaxSubscriptionsPerPrinter,   CUPSD_VARTYPE_INTEGER },
    156146  { "MaxSubscriptionsPerUser",  &MaxSubscriptionsPerUser,       CUPSD_VARTYPE_INTEGER },
    157147  { "MultipleOperationTimeout", &MultipleOperationTimeout,      CUPSD_VARTYPE_TIME },
    158   { "PageLog",                  &PageLog,               CUPSD_VARTYPE_STRING },
    159148  { "PageLogFormat",            &PageLogFormat,         CUPSD_VARTYPE_STRING },
    160149  { "PreserveJobFiles",         &JobFiles,              CUPSD_VARTYPE_TIME },
    161150  { "PreserveJobHistory",       &JobHistory,            CUPSD_VARTYPE_TIME },
    162   { "Printcap",                 &Printcap,              CUPSD_VARTYPE_STRING },
    163   { "PrintcapGUI",              &PrintcapGUI,           CUPSD_VARTYPE_STRING },
    164151  { "ReloadTimeout",            &ReloadTimeout,         CUPSD_VARTYPE_TIME },
    165   { "RemoteRoot",               &RemoteRoot,            CUPSD_VARTYPE_STRING },
    166   { "RequestRoot",              &RequestRoot,           CUPSD_VARTYPE_STRING },
    167152  { "RIPCache",                 &RIPCache,              CUPSD_VARTYPE_STRING },
    168153  { "RootCertDuration",         &RootCertDuration,      CUPSD_VARTYPE_TIME },
    169154  { "ServerAdmin",              &ServerAdmin,           CUPSD_VARTYPE_STRING },
     155  { "ServerName",               &ServerName,            CUPSD_VARTYPE_STRING },
     156  { "StrictConformance",        &StrictConformance,     CUPSD_VARTYPE_BOOLEAN },
     157  { "Timeout",                  &Timeout,               CUPSD_VARTYPE_TIME },
     158  { "UseNetworkDefault",        &UseNetworkDefault,     CUPSD_VARTYPE_BOOLEAN },
     159  { "WebInterface",             &WebInterface,          CUPSD_VARTYPE_BOOLEAN }
     160};
     161static const cupsd_var_t        cupsfiles_vars[] =
     162{
     163  { "AccessLog",                &AccessLog,             CUPSD_VARTYPE_STRING },
     164  { "CacheDir",                 &CacheDir,              CUPSD_VARTYPE_STRING },
     165  { "ConfigFilePerm",           &ConfigFilePerm,        CUPSD_VARTYPE_INTEGER },
     166  { "DataDir",                  &DataDir,               CUPSD_VARTYPE_STRING },
     167  { "DocumentRoot",             &DocumentRoot,          CUPSD_VARTYPE_STRING },
     168  { "ErrorLog",                 &ErrorLog,              CUPSD_VARTYPE_STRING },
     169  { "FileDevice",               &FileDevice,            CUPSD_VARTYPE_BOOLEAN },
     170  { "FontPath",                 &FontPath,              CUPSD_VARTYPE_STRING },
     171  { "LogFilePerm",              &LogFilePerm,           CUPSD_VARTYPE_INTEGER },
     172  { "LPDConfigFile",            &LPDConfigFile,         CUPSD_VARTYPE_STRING },
     173  { "PageLog",                  &PageLog,               CUPSD_VARTYPE_STRING },
     174  { "PidFile",                  &PidFile,               CUPSD_VARTYPE_STRING },
     175  { "Printcap",                 &Printcap,              CUPSD_VARTYPE_STRING },
     176  { "RemoteRoot",               &RemoteRoot,            CUPSD_VARTYPE_STRING },
     177  { "RequestRoot",              &RequestRoot,           CUPSD_VARTYPE_STRING },
    170178  { "ServerBin",                &ServerBin,             CUPSD_VARTYPE_PATHNAME },
    171179#ifdef HAVE_SSL
    172180  { "ServerCertificate",        &ServerCertificate,     CUPSD_VARTYPE_PATHNAME },
     
    174182  { "ServerKey",                &ServerKey,             CUPSD_VARTYPE_PATHNAME },
    175183#  endif /* HAVE_LIBSSL || HAVE_GNUTLS */
    176184#endif /* HAVE_SSL */
    177   { "ServerName",               &ServerName,            CUPSD_VARTYPE_STRING },
    178185  { "ServerRoot",               &ServerRoot,            CUPSD_VARTYPE_PATHNAME },
    179186  { "SMBConfigFile",            &SMBConfigFile,         CUPSD_VARTYPE_STRING },
    180187  { "StateDir",                 &StateDir,              CUPSD_VARTYPE_STRING },
    181   { "StrictConformance",        &StrictConformance,     CUPSD_VARTYPE_BOOLEAN },
    182188#ifdef HAVE_AUTHORIZATION_H
    183189  { "SystemGroupAuthKey",       &SystemGroupAuthKey,    CUPSD_VARTYPE_STRING },
    184190#endif /* HAVE_AUTHORIZATION_H */
    185   { "TempDir",                  &TempDir,               CUPSD_VARTYPE_PATHNAME },
    186   { "Timeout",                  &Timeout,               CUPSD_VARTYPE_TIME },
    187   { "UseNetworkDefault",        &UseNetworkDefault,     CUPSD_VARTYPE_BOOLEAN },
    188   { "WebInterface",             &WebInterface,          CUPSD_VARTYPE_BOOLEAN },
    189   { "PidFile",                  &PidFile,               CUPSD_VARTYPE_STRING }
     191  { "TempDir",                  &TempDir,               CUPSD_VARTYPE_PATHNAME }
    190192};
    191 #define NUM_VARS        (sizeof(variables) / sizeof(variables[0]))
    192193
     194static int              default_auth_type = CUPSD_AUTH_AUTO;
     195                                        /* Default AuthType, if not specified */
    193196
    194197static const unsigned   ones[4] =
    195198                        {
     
    214217static int              parse_fatal_errors(const char *s);
    215218static int              parse_groups(const char *s);
    216219static int              parse_protocols(const char *s);
    217 static int              read_configuration(cups_file_t *fp);
     220static int              parse_variable(const char *filename, int linenum,
     221                                       const char *line, const char *value,
     222                                       size_t num_vars,
     223                                       const cupsd_var_t *vars);
     224static int              read_cupsd_conf(cups_file_t *fp);
     225static int              read_cups_files_conf(cups_file_t *fp);
    218226static int              read_location(cups_file_t *fp, char *name, int linenum);
    219227static int              read_policy(cups_file_t *fp, char *name, int linenum);
    220228static void             set_policy_defaults(cupsd_policy_t *pol);
     
    828836  cupsdInitEnv();
    829837
    830838 /*
    831   * Read the configuration file...
     839  * Read the cups-files.conf file...
     840  */
     841
     842  if ((fp = cupsFileOpen(CupsFilesFile, "r")) != NULL)
     843  {
     844    status = read_cups_files_conf(fp);
     845
     846    cupsFileClose(fp);
     847
     848    if (!status)
     849      return (0);
     850  }
     851  else if (errno == ENOENT)
     852    cupsdLogMessage(CUPSD_LOG_INFO, "No %s, using defaults.", CupsFilesFile);
     853  else
     854  {
     855    cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", CupsFilesFile,
     856                    strerror(errno));
     857    return (0);
     858  }
     859
     860  if (!ErrorLog)
     861    cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log");
     862
     863 /*
     864  * Read the cupsd.conf file...
    832865  */
    833866
    834867  if ((fp = cupsFileOpen(ConfigurationFile, "r")) == NULL)
     868  {
     869    cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", ConfigurationFile,
     870                    strerror(errno));
    835871    return (0);
     872  }
    836873
    837   status = read_configuration(fp);
     874  status = read_cupsd_conf(fp);
    838875
    839876  cupsFileClose(fp);
    840877
    841878  if (!status)
    842879    return (0);
    843880
    844   if (!ErrorLog)
    845     cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log");
    846 
    847881  RunUser = getuid();
    848882
    849883  cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.",
     
    962996  BrowseACL = cupsdFindLocation("CUPS_INTERNAL_BROWSE_ACL");
    963997
    964998 /*
     999  * Make sure ConfigFilePerm and LogFilePerm have sane values...
     1000  */
     1001
     1002  ConfigFilePerm &= 0664;
     1003  LogFilePerm    &= 0664;
     1004
     1005 /*
    9651006  * Open the system log for cupsd if necessary...
    9661007  */
    9671008
     
    26272668
    26282669
    26292670/*
    2630  * 'read_configuration()' - Read a configuration file.
     2671 * 'parse_variable()' - Parse a variable line.
    26312672 */
    26322673
    26332674static int                              /* O - 1 on success, 0 on failure */
    2634 read_configuration(cups_file_t *fp)     /* I - File to read from */
     2675parse_variable(
     2676    const char        *filename,        /* I - Name of configuration file */
     2677    int               linenum,          /* I - Line in configuration file */
     2678    const char        *line,            /* I - Line from configuration file */
     2679    const char        *value,           /* I - Value from configuration file */
     2680    size_t            num_vars,         /* I - Number of variables */
     2681    const cupsd_var_t *vars)            /* I - Variables */
     2682{
     2683  size_t                i;              /* Looping var */
     2684  const cupsd_var_t     *var;           /* Variables */
     2685  char                  temp[1024];     /* Temporary string */
     2686
     2687
     2688  for (i = num_vars, var = vars; i > 0; i --, var ++)
     2689    if (!_cups_strcasecmp(line, var->name))
     2690      break;
     2691
     2692  if (i == 0)
     2693  {
     2694   /*
     2695    * Unknown directive!  Output an error message and continue...
     2696    */
     2697
     2698    if (!value)
     2699      cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value for %s on line %d of %s.",
     2700                      line, linenum, filename);
     2701    else
     2702      cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d of %s.",
     2703                      line, linenum, filename);
     2704
     2705    return (0);
     2706  }
     2707
     2708  switch (var->type)
     2709  {
     2710    case CUPSD_VARTYPE_INTEGER :
     2711        if (!value)
     2712        {
     2713          cupsdLogMessage(CUPSD_LOG_ERROR,
     2714                          "Missing integer value for %s on line %d of %s.",
     2715                          line, linenum, filename);
     2716          return (0);
     2717        }
     2718        else if (!isdigit(*value & 255))
     2719        {
     2720          cupsdLogMessage(CUPSD_LOG_ERROR,
     2721                          "Bad integer value for %s on line %d of %s.",
     2722                          line, linenum, filename);
     2723          return (0);
     2724        }
     2725        else
     2726        {
     2727          int   n;              /* Number */
     2728          char  *units;         /* Units */
     2729
     2730          n = strtol(value, &units, 0);
     2731
     2732          if (units && *units)
     2733          {
     2734            if (tolower(units[0] & 255) == 'g')
     2735              n *= 1024 * 1024 * 1024;
     2736            else if (tolower(units[0] & 255) == 'm')
     2737              n *= 1024 * 1024;
     2738            else if (tolower(units[0] & 255) == 'k')
     2739              n *= 1024;
     2740            else if (tolower(units[0] & 255) == 't')
     2741              n *= 262144;
     2742            else
     2743            {
     2744              cupsdLogMessage(CUPSD_LOG_ERROR,
     2745                              "Unknown integer value for %s on line %d of %s.",
     2746                              line, linenum, filename);
     2747              return (0);
     2748            }
     2749          }
     2750
     2751          if (n < 0)
     2752          {
     2753            cupsdLogMessage(CUPSD_LOG_ERROR,
     2754                            "Bad negative integer value for %s on line %d of "
     2755                            "%s.", line, linenum, filename);
     2756            return (0);
     2757          }
     2758          else
     2759          {
     2760            *((int *)var->ptr) = n;
     2761          }
     2762        }
     2763        break;
     2764
     2765    case CUPSD_VARTYPE_TIME :
     2766        if (!value)
     2767        {
     2768          cupsdLogMessage(CUPSD_LOG_ERROR,
     2769                          "Missing time interval value for %s on line %d of "
     2770                          "%s.", line, linenum, filename);
     2771          return (0);
     2772        }
     2773        else if (!_cups_strncasecmp(line, "PreserveJob", 11) &&
     2774                 (!_cups_strcasecmp(value, "true") ||
     2775                  !_cups_strcasecmp(value, "on") ||
     2776                  !_cups_strcasecmp(value, "enabled") ||
     2777                  !_cups_strcasecmp(value, "yes")))
     2778        {
     2779          *((int *)var->ptr) = INT_MAX;
     2780        }
     2781        else if (!_cups_strcasecmp(value, "false") ||
     2782                 !_cups_strcasecmp(value, "off") ||
     2783                 !_cups_strcasecmp(value, "disabled") ||
     2784                 !_cups_strcasecmp(value, "no"))
     2785        {
     2786          *((int *)var->ptr) = 0;
     2787        }
     2788        else if (!isdigit(*value & 255))
     2789        {
     2790          cupsdLogMessage(CUPSD_LOG_ERROR,
     2791                          "Unknown time interval value for %s on line %d of "
     2792                          "%s.", line, linenum, filename);
     2793          return (0);
     2794        }
     2795        else
     2796        {
     2797          double        n;              /* Number */
     2798          char          *units;         /* Units */
     2799
     2800          n = strtod(value, &units);
     2801
     2802          if (units && *units)
     2803          {
     2804            if (tolower(units[0] & 255) == 'w')
     2805              n *= 7 * 24 * 60 * 60;
     2806            else if (tolower(units[0] & 255) == 'd')
     2807              n *= 24 * 60 * 60;
     2808            else if (tolower(units[0] & 255) == 'h')
     2809              n *= 60 * 60;
     2810            else if (tolower(units[0] & 255) == 'm')
     2811              n *= 60;
     2812            else
     2813            {
     2814              cupsdLogMessage(CUPSD_LOG_ERROR,
     2815                              "Unknown time interval value for %s on line "
     2816                              "%d of %s.", line, linenum, filename);
     2817              return (0);
     2818            }
     2819          }
     2820
     2821          if (n < 0.0 || n > INT_MAX)
     2822          {
     2823            cupsdLogMessage(CUPSD_LOG_ERROR,
     2824                            "Bad time value for %s on line %d of %s.",
     2825                            line, linenum, filename);
     2826            return (0);
     2827          }
     2828          else
     2829          {
     2830            *((int *)var->ptr) = (int)n;
     2831          }
     2832        }
     2833        break;
     2834
     2835    case CUPSD_VARTYPE_BOOLEAN :
     2836        if (!value)
     2837        {
     2838          cupsdLogMessage(CUPSD_LOG_ERROR,
     2839                          "Missing boolean value for %s on line %d of %s.",
     2840                          line, linenum, filename);
     2841          return (0);
     2842        }
     2843        else if (!_cups_strcasecmp(value, "true") ||
     2844                 !_cups_strcasecmp(value, "on") ||
     2845                 !_cups_strcasecmp(value, "enabled") ||
     2846                 !_cups_strcasecmp(value, "yes") ||
     2847                 atoi(value) != 0)
     2848        {
     2849          *((int *)var->ptr) = TRUE;
     2850        }
     2851        else if (!_cups_strcasecmp(value, "false") ||
     2852                 !_cups_strcasecmp(value, "off") ||
     2853                 !_cups_strcasecmp(value, "disabled") ||
     2854                 !_cups_strcasecmp(value, "no") ||
     2855                 !_cups_strcasecmp(value, "0"))
     2856        {
     2857          *((int *)var->ptr) = FALSE;
     2858        }
     2859        else
     2860        {
     2861          cupsdLogMessage(CUPSD_LOG_ERROR,
     2862                          "Unknown boolean value %s on line %d of %s.",
     2863                          value, linenum, filename);
     2864          return (0);
     2865        }
     2866        break;
     2867
     2868    case CUPSD_VARTYPE_PATHNAME :
     2869        if (!value)
     2870        {
     2871          cupsdLogMessage(CUPSD_LOG_ERROR,
     2872                          "Missing pathname value for %s on line %d of %s.",
     2873                          line, linenum, filename);
     2874          return (0);
     2875        }
     2876
     2877        if (value[0] == '/')
     2878          strlcpy(temp, value, sizeof(temp));
     2879        else
     2880          snprintf(temp, sizeof(temp), "%s/%s", ServerRoot, value);
     2881
     2882        if (access(temp, 0))
     2883        {
     2884          cupsdLogMessage(CUPSD_LOG_ERROR,
     2885                          "File or directory for \"%s %s\" on line %d of %s "
     2886                          "does not exist.", line, value, linenum, filename);
     2887          return (0);
     2888        }
     2889
     2890        cupsdSetString((char **)var->ptr, temp);
     2891        break;
     2892
     2893    case CUPSD_VARTYPE_STRING :
     2894        cupsdSetString((char **)var->ptr, value);
     2895        break;
     2896  }
     2897
     2898  return (1);
     2899}
     2900
     2901
     2902/*
     2903 * 'read_cupsd_conf()' - Read the cupsd.conf configuration file.
     2904 */
     2905
     2906static int                              /* O - 1 on success, 0 on failure */
     2907read_cupsd_conf(cups_file_t *fp)        /* I - File to read from */
    26352908{
    2636   int                   i;              /* Looping var */
    26372909  int                   linenum;        /* Current line number */
    26382910  char                  line[HTTP_MAX_BUFFER],
    26392911                                        /* Line from file */
     
    26432915                        *value,         /* Pointer to value */
    26442916                        *valueptr;      /* Pointer into value */
    26452917  int                   valuelen;       /* Length of value */
    2646   cupsd_var_t const     *var;           /* Current variable */
    26472918  http_addrlist_t       *addrlist,      /* Address list */
    26482919                        *addr;          /* Current address */
    26492920  unsigned              ip[4],          /* Address value */
     
    26532924  cupsd_location_t      *location;      /* Browse location */
    26542925  cups_file_t           *incfile;       /* Include file */
    26552926  char                  incname[1024];  /* Include filename */
    2656   struct group          *group;         /* Group */
    26572927
    26582928
    26592929 /*
     
    26852955                        incname, strerror(errno));
    26862956      else
    26872957      {
    2688         read_configuration(incfile);
     2958        read_cupsd_conf(incfile);
    26892959        cupsFileClose(incfile);
    26902960      }
    26912961    }
     
    27092979      if (linenum == 0)
    27102980        return (0);
    27112981    }
    2712     else if (!_cups_strcasecmp(line, "FatalErrors"))
    2713       FatalErrors = parse_fatal_errors(value);
    27142982    else if (!_cups_strcasecmp(line, "FaxRetryInterval") && value)
    27152983    {
    27162984      JobRetryInterval = atoi(value);
     
    33193587      cupsdLogMessage(CUPSD_LOG_INFO, "Polling %s:%d", pollp->hostname,
    33203588                      pollp->port);
    33213589    }
    3322     else if (!_cups_strcasecmp(line, "default_auth_type") && value)
     3590    else if (!_cups_strcasecmp(line, "DefaultAuthType") && value)
    33233591    {
    33243592     /*
    3325       * default_auth_type {basic,digest,basicdigest,negotiate}
     3593      * DefaultAuthType {basic,digest,basicdigest,negotiate}
    33263594      */
    33273595
    33283596      if (!_cups_strcasecmp(value, "none"))
     
    33713639      }
    33723640    }
    33733641#endif /* HAVE_SSL */
    3374     else if (!_cups_strcasecmp(line, "User") && value)
    3375     {
    3376      /*
    3377       * User ID to run as...
    3378       */
    3379 
    3380       if (isdigit(value[0] & 255))
    3381       {
    3382         int uid = atoi(value);
    3383 
    3384         if (!uid)
    3385           cupsdLogMessage(CUPSD_LOG_ERROR,
    3386                           "Will not use User 0 as specified on line %d "
    3387                           "for security reasons.  You must use a non-"
    3388                           "privileged account instead.",
    3389                           linenum);
    3390         else
    3391           User = atoi(value);
    3392       }
    3393       else
    3394       {
    3395         struct passwd *p;       /* Password information */
    3396 
    3397         endpwent();
    3398         p = getpwnam(value);
    3399 
    3400         if (p)
    3401         {
    3402           if (!p->pw_uid)
    3403             cupsdLogMessage(CUPSD_LOG_ERROR,
    3404                             "Will not use User %s (UID=0) as specified on line "
    3405                             "%d for security reasons.  You must use a non-"
    3406                             "privileged account instead.",
    3407                             value, linenum);
    3408           else
    3409             User = p->pw_uid;
    3410         }
    3411         else
    3412           cupsdLogMessage(CUPSD_LOG_ERROR,
    3413                           "Unknown User \"%s\" on line %d, ignoring.",
    3414                           value, linenum);
    3415       }
    3416     }
    3417     else if (!_cups_strcasecmp(line, "Group") && value)
    3418     {
    3419      /*
    3420       * Group ID to run as...
    3421       */
    3422 
    3423       if (isdigit(value[0]))
    3424         Group = atoi(value);
    3425       else
    3426       {
    3427         endgrent();
    3428         group = getgrnam(value);
    3429 
    3430         if (group != NULL)
    3431           Group = group->gr_gid;
    3432         else
    3433           cupsdLogMessage(CUPSD_LOG_ERROR,
    3434                           "Unknown Group \"%s\" on line %d, ignoring.",
    3435                           value, linenum);
    3436       }
    3437     }
    3438     else if (!_cups_strcasecmp(line, "SystemGroup") && value)
    3439     {
    3440      /*
    3441       * SystemGroup (admin) group(s)...
    3442       */
    3443 
    3444       if (!parse_groups(value))
    3445         cupsdLogMessage(CUPSD_LOG_ERROR,
    3446                         "Unknown SystemGroup \"%s\" on line %d, ignoring.",
    3447                         value, linenum);
    3448     }
    34493642    else if (!_cups_strcasecmp(line, "HostNameLookups") && value)
    34503643    {
    34513644     /*
     
    35243717        cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d.",
    35253718                        value, linenum);
    35263719    }
    3527     else if (!_cups_strcasecmp(line, "PrintcapFormat") && value)
    3528     {
    3529      /*
    3530       * Format of printcap file?
    3531       */
    3532 
    3533       if (!_cups_strcasecmp(value, "bsd"))
    3534         PrintcapFormat = PRINTCAP_BSD;
    3535       else if (!_cups_strcasecmp(value, "plist"))
    3536         PrintcapFormat = PRINTCAP_PLIST;
    3537       else if (!_cups_strcasecmp(value, "solaris"))
    3538         PrintcapFormat = PRINTCAP_SOLARIS;
    3539       else
    3540         cupsdLogMessage(CUPSD_LOG_WARN, "Unknown PrintcapFormat %s on line %d.",
    3541                         value, linenum);
    3542     }
    35433720    else if (!_cups_strcasecmp(line, "ServerTokens") && value)
    35443721    {
    35453722     /*
     
    36653842                        "line %d.", value, linenum);
    36663843    }
    36673844#endif /* HAVE_SSL */
     3845    else if (!_cups_strcasecmp(line, "AccessLog") ||
     3846             !_cups_strcasecmp(line, "CacheDir") ||
     3847             !_cups_strcasecmp(line, "ConfigFilePerm") ||
     3848             !_cups_strcasecmp(line, "DataDir") ||
     3849             !_cups_strcasecmp(line, "DocumentRoot") ||
     3850             !_cups_strcasecmp(line, "ErrorLog") ||
     3851             !_cups_strcasecmp(line, "FatalErrors") ||
     3852             !_cups_strcasecmp(line, "FileDevice") ||
     3853             !_cups_strcasecmp(line, "FontPath") ||
     3854             !_cups_strcasecmp(line, "Group") ||
     3855             !_cups_strcasecmp(line, "LogFilePerm") ||
     3856             !_cups_strcasecmp(line, "LPDConfigFile") ||
     3857             !_cups_strcasecmp(line, "PageLog") ||
     3858             !_cups_strcasecmp(line, "PidFile") ||
     3859             !_cups_strcasecmp(line, "Printcap") ||
     3860             !_cups_strcasecmp(line, "PrintcapFormat") ||
     3861             !_cups_strcasecmp(line, "RemoteRoot") ||
     3862             !_cups_strcasecmp(line, "RequestRoot") ||
     3863             !_cups_strcasecmp(line, "ServerBin") ||
     3864             !_cups_strcasecmp(line, "ServerCertificate") ||
     3865             !_cups_strcasecmp(line, "ServerKey") ||
     3866             !_cups_strcasecmp(line, "ServerRoot") ||
     3867             !_cups_strcasecmp(line, "SMBConfigFile") ||
     3868             !_cups_strcasecmp(line, "StateDir") ||
     3869             !_cups_strcasecmp(line, "TempDir") ||
     3870             !_cups_strcasecmp(line, "User"))
     3871    {
     3872      cupsdLogMessage(CUPSD_LOG_WARN,
     3873                      "Please move \"%s%s%s\" on line %d of %s to the %s file; "
     3874                      "this will become an error in a future release.",
     3875                      line, value ? " " : "", value ? value : "", linenum,
     3876                      ConfigurationFile, CupsFilesFile);
     3877    }
    36683878    else
     3879      parse_variable(ConfigurationFile, linenum, line, value,
     3880                     sizeof(cupsd_vars) / sizeof(cupsd_vars[0]), cupsd_vars);
     3881  }
     3882
     3883  return (1);
     3884}
     3885
     3886
     3887/*
     3888 * 'read_cups_files_conf()' - Read the cups-files.conf configuration file.
     3889 */
     3890
     3891static int                              /* O - 1 on success, 0 on failure */
     3892read_cups_files_conf(cups_file_t *fp)   /* I - File to read from */
     3893{
     3894  int           linenum;                /* Current line number */
     3895  char          line[HTTP_MAX_BUFFER],  /* Line from file */
     3896                *value;                 /* Value from line */
     3897  struct group  *group;                 /* Group */
     3898
     3899
     3900 /*
     3901  * Loop through each line in the file...
     3902  */
     3903
     3904  linenum = 0;
     3905
     3906  while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
     3907  {
     3908    if (!_cups_strcasecmp(line, "FatalErrors"))
     3909      FatalErrors = parse_fatal_errors(value);
     3910    else if (!_cups_strcasecmp(line, "Group") && value)
    36693911    {
    36703912     /*
    3671       * Find a simple variable in the list...
     3913      * Group ID to run as...
    36723914      */
    36733915
    3674       for (i = NUM_VARS, var = variables; i > 0; i --, var ++)
    3675         if (!_cups_strcasecmp(line, var->name))
    3676           break;
    3677 
    3678       if (i == 0)
     3916      if (isdigit(value[0]))
     3917        Group = atoi(value);
     3918      else
    36793919      {
    3680        /*
    3681         * Unknown directive!  Output an error message and continue...
    3682         */
     3920        endgrent();
     3921        group = getgrnam(value);
    36833922
    3684         if (!value)
    3685           cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value for %s on line %d.",
    3686                           line, linenum);
     3923        if (group != NULL)
     3924          Group = group->gr_gid;
    36873925        else
    3688           cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d.",
    3689                           line, linenum);
    3690         continue;
     3926        {
     3927          cupsdLogMessage(CUPSD_LOG_ERROR,
     3928                          "Unknown Group \"%s\" on line %d of %s.", value,
     3929                          linenum, CupsFilesFile);
     3930          if (FatalErrors & CUPSD_FATAL_CONFIG)
     3931            return (0);
     3932        }
    36913933      }
     3934    }
     3935    else if (!_cups_strcasecmp(line, "PrintcapFormat") && value)
     3936    {
     3937     /*
     3938      * Format of printcap file?
     3939      */
    36923940
    3693       switch (var->type)
     3941      if (!_cups_strcasecmp(value, "bsd"))
     3942        PrintcapFormat = PRINTCAP_BSD;
     3943      else if (!_cups_strcasecmp(value, "plist"))
     3944        PrintcapFormat = PRINTCAP_PLIST;
     3945      else if (!_cups_strcasecmp(value, "solaris"))
     3946        PrintcapFormat = PRINTCAP_SOLARIS;
     3947      else
    36943948      {
    3695         case CUPSD_VARTYPE_INTEGER :
    3696             if (!value)
    3697               cupsdLogMessage(CUPSD_LOG_ERROR,
    3698                               "Missing integer value for %s on line %d.",
    3699                               line, linenum);
    3700             else if (!isdigit(*value & 255))
    3701               cupsdLogMessage(CUPSD_LOG_ERROR,
    3702                               "Bad integer value for %s on line %d.",
    3703                               line, linenum);
    3704             else
    3705             {
    3706               int       n;              /* Number */
    3707               char      *units;         /* Units */
    3708 
    3709               n = strtol(value, &units, 0);
    3710 
    3711               if (units && *units)
    3712               {
    3713                 if (tolower(units[0] & 255) == 'g')
    3714                   n *= 1024 * 1024 * 1024;
    3715                 else if (tolower(units[0] & 255) == 'm')
    3716                   n *= 1024 * 1024;
    3717                 else if (tolower(units[0] & 255) == 'k')
    3718                   n *= 1024;
    3719                 else if (tolower(units[0] & 255) == 't')
    3720                   n *= 262144;
    3721                 else
    3722                 {
    3723                   cupsdLogMessage(CUPSD_LOG_ERROR,
    3724                                   "Unknown integer value for %s on line %d.",
    3725                                   line, linenum);
    3726                   break;
    3727                 }
    3728               }
    3729 
    3730               if (n < 0)
    3731                 cupsdLogMessage(CUPSD_LOG_ERROR,
    3732                                 "Bad negative integer value for %s on line %d.",
    3733                                 line, linenum);
    3734               else
    3735                 *((int *)var->ptr) = n;
    3736             }
    3737             break;
    3738 
    3739         case CUPSD_VARTYPE_TIME :
    3740             if (!value)
    3741               cupsdLogMessage(CUPSD_LOG_ERROR,
    3742                               "Missing time interval value for %s on line %d.",
    3743                               line, linenum);
    3744             else if (!_cups_strncasecmp(line, "PreserveJob", 11) &&
    3745                      (!_cups_strcasecmp(value, "true") ||
    3746                       !_cups_strcasecmp(value, "on") ||
    3747                       !_cups_strcasecmp(value, "enabled") ||
    3748                       !_cups_strcasecmp(value, "yes")))
    3749               *((int *)var->ptr) = INT_MAX;
    3750             else if (!_cups_strcasecmp(value, "false") ||
    3751                      !_cups_strcasecmp(value, "off") ||
    3752                      !_cups_strcasecmp(value, "disabled") ||
    3753                      !_cups_strcasecmp(value, "no"))
    3754               *((int *)var->ptr) = 0;
    3755             else if (!isdigit(*value & 255))
    3756               cupsdLogMessage(CUPSD_LOG_ERROR,
    3757                               "Unknown time interval value for %s on line %d.",
    3758                               line, linenum);
    3759             else
    3760             {
    3761               double    n;              /* Number */
    3762               char      *units;         /* Units */
    3763 
    3764               n = strtod(value, &units);
    3765 
    3766               if (units && *units)
    3767               {
    3768                 if (tolower(units[0] & 255) == 'w')
    3769                   n *= 7 * 24 * 60 * 60;
    3770                 else if (tolower(units[0] & 255) == 'd')
    3771                   n *= 24 * 60 * 60;
    3772                 else if (tolower(units[0] & 255) == 'h')
    3773                   n *= 60 * 60;
    3774                 else if (tolower(units[0] & 255) == 'm')
    3775                   n *= 60;
    3776                 else
    3777                 {
    3778                   cupsdLogMessage(CUPSD_LOG_ERROR,
    3779                                   "Unknown time interval value for %s on line "
    3780                                   "%d.", line, linenum);
    3781                   break;
    3782                 }
    3783               }
    3784 
    3785               if (n < 0.0 || n > INT_MAX)
    3786                 cupsdLogMessage(CUPSD_LOG_ERROR,
    3787                                 "Bad time value for %s on line %d.",
    3788                                 line, linenum);
    3789               else
    3790                 *((int *)var->ptr) = (int)n;
    3791             }
    3792             break;
     3949        cupsdLogMessage(CUPSD_LOG_ERROR,
     3950                        "Unknown PrintcapFormat \"%s\" on line %d of %s.",
     3951                        value, linenum, CupsFilesFile);
     3952        if (FatalErrors & CUPSD_FATAL_CONFIG)
     3953          return (0);
     3954      }
     3955    }
     3956    else if (!_cups_strcasecmp(line, "SystemGroup") && value)
     3957    {
     3958     /*
     3959      * SystemGroup (admin) group(s)...
     3960      */
    37933961
    3794         case CUPSD_VARTYPE_BOOLEAN :
    3795             if (!value)
    3796               cupsdLogMessage(CUPSD_LOG_ERROR,
    3797                               "Missing boolean value for %s on line %d.",
    3798                               line, linenum);
    3799             else if (!_cups_strcasecmp(value, "true") ||
    3800                      !_cups_strcasecmp(value, "on") ||
    3801                      !_cups_strcasecmp(value, "enabled") ||
    3802                      !_cups_strcasecmp(value, "yes") ||
    3803                      atoi(value) != 0)
    3804               *((int *)var->ptr) = TRUE;
    3805             else if (!_cups_strcasecmp(value, "false") ||
    3806                      !_cups_strcasecmp(value, "off") ||
    3807                      !_cups_strcasecmp(value, "disabled") ||
    3808                      !_cups_strcasecmp(value, "no") ||
    3809                      !_cups_strcasecmp(value, "0"))
    3810               *((int *)var->ptr) = FALSE;
    3811             else
    3812               cupsdLogMessage(CUPSD_LOG_ERROR,
    3813                               "Unknown boolean value %s on line %d.",
    3814                               value, linenum);
    3815             break;
     3962      if (!parse_groups(value))
     3963      {
     3964        cupsdLogMessage(CUPSD_LOG_ERROR,
     3965                        "Unknown SystemGroup \"%s\" on line %d of %s.", value,
     3966                        linenum, CupsFilesFile);
     3967        if (FatalErrors & CUPSD_FATAL_CONFIG)
     3968          return (0);
     3969      }
     3970    }
     3971    else if (!_cups_strcasecmp(line, "User") && value)
     3972    {
     3973     /*
     3974      * User ID to run as...
     3975      */
    38163976
    3817         case CUPSD_VARTYPE_PATHNAME :
    3818             if (!value)
    3819             {
    3820               cupsdLogMessage(CUPSD_LOG_ERROR,
    3821                               "Missing pathname value for %s on line %d.",
    3822                               line, linenum);
    3823               break;
    3824             }
     3977      if (isdigit(value[0] & 255))
     3978      {
     3979        int uid = atoi(value);
    38253980
    3826             if (value[0] == '/')
    3827               strlcpy(temp, value, sizeof(temp));
    3828             else
    3829               snprintf(temp, sizeof(temp), "%s/%s", ServerRoot, value);
     3981        if (!uid)
     3982        {
     3983          cupsdLogMessage(CUPSD_LOG_ERROR,
     3984                          "Will not use User 0 as specified on line %d of %s "
     3985                          "for security reasons.  You must use a non-"
     3986                          "privileged account instead.",
     3987                          linenum, CupsFilesFile);
     3988          if (FatalErrors & CUPSD_FATAL_CONFIG)
     3989            return (0);
     3990        }
     3991        else
     3992          User = atoi(value);
     3993      }
     3994      else
     3995      {
     3996        struct passwd *p;       /* Password information */
    38303997
    3831             if (access(temp, 0))
    3832             {
    3833               cupsdLogMessage(CUPSD_LOG_ERROR,
    3834                               "File or directory for \"%s %s\" on line %d "
    3835                               "does not exist.", line, value, linenum);
    3836               break;
    3837             }
     3998        endpwent();
     3999        p = getpwnam(value);
    38384000
    3839         case CUPSD_VARTYPE_STRING :
    3840             cupsdSetString((char **)var->ptr, value);
    3841             break;
     4001        if (p)
     4002        {
     4003          if (!p->pw_uid)
     4004          {
     4005            cupsdLogMessage(CUPSD_LOG_ERROR,
     4006                            "Will not use User %s (UID=0) as specified on line "
     4007                            "%d of %s for security reasons.  You must use a "
     4008                            "non-privileged account instead.",
     4009                            value, linenum, CupsFilesFile);
     4010            if (FatalErrors & CUPSD_FATAL_CONFIG)
     4011              return (0);
     4012          }
     4013          else
     4014            User = p->pw_uid;
     4015        }
     4016        else
     4017        {
     4018          cupsdLogMessage(CUPSD_LOG_ERROR,
     4019                          "Unknown User \"%s\" on line %d of %s.",
     4020                          value, linenum, CupsFilesFile);
     4021          if (FatalErrors & CUPSD_FATAL_CONFIG)
     4022            return (0);
     4023        }
    38424024      }
    38434025    }
     4026    else if (!parse_variable(CupsFilesFile, linenum, line, value,
     4027                             sizeof(cupsfiles_vars) / sizeof(cupsfiles_vars[0]),
     4028                             cupsfiles_vars) &&
     4029             (FatalErrors & CUPSD_FATAL_CONFIG))
     4030      return (0);
    38444031  }
    38454032
    38464033  return (1);
  • scheduler/conf.h

    old new  
    9696 */
    9797
    9898VAR char                *ConfigurationFile      VALUE(NULL),
    99                                         /* Configuration file to use */
     99                                        /* cupsd.conf file to use */
     100                        *CupsFilesFile          VALUE(NULL),
     101                                        /* cups-files.conf file to use */
    100102                        *ServerName             VALUE(NULL),
    101103                                        /* FQDN for server */
    102104                        *ServerAdmin            VALUE(NULL),
  • scheduler/main.c

    old new  
    210210
    211211                char *current;          /* Current directory */
    212212
    213 
    214213               /*
    215214                * Allocate a buffer for the current working directory to
    216215                * reduce run-time stack usage; this approximates the
     
    274273              UseProfiles = 0;
    275274              break;
    276275
     276          case 's' : /* Set cups-files.conf location */
     277              i ++;
     278              if (i >= argc)
     279              {
     280                _cupsLangPuts(stderr, _("cupsd: Expected cups-files.conf "
     281                                        "filename after \"-s\" option."));
     282                usage(1);
     283              }
     284
     285              if (argv[i][0] != '/')
     286              {
     287               /*
     288                * Relative filename not allowed...
     289                */
     290
     291                _cupsLangPuts(stderr, _("cupsd: Relative cups-files.conf "
     292                                        "filename not allowed."));
     293                usage(1);
     294              }
     295
     296              cupsdSetString(&CupsFilesFile, argv[i]);
     297              break;
     298
    277299#ifdef __APPLE__
    278300          case 'S' : /* Disable system management functions */
    279301              fputs("cupsd: -S (disable system management) for internal "
     
    301323    }
    302324
    303325  if (!ConfigurationFile)
     326  {
    304327    cupsdSetString(&ConfigurationFile, CUPS_SERVERROOT "/cupsd.conf");
     328    cupsdSetString(&CupsFilesFile, CUPS_SERVERROOT "/cups-files.conf");
     329  }
     330
     331  if (!CupsFilesFile)
     332  {
     333    char        *filename,      /* Copy of cupsd.conf filename */
     334                *slash;         /* Final slash in cupsd.conf filename */
     335    size_t      len;            /* Size of buffer */
     336
     337    len = strlen(ConfigurationFile) + 15;
     338    if ((filename = malloc(len)) == NULL)
     339    {
     340      _cupsLangPrintf(stderr,
     341                      _("cupsd: Unable to get path to "
     342                        "cups-files.conf file."));
     343      return (1);
     344    }
     345
     346    strlcpy(filename, ConfigurationFile, len);
     347    if ((slash = strrchr(filename, '/')) == NULL)
     348    {
     349      _cupsLangPrintf(stderr,
     350                      _("cupsd: Unable to get path to "
     351                        "cups-files.conf file."));
     352      return (1);
     353    }
     354
     355    strlcpy(slash, "/cups-files.conf", len - (slash - filename));
     356    cupsdSetString(&CupsFilesFile, filename);
     357    free(filename);
     358  }
    305359
    306360 /*
    307361  * If the user hasn't specified "-f", run in the background...
  • test/run-stp-tests.sh

    old new  
    385385cat >/tmp/cups-$user/cupsd.conf <<EOF
    386386StrictConformance Yes
    387387Browsing Off
    388 FileDevice yes
    389 Printcap
    390388Listen localhost:$port
    391 User $user
    392 ServerRoot /tmp/cups-$user
    393 StateDir /tmp/cups-$user
    394 ServerBin /tmp/cups-$user/bin
    395 CacheDir /tmp/cups-$user/share
    396 DataDir /tmp/cups-$user/share
    397 FontPath /tmp/cups-$user/share/fonts
    398389PassEnv LOCALEDIR
    399390PassEnv DYLD_INSERT_LIBRARIES
    400 DocumentRoot $root/doc
    401 RequestRoot /tmp/cups-$user/spool
    402 TempDir /tmp/cups-$user/spool/temp
    403 PidFile /tmp/cups-$user/cupsd.pid
    404391MaxSubscriptions 3
    405392MaxLogSize 0
    406 AccessLog /tmp/cups-$user/log/access_log
    407 ErrorLog /tmp/cups-$user/log/error_log
    408 PageLog /tmp/cups-$user/log/page_log
    409393AccessLogLevel actions
    410394LogLevel debug2
    411395LogTimeFormat usecs
     
    418402</Policy>
    419403EOF
    420404
     405cat >/tmp/cups-$user/cups-files.conf <<EOF
     406FileDevice yes
     407Printcap
     408User $user
     409ServerRoot /tmp/cups-$user
     410StateDir /tmp/cups-$user
     411ServerBin /tmp/cups-$user/bin
     412CacheDir /tmp/cups-$user/share
     413DataDir /tmp/cups-$user/share
     414FontPath /tmp/cups-$user/share/fonts
     415DocumentRoot $root/doc
     416RequestRoot /tmp/cups-$user/spool
     417TempDir /tmp/cups-$user/spool/temp
     418AccessLog /tmp/cups-$user/log/access_log
     419ErrorLog /tmp/cups-$user/log/error_log
     420PageLog /tmp/cups-$user/log/page_log
     421PidFile /tmp/cups-$user/cupsd.pid
     422EOF
     423
    421424#
    422425# Setup lots of test queues - half with PPD files, half without...
    423426#