]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/conf.h
Merge changes from CUPS 1.4svn-r7961.
[thirdparty/cups.git] / scheduler / conf.h
index 314a0d7c6f93f16a9520963f35f18d2f38a69ff9..e53f13f44aeb6e7f2a2bc3d2388271445786550f 100644 (file)
@@ -1,26 +1,17 @@
 /*
- * "$Id: conf.h 4719 2005-09-28 21:12:44Z mike $"
+ * "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $"
  *
  *   Configuration file definitions for the Common UNIX Printing System (CUPS)
  *   scheduler.
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ *   Copyright 2007-2008 by Apple Inc.
+ *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  */
 
 
 
 typedef enum
 {
-  CUPSD_LOG_ATTR = -3,         /* Used internally for attributes */
-  CUPSD_LOG_STATE,             /* Used internally for state-reasons */
-  CUPSD_LOG_PAGE,              /* Used internally for page logging */
+  CUPSD_LOG_PPD = -4,                  /* Used internally for PPD keywords */
+  CUPSD_LOG_ATTR,                      /* Used internally for attributes */
+  CUPSD_LOG_STATE,                     /* Used internally for state-reasons */
+  CUPSD_LOG_PAGE,                      /* Used internally for page logging */
   CUPSD_LOG_NONE,
-  CUPSD_LOG_EMERG,             /* Emergency issues */
-  CUPSD_LOG_ALERT,             /* Something bad happened that needs attention */
-  CUPSD_LOG_CRIT,              /* Critical error but server continues */
-  CUPSD_LOG_ERROR,             /* Error condition */
-  CUPSD_LOG_WARN,              /* Warning */
-  CUPSD_LOG_NOTICE,            /* Normal condition that needs logging */
-  CUPSD_LOG_INFO,              /* General information */
-  CUPSD_LOG_DEBUG,             /* General debugging */
-  CUPSD_LOG_DEBUG2             /* Detailed debugging */
+  CUPSD_LOG_EMERG,                     /* Emergency issues */
+  CUPSD_LOG_ALERT,                     /* Something bad happened that needs attention */
+  CUPSD_LOG_CRIT,                      /* Critical error but server continues */
+  CUPSD_LOG_ERROR,                     /* Error condition */
+  CUPSD_LOG_WARN,                      /* Warning */
+  CUPSD_LOG_NOTICE,                    /* Normal condition that needs logging */
+  CUPSD_LOG_INFO,                      /* General information */
+  CUPSD_LOG_DEBUG,                     /* General debugging */
+  CUPSD_LOG_DEBUG2                     /* Detailed debugging */
 } cupsd_loglevel_t;
 
+typedef enum
+{
+  CUPSD_ACCESSLOG_CONFIG,              /* Log config requests */
+  CUPSD_ACCESSLOG_ACTIONS,             /* Log config, print, and job management requests */
+  CUPSD_ACCESSLOG_ALL                  /* Log everything */
+} cupsd_accesslog_t;
+
+
+/*
+ * FatalErrors flags...
+ */
+
+#define CUPSD_FATAL_NONE       0       /* No errors are fatal */
+#define CUPSD_FATAL_BROWSE     1       /* Browse bind errors are fatal */
+#define CUPSD_FATAL_CONFIG     2       /* Config file syntax errors are fatal */
+#define CUPSD_FATAL_LISTEN     4       /* Listen/Port bind errors are fatal */
+#define CUPSD_FATAL_LOG                8       /* Log file errors are fatal */
+#define CUPSD_FATAL_PERMISSIONS        16      /* File permission errors are fatal */
+#define CUPSD_FATAL_ALL                ~0      /* All errors are fatal */
+
 
 /*
  * Printcap formats...
  */
 
