1 /*
2  * Configuration file for CUPS and Xcode.
3  *
4  * Copyright © 2021 by Michael R Sweet
5  * Copyright © 2007-2019 by Apple Inc.
6  * Copyright © 1997-2007 by Easy Software Products.
7  *
8  * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
9  */
10 
11 #ifndef _CUPS_CONFIG_H_
12 #define _CUPS_CONFIG_H_
13 
14 #include <AvailabilityMacros.h>
15 #include <TargetConditionals.h>
16 
17 
18 /*
19  * Version of software...
20  */
21 
22 #define CUPS_SVERSION "CUPS v2.3.3op2"
23 #define CUPS_MINIMAL "CUPS/2.3.3op2"
24 
25 
26 /*
27  * Default user and groups...
28  */
29 
30 #define CUPS_DEFAULT_USER "_lp"
31 #define CUPS_DEFAULT_GROUP "_lp"
32 #define CUPS_DEFAULT_SYSTEM_GROUPS "admin"
33 #define CUPS_DEFAULT_PRINTOPERATOR_AUTH "@AUTHKEY(system.print.operator) @admin @lpadmin"
34 #define CUPS_DEFAULT_SYSTEM_AUTHKEY "system.print.admin"
35 
36 
37 /*
38  * Default file permissions...
39  */
40 
41 #define CUPS_DEFAULT_CONFIG_FILE_PERM 0644
42 #define CUPS_DEFAULT_LOG_FILE_PERM 0644
43 
44 
45 /*
46  * Default logging settings...
47  */
48 
49 #define CUPS_DEFAULT_LOG_LEVEL "warn"
50 #define CUPS_DEFAULT_ACCESS_LOG_LEVEL "none"
51 #define CUPS_DEFAULT_MAX_LOG_SIZE "1m"
52 
53 
54 /*
55  * Default fatal error settings...
56  */
57 
58 #define CUPS_DEFAULT_FATAL_ERRORS "config"
59 
60 
61 /*
62  * Default browsing settings...
63  */
64 
65 #define CUPS_DEFAULT_BROWSING 1
66 #define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS "dnssd"
67 #define CUPS_DEFAULT_DEFAULT_SHARED 1
68 
69 
70 /*
71  * Default IPP port...
72  */
73 
74 #define CUPS_DEFAULT_IPP_PORT 631
75 
76 
77 /*
78  * Default printcap file...
79  */
80 
81 #define CUPS_DEFAULT_PRINTCAP "/Library/Preferences/org.cups.printers.plist"
82 
83 
84 /*
85  * Default Samba and LPD config files...
86  */
87 
88 #define CUPS_DEFAULT_SMB_CONFIG_FILE ""
89 #define CUPS_DEFAULT_LPD_CONFIG_FILE "launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
90 
91 
92 /*
93  * Default ErrorPolicy value...
94  */
95 
96 #define CUPS_DEFAULT_ERROR_POLICY "stop-printer"
97 
98 
99 /*
100  * Default MaxCopies value...
101  */
102 
103 #define CUPS_DEFAULT_MAX_COPIES 9999
104 
105 
106 /*
107  * Default SyncOnClose value...
108  */
109 
110 /* #undef CUPS_DEFAULT_SYNC_ON_CLOSE */
111 
112 
113 /*
114  * Do we have domain socket support, and if so what is the default one?
115  */
116 
117 #define CUPS_DEFAULT_DOMAINSOCKET "/private/var/run/cupsd"
118 
119 
120 /*
121  * Default WebInterface value...
122  */
123 
124 #define CUPS_DEFAULT_WEBIF 0
125 
126 
127 /*
128  * Where are files stored?
129  *
130  * Note: These are defaults, which can be overridden by environment
131  *       variables at run-time...
132  */
133 
134 #define CUPS_BINDIR "/usr/bin"
135 #define CUPS_CACHEDIR "/private/var/spool/cups/cache"
136 #define CUPS_DATADIR "/usr/share/cups"
137 #define CUPS_DOCROOT "/usr/share/doc/cups"
138 #define CUPS_FONTPATH "/usr/share/cups/fonts"
139 #define CUPS_LOCALEDIR "/usr/share/locale"
140 #define CUPS_LOGDIR "/private/var/log/cups"
141 #define CUPS_REQUESTS "/private/var/spool/cups"
142 #define CUPS_SBINDIR "/usr/sbin"
143 #define CUPS_SERVERBIN "/usr/libexec/cups"
144 #define CUPS_SERVERROOT "/private/etc/cups"
145 #define CUPS_STATEDIR "/private/etc/cups"
146 
147 
148 /*
149  * Do we have posix_spawn?
150  */
151 
152 #define HAVE_POSIX_SPAWN 1
153 
154 
155 /*
156  * Do we have ZLIB?
157  */
158 
159 #define HAVE_LIBZ 1
160 #define HAVE_INFLATECOPY 1
161 
162 
163 /*
164  * Do we have PAM stuff?
165  */
166 
167 #if TARGET_OS_OSX
168 #  define HAVE_LIBPAM 1
169 /* #undef HAVE_PAM_PAM_APPL_H */
170 #  define HAVE_PAM_SET_ITEM 1
171 #  define HAVE_PAM_SETCRED 1
172 #endif /* TARGET_OS_OSX */
173 
174 
175 /*
176  * Do we have <shadow.h>?
177  */
178 
179 /* #undef HAVE_SHADOW_H */
180 
181 
182 /*
183  * Do we have <crypt.h>?
184  */
185 
186 /* #undef HAVE_CRYPT_H */
187 
188 
189 /*
190  * Use <stdint.h>?
191  */
192 
193 #define HAVE_STDINT_H 1
194 
195 
196 /*
197  * Use <string.h>, <strings.h>, and/or <bstring.h>?
198  */
199 
200 #define HAVE_STRING_H 1
201 #define HAVE_STRINGS_H 1
202 /* #undef HAVE_BSTRING_H */
203 
204 
205 /*
206  * Do we have the long long type?
207  */
208 
209 #define HAVE_LONG_LONG 1
210 
211 #ifdef HAVE_LONG_LONG
212 #  define CUPS_LLFMT	"%lld"
213 #  define CUPS_LLCAST	(long long)
214 #else
215 #  define CUPS_LLFMT	"%ld"
216 #  define CUPS_LLCAST	(long)
217 #endif /* HAVE_LONG_LONG */
218 
219 
220 /*
221  * Do we have the strtoll() function?
222  */
223 
224 #define HAVE_STRTOLL 1
225 
226 #ifndef HAVE_STRTOLL
227 #  define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
228 #endif /* !HAVE_STRTOLL */
229 
230 
231 /*
232  * Do we have the strXXX() functions?
233  */
234 
235 #define HAVE_STRDUP 1
236 #define HAVE_STRLCAT 1
237 #define HAVE_STRLCPY 1
238 
239 
240 /*
241  * Do we have the geteuid() function?
242  */
243 
244 #define HAVE_GETEUID 1
245 
246 
247 /*
248  * Do we have the setpgid() function?
249  */
250 
251 #define HAVE_SETPGID 1
252 
253 
254 /*
255  * Do we have the vsyslog() function?
256  */
257 
258 #define HAVE_VSYSLOG 1
259 
260 
261 /*
262  * Do we have the systemd journal functions?
263  */
264 
265 /* #undef HAVE_SYSTEMD_SD_JOURNAL_H */
266 
267 
268 /*
269  * Do we have the (v)snprintf() functions?
270  */
271 
272 #define HAVE_SNPRINTF 1
273 #define HAVE_VSNPRINTF 1
274 
275 
276 /*
277  * What signal functions to use?
278  */
279 
280 #define HAVE_SIGSET 1
281 #define HAVE_SIGACTION 1
282 
283 
284 /*
285  * What wait functions to use?
286  */
287 
288 #define HAVE_WAITPID 1
289 #define HAVE_WAIT3 1
290 
291 
292 /*
293  * Do we have the mallinfo function and malloc.h?
294  */
295 
296 /* #undef HAVE_MALLINFO */
297 /* #undef HAVE_MALLOC_H */
298 
299 
300 /*
301  * Do we have the POSIX ACL functions?
302  */
303 
304 #define HAVE_ACL_INIT 1
305 
306 
307 /*
308  * Do we have the langinfo.h header file?
309  */
310 
311 #define HAVE_LANGINFO_H 1
312 
313 
314 /*
315  * Which encryption libraries do we have?
316  */
317 
318 #define HAVE_CDSASSL 1
319 /* #undef HAVE_GNUTLS */
320 /* #undef HAVE_SSPISSL */
321 #define HAVE_SSL 1
322 
323 
324 /*
325  * Do we have the gnutls_transport_set_pull_timeout_function function?
326  */
327 
328 /* #undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
329 
330 
331 /*
332  * Do we have the gnutls_priority_set_direct function?
333  */
334 
335 /* #undef HAVE_GNUTLS_PRIORITY_SET_DIRECT */
336 
337 
338 /*
339  * What Security framework headers do we have?
340  */
341 
342 #if TARGET_OS_OSX
343 #  define HAVE_AUTHORIZATION_H 1
344 #endif /* TARGET_OS_OSX */
345 
346 #define HAVE_SECCERTIFICATE_H 1
347 #define HAVE_SECITEM_H 1
348 #define HAVE_SECPOLICY_H 1
349 
350 
351 /*
352  * Do we have the SecGenerateSelfSignedCertificate function?
353  */
354 
355 #if !TARGET_OS_OSX
356 #  define HAVE_SECGENERATESELFSIGNEDCERTIFICATE 1
357 #endif /* !TARGET_OS_OSX */
358 
359 
360 /*
361  * Do we have libpaper?
362  */
363 
364 /* #undef HAVE_LIBPAPER */
365 
366 
367 /*
368  * Do we have mDNSResponder for DNS Service Discovery (aka Bonjour)?
369  */
370 
371 #define HAVE_DNSSD 1
372 
373 
374 /*
375  * Do we have Avahi for DNS Service Discovery (aka Bonjour)?
376  */
377 
378 /* #undef HAVE_AVAHI */
379 
380 
381 /*
382  * Do we have <sys/ioctl.h>?
383  */
384 
385 #define HAVE_SYS_IOCTL_H 1
386 
387 
388 /*
389  * Does the "stat" structure contain the "st_gen" member?
390  */
391 
392 #define HAVE_ST_GEN 1
393 
394 
395 /*
396  * Does the "tm" structure contain the "tm_gmtoff" member?
397  */
398 
399 #define HAVE_TM_GMTOFF 1
400 
401 
402 /*
403  * Do we have rresvport_af()?
404  */
405 
406 #define HAVE_RRESVPORT_AF 1
407 
408 
409 /*
410  * Do we have getaddrinfo()?
411  */
412 
413 #define HAVE_GETADDRINFO 1
414 
415 
416 /*
417  * Do we have getnameinfo()?
418  */
419 
420 #define HAVE_GETNAMEINFO 1
421 
422 
423 /*
424  * Do we have getifaddrs()?
425  */
426 
427 #define HAVE_GETIFADDRS 1
428 
429 
430 /*
431  * Do we have hstrerror()?
432  */
433 
434 #define HAVE_HSTRERROR 1
435 
436 
437 /*
438  * Do we have res_init()?
439  */
440 
441 #define HAVE_RES_INIT 1
442 
443 
444 /*
445  * Do we have <resolv.h>
446  */
447 
448 #define HAVE_RESOLV_H 1
449 
450 
451 /*
452  * Do we have the <sys/sockio.h> header file?
453  */
454 
455 #define HAVE_SYS_SOCKIO_H 1
456 
457 
458 /*
459  * Does the sockaddr structure contain an sa_len parameter?
460  */
461 
462 /* #undef HAVE_STRUCT_SOCKADDR_SA_LEN */
463 
464 
465 /*
466  * Do we have pthread support?
467  */
468 
469 #define HAVE_PTHREAD_H 1
470 
471 
472 /*
473  * Do we have on-demand support (launchd/systemd/upstart)?
474  */
475 
476 #define HAVE_ONDEMAND 1
477 
478 
479 /*
480  * Do we have launchd support?
481  */
482 
483 #define HAVE_LAUNCH_H 1
484 #define HAVE_LAUNCHD 1
485 
486 
487 /*
488  * Do we have systemd support?
489  */
490 
491 /* #undef HAVE_SYSTEMD */
492 
493 
494 /*
495  * Do we have upstart support?
496  */
497 
498 /* #undef HAVE_UPSTART */
499 
500 
501 /*
502  * Do we have CoreFoundation public headers?
503  */
504 
505 #define HAVE_COREFOUNDATION_H 1
506 
507 
508 /*
509  * Do we have ApplicationServices public headers?
510  */
511 
512 #if TARGET_OS_OSX
513 #  define HAVE_APPLICATIONSERVICES_H 1
514 #endif /* TARGET_OS_OSX */
515 
516 
517 /*
518  * Do we have the SCDynamicStoreCopyComputerName function?
519  */
520 
521 #if TARGET_OS_OSX
522 #  define HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME 1
523 #endif /* TARGET_OS_OSX */
524 
525 
526 /*
527  * Do we have the getgrouplist() function?
528  */
529 
530 #define HAVE_GETGROUPLIST 1
531 
532 
533 /*
534  * Do we have macOS 10.4's mbr_XXX functions?
535  */
536 
537 #define HAVE_MEMBERSHIP_H 1
538 #define HAVE_MBR_UID_TO_UUID 1
539 
540 
541 /*
542  * Do we have Darwin's notify_post header and function?
543  */
544 
545 #define HAVE_NOTIFY_H 1
546 #define HAVE_NOTIFY_POST 1
547 
548 
549 /*
550  * Do we have DBUS?
551  */
552 
553 /* #undef HAVE_DBUS */
554 /* #undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
555 /* #undef HAVE_DBUS_THREADS_INIT */
556 
557 
558 /*
559  * Do we have the GSSAPI support library (for Kerberos support)?
560  */
561 
562 #if TARGET_OS_OSX
563 #  define HAVE_GSS_ACQUIRED_CRED_EX_F 1
564 #  define HAVE_GSS_C_NT_HOSTBASED_SERVICE 1
565 #  define HAVE_GSS_GSSAPI_H 1
566 /* #undef HAVE_GSS_GSSAPI_SPI_H */
567 #  define HAVE_GSSAPI 1
568 /* #undef HAVE_GSSAPI_GSSAPI_H */
569 /* #undef HAVE_GSSAPI_H */
570 #endif /* TARGET_OS_OSX */
571 
572 
573 /*
574  * Default GSS service name...
575  */
576 
577 #define CUPS_DEFAULT_GSSSERVICENAME "host"
578 
579 
580 /*
581  * Select/poll interfaces...
582  */
583 
584 #define HAVE_POLL 1
585 /* #undef HAVE_EPOLL */
586 #define HAVE_KQUEUE 1
587 
588 
589 /*
590  * Do we have the <dlfcn.h> header?
591  */
592 
593 #define HAVE_DLFCN_H 1
594 
595 
596 /*
597  * Do we have <sys/param.h>?
598  */
599 
600 #define HAVE_SYS_PARAM_H 1
601 
602 
603 /*
604  * Do we have <sys/ucred.h>?
605  */
606 
607 #define HAVE_SYS_UCRED_H 1
608 
609 
610 /*
611  * Do we have removefile()?
612  */
613 
614 #define HAVE_REMOVEFILE 1
615 
616 
617 /*
618  * Do we have <sandbox.h>?
619  */
620 
621 #define HAVE_SANDBOX_H 1
622 
623 
624 /*
625  * Which random number generator function to use...
626  */
627 
628 #define HAVE_ARC4RANDOM 1
629 #define HAVE_RANDOM 1
630 #define HAVE_LRAND48 1
631 
632 #ifdef HAVE_ARC4RANDOM
633 #  define CUPS_RAND() arc4random()
634 #  define CUPS_SRAND(v)
635 #elif defined(HAVE_RANDOM)
636 #  define CUPS_RAND() random()
637 #  define CUPS_SRAND(v) srandom(v)
638 #elif defined(HAVE_LRAND48)
639 #  define CUPS_RAND() lrand48()
640 #  define CUPS_SRAND(v) srand48(v)
641 #else
642 #  define CUPS_RAND() rand()
643 #  define CUPS_SRAND(v) srand(v)
644 #endif /* HAVE_ARC4RANDOM */
645 
646 
647 /*
648  * Do we have libusb?
649  */
650 
651 /* #undef HAVE_LIBUSB */
652 
653 
654 /*
655  * Do we have libwrap and tcpd.h?
656  */
657 
658 /* #undef HAVE_TCPD_H */
659 
660 
661 /*
662  * Do we have <iconv.h>?
663  */
664 
665 #define HAVE_ICONV_H 1
666 
667 
668 /*
669  * Do we have statfs or statvfs and one of the corresponding headers?
670  */
671 
672 #define HAVE_STATFS 1
673 #define HAVE_STATVFS 1
674 #define HAVE_SYS_MOUNT_H 1
675 /* #undef HAVE_SYS_STATFS_H */
676 #define HAVE_SYS_STATVFS_H 1
677 /* #undef HAVE_SYS_VFS_H */
678 
679 
680 /*
681  * Location of localization bundle, if any.
682  */
683 
684 #if TARGET_OS_OSX
685 #  define CUPS_BUNDLEDIR "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
686 #else
687 #  define CUPS_BUNDLEDIR "/System/Library/PrivateFrameworks/PrintKit.framework/Versions/A"
688 #endif /* TARGET_OS_OSX */
689 
690 
691 /*
692  * Do we have XPC?
693  */
694 
695 #define HAVE_XPC 1
696 
697 
698 /*
699  * Do we have the C99 abs() function?
700  */
701 
702 #define HAVE_ABS 1
703 #if !defined(HAVE_ABS) && !defined(abs)
704 #  if defined(__GNUC__) || __STDC_VERSION__ >= 199901L
705 #    define abs(x) _cups_abs(x)
_cups_abs(int i)706 static inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
707 #  elif defined(_MSC_VER)
708 #    define abs(x) _cups_abs(x)
_cups_abs(int i)709 static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
710 #  else
711 #    define abs(x) ((x) < 0 ? -(x) : (x))
712 #  endif /* __GNUC__ || __STDC_VERSION__ */
713 #endif /* !HAVE_ABS && !abs */
714 
715 #endif /* !_CUPS_CONFIG_H_ */
716