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