-#define PRINTCAP_BSD   0       /* Berkeley LPD format */
-#define PRINTCAP_SOLARIS 1     /* Solaris lpsched format */
+#define PRINTCAP_BSD           0       /* Berkeley LPD format */
+#define PRINTCAP_SOLARIS       1       /* Solaris lpsched format */
+
+
+/*
+ * SSL options (bits)...
+ */
+
+#define CUPSD_SSL_NONE         0       /* No special options */
+#define CUPSD_SSL_NOEMPTY      1       /* Do not insert empty fragments */
 
 
 /*
@@ -74,11 +94,14 @@ VAR char            *ConfigurationFile      VALUE(NULL),
                                        /* Directory for request files */
                        *DocumentRoot           VALUE(NULL);
                                        /* Root directory for documents */
+VAR int                        ServerNameIsIP          VALUE(0);
 VAR int                        NumSystemGroups         VALUE(0);
                                        /* Number of system group names */
-VAR char               *SystemGroups[MAX_SYSTEM_GROUPS];
+VAR char               *SystemGroups[MAX_SYSTEM_GROUPS]
+                                               VALUE({0});
                                        /* System group names */
-VAR int                        SystemGroupIDs[MAX_SYSTEM_GROUPS];
+VAR gid_t              SystemGroupIDs[MAX_SYSTEM_GROUPS]
+                                               VALUE({0});
                                        /* System group IDs */
 VAR char               *AccessLog              VALUE(NULL),
                                        /* Access log filename */
@@ -96,6 +119,10 @@ VAR char            *AccessLog              VALUE(NULL),
                                        /* Default charset */
                        *DefaultLocale          VALUE(NULL),
                                        /* Default locale */
+                       *DefaultPaperSize       VALUE(NULL),
+                                       /* Default paper size */
+                       *ErrorPolicy            VALUE(NULL),
+                                       /* Default printer-error-policy */
                        *RIPCache               VALUE(NULL),
                                        /* Amount of memory for RIPs */
                        *TempDir                VALUE(NULL),
@@ -110,23 +137,33 @@ VAR char          *AccessLog              VALUE(NULL),
                                        /* Remote root user */
                        *Classification         VALUE(NULL);
                                        /* Classification of system */
+#ifdef HAVE_GSSAPI
+VAR char               *GSSServiceName         VALUE(NULL);
+                                       /* GSS service name */
+VAR char               *Krb5Keytab             VALUE(NULL);
+                                       /* Kerberos Keytab */
+#endif /* HAVE_GSSAPI */
 VAR uid_t              User                    VALUE(1);
                                        /* User ID for server */
 VAR gid_t              Group                   VALUE(0);
                                        /* Group ID for server */
-VAR int                        ClassifyOverride        VALUE(0),
+VAR int                        AccessLogLevel          VALUE(CUPSD_ACCESSLOG_ACTIONS),
+                                       /* Access log level */
+                       ClassifyOverride        VALUE(0),
                                        /* Allow overrides? */
                        ConfigFilePerm          VALUE(0640),
                                        /* Permissions for config files */
+                       FatalErrors             VALUE(CUPSD_FATAL_CONFIG),
+                                       /* Which errors are fatal? */
                        LogFilePerm             VALUE(0644),
                                        /* Permissions for log files */
-                       LogLevel                VALUE(CUPSD_LOG_ERROR),
-                                       /* Log level */
+                       LogLevel                VALUE(CUPSD_LOG_WARN),
+                                       /* Error log level */
                        MaxClients              VALUE(0),
                                        /* Maximum number of clients */
                        MaxClientsPerHost       VALUE(0),
                                        /* Maximum number of clients per host */
-                       MaxCopies               VALUE(100),
+                       MaxCopies               VALUE(CUPS_DEFAULT_MAX_COPIES),
                                        /* Maximum number of copies per job */
                        MaxLogSize              VALUE(1024 * 1024),
                                        /* Maximum size of log files */
@@ -156,21 +193,24 @@ VAR int                   ClassifyOverride        VALUE(0),
                                        /* Current filter level */
                        FilterNice              VALUE(0),
                                        /* Nice value for filters */
-                       ReloadTimeout           VALUE(0),
+                       ReloadTimeout           VALUE(DEFAULT_KEEPALIVE),
                                        /* Timeout before reload from SIGHUP */
                        RootCertDuration        VALUE(300),
                                        /* Root certificate update interval */
-                       RunAsUser               VALUE(FALSE),
-                                       /* Run as unpriviledged user? */
-                       RunUser,        /* User to run as, used for files */
-                       PrintcapFormat          VALUE(PRINTCAP_BSD);
+                       RunUser                 VALUE(0),
+                                       /* User to run as, used for files */
+                       PrintcapFormat          VALUE(PRINTCAP_BSD),
                                        /* Format of printcap file? */
+                       DefaultShared           VALUE(TRUE);
+                                       /* Share printers by default? */
 VAR cups_file_t                *AccessFile             VALUE(NULL),
                                        /* Access log file */
                        *ErrorFile              VALUE(NULL),
                                        /* Error log file */
                        *PageFile               VALUE(NULL);
                                        /* Page log file */
+VAR char               *PageLogFormat          VALUE(NULL);
+                                       /* Page log format */
 VAR mime_t             *MimeDatabase           VALUE(NULL);
                                        /* MIME type database */
 VAR int                        NumMimeTypes            VALUE(0);
@@ -184,28 +224,59 @@ VAR char          *ServerCertificate      VALUE(NULL);
 #  if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS)
 VAR char               *ServerKey              VALUE(NULL);
                                        /* Server key file */
-#  else
-VAR CFArrayRef         ServerCertificatesArray VALUE(NULL);
-                                       /* Array containing certificates */
 #  endif /* HAVE_LIBSSL || HAVE_GNUTLS */
+VAR int                        SSLOptions              VALUE(CUPSD_SSL_NONE);
+                                       /* SSL/TLS options */
 #endif /* HAVE_SSL */
 
+#ifdef HAVE_LAUNCHD
+VAR int                        LaunchdTimeout          VALUE(DEFAULT_KEEPALIVE);
+                                       /* Time after which an idle cupsd will exit */
+VAR char               *LaunchdConf            VALUE(NULL);
+                                       /* launchd(8) configuration file */
+#endif /* HAVE_LAUNCHD */
+
+#ifdef __APPLE__
+VAR int                        AppleQuotas             VALUE(TRUE);
+                                       /* Use Apple PrintService Quotas instead of CUPS quotas */
+#endif  /* __APPLE__ */
+
+#ifdef HAVE_AUTHORIZATION_H
+VAR char               *SystemGroupAuthKey     VALUE(NULL);
+                                       /* System group auth key */
+#endif /* HAVE_AUTHORIZATION_H */
+
 
 /*
  * Prototypes...
  */
 
+extern int     cupsdCheckPermissions(const char *filename,
+                                     const char *suffix, int mode,
+                                     int user, int group, int is_dir,
+                                     int create_dir);
 extern char    *cupsdGetDateTime(time_t t);
-extern int     cupsdReadConfiguration(void);
-extern int     cupsdLogRequest(cupsd_client_t *con, http_status_t code);
+#ifdef HAVE_GSSAPI
+extern int     cupsdLogGSSMessage(int level, int major_status,
+                                  int minor_status,
+                                  const char *message, ...);
+#endif /* HAVE_GSSAPI */
+extern int     cupsdLogJob(cupsd_job_t *job, int level, const char *message, ...)
+#ifdef __GNUC__
+__attribute__ ((__format__ (__printf__, 3, 4)))
+#endif /* __GNUC__ */
+;
 extern int     cupsdLogMessage(int level, const char *message, ...)
 #ifdef __GNUC__
 __attribute__ ((__format__ (__printf__, 2, 3)))
 #endif /* __GNUC__ */
 ;
 extern int     cupsdLogPage(cupsd_job_t *job, const char *page);
+extern int     cupsdLogRequest(cupsd_client_t *con, http_status_t code);
+extern int     cupsdReadConfiguration(void);
+extern int     cupsdWriteErrorLog(int level, const char *message);
 
 
 /*
- * End of "$Id: conf.h 4719 2005-09-28 21:12:44Z mike $".
+ * End of "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $".
  */