]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
f2d18633 | 2 | * "$Id$" |
ef416fc2 | 3 | * |
7e86f2f6 | 4 | * Configuration file definitions for the CUPS scheduler. |
ef416fc2 | 5 | * |
a1797929 | 6 | * Copyright 2007-2015 by Apple Inc. |
7e86f2f6 | 7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | * |
7e86f2f6 MS |
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/". | |
ef416fc2 | 14 | */ |
15 | ||
16 | ||
17 | /* | |
18 | * Log levels... | |
19 | */ | |
20 | ||
21 | typedef enum | |
22 | { | |
a469f8a5 | 23 | CUPSD_LOG_PPD = -5, /* Used internally for PPD keywords */ |
c9fc04c6 | 24 | CUPSD_LOG_ATTR, /* Used internally for attributes */ |
a469f8a5 MS |
25 | CUPSD_LOG_STATE, /* Used internally for printer-state-reasons */ |
26 | CUPSD_LOG_JOBSTATE, /* Used internally for job-state-reasons */ | |
f7deaa1a | 27 | CUPSD_LOG_PAGE, /* Used internally for page logging */ |
ef416fc2 | 28 | CUPSD_LOG_NONE, |
f7deaa1a | 29 | CUPSD_LOG_EMERG, /* Emergency issues */ |
30 | CUPSD_LOG_ALERT, /* Something bad happened that needs attention */ | |
31 | CUPSD_LOG_CRIT, /* Critical error but server continues */ | |
32 | CUPSD_LOG_ERROR, /* Error condition */ | |
33 | CUPSD_LOG_WARN, /* Warning */ | |
34 | CUPSD_LOG_NOTICE, /* Normal condition that needs logging */ | |
35 | CUPSD_LOG_INFO, /* General information */ | |
36 | CUPSD_LOG_DEBUG, /* General debugging */ | |
37 | CUPSD_LOG_DEBUG2 /* Detailed debugging */ | |
ef416fc2 | 38 | } cupsd_loglevel_t; |
39 | ||
1f0275e3 MS |
40 | typedef enum |
41 | { | |
c9dcc485 | 42 | CUPSD_ACCESSLOG_NONE, /* Log no requests */ |
1f0275e3 MS |
43 | CUPSD_ACCESSLOG_CONFIG, /* Log config requests */ |
44 | CUPSD_ACCESSLOG_ACTIONS, /* Log config, print, and job management requests */ | |
45 | CUPSD_ACCESSLOG_ALL /* Log everything */ | |
46 | } cupsd_accesslog_t; | |
47 | ||
dfd5680b MS |
48 | typedef enum |
49 | { | |
50 | CUPSD_TIME_STANDARD, /* "Standard" Apache/CLF format */ | |
51 | CUPSD_TIME_USECS /* Standard format with microseconds */ | |
52 | } cupsd_time_t; | |
53 | ||
8fe0183a MS |
54 | typedef enum |
55 | { | |
56 | CUPSD_SANDBOXING_OFF, /* No sandboxing */ | |
57 | CUPSD_SANDBOXING_RELAXED, /* Relaxed sandboxing */ | |
58 | CUPSD_SANDBOXING_STRICT /* Strict sandboxing */ | |
59 | } cupsd_sandboxing_t; | |
60 | ||
ef416fc2 | 61 | |
49d87452 MS |
62 | /* |
63 | * FatalErrors flags... | |
64 | */ | |
65 | ||
66 | #define CUPSD_FATAL_NONE 0 /* No errors are fatal */ | |
67 | #define CUPSD_FATAL_BROWSE 1 /* Browse bind errors are fatal */ | |
68 | #define CUPSD_FATAL_CONFIG 2 /* Config file syntax errors are fatal */ | |
69 | #define CUPSD_FATAL_LISTEN 4 /* Listen/Port bind errors are fatal */ | |
70 | #define CUPSD_FATAL_LOG 8 /* Log file errors are fatal */ | |
71 | #define CUPSD_FATAL_PERMISSIONS 16 /* File permission errors are fatal */ | |
72 | #define CUPSD_FATAL_ALL ~0 /* All errors are fatal */ | |
73 | ||
74 | ||
ef416fc2 | 75 | /* |
76 | * Printcap formats... | |
77 | */ | |
78 | ||
f7deaa1a | 79 | #define PRINTCAP_BSD 0 /* Berkeley LPD format */ |
80 | #define PRINTCAP_SOLARIS 1 /* Solaris lpsched format */ | |
f3c17241 | 81 | #define PRINTCAP_PLIST 2 /* OS X plist format */ |
ef416fc2 | 82 | |
83 | ||
e07d4801 MS |
84 | /* |
85 | * ServerAlias data... | |
86 | */ | |
87 | ||
88 | typedef struct | |
89 | { | |
90 | size_t namelen; /* Length of alias name */ | |
91 | char name[1]; /* Alias name */ | |
92 | } cupsd_alias_t; | |
93 | ||
94 | ||
ef416fc2 | 95 | /* |
96 | * Globals... | |
97 | */ | |
98 | ||
99 | VAR char *ConfigurationFile VALUE(NULL), | |
c41769ff MS |
100 | /* cupsd.conf file to use */ |
101 | *CupsFilesFile VALUE(NULL), | |
102 | /* cups-files.conf file to use */ | |
ef416fc2 | 103 | *ServerName VALUE(NULL), |
104 | /* FQDN for server */ | |
105 | *ServerAdmin VALUE(NULL), | |
106 | /* Administrator's email */ | |
107 | *ServerRoot VALUE(NULL), | |
108 | /* Root directory for scheduler */ | |
109 | *ServerBin VALUE(NULL), | |
110 | /* Root directory for binaries */ | |
111 | *StateDir VALUE(NULL), | |
112 | /* Root directory for state data */ | |
113 | *RequestRoot VALUE(NULL), | |
114 | /* Directory for request files */ | |
115 | *DocumentRoot VALUE(NULL); | |
116 | /* Root directory for documents */ | |
e07d4801 MS |
117 | VAR cups_array_t *ServerAlias VALUE(NULL); |
118 | /* Alias names for server */ | |
f11a948a | 119 | VAR int ServerNameIsIP VALUE(0); |
d1c13e16 | 120 | /* Is the ServerName an IP address? */ |
ef416fc2 | 121 | VAR int NumSystemGroups VALUE(0); |
122 | /* Number of system group names */ | |
ac884b6a MS |
123 | VAR char *SystemGroups[MAX_SYSTEM_GROUPS] |
124 | VALUE({0}); | |
ef416fc2 | 125 | /* System group names */ |
ac884b6a MS |
126 | VAR gid_t SystemGroupIDs[MAX_SYSTEM_GROUPS] |
127 | VALUE({0}); | |
ef416fc2 | 128 | /* System group IDs */ |
129 | VAR char *AccessLog VALUE(NULL), | |
130 | /* Access log filename */ | |
131 | *ErrorLog VALUE(NULL), | |
132 | /* Error log filename */ | |
133 | *PageLog VALUE(NULL), | |
134 | /* Page log filename */ | |
135 | *CacheDir VALUE(NULL), | |
136 | /* Cache file directory */ | |
137 | *DataDir VALUE(NULL), | |
138 | /* Data file directory */ | |
139 | *DefaultLanguage VALUE(NULL), | |
140 | /* Default language encoding */ | |
ef416fc2 | 141 | *DefaultLocale VALUE(NULL), |
142 | /* Default locale */ | |
c5571a1d MS |
143 | *DefaultPaperSize VALUE(NULL), |
144 | /* Default paper size */ | |
323c5de1 | 145 | *ErrorPolicy VALUE(NULL), |
146 | /* Default printer-error-policy */ | |
ef416fc2 | 147 | *RIPCache VALUE(NULL), |
148 | /* Amount of memory for RIPs */ | |
149 | *TempDir VALUE(NULL), | |
150 | /* Temporary directory */ | |
151 | *Printcap VALUE(NULL), | |
152 | /* Printcap file */ | |
ef416fc2 | 153 | *FontPath VALUE(NULL), |
154 | /* Font search path */ | |
155 | *RemoteRoot VALUE(NULL), | |
156 | /* Remote root user */ | |
157 | *Classification VALUE(NULL); | |
158 | /* Classification of system */ | |
7e86f2f6 | 159 | VAR uid_t User VALUE(1), |
ef416fc2 | 160 | /* User ID for server */ |
7e86f2f6 MS |
161 | RunUser VALUE(0); |
162 | /* User to run as, used for files */ | |
ef416fc2 | 163 | VAR gid_t Group VALUE(0); |
164 | /* Group ID for server */ | |
dfd5680b | 165 | VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS); |
1f0275e3 | 166 | /* Access log level */ |
dfd5680b | 167 | VAR int ClassifyOverride VALUE(0), |
ef416fc2 | 168 | /* Allow overrides? */ |
178cb736 MS |
169 | LogDebugHistory VALUE(200), |
170 | /* Amount of automatic debug history */ | |
49d87452 MS |
171 | FatalErrors VALUE(CUPSD_FATAL_CONFIG), |
172 | /* Which errors are fatal? */ | |
a29fd7dd MS |
173 | StrictConformance VALUE(FALSE), |
174 | /* Require strict IPP conformance? */ | |
7e86f2f6 | 175 | SyncOnClose VALUE(FALSE); |
8a259669 | 176 | /* Call fsync() when closing files? */ |
7e86f2f6 MS |
177 | VAR mode_t ConfigFilePerm VALUE(0640U), |
178 | /* Permissions for config files */ | |
179 | LogFilePerm VALUE(0644U); | |
ef416fc2 | 180 | /* Permissions for log files */ |
dfd5680b | 181 | VAR cupsd_loglevel_t LogLevel VALUE(CUPSD_LOG_WARN); |
1f0275e3 | 182 | /* Error log level */ |
dfd5680b MS |
183 | VAR cupsd_time_t LogTimeFormat VALUE(CUPSD_TIME_STANDARD); |
184 | /* Log file time format */ | |
a1797929 MS |
185 | VAR cups_file_t *LogStderr VALUE(NULL); |
186 | /* Stderr file, if any */ | |
8fe0183a MS |
187 | VAR cupsd_sandboxing_t Sandboxing VALUE(CUPSD_SANDBOXING_STRICT); |
188 | /* Sandboxing level */ | |
189 | VAR int UseSandboxing VALUE(1); | |
190 | /* Use sandboxing for child procs? */ | |
dfd5680b | 191 | VAR int MaxClients VALUE(100), |
ef416fc2 | 192 | /* Maximum number of clients */ |
193 | MaxClientsPerHost VALUE(0), | |
194 | /* Maximum number of clients per host */ | |
f7deaa1a | 195 | MaxCopies VALUE(CUPS_DEFAULT_MAX_COPIES), |
ef416fc2 | 196 | /* Maximum number of copies per job */ |
197 | MaxLogSize VALUE(1024 * 1024), | |
198 | /* Maximum size of log files */ | |
ef416fc2 | 199 | MaxRequestSize VALUE(0), |
200 | /* Maximum size of IPP requests */ | |
201 | HostNameLookups VALUE(FALSE), | |
202 | /* Do we do reverse lookups? */ | |
203 | Timeout VALUE(DEFAULT_TIMEOUT), | |
204 | /* Timeout during requests */ | |
205 | KeepAlive VALUE(TRUE), | |
206 | /* Support the Keep-Alive option? */ | |
207 | KeepAliveTimeout VALUE(DEFAULT_KEEPALIVE), | |
208 | /* Timeout between requests */ | |
ef416fc2 | 209 | FileDevice VALUE(FALSE), |
210 | /* Allow file: devices? */ | |
211 | FilterLimit VALUE(0), | |
212 | /* Max filter cost at any time */ | |
213 | FilterLevel VALUE(0), | |
214 | /* Current filter level */ | |
215 | FilterNice VALUE(0), | |
216 | /* Nice value for filters */ | |
49d87452 | 217 | ReloadTimeout VALUE(DEFAULT_KEEPALIVE), |
ef416fc2 | 218 | /* Timeout before reload from SIGHUP */ |
219 | RootCertDuration VALUE(300), | |
220 | /* Root certificate update interval */ | |
fa73b229 | 221 | PrintcapFormat VALUE(PRINTCAP_BSD), |
ef416fc2 | 222 | /* Format of printcap file? */ |
dfd5680b | 223 | DefaultShared VALUE(TRUE), |
fa73b229 | 224 | /* Share printers by default? */ |
229681c1 | 225 | MultipleOperationTimeout VALUE(DEFAULT_TIMEOUT), |
dfd5680b | 226 | /* multiple-operation-time-out value */ |
229681c1 MS |
227 | WebInterface VALUE(CUPS_DEFAULT_WEBIF); |
228 | /* Enable the web interface? */ | |
ef416fc2 | 229 | VAR cups_file_t *AccessFile VALUE(NULL), |
230 | /* Access log file */ | |
231 | *ErrorFile VALUE(NULL), | |
232 | /* Error log file */ | |
233 | *PageFile VALUE(NULL); | |
234 | /* Page log file */ | |
01ce6322 MS |
235 | VAR char *PageLogFormat VALUE(NULL); |
236 | /* Page log format */ | |
ef416fc2 | 237 | VAR mime_t *MimeDatabase VALUE(NULL); |
238 | /* MIME type database */ | |
239 | VAR int NumMimeTypes VALUE(0); | |
240 | /* Number of MIME types */ | |
241 | VAR const char **MimeTypes VALUE(NULL); | |
242 | /* Array of MIME types */ | |
243 | ||
244 | #ifdef HAVE_SSL | |
72d05bc9 MS |
245 | VAR char *ServerKeychain VALUE(NULL); |
246 | /* Keychain holding cert + key */ | |
ef416fc2 | 247 | #endif /* HAVE_SSL */ |
248 | ||
1720786e MS |
249 | #if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD) |
250 | VAR int IdleExitTimeout VALUE(60); | |
a4d04587 | 251 | /* Time after which an idle cupsd will exit */ |
1720786e | 252 | #endif /* HAVE_LAUNCHD || HAVE_SYSTEMD */ |
ef416fc2 | 253 | |
f7deaa1a | 254 | #ifdef HAVE_AUTHORIZATION_H |
255 | VAR char *SystemGroupAuthKey VALUE(NULL); | |
256 | /* System group auth key */ | |
257 | #endif /* HAVE_AUTHORIZATION_H */ | |
258 | ||
dcb445bc MS |
259 | #ifdef HAVE_GSSAPI |
260 | VAR char *GSSServiceName VALUE(NULL); | |
261 | /* GSS service name */ | |
262 | int HaveServerCreds VALUE(0); | |
263 | /* Do we have server credentials? */ | |
264 | gss_cred_id_t ServerCreds; /* Server's GSS credentials */ | |
265 | #endif /* HAVE_GSSAPI */ | |
266 | ||
f7deaa1a | 267 | |
ef416fc2 | 268 | /* |
269 | * Prototypes... | |
270 | */ | |
271 | ||
e07d4801 | 272 | extern void cupsdAddAlias(cups_array_t *aliases, const char *name); |
22c9029b | 273 | extern int cupsdCheckLogFile(cups_file_t **lf, const char *logname); |
b94498cf | 274 | extern int cupsdCheckPermissions(const char *filename, |
7e86f2f6 MS |
275 | const char *suffix, mode_t mode, |
276 | uid_t user, gid_t group, int is_dir, | |
b94498cf | 277 | int create_dir); |
22c9029b | 278 | extern int cupsdCheckProgram(const char *filename, cupsd_printer_t *p); |
dcb445bc | 279 | extern int cupsdDefaultAuthType(void); |
e07d4801 | 280 | extern void cupsdFreeAliases(cups_array_t *aliases); |
dfd5680b | 281 | extern char *cupsdGetDateTime(struct timeval *t, cupsd_time_t format); |
996acce8 MS |
282 | extern int cupsdLogClient(cupsd_client_t *con, int level, |
283 | const char *message, ...) | |
284 | __attribute__((__format__(__printf__, 3, 4))); | |
22c9029b MS |
285 | extern void cupsdLogFCMessage(void *context, _cups_fc_result_t result, |
286 | const char *message); | |
f7deaa1a | 287 | #ifdef HAVE_GSSAPI |
7e86f2f6 MS |
288 | extern int cupsdLogGSSMessage(int level, OM_uint32 major_status, |
289 | OM_uint32 minor_status, | |
f7deaa1a | 290 | const char *message, ...); |
291 | #endif /* HAVE_GSSAPI */ | |
85dda01c MS |
292 | extern int cupsdLogJob(cupsd_job_t *job, int level, const char *message, |
293 | ...) __attribute__((__format__(__printf__, 3, 4))); | |
ef416fc2 | 294 | extern int cupsdLogMessage(int level, const char *message, ...) |
85dda01c | 295 | __attribute__ ((__format__ (__printf__, 2, 3))); |
ef416fc2 | 296 | extern int cupsdLogPage(cupsd_job_t *job, const char *page); |
f7deaa1a | 297 | extern int cupsdLogRequest(cupsd_client_t *con, http_status_t code); |
b94498cf | 298 | extern int cupsdReadConfiguration(void); |
75bd9771 | 299 | extern int cupsdWriteErrorLog(int level, const char *message); |
ef416fc2 | 300 | |
301 | ||
302 | /* | |
f2d18633 | 303 | * End of "$Id$". |
ef416fc2 | 304 | */ |