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