Ticket #3754: CVE-2012-5519.patch
File CVE-2012-5519.patch, 82.8 KB (added by , 12 years ago) |
---|
-
TabularUnified 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 19 19 # Config files... 20 20 # 21 21 22 KEEP = cups d.conf snmp.conf22 KEEP = cups-files.conf cupsd.conf snmp.conf 23 23 REPLACE = mime.convs mime.types 24 24 25 25 -
TabularUnified 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... 17 SystemGroup @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. 33 AccessLog @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. 48 ErrorLog @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. 60 PageLog @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 # -
TabularUnified config-scripts/cups-defaults.m4
old new 372 372 fi 373 373 374 374 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE") 375 AC_SUBST(CUPS_DEFAULT_LPD_CONFIG_FILE) 375 376 376 377 dnl Default SMB config file... 377 378 AC_ARG_WITH(smbconfigfile, [ --with-smbconfigfile set default SMBConfigFile URI], … … 393 394 fi 394 395 395 396 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE") 397 AC_SUBST(CUPS_DEFAULT_SMB_CONFIG_FILE) 396 398 397 399 dnl Default MaxCopies value... 398 400 AC_ARG_WITH(max-copies, [ --with-max-copies set default max copies value, default=9999 ], -
TabularUnified config-scripts/cups-ssl.m4
old new 27 27 SSLFLAGS="" 28 28 SSLLIBS="" 29 29 have_ssl=0 30 CUPS_SERVERCERT="" 31 CUPS_SERVERKEY="" 30 32 31 33 if test x$enable_ssl != xno; then 32 34 dnl Look for CDSA... … … 36 38 have_ssl=1 37 39 AC_DEFINE(HAVE_SSL) 38 40 AC_DEFINE(HAVE_CDSASSL) 41 CUPS_SERVERCERT="/Library/Keychains/System.keychain" 39 42 40 43 dnl Check for the various security headers... 41 44 AC_CHECK_HEADER(Security/SecureTransportPriv.h, … … 106 109 fi 107 110 108 111 if test $have_ssl = 1; then 112 CUPS_SERVERCERT="ssl/server.crt" 113 CUPS_SERVERKEY="ssl/server.key" 114 109 115 if $PKGCONFIG --exists gcrypt; then 110 116 SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`" 111 117 SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`" … … 148 154 done 149 155 150 156 if test "x${SSLLIBS}" != "x"; then 157 CUPS_SERVERCERT="ssl/server.crt" 158 CUPS_SERVERKEY="ssl/server.key" 159 151 160 LIBS="$SAVELIBS $SSLLIBS" 152 161 AC_CHECK_FUNCS(SSL_set_tlsext_host_name) 153 162 fi … … 165 174 AC_MSG_ERROR([Unable to enable SSL support.]) 166 175 fi 167 176 177 AC_SUBST(CUPS_SERVERCERT) 178 AC_SUBST(CUPS_SERVERKEY) 168 179 AC_SUBST(IPPALIASES) 169 180 AC_SUBST(SSLFLAGS) 170 181 AC_SUBST(SSLLIBS) -
TabularUnified configure.in
old new 60 60 AC_SUBST(UNINSTALL_LANGUAGES) 61 61 62 62 AC_OUTPUT(Makedefs 63 conf/cups-files.conf 63 64 conf/cupsd.conf 64 65 conf/mime.convs 65 66 conf/pam.std … … 73 74 man/client.conf.man 74 75 man/cups-deviced.man 75 76 man/cups-driverd.man 77 man/cups-files.conf.man 76 78 man/cups-lpd.man 77 79 man/cups-snmp.man 78 80 man/cupsaddsmb.man -
TabularUnified 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"> 18 AccessLog /var/log/cups/access_log 19 AccessLog /var/log/cups/access_log-%s 20 AccessLog syslog 21 </PRE> 22 23 <H3>Description</H3> 24 25 <P>The <CODE>AccessLog</CODE> directive sets the name of the 26 access log file. If the filename is not absolute then it is 27 assumed to be relative to the <A 28 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The 29 access log file is stored in "common log format" and can be used 30 by any web access reporting tool to generate a report on CUPS 31 server 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 37 information 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"> 48 ConfigFilePerm 0644 49 ConfigFilePerm 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"> 68 DataDir /usr/share/cups 69 </PRE> 70 71 <H3>Description</H3> 72 73 <P>The <CODE>DataDir</CODE> directive sets the directory to use 74 for 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"> 82 DocumentRoot /usr/share/doc/cups 83 DocumentRoot /foo/bar/doc/cups 84 </PRE> 85 86 <H3>Description</H3> 87 88 <P>The <CODE>DocumentRoot</CODE> directive specifies the location 89 of web content for the HTTP server in CUPS. If an absolute path 90 is not specified then it is assumed to be relative to the <A 91 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The 92 default directory is <VAR>@CUPS_DOCROOT@</VAR>.</P> 93 94 <P>Documents are first looked up in a sub-directory for the 95 primary language requested by the client (e.g. 96 <VAR>@CUPS_DOCROOT@/fr/...</VAR>) and then directly under 97 the <CODE>DocumentRoot</CODE> directory (e.g. 98 <VAR>@CUPS_DOCROOT@/...</VAR>), so it is possible to 99 localize the web content by providing subdirectories for each 100 language needed.</P> 101 102 103 <H2 CLASS="title"><A NAME="ErrorLog">ErrorLog</A></H2> 104 105 <H3>Examples</H3> 106 107 <PRE CLASS="command"> 108 ErrorLog /var/log/cups/error_log 109 ErrorLog /var/log/cups/error_log-%s 110 ErrorLog syslog 111 </PRE> 112 113 <H3>Description</H3> 114 115 <P>The <CODE>ErrorLog</CODE> directive sets the name of the error 116 log file. If the filename is not absolute then it is assumed to 117 be relative to the <A 118 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The 119 default 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 125 information 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"> 133 FatalErrors none 134 FatalErrors all 135 FatalErrors browse 136 FatalErrors config 137 FatalErrors listen 138 FatalErrors log 139 FatalErrors permissions 140 FatalErrors all -permissions 141 FatalErrors config permissions log 142 </PRE> 143 144 <H3>Description</H3> 145 146 <P>The <CODE>FatalErrors</CODE> directive determines whether certain kinds of 147 errors 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"> 183 FileDevice Yes 184 FileDevice No 185 </PRE> 186 187 <H3>Description</H3> 188 189 <P>The <CODE>FileDevice</CODE> directive determines whether the 190 scheduler allows new printers to be added using device URIs of 191 the form <CODE>file:/filename</CODE>. File devices are most often 192 used to test new printer drivers and do not support raw file 193 printing.</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 200 scheduler normally runs as the root user, file devices 201 can be used to overwrite system files and potentially 202 gain unauthorized access to the system. If you must 203 create printers using file devices, we recommend that 204 you set the <CODE>FileDevice</CODE> directive to 205 <CODE>Yes</CODE> for only as long as you need to add the 206 printers 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"> 217 FontPath /foo/bar/fonts 218 FontPath /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 224 use 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"> 233 Group lp 234 Group nobody 235 </PRE> 236 237 <H3>Description</H3> 238 239 <P>The <CODE>Group</CODE> directive specifies the UNIX group that 240 filter and CGI programs run as. The default group is 241 system-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"> 250 LogFilePerm 0644 251 LogFilePerm 0600 252 </PRE> 253 254 <H3>Description</H3> 255 256 <P>The <CODE>LogFilePerm</CODE> directive specifies the 257 permissions to use when writing log files. The default 258 is @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"> 266 PageLog /var/log/cups/page_log 267 PageLog /var/log/cups/page_log-%s 268 PageLog syslog 269 </PRE> 270 271 <H3>Description</H3> 272 273 <P>The <CODE>PageLog</CODE> directive sets the name of the page 274 log file. If the filename is not absolute then it is assumed to 275 be relative to the <A 276 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The 277 default 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 283 information 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"> 291 Printcap 292 Printcap /etc/printcap 293 Printcap /etc/printers.conf 294 Printcap /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 300 printcap file is automatically generated and updated with a list 301 of available printers. If specified with no value, then no 302 printcap file will be generated. The default is to generate a 303 file named <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>.</P> 304 305 <P>When a filename is specified (e.g. <VAR>@CUPS_DEFAULT_PRINTCAP@</VAR>), 306 the printcap file is written whenever a printer is added or 307 removed. The printcap file can then be used by applications that 308 are hardcoded to look at the printcap file for the available 309 printers.</P> 310 311 312 <H2 CLASS="title"><A NAME="PrintcapFormat">PrintcapFormat</A></H2> 313 314 <H3>Examples</H3> 315 316 <PRE CLASS="command"> 317 PrintcapFormat BSD 318 PrintcapFormat Solaris 319 PrintcapFormat plist 320 </PRE> 321 322 <H3>Description</H3> 323 324 <P>The <CODE>PrintcapFormat</CODE> directive controls the output format of the 325 printcap file. The default is to generate the plist format on OS X, the 326 Solaris 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"> 334 RemoteRoot remroot 335 RemoteRoot root 336 </PRE> 337 338 <H3>Description</H3> 339 340 <P>The <CODE>RemoteRoot</CODE> directive sets the username for 341 unauthenticated root requests from remote hosts. The default 342 username is <VAR>remroot</VAR>. Setting <CODE>RemoteRoot</CODE> 343 to <VAR>root</VAR> effectively disables this security 344 mechanism.</P> 345 346 347 <H2 CLASS="title"><A NAME="RequestRoot">RequestRoot</A></H2> 348 349 <H3>Examples</H3> 350 351 <PRE CLASS="command"> 352 RequestRoot /var/spool/cups 353 RequestRoot /foo/bar/spool/cups 354 </PRE> 355 356 <H3>Description</H3> 357 358 <P>The <CODE>RequestRoot</CODE> directive sets the directory for 359 incoming IPP requests and HTML forms. If an absolute path is not 360 provided then it is assumed to be relative to the <A 361 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The 362 default 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"> 370 ServerBin /usr/lib/cups 371 ServerBin /foo/bar/lib/cups 372 </PRE> 373 374 <H3>Description</H3> 375 376 <P>The <CODE>ServerBin</CODE> directive sets the directory for 377 server-run executables. If an absolute path is not provided then 378 it is assumed to be relative to the <A 379 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The 380 default executable directory is <VAR>/usr/lib/cups</VAR>, 381 <VAR>/usr/lib32/cups</VAR>, or <VAR>/usr/libexec/cups</VAR> 382 depending 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"> 390 ServerCertificate /etc/cups/ssl/server.crt 391 </PRE> 392 393 <H3>Description</H3> 394 395 <P>The <CODE>ServerCertificate</CODE> directive specifies the 396 location of the SSL certificate file used by the server when 397 negotiating encrypted connections. The certificate must not be 398 encrypted (password protected) since the scheduler normally runs 399 in 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"> 410 ServerKey /etc/cups/ssl/server.key 411 </PRE> 412 413 <H3>Description</H3> 414 415 <P>The <CODE>ServerKey</CODE> directive specifies the location of 416 the SSL private key file used by the server when negotiating 417 encrypted 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"> 428 ServerRoot /etc/cups 429 ServerRoot /foo/bar/cups 430 </PRE> 431 432 <H3>Description</H3> 433 434 <P>The <CODE>ServerRoot</CODE> directive specifies the absolute 435 path to the server configuration and state files. It is also used 436 to resolve relative paths in the <VAR>cupsd.conf</VAR> file. The 437 default 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"> 445 SystemGroup lpadmin 446 SystemGroup sys 447 SystemGroup system 448 SystemGroup root 449 SystemGroup root lpadmin 450 </PRE> 451 452 <H3>Description</H3> 453 454 <P>The <CODE>SystemGroup</CODE> directive specifies the system 455 administration group for <CODE>System</CODE> authentication. 456 Multiple groups can be listed, separated with spaces. The default 457 group 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"> 465 TempDir /var/tmp 466 TempDir /foo/bar/tmp 467 </PRE> 468 469 <H3>Description</H3> 470 471 <P>The <CODE>TempDir</CODE> directive specifies an absolute path 472 for the directory to use for temporary files. The default 473 directory is <VAR>@CUPS_REQUESTS@/tmp</VAR>.</P> 474 475 <P>Temporary directories must be world-writable and should have 476 the "sticky" permission bit enabled so that other users cannot 477 delete filter temporary files. The following commands will create 478 an 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"> 492 User lp 493 User guest 494 </PRE> 495 496 <H3>Description</H3> 497 498 <P>The <CODE>User</CODE> directive specifies the UNIX user that 499 filter 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 505 the system to unacceptable security risks. The scheduler will 506 automatically choose user <CODE>nobody</CODE> if you specify a 507 user whose ID is 0.</P> 508 509 </BLOCKQUOTE> 510 511 512 </BODY> 513 </HTML> -
TabularUnified doc/help/ref-cupsd-conf.html.in
old new 197 197 HREF="#Limit"><CODE>Limit</CODE></A> section.</P> 198 198 199 199 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 <Location /path>206 ...207 AuthClass Anonymous208 AuthClass User209 AuthClass System210 AuthClass Group211 </Location>212 </PRE>213 214 <H3>Description</H3>215 216 <P>The <CODE>AuthClass</CODE> directive defines what level of217 authentication is required:</P>218 219 <UL>220 221 <LI><CODE>Anonymous</CODE> - No authentication should be222 performed (default)</LI>223 224 <LI><CODE>User</CODE> - A valid username and password is225 required</LI>226 227 <LI><CODE>System</CODE> - A valid username and password228 is required, and the username must belong to the "sys"229 group; this can be changed using the <A230 HREF="#SystemGroup"><CODE>SystemGroup</CODE></A>231 directive</LI>232 233 <LI><CODE>Group</CODE> - A valid username and password is234 required, and the username must belong to the group named235 by the <A236 HREF="#AuthGroupName"><CODE>AuthGroupName</CODE></A>237 directive</LI>238 239 </UL>240 241 <P>The <CODE>AuthClass</CODE> directive must appear inside a <A242 HREF="#Location"><CODE>Location</CODE></A> or <A243 HREF="#Limit"><CODE>Limit</CODE></A> section.</P>244 245 <P><B>This directive is deprecated and will be removed from a246 future release of CUPS.</B> Consider using the more flexible <A247 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 <Location /path>256 ...257 AuthGroupName mygroup258 AuthGroupName lp259 </Location>260 </PRE>261 262 <H3>Description</H3>263 264 <P>The <CODE>AuthGroupName</CODE> directive sets the group to use265 for <CODE>Group</CODE> authentication.</P>266 267 <P>The <CODE>AuthGroupName</CODE> directive must appear inside a268 <A HREF="#Location"><CODE>Location</CODE></A> or <A269 HREF="#Limit"><CODE>Limit</CODE></A> section.</P>270 271 <P><B>This directive is deprecated and will be removed from a272 future release of CUPS.</B> Consider using the more flexible <A273 HREF="#Require"><CODE>Require</CODE></A> directive instead.</P>274 275 276 200 <H2 CLASS="title"><A NAME="AuthType">AuthType</A></H2> 277 201 278 202 <H3>Examples</H3> … … 2510 2434 </BLOCKQUOTE> 2511 2435 2512 2436 2513 <H2 CLASS="title"><A NAME="Printcap">Printcap</A></H2>2514 2515 <H3>Examples</H3>2516 2517 <PRE CLASS="command">2518 Printcap2519 Printcap /etc/printcap2520 Printcap /etc/printers.conf2521 Printcap /Library/Preferences/org.cups.printers.plist2522 </PRE>2523 2524 <H3>Description</H3>2525 2526 <P>The <CODE>Printcap</CODE> directive controls whether or not a2527 printcap file is automatically generated and updated with a list2528 of available printers. If specified with no value, then no2529 printcap file will be generated. The default is to generate a2530 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 or2534 removed. The printcap file can then be used by applications that2535 are hardcoded to look at the printcap file for the available2536 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 BSD2545 PrintcapFormat Solaris2546 PrintcapFormat plist2547 </PRE>2548 2549 <H3>Description</H3>2550 2551 <P>The <CODE>PrintcapFormat</CODE> directive controls the output format of the2552 printcap file. The default is to generate the plist format on OS X, the2553 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/glpoptions2562 </PRE>2563 2564 <H3>Description</H3>2565 2566 <P>The <CODE>PrintcapGUI</CODE> directive sets the program to2567 associate with the IRIX printer GUI interface script which is2568 used by IRIX applications to display printer-specific options.2569 There is no default program.</P>2570 2571 2572 2437 <H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.21</SPAN><A NAME="ReloadTimeout">ReloadTimeout</A></H2> 2573 2438 2574 2439 <H3>Examples</H3> … … 2585 2450 before doing a restart. The default is 30 seconds.</P> 2586 2451 2587 2452 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 remroot2594 RemoteRoot root2595 </PRE>2596 2597 <H3>Description</H3>2598 2599 <P>The <CODE>RemoteRoot</CODE> directive sets the username for2600 unauthenticated root requests from remote hosts. The default2601 username is <VAR>remroot</VAR>. Setting <CODE>RemoteRoot</CODE>2602 to <VAR>root</VAR> effectively disables this security2603 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/cups2612 RequestRoot /foo/bar/spool/cups2613 </PRE>2614 2615 <H3>Description</H3>2616 2617 <P>The <CODE>RequestRoot</CODE> directive sets the directory for2618 incoming IPP requests and HTML forms. If an absolute path is not2619 provided then it is assumed to be relative to the <A2620 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The2621 default request directory is <VAR>@CUPS_REQUESTS@</VAR>.</P>2622 2623 2624 2453 <H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.7</SPAN><A NAME="Require">Require</A></H2> 2625 2454 2626 2455 <H3>Examples</H3> … … 2773 2602 </BLOCKQUOTE> 2774 2603 2775 2604 2776 <H2 CLASS="title"><A NAME="ServerBin">ServerBin</A></H2>2777 2778 <H3>Examples</H3>2779 2780 <PRE CLASS="command">2781 ServerBin /usr/lib/cups2782 ServerBin /foo/bar/lib/cups2783 </PRE>2784 2785 <H3>Description</H3>2786 2787 <P>The <CODE>ServerBin</CODE> directive sets the directory for2788 server-run executables. If an absolute path is not provided then2789 it is assumed to be relative to the <A2790 HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The2791 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.crt2802 </PRE>2803 2804 <H3>Description</H3>2805 2806 <P>The <CODE>ServerCertificate</CODE> directive specifies the2807 location of the SSL certificate file used by the server when2808 negotiating encrypted connections. The certificate must not be2809 encrypted (password protected) since the scheduler normally runs2810 in the background and will be unable to ask for a password.</P>2811 2812 <P>The default certificate file is2813 <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.key2822 </PRE>2823 2824 <H3>Description</H3>2825 2826 <P>The <CODE>ServerKey</CODE> directive specifies the location of2827 the SSL private key file used by the server when negotiating2828 encrypted connections.</P>2829 2830 <P>The default key file is2831 <VAR>/etc/cups/ssl/server.crt</VAR>.</P>2832 2833 2834 2605 <H2 CLASS="title"><A NAME="ServerName">ServerName</A></H2> 2835 2606 2836 2607 <H3>Examples</H3> … … 2847 2618 hostname.</P> 2848 2619 2849 2620 2850 <H2 CLASS="title"><A NAME="ServerRoot">ServerRoot</A></H2>2851 2852 <H3>Examples</H3>2853 2854 <PRE CLASS="command">2855 ServerRoot /etc/cups2856 ServerRoot /foo/bar/cups2857 </PRE>2858 2859 <H3>Description</H3>2860 2861 <P>The <CODE>ServerRoot</CODE> directive specifies the absolute2862 path to the server configuration and state files. It is also used2863 to resolve relative paths in the <VAR>cupsd.conf</VAR> file. The2864 default server directory is <VAR>/etc/cups</VAR>.</P>2865 2866 2867 2621 <H2 CLASS="title"><SPAN CLASS="info">CUPS 1.1.21</SPAN><A NAME="ServerTokens">ServerTokens</A></H2> 2868 2622 2869 2623 <H3>Examples</H3> … … 3059 2813 HREF="#Policy"><CODE>Policy</CODE></A> section.</P> 3060 2814 3061 2815 3062 <H2 CLASS="title"><A NAME="SystemGroup">SystemGroup</A></H2>3063 3064 <H3>Examples</H3>3065 3066 <PRE CLASS="command">3067 SystemGroup lpadmin3068 SystemGroup sys3069 SystemGroup system3070 SystemGroup root3071 SystemGroup root lpadmin3072 </PRE>3073 3074 <H3>Description</H3>3075 3076 <P>The <CODE>SystemGroup</CODE> directive specifies the system3077 administration group for <CODE>System</CODE> authentication.3078 Multiple groups can be listed, separated with spaces. The default3079 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/tmp3088 TempDir /foo/bar/tmp3089 </PRE>3090 3091 <H3>Description</H3>3092 3093 <P>The <CODE>TempDir</CODE> directive specifies an absolute path3094 for the directory to use for temporary files. The default3095 directory is <VAR>@CUPS_REQUESTS@/tmp</VAR>.</P>3096 3097 <P>Temporary directories must be world-writable and should have3098 the "sticky" permission bit enabled so that other users cannot3099 delete filter temporary files. The following commands will create3100 an appropriate temporary directory called3101 <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 3109 2816 <H2 CLASS="title"><A NAME="Timeout">Timeout</A></H2> 3110 2817 3111 2818 <H3>Examples</H3> … … 3148 2855 <P>The default is <CODE>@CUPS_USE_NETWORK_DEFAULT@</CODE>.</P> 3149 2856 3150 2857 3151 <H2 CLASS="title"><A NAME="User">User</A></H2>3152 3153 <H3>Examples</H3>3154 3155 <PRE CLASS="command">3156 User lp3157 User guest3158 </PRE>3159 3160 <H3>Description</H3>3161 3162 <P>The <CODE>User</CODE> directive specifies the UNIX user that3163 filter and CGI programs run as. The default user is3164 <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 expose3169 the system to unacceptable security risks. The scheduler will3170 automatically choose user <CODE>nobody</CODE> if you specify a3171 user whose ID is 0.</P>3172 3173 </BLOCKQUOTE>3174 3175 3176 2858 <H2 CLASS="title"><SPAN CLASS="INFO">CUPS 1.5</SPAN><A NAME="WebInterface">WebInterface</A></H2> 3177 2859 3178 2860 <H3>Examples</H3> -
TabularUnified man/Makefile
old new 39 39 ppdpo.$(MAN1EXT) 40 40 MAN5 = classes.conf.$(MAN5EXT) \ 41 41 client.conf.$(MAN5EXT) \ 42 cups-files.conf.$(MAN5EXT) \ 42 43 cups-snmp.conf.$(MAN5EXT) \ 43 44 cupsd.conf.$(MAN5EXT) \ 44 45 ipptoolfile.$(MAN5EXT) \ -
TabularUnified 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 17 cups-files.conf \- file and directory configuration file for cups 18 .SH DESCRIPTION 19 The \fIcups-file.conf\fR file configures the files and directories used by the 20 CUPS scheduler, \fIcupsd(8)\fR. It is normally located in the 21 \fI@CUPS_SERVERROOT@\fR directory. 22 .LP 23 Each line in the file can be a configuration directive, a blank line, 24 or a comment. Comment lines start with the # character. 25 .SH DIRECTIVES 26 The following directives are understood by \fIcupsd(8)\fR. Consult the 27 on-line help for detailed descriptions: 28 .TP 5 29 AccessLog filename 30 .TP 5 31 AccessLog syslog 32 .br 33 Defines the access log filename. 34 .TP 5 35 ConfigFilePerm mode 36 .br 37 Specifies the permissions for all configuration files that the scheduler 38 writes. 39 .TP 5 40 DataDir path 41 .br 42 Specified the directory where data files can be found. 43 .TP 5 44 DocumentRoot directory 45 .br 46 Specifies the root directory for the internal web server documents. 47 .TP 5 48 ErrorLog filename 49 .TP 5 50 ErrorLog syslog 51 .br 52 Specifies the error log filename. 53 .TP 5 54 FatalErrors none 55 .TP 5 56 FatalErrors all -kind [... -kind] 57 .TP 5 58 FatalErrors kind [... kind] 59 .br 60 Specifies which errors are fatal, causing the scheduler to exit. "Kind" is 61 "browse", "config", "listen", "log", or "permissions". 62 .TP 5 63 FileDevice Yes 64 .TP 5 65 FileDevice No 66 .br 67 Specifies whether the file pseudo-device can be used for new 68 printer queues. 69 .TP 5 70 FontPath directory[:directory:...] 71 .br 72 Specifies the search path for fonts. 73 .TP 5 74 Group group-name-or-number 75 .br 76 Specifies the group name or ID that will be used when executing 77 external programs. 78 .TP 5 79 LogFilePerm mode 80 .br 81 Specifies the permissions for all log files that the scheduler writes. 82 .TP 5 83 PageLog filename 84 .TP 5 85 PageLog syslog 86 .br 87 Specifies the page log filename. 88 .TP 5 89 Printcap 90 .TP 5 91 Printcap filename 92 .br 93 Specifies the filename for a printcap file that is updated 94 automatically with a list of available printers (needed for 95 legacy applications); specifying Printcap with no filename 96 disables printcap generation. 97 .TP 5 98 RemoteRoot user-name 99 .br 100 Specifies the username that is associated with unauthenticated root 101 accesses. 102 .TP 5 103 RequestRoot directory 104 .br 105 Specifies the directory to store print jobs and other HTTP request 106 data. 107 .TP 5 108 ServerBin directory 109 .br 110 Specifies the directory where backends, CGIs, daemons, and filters may 111 be found. 112 .TP 5 113 ServerCertificate filename 114 .br 115 Specifies the encryption certificate to use. 116 .TP 5 117 ServerKey filename 118 .br 119 Specifies the encryption key to use. 120 .TP 5 121 ServerRoot directory 122 .br 123 Specifies the directory where the server configuration files can be found. 124 .TP 5 125 SystemGroup group-name [group-name ...] 126 .br 127 Specifies the group(s) to use for System class authentication. 128 .TP 5 129 TempDir directory 130 .br 131 Specifies the directory where temporary files are stored. 132 .TP 5 133 User user-name 134 .br 135 Specifies 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 141 http://localhost:631/help 142 .SH COPYRIGHT 143 Copyright 2007-2012 by Apple Inc. 144 .\" 145 .\" End of "$Id$". 146 .\" -
TabularUnified man/cupsd.conf.man.in
old new 12 12 .\" which should have been included with this file. If this file is 13 13 .\" file is missing or damaged, see the license at "http://www.cups.org/". 14 14 .\" 15 .TH cupsd.conf 5 "CUPS" "1 8 May2012" "Apple Inc."15 .TH cupsd.conf 5 "CUPS" "19 November 2012" "Apple Inc." 16 16 .SH NAME 17 17 cupsd.conf \- server configuration file for cups 18 18 .SH DESCRIPTION 19 19 The \fIcupsd.conf\fR file configures the CUPS scheduler, \fIcupsd(8)\fR. It 20 is normally located in the \fI@CUPS_SERVERROOT@\fR directory. 20 is normally located in the \fI@CUPS_SERVERROOT@\fR directory. \fBNote:\fR 21 File, directory, and user configuration directives that used to be allowed in 22 the \fIcupsd.conf\fR file are now stored in the \fIcups-files.conf(5)\fR instead 23 in order to prevent certain types of privilege escalation attacks. 21 24 .LP 22 25 Each line in the file can be a configuration directive, a blank line, 23 26 or a comment. Comment lines start with the # character. The … … 27 30 The following directives are understood by \fIcupsd(8)\fR. Consult the 28 31 on-line help for detailed descriptions: 29 32 .TP 5 30 AccessLog filename31 .TP 532 AccessLog syslog33 .br34 Defines the access log filename.35 .TP 536 33 AccessLogLevel config 37 34 .TP 5 38 35 AccessLogLevel actions … … 61 58 .br 62 59 Allows access from the named hosts or addresses. 63 60 .TP 5 64 AuthClass User65 .TP 566 AuthClass Group67 .TP 568 AuthClass System69 .br70 Specifies the authentication class (User, Group, System) -71 \fBthis directive is deprecated\fR.72 .TP 573 AuthGroupName group-name74 .br75 Specifies the authentication group - \fBthis directive is76 deprecated\fR.77 .TP 578 61 AuthType None 79 62 .TP 5 80 63 AuthType Basic … … 200 183 .TP 5 201 184 Browsing No 202 185 .br 203 Specifies whether or not remote printer browsing should be enabled.186 Specifies whether or not shared printers should be advertised. 204 187 .TP 5 205 188 Classification banner 206 189 .br … … 213 196 Specifies whether to allow users to override the classification 214 197 of individual print jobs. 215 198 .TP 5 216 ConfigFilePerm mode217 .br218 Specifies the permissions for all configuration files that the scheduler219 writes.220 .TP 5221 DataDir path222 .br223 Specified the directory where data files can be found.224 .TP 5225 199 DefaultAuthType Basic 226 200 .TP 5 227 201 DefaultAuthType BasicDigest … … 289 263 causes the update to happen as soon as possible, typically within a few 290 264 milliseconds. 291 265 .TP 5 292 DocumentRoot directory293 .br294 Specifies the root directory for the internal web server documents.295 .TP 5296 266 Encryption IfRequested 297 267 .TP 5 298 268 Encryption Never … … 302 272 Specifies the level of encryption that is required for a particular 303 273 location. 304 274 .TP 5 305 ErrorLog filename306 .TP 5307 ErrorLog syslog308 .br309 Specifies the error log filename.310 .TP 5311 FatalErrors none312 .TP 5313 FatalErrors all -kind [... -kind]314 .TP 5315 FatalErrors kind [... kind]316 .br317 Specifies which errors are fatal, causing the scheduler to exit. "Kind" is318 "browse", "config", "listen", "log", or "permissions".319 .TP 5320 FileDevice Yes321 .TP 5322 FileDevice No323 .br324 Specifies whether the file pseudo-device can be used for new325 printer queues.326 .TP 5327 275 FilterLimit limit 328 276 .br 329 277 Specifies the maximum cost of filters that are run concurrently. … … 333 281 Specifies the scheduling priority ("nice" value) of filters that 334 282 are run to print a job. 335 283 .TP 5 336 FontPath directory[:directory:...]337 .br338 Specifies the search path for fonts.339 .TP 5340 Group group-name-or-number341 .br342 Specifies the group name or ID that will be used when executing343 external programs.344 .TP 5345 284 GSSServiceName name 346 285 .br 347 286 Specifies the service name when using Kerberos authentication. The default … … 454 393 Specifies the number of debugging messages that are logged when an error 455 394 occurs in a print job. 456 395 .TP 5 457 LogFilePerm mode458 .br459 Specifies the permissions for all log files that the scheduler writes.460 .TP 5461 396 LogLevel alert 462 397 .TP 5 463 398 LogLevel crit … … 542 477 .br 543 478 Specifies the order of HTTP access control (allow,deny or deny,allow) 544 479 .TP 5 545 PageLog filename546 .TP 5547 PageLog syslog548 .br549 Specifies the page log filename.550 .TP 5551 480 PageLogFormat format string 552 481 .br 553 482 Specifies the format of page log lines. … … 577 506 Specifies whether or not to preserve the job history after they are 578 507 printed. 579 508 .TP 5 580 Printcap581 .TP 5582 Printcap filename583 .br584 Specifies the filename for a printcap file that is updated585 automatically with a list of available printers (needed for586 legacy applications); specifying Printcap with no filename587 disables printcap generation.588 .TP 5589 509 PrintcapFormat bsd 590 510 .TP 5 591 511 PrintcapFormat plist … … 594 514 .br 595 515 Specifies the format of the printcap file. 596 516 .TP 5 597 PrintcapGUI598 .TP 5599 PrintcapGUI gui-program-filename600 .br601 Specifies whether to generate option panel definition files on602 some operating systems. When provided with no program filename,603 disables option panel definition files.604 .TP 5605 517 ReloadTimeout seconds 606 518 .br 607 519 Specifies the amount of time to wait for job completion before 608 520 restarting the scheduler. 609 521 .TP 5 610 RemoteRoot user-name611 .br612 Specifies the username that is associated with unauthenticated root613 accesses.614 .TP 5615 RequestRoot directory616 .br617 Specifies the directory to store print jobs and other HTTP request618 data.619 .TP 5620 522 Require group group-name-list 621 523 .TP 5 622 524 Require user user-name-list … … 648 550 Specifies an alternate name that the server is known by. The special name "*" 649 551 allows any name to be used. 650 552 .TP 5 651 ServerBin directory652 .br653 Specifies the directory where backends, CGIs, daemons, and filters may654 be found.655 .TP 5656 ServerCertificate filename657 .br658 Specifies the encryption certificate to use.659 .TP 5660 ServerKey filename661 .br662 Specifies the encryption key to use.663 .TP 5664 553 ServerName hostname-or-ip-address 665 554 .br 666 555 Specifies the fully-qualified hostname of the server. 667 556 .TP 5 668 ServerRoot directory669 .br670 Specifies the directory where the server configuration files can be found.671 .TP 5672 557 ServerTokens Full 673 558 .TP 5 674 559 ServerTokens Major … … 732 617 "notify-events", "notify-pull-method", "notify-recipient-uri", 733 618 "notify-subscriber-user-name", and "notify-user-data". 734 619 .TP 5 735 SystemGroup group-name [group-name ...]736 .br737 Specifies the group(s) to use for System class authentication.738 .TP 5739 TempDir directory740 .br741 Specifies the directory where temporary files are stored.742 .TP 5743 620 Timeout seconds 744 621 .br 745 622 Specifies the HTTP request timeout in seconds. 746 623 .TP 5 747 User user-name748 .br749 Specifies the user name or ID that is used when running external programs.750 .TP 5751 624 WebInterface yes 752 625 .TP 5 753 626 WebInterface no 754 627 Specifies whether the web interface is enabled. 755 628 .SH SEE ALSO 756 \fIclasses.conf(5)\fR, \fIcups d(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, 758 631 \fIsubscriptions.conf(5)\fR, 759 632 .br 760 633 http://localhost:631/help -
TabularUnified packaging/cups.list.in
old new 534 534 d 0755 root $CUPS_GROUP $SERVERROOT/interfaces - 535 535 d 0755 root $CUPS_GROUP $SERVERROOT/ppd - 536 536 d 0700 root $CUPS_GROUP $SERVERROOT/ssl - 537 c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf conf/cups-files.conf 538 f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cups-files.conf.default conf/cups-files.conf 537 539 c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf conf/cupsd.conf 538 540 f $CUPS_PERM root $CUPS_GROUP $SERVERROOT/cupsd.conf.default conf/cupsd.conf 539 541 c $CUPS_PERM root $CUPS_GROUP $SERVERROOT/snmp.conf conf/snmp.conf -
TabularUnified packaging/cups.spec.in
old new 135 135 %defattr(-,root,root) 136 136 %dir /etc/cups 137 137 %config(noreplace) /etc/cups/*.conf 138 /etc/cups/cups-files.conf.default 138 139 /etc/cups/cupsd.conf.default 139 140 %dir /etc/cups/interfaces 140 141 %dir /etc/cups/ppd -
TabularUnified scheduler/client.c
old new 32 32 * compare_clients() - Compare two client connections. 33 33 * data_ready() - Check whether data is available from a client. 34 34 * get_file() - Get a filename and state info. 35 * install_c onf_file() - Install a configuration file.35 * install_cupsd_conf() - Install a configuration file. 36 36 * is_cgi() - Is the resource a CGI script/program? 37 37 * is_path_absolute() - Is a path absolute and free of relative elements 38 38 * (i.e. ".."). … … 95 95 static int data_ready(cupsd_client_t *con); 96 96 static char *get_file(cupsd_client_t *con, struct stat *filestats, 97 97 char *filename, int len); 98 static http_status_t install_c onf_file(cupsd_client_t *con);98 static http_status_t install_cupsd_conf(cupsd_client_t *con); 99 99 static int is_cgi(cupsd_client_t *con, const char *filename, 100 100 struct stat *filestats, mime_type_t *type); 101 101 static int is_path_absolute(const char *path); … … 1666 1666 * Validate the resource name... 1667 1667 */ 1668 1668 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")) 1672 1670 { 1673 1671 /* 1674 * PUT can only be done to configuration files under 1675 * /admin/conf... 1672 * PUT can only be done to the cupsd.conf file... 1676 1673 */ 1677 1674 1678 1675 cupsdLogMessage(CUPSD_LOG_ERROR, 1679 "[Client %d] Request for subdirectory\"%s\".",1676 "[Client %d] Disallowed PUT request for \"%s\".", 1680 1677 con->http.fd, con->uri); 1681 1678 1682 1679 if (!cupsdSendError(con, HTTP_FORBIDDEN, CUPSD_AUTH_NONE)) … … 2044 2041 * Install the configuration file... 2045 2042 */ 2046 2043 2047 status = install_c onf_file(con);2044 status = install_cupsd_conf(con); 2048 2045 2049 2046 /* 2050 2047 * Return the status to the client... … … 3301 3298 3302 3299 3303 3300 /* 3304 * 'install_c onf_file()' - Install a configuration file.3301 * 'install_cupsd_conf()' - Install a configuration file. 3305 3302 */ 3306 3303 3307 3304 static http_status_t /* O - Status */ 3308 install_c onf_file(cupsd_client_t *con) /* I - Connection */3305 install_cupsd_conf(cupsd_client_t *con) /* I - Connection */ 3309 3306 { 3310 3307 char filename[1024]; /* Configuration filename */ 3311 mode_t mode; /* Permissions */3312 3308 cups_file_t *in, /* Input file */ 3313 3309 *out; /* Output file */ 3314 3310 char buffer[16384]; /* Copy buffer */ … … 3330 3326 * Open the new config file... 3331 3327 */ 3332 3328 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) 3340 3331 { 3341 3332 cupsFileClose(in); 3342 3333 return (HTTP_SERVER_ERROR); … … 3381 3372 cupsdClearString(&con->filename); 3382 3373 3383 3374 /* 3384 * If the cupsd.conf file was updated, set the NeedReload flag...3375 * Set the NeedReload flag... 3385 3376 */ 3386 3377 3387 if (!strcmp(con->uri, "/admin/conf/cupsd.conf")) 3388 NeedReload = RELOAD_CUPSD; 3389 else 3390 NeedReload = RELOAD_ALL; 3391 3378 NeedReload = RELOAD_CUPSD; 3392 3379 ReloadTime = time(NULL); 3393 3380 3394 3381 /* -
TabularUnified scheduler/conf.c
old new 14 14 * 15 15 * Contents: 16 16 * 17 * cupsdAddAlias() 17 * cupsdAddAlias() - Add a host alias. 18 18 * cupsdCheckPermissions() - Fix the mode and ownership of a file or 19 * 19 * directory. 20 20 * cupsdDefaultAuthType() - Get the default AuthType. 21 21 * cupsdFreeAliases() - Free all of the alias entries. 22 22 * cupsdReadConfiguration() - Read the cupsd.conf file. 23 * get_address() 23 * get_address() - Get an address + port number from a line. 24 24 * get_addr_and_mask() - Get an IP address and netmask. 25 * mime_error_cb() 26 * parse_aaa() 27 * 25 * mime_error_cb() - Log a MIME error. 26 * parse_aaa() - Parse authentication, authorization, and access 27 * control lines. 28 28 * 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. 34 36 * set_policy_defaults() - Set default policy values as needed. 35 37 */ 36 38 … … 83 85 * Local globals... 84 86 */ 85 87 86 static int default_auth_type = CUPSD_AUTH_AUTO; 87 /* Default AuthType, if not specified */ 88 static const cupsd_var_t variables[] = 88 static const cupsd_var_t cupsd_vars[] = 89 89 { 90 { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING },91 90 { "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN }, 92 91 #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) 93 92 { "BrowseDNSSDSubTypes", &DNSSDSubTypes, CUPSD_VARTYPE_STRING }, … … 100 99 { "BrowseTimeout", &BrowseTimeout, CUPSD_VARTYPE_INTEGER }, 101 100 { "BrowseWebIF", &BrowseWebIF, CUPSD_VARTYPE_BOOLEAN }, 102 101 { "Browsing", &Browsing, CUPSD_VARTYPE_BOOLEAN }, 103 { "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING },104 102 { "Classification", &Classification, CUPSD_VARTYPE_STRING }, 105 103 { "ClassifyOverride", &ClassifyOverride, CUPSD_VARTYPE_BOOLEAN }, 106 { "ConfigFilePerm", &ConfigFilePerm, CUPSD_VARTYPE_INTEGER },107 { "DataDir", &DataDir, CUPSD_VARTYPE_STRING },108 104 { "DefaultLanguage", &DefaultLanguage, CUPSD_VARTYPE_STRING }, 109 105 { "DefaultLeaseDuration", &DefaultLeaseDuration, CUPSD_VARTYPE_TIME }, 110 106 { "DefaultPaperSize", &DefaultPaperSize, CUPSD_VARTYPE_STRING }, 111 107 { "DefaultPolicy", &DefaultPolicy, CUPSD_VARTYPE_STRING }, 112 108 { "DefaultShared", &DefaultShared, CUPSD_VARTYPE_BOOLEAN }, 113 109 { "DirtyCleanInterval", &DirtyCleanInterval, CUPSD_VARTYPE_TIME }, 114 { "DocumentRoot", &DocumentRoot, CUPSD_VARTYPE_STRING },115 { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING },116 110 { "ErrorPolicy", &ErrorPolicy, CUPSD_VARTYPE_STRING }, 117 { "FileDevice", &FileDevice, CUPSD_VARTYPE_BOOLEAN },118 111 { "FilterLimit", &FilterLimit, CUPSD_VARTYPE_INTEGER }, 119 112 { "FilterNice", &FilterNice, CUPSD_VARTYPE_INTEGER }, 120 { "FontPath", &FontPath, CUPSD_VARTYPE_STRING },121 113 #ifdef HAVE_GSSAPI 122 114 { "GSSServiceName", &GSSServiceName, CUPSD_VARTYPE_STRING }, 123 115 #endif /* HAVE_GSSAPI */ … … 135 127 { "LimitRequestBody", &MaxRequestSize, CUPSD_VARTYPE_INTEGER }, 136 128 { "ListenBackLog", &ListenBackLog, CUPSD_VARTYPE_INTEGER }, 137 129 { "LogDebugHistory", &LogDebugHistory, CUPSD_VARTYPE_INTEGER }, 138 { "LogFilePerm", &LogFilePerm, CUPSD_VARTYPE_INTEGER },139 { "LPDConfigFile", &LPDConfigFile, CUPSD_VARTYPE_STRING },140 130 { "MaxActiveJobs", &MaxActiveJobs, CUPSD_VARTYPE_INTEGER }, 141 131 { "MaxClients", &MaxClients, CUPSD_VARTYPE_INTEGER }, 142 132 { "MaxClientsPerHost", &MaxClientsPerHost, CUPSD_VARTYPE_INTEGER }, … … 155 145 { "MaxSubscriptionsPerPrinter",&MaxSubscriptionsPerPrinter, CUPSD_VARTYPE_INTEGER }, 156 146 { "MaxSubscriptionsPerUser", &MaxSubscriptionsPerUser, CUPSD_VARTYPE_INTEGER }, 157 147 { "MultipleOperationTimeout", &MultipleOperationTimeout, CUPSD_VARTYPE_TIME }, 158 { "PageLog", &PageLog, CUPSD_VARTYPE_STRING },159 148 { "PageLogFormat", &PageLogFormat, CUPSD_VARTYPE_STRING }, 160 149 { "PreserveJobFiles", &JobFiles, CUPSD_VARTYPE_TIME }, 161 150 { "PreserveJobHistory", &JobHistory, CUPSD_VARTYPE_TIME }, 162 { "Printcap", &Printcap, CUPSD_VARTYPE_STRING },163 { "PrintcapGUI", &PrintcapGUI, CUPSD_VARTYPE_STRING },164 151 { "ReloadTimeout", &ReloadTimeout, CUPSD_VARTYPE_TIME }, 165 { "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING },166 { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING },167 152 { "RIPCache", &RIPCache, CUPSD_VARTYPE_STRING }, 168 153 { "RootCertDuration", &RootCertDuration, CUPSD_VARTYPE_TIME }, 169 154 { "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 }; 161 static 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 }, 170 178 { "ServerBin", &ServerBin, CUPSD_VARTYPE_PATHNAME }, 171 179 #ifdef HAVE_SSL 172 180 { "ServerCertificate", &ServerCertificate, CUPSD_VARTYPE_PATHNAME }, … … 174 182 { "ServerKey", &ServerKey, CUPSD_VARTYPE_PATHNAME }, 175 183 # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ 176 184 #endif /* HAVE_SSL */ 177 { "ServerName", &ServerName, CUPSD_VARTYPE_STRING },178 185 { "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME }, 179 186 { "SMBConfigFile", &SMBConfigFile, CUPSD_VARTYPE_STRING }, 180 187 { "StateDir", &StateDir, CUPSD_VARTYPE_STRING }, 181 { "StrictConformance", &StrictConformance, CUPSD_VARTYPE_BOOLEAN },182 188 #ifdef HAVE_AUTHORIZATION_H 183 189 { "SystemGroupAuthKey", &SystemGroupAuthKey, CUPSD_VARTYPE_STRING }, 184 190 #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 } 190 192 }; 191 #define NUM_VARS (sizeof(variables) / sizeof(variables[0]))192 193 194 static int default_auth_type = CUPSD_AUTH_AUTO; 195 /* Default AuthType, if not specified */ 193 196 194 197 static const unsigned ones[4] = 195 198 { … … 214 217 static int parse_fatal_errors(const char *s); 215 218 static int parse_groups(const char *s); 216 219 static int parse_protocols(const char *s); 217 static int read_configuration(cups_file_t *fp); 220 static 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); 224 static int read_cupsd_conf(cups_file_t *fp); 225 static int read_cups_files_conf(cups_file_t *fp); 218 226 static int read_location(cups_file_t *fp, char *name, int linenum); 219 227 static int read_policy(cups_file_t *fp, char *name, int linenum); 220 228 static void set_policy_defaults(cupsd_policy_t *pol); … … 828 836 cupsdInitEnv(); 829 837 830 838 /* 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... 832 865 */ 833 866 834 867 if ((fp = cupsFileOpen(ConfigurationFile, "r")) == NULL) 868 { 869 cupsdLogMessage(CUPSD_LOG_CRIT, "Unable to open %s: %s", ConfigurationFile, 870 strerror(errno)); 835 871 return (0); 872 } 836 873 837 status = read_c onfiguration(fp);874 status = read_cupsd_conf(fp); 838 875 839 876 cupsFileClose(fp); 840 877 841 878 if (!status) 842 879 return (0); 843 880 844 if (!ErrorLog)845 cupsdSetString(&ErrorLog, CUPS_LOGDIR "/error_log");846 847 881 RunUser = getuid(); 848 882 849 883 cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.", … … 962 996 BrowseACL = cupsdFindLocation("CUPS_INTERNAL_BROWSE_ACL"); 963 997 964 998 /* 999 * Make sure ConfigFilePerm and LogFilePerm have sane values... 1000 */ 1001 1002 ConfigFilePerm &= 0664; 1003 LogFilePerm &= 0664; 1004 1005 /* 965 1006 * Open the system log for cupsd if necessary... 966 1007 */ 967 1008 … … 2627 2668 2628 2669 2629 2670 /* 2630 * ' read_configuration()' - Read a configuration file.2671 * 'parse_variable()' - Parse a variable line. 2631 2672 */ 2632 2673 2633 2674 static int /* O - 1 on success, 0 on failure */ 2634 read_configuration(cups_file_t *fp) /* I - File to read from */ 2675 parse_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 2906 static int /* O - 1 on success, 0 on failure */ 2907 read_cupsd_conf(cups_file_t *fp) /* I - File to read from */ 2635 2908 { 2636 int i; /* Looping var */2637 2909 int linenum; /* Current line number */ 2638 2910 char line[HTTP_MAX_BUFFER], 2639 2911 /* Line from file */ … … 2643 2915 *value, /* Pointer to value */ 2644 2916 *valueptr; /* Pointer into value */ 2645 2917 int valuelen; /* Length of value */ 2646 cupsd_var_t const *var; /* Current variable */2647 2918 http_addrlist_t *addrlist, /* Address list */ 2648 2919 *addr; /* Current address */ 2649 2920 unsigned ip[4], /* Address value */ … … 2653 2924 cupsd_location_t *location; /* Browse location */ 2654 2925 cups_file_t *incfile; /* Include file */ 2655 2926 char incname[1024]; /* Include filename */ 2656 struct group *group; /* Group */2657 2927 2658 2928 2659 2929 /* … … 2685 2955 incname, strerror(errno)); 2686 2956 else 2687 2957 { 2688 read_c onfiguration(incfile);2958 read_cupsd_conf(incfile); 2689 2959 cupsFileClose(incfile); 2690 2960 } 2691 2961 } … … 2709 2979 if (linenum == 0) 2710 2980 return (0); 2711 2981 } 2712 else if (!_cups_strcasecmp(line, "FatalErrors"))2713 FatalErrors = parse_fatal_errors(value);2714 2982 else if (!_cups_strcasecmp(line, "FaxRetryInterval") && value) 2715 2983 { 2716 2984 JobRetryInterval = atoi(value); … … 3319 3587 cupsdLogMessage(CUPSD_LOG_INFO, "Polling %s:%d", pollp->hostname, 3320 3588 pollp->port); 3321 3589 } 3322 else if (!_cups_strcasecmp(line, " default_auth_type") && value)3590 else if (!_cups_strcasecmp(line, "DefaultAuthType") && value) 3323 3591 { 3324 3592 /* 3325 * default_auth_type {basic,digest,basicdigest,negotiate}3593 * DefaultAuthType {basic,digest,basicdigest,negotiate} 3326 3594 */ 3327 3595 3328 3596 if (!_cups_strcasecmp(value, "none")) … … 3371 3639 } 3372 3640 } 3373 3641 #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 else3391 User = atoi(value);3392 }3393 else3394 {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 else3409 User = p->pw_uid;3410 }3411 else3412 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 else3426 {3427 endgrent();3428 group = getgrnam(value);3429 3430 if (group != NULL)3431 Group = group->gr_gid;3432 else3433 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 }3449 3642 else if (!_cups_strcasecmp(line, "HostNameLookups") && value) 3450 3643 { 3451 3644 /* … … 3524 3717 cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogTimeFormat %s on line %d.", 3525 3718 value, linenum); 3526 3719 } 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 else3540 cupsdLogMessage(CUPSD_LOG_WARN, "Unknown PrintcapFormat %s on line %d.",3541 value, linenum);3542 }3543 3720 else if (!_cups_strcasecmp(line, "ServerTokens") && value) 3544 3721 { 3545 3722 /* … … 3665 3842 "line %d.", value, linenum); 3666 3843 } 3667 3844 #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 } 3668 3878 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 3891 static int /* O - 1 on success, 0 on failure */ 3892 read_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) 3669 3911 { 3670 3912 /* 3671 * Find a simple variable in the list...3913 * Group ID to run as... 3672 3914 */ 3673 3915 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 3679 3919 { 3680 /* 3681 * Unknown directive! Output an error message and continue... 3682 */ 3920 endgrent(); 3921 group = getgrnam(value); 3683 3922 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; 3687 3925 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 } 3691 3933 } 3934 } 3935 else if (!_cups_strcasecmp(line, "PrintcapFormat") && value) 3936 { 3937 /* 3938 * Format of printcap file? 3939 */ 3692 3940 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 3694 3948 { 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 */ 3793 3961 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 */ 3816 3976 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); 3825 3980 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 */ 3830 3997 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); 3838 4000 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 } 3842 4024 } 3843 4025 } 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); 3844 4031 } 3845 4032 3846 4033 return (1); -
TabularUnified scheduler/conf.h
old new 96 96 */ 97 97 98 98 VAR 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 */ 100 102 *ServerName VALUE(NULL), 101 103 /* FQDN for server */ 102 104 *ServerAdmin VALUE(NULL), -
TabularUnified scheduler/main.c
old new 210 210 211 211 char *current; /* Current directory */ 212 212 213 214 213 /* 215 214 * Allocate a buffer for the current working directory to 216 215 * reduce run-time stack usage; this approximates the … … 274 273 UseProfiles = 0; 275 274 break; 276 275 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 277 299 #ifdef __APPLE__ 278 300 case 'S' : /* Disable system management functions */ 279 301 fputs("cupsd: -S (disable system management) for internal " … … 301 323 } 302 324 303 325 if (!ConfigurationFile) 326 { 304 327 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 } 305 359 306 360 /* 307 361 * If the user hasn't specified "-f", run in the background... -
TabularUnified test/run-stp-tests.sh
old new 385 385 cat >/tmp/cups-$user/cupsd.conf <<EOF 386 386 StrictConformance Yes 387 387 Browsing Off 388 FileDevice yes389 Printcap390 388 Listen localhost:$port 391 User $user392 ServerRoot /tmp/cups-$user393 StateDir /tmp/cups-$user394 ServerBin /tmp/cups-$user/bin395 CacheDir /tmp/cups-$user/share396 DataDir /tmp/cups-$user/share397 FontPath /tmp/cups-$user/share/fonts398 389 PassEnv LOCALEDIR 399 390 PassEnv DYLD_INSERT_LIBRARIES 400 DocumentRoot $root/doc401 RequestRoot /tmp/cups-$user/spool402 TempDir /tmp/cups-$user/spool/temp403 PidFile /tmp/cups-$user/cupsd.pid404 391 MaxSubscriptions 3 405 392 MaxLogSize 0 406 AccessLog /tmp/cups-$user/log/access_log407 ErrorLog /tmp/cups-$user/log/error_log408 PageLog /tmp/cups-$user/log/page_log409 393 AccessLogLevel actions 410 394 LogLevel debug2 411 395 LogTimeFormat usecs … … 418 402 </Policy> 419 403 EOF 420 404 405 cat >/tmp/cups-$user/cups-files.conf <<EOF 406 FileDevice yes 407 Printcap 408 User $user 409 ServerRoot /tmp/cups-$user 410 StateDir /tmp/cups-$user 411 ServerBin /tmp/cups-$user/bin 412 CacheDir /tmp/cups-$user/share 413 DataDir /tmp/cups-$user/share 414 FontPath /tmp/cups-$user/share/fonts 415 DocumentRoot $root/doc 416 RequestRoot /tmp/cups-$user/spool 417 TempDir /tmp/cups-$user/spool/temp 418 AccessLog /tmp/cups-$user/log/access_log 419 ErrorLog /tmp/cups-$user/log/error_log 420 PageLog /tmp/cups-$user/log/page_log 421 PidFile /tmp/cups-$user/cupsd.pid 422 EOF 423 421 424 # 422 425 # Setup lots of test queues - half with PPD files, half without... 423 426 #