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