Comparar commits

...

181 Commits

Autor SHA1 Mensagem Data
Michael R Sweet c13e2f44eb Bump version 2018-12-07 14:40:21 -05:00
Michael R Sweet b9ff93ce91 CVE-2018-4700: Linux session cookies used a predictable random number seed. 2018-12-07 12:08:27 -05:00
Michael R Sweet 46637f30d7 Update localization files. 2018-12-06 14:58:20 -05:00
Michael R Sweet f1def5b85f Remove cupsaddsmb and associated documentation and infrastructure (Issue #5449) 2018-12-06 14:58:01 -05:00
Michael R Sweet dc5c941a67 Drop cupstestdsc program and related documentation (Issue #5450) 2018-12-06 14:53:22 -05:00
Michael R Sweet 51c22b864a Update HTML man pages. 2018-12-06 14:41:43 -05:00
Michael R Sweet 33abc3d644 Changelog 2018-12-06 14:41:26 -05:00
Michael R Sweet 4eeef849d6 Update message catalogs for new usage help (Issue #5326) 2018-12-06 14:40:52 -05:00
Michael R Sweet c4b22214d2 Normalize --help usage for cupsd (Issue #5326) 2018-12-06 14:39:57 -05:00
Michael R Sweet 860f3d3b13 Add --help usage for all Berkeley commands (Issue #5326) 2018-12-06 14:38:05 -05:00
Michael R Sweet abc300696c Normalize --help usage for ippfind and ipptool (Issue #5326) 2018-12-06 14:24:29 -05:00
Michael R Sweet 8e52928cfd Add --help usage for all System V commands (Issue #5326) 2018-12-06 14:17:23 -05:00
Michael R Sweet df4101bff6 lpoptions now works with discovered but un-added printers (Issue #5045) 2018-12-06 11:24:11 -05:00
Michael R Sweet 7d730d0ce7 Don't error out on deprecations. 2018-12-06 09:21:58 -05:00
Michael R Sweet c29d06f9f9 Fix -E option (Issue #5440) 2018-12-05 12:59:56 -05:00
Michael R Sweet 9fb5f30d78 More bogus indentation. 2018-12-05 12:39:33 -05:00
Michael R Sweet ef4e12b3f9 Update configure script. 2018-12-05 12:38:06 -05:00
Michael R Sweet c028bdf75e Fix bogus indentation. 2018-12-05 12:37:23 -05:00
Michael R Sweet 3dee5db7b9 Revert os_transaction changes. 2018-12-05 12:34:39 -05:00
Michael R Sweet 8c7143551a Fix handling of MaxJobTime 0 (Issue #5438) 2018-12-05 12:18:13 -05:00
Michael R Sweet f337a1b74e Pass ASAN_OPTIONS to filters. 2018-12-05 12:07:24 -05:00
Michael R Sweet ba4fe5d958 Remove malloc logging output since we no longer use GuardMalloc in the test suite. 2018-12-05 11:40:14 -05:00
Michael R Sweet e14894bd8d Fix test suite failure caused by log rotation due to sandboxing warning message. 2018-12-05 11:38:44 -05:00
Michael R Sweet e5daa5b780 Fix ASAN support on Linux, drop suppressions file and just disable leak tests.
ASAN on Linux also requires us to build with --disable-shared.  Which means the
test script should not try to preload the .so files...
2018-12-04 16:52:56 -05:00
Michael R Sweet 31b3c060f8 Don't use GuardMalloc on macOS now that we have AddressSanitizer. 2018-12-04 10:03:48 -05:00
Michael R Sweet f518bf7ea1 Support AddressSanitizer in builds.
Fix a compiler warning on macOS.
2018-12-04 09:36:02 -05:00
Michael R Sweet 3043e3a533 Add USB quirk rule for Zebra ZD420 (Issue #5395) 2018-11-30 13:05:03 -05:00
Michael R Sweet ffcecff2d7 Add USB quirk rule for Star printer (Issue #5443) 2018-11-26 22:39:00 -05:00
Michael R Sweet 2d9eecc44e Fix a crash bug when mapping PPD duplex options to IPP attributes (rdar://46183976) 2018-11-26 22:32:24 -05:00
Michael R Sweet a8a73fd881 Update default compiler options for GCC 8.x. 2018-11-16 15:58:29 -05:00
Michael R Sweet cee8cdadee Fix compile error. 2018-11-14 10:17:41 -05:00
Michael R Sweet c0c13a68b1 Add cupsManualCopies as needed (Issue #5433) 2018-11-14 10:15:04 -05:00
Michael R Sweet ef2f369c0c Fix potential truncation of Kerberos credentials (Issue #5435) 2018-11-14 09:09:33 -05:00
Michael R Sweet dbcea8da9d Switch from xpc_transaction_begin to os_transaction_create. 2018-11-08 15:52:50 -05:00
Michael R Sweet ee347e17be Add note about restarting the scheduler manually after editing config files (Issue #5402) 2018-11-08 09:51:21 -05:00
Michael R Sweet b167c7fcf8 Clarify meaning of printer errors (Issue #5404) 2018-11-08 09:43:18 -05:00
Michael R Sweet f07dbc95aa Document indirect changing of configuration files (Issue #5403) 2018-11-08 09:35:36 -05:00
Michael R Sweet 4ab680ad06 Merge pull request #5410 from AOSC-Dev/master
locale/zh_CN: 100%
2018-11-08 09:30:06 -05:00
Michael R Sweet 3bd3849715 Deprecate snmp backend. 2018-11-08 09:29:13 -05:00
Michael R Sweet 8d32a3f933 Disable SNMP supply levels when the community name is cleared (Issue #5354)
backend/snmp-supplies.c:
- Look for empty community name.

cups/snmp.c:
- Allow empty community name.

man/cups-snmp.conf.man:
- Document behavior of empty community name.
2018-11-08 09:24:48 -05:00
Michael R Sweet 9eacf61969 Don't include subdirs for internal libraries. 2018-11-07 11:42:44 -05:00
Michael R Sweet 72a2134826 Fix stuck multi-file jobs (Issue #5359, Issue #5413) 2018-11-07 11:33:00 -05:00
Michael R Sweet 08eac601d0 Localization updates (Issue #5408) 2018-11-07 10:40:29 -05:00
Michael R Sweet 08761c26aa Add USB quirks rule for Lexmark MS317dn (Issue #5420) 2018-11-07 10:37:27 -05:00
Michael R Sweet c4edc066e9 Fix more compiler warnings (Issue #5423) 2018-11-06 16:20:56 -05:00
Michael R Sweet 6276d173b6 Fix compiler warnings (Issue #5423) 2018-11-06 16:16:16 -05:00
Michael R Sweet bafe8fce84 Fix makefile errors on install. 2018-10-29 18:18:04 -04:00
Michael R Sweet 58b64dbba8 Add new libcupslite component that builds a libcups without driver/PPD support. 2018-10-29 17:56:28 -04:00
Michael R Sweet 171c38f224 Add libcups component name, localization bundle support for iOS. 2018-10-29 16:36:11 -04:00
Michael R Sweet 144351068c Don't install cupscgi, cupsmime, or cupsppdc shared libraries. 2018-10-29 12:12:41 -04:00
Michael R Sweet 899483675b Make sure _cups_debug_set always exists. 2018-10-25 14:18:36 -04:00
Michael R Sweet 82428176f5 Need to install debug-private.h as a private header. 2018-10-25 13:09:46 -04:00
Michael R Sweet 72ca662e7e Use 'Standard' process type to get higher priority for printing. 2018-10-18 22:05:11 -04:00
Michael R Sweet 171b7064c6 Drop -Wno-format-truncation since only newer versions of GCC support it and the configure check has never worked. 2018-10-18 22:00:43 -04:00
Michael R Sweet e4b72d7ee1 Update the location of strings files on newer versions of macOS.
Don't install debug symbols for static libraries.
2018-10-18 21:53:15 -04:00
Michael R Sweet 78312b3c7a Don't install/remove private headers for internal libraries.
Don't install symlinks for internal libraries.
2018-10-18 14:36:16 -04:00
Michael R Sweet fb863569eb Move debug printfs to internal usage only.
Also, old MD5 code is internal-only.
2018-10-18 14:25:09 -04:00
Michael R Sweet 941a5490cf Drop _httpTLSSetCredentials - not implemented or used. 2018-10-18 10:18:53 -04:00
Michael R Sweet f4b526e71e Don't install internal headers. 2018-10-18 09:38:49 -04:00
Michael R Sweet 0b353e63ec Cleanup. 2018-10-17 16:54:15 -04:00
Michael R Sweet 2064e071b0 Save/restore line number to fix error line reporting. 2018-10-17 16:37:04 -04:00
Michael R Sweet 9fd217fc95 Don't install headers for libcupcgi, libcupsmime, or libcupsppdc. 2018-10-17 16:12:46 -04:00
Michael R Sweet 739bae4ea3 Fix embedded whitespace issue. 2018-10-17 14:17:47 -04:00
Michael R Sweet 5f07499d2b Re-wrap comment. 2018-10-17 13:09:37 -04:00
Michael R Sweet 9a9dab7224 Fix location of program database. 2018-10-17 11:40:37 -04:00
Michael R Sweet ace3ea0a52 Drop SNMP functions. 2018-10-17 11:36:45 -04:00
Michael R Sweet 4bc478876d Update Windows DLL exports. 2018-10-17 11:35:37 -04:00
Michael R Sweet 9a38ff69a6 Don't need to include zlib header. 2018-10-17 11:35:03 -04:00
Michael R Sweet 5a855d856a Remove dependency on zlib headers outside of libcups. 2018-10-17 11:31:45 -04:00
Michael R Sweet 104c528358 More build fixes. 2018-10-16 16:31:07 -04:00
Michael R Sweet 86206ccf13 Add missing DNSSD.LIB functions. 2018-10-16 16:09:17 -04:00
Michael R Sweet d3a97696d7 Fix build issues, add missing files. 2018-10-16 15:31:09 -04:00
Michael R Sweet d00c3f2678 Add DNS-SD stub library project. Update VS projects. 2018-10-16 14:56:39 -04:00
Michael R Sweet c8c5ec3b57 Search for codesign/true, use LDFLAGS for shared libraries (Issue #5411) 2018-10-15 21:03:40 -04:00
Michael R Sweet 1a6abb3661 Update Xcode project, clean up includes for _cupsRasterInterpretPPD. 2018-10-10 21:02:20 -04:00
Michael R Sweet f81f6d3d57 Move PPD tests to PPD unit test file.
Shorten cupsColorSpace strings.
2018-10-10 20:44:21 -04:00
Michael R Sweet dcd7f90ecb Fix raster header writing. 2018-10-10 20:29:31 -04:00
Michael R Sweet c857c27e47 Remove obsolete declarations. 2018-10-10 20:23:33 -04:00
Michael R Sweet dd204f7a50 Move raster functions into libcups, with stubs that call back to libcups in libcupsimage. 2018-10-10 20:22:24 -04:00
Michael R Sweet 11ea1663d5 Mark internal functions as internal. 2018-10-10 01:06:43 -04:00
Michael R Sweet e35868753c Update visibility stuff so we can build libcups.2.dylib without an exports list. 2018-10-10 01:01:56 -04:00
Michael R Sweet 24a06ed381 Migrate Windows conditional code to _WIN32 define. 2018-10-10 00:18:00 -04:00
Michael R Sweet 19dc16f764 Migrate Windows conditional code to _WIN32 define. 2018-10-10 00:17:22 -04:00
Mingcong Bai 772416f73a locale/zh_CN: 100% 2018-10-09 00:22:16 -05:00
Michael R Sweet d65e20fe7c Add Travis CI support. 2018-10-02 18:31:43 -04:00
Michael R Sweet b37177a7a9 Fix test suite with shared libraries on macOS. 2018-10-02 18:21:25 -04:00
Michael R Sweet b3903a94c6 Move private header includes to tls-darwin.c. 2018-09-28 16:52:32 -04:00
Michael R Sweet 1582479ceb Fix lpadmin error reporting for IPP Everywhere printers (Issue #5370) 2018-09-28 11:22:21 -04:00
Michael R Sweet bf86060f9e Support face-up printers (Issue #5345) 2018-09-28 11:12:40 -04:00
Michael R Sweet 7219e504e7 Whitespace issues reported by Git. 2018-09-27 12:03:33 -04:00
Michael R Sweet 2c3b8f53ad Set QoS priority class for the main thread when running from launchd. 2018-09-27 12:01:33 -04:00
Michael R Sweet 42bb90c481 Add new dynamic mDNSResponder stub. 2018-09-26 16:51:41 -04:00
Michael R Sweet cdeee633ce Changelog. 2018-09-18 11:42:27 -04:00
Michael R Sweet e70450f17d Update list of files to ignore. 2018-09-18 11:37:52 -04:00
Michael R Sweet 137fa9a836 Code signing changes. 2018-09-18 11:27:20 -04:00
Michael R Sweet 00dbe99f3f Add code signing for macOS Mojave. 2018-09-18 11:02:51 -04:00
Michael R Sweet 67c0a18b85 Make sure clean is clean. 2018-09-18 09:18:14 -04:00
Michael R Sweet 5737d5eba4 More Digest changes. 2018-09-14 14:58:35 -04:00
Michael R Sweet 16f67389a8 More Digest authentication fixes/improvements. 2018-09-14 13:02:53 -04:00
Michael R Sweet 80f5715924 Change the threading model to keep track of a separate client thread count instead. 2018-09-13 16:19:47 -04:00
Michael R Sweet 7e3643bff1 Update testclient to support simulation of N clients. 2018-09-12 07:57:15 -04:00
Michael R Sweet 296185eb1a Add explicit 1 second wait for Digest challenge. 2018-09-11 12:22:27 -04:00
Michael R Sweet c0a48c3773 Update IPP backend to use non-deprecated APIs and constants. 2018-09-11 10:21:18 -04:00
Michael R Sweet 29bda83e12 Silence some bogus Clang warnings. 2018-09-03 09:30:08 -04:00
Michael R Sweet a7d80a247f Add digest debugging and fix a small bug in the HTTP unit test. 2018-08-29 18:20:11 -04:00
Michael R Sweet 69c0af2ec8 Further simplify the logic in ippCopyAttribute. 2018-08-29 11:50:22 -04:00
Michael R Sweet ebcccc6a56 Simplify the logic in ippCopyAttribute. 2018-08-29 11:43:50 -04:00
Michael R Sweet 387ff05cd4 Fix availability macros. 2018-08-28 23:18:04 -04:00
Michael R Sweet 3aeb120e10 Fix issue with HTTP Digest authentication, add unit tests (rdar://41709086) 2018-08-28 22:47:39 -04:00
Michael R Sweet 59a8560a52 Fix a scheduler crash bug (rdar://42198057) 2018-08-27 16:43:16 -04:00
Michael R Sweet bac967ae56 Add checks for missing/bad CloseUI/JCLCloseUI keywords (Issue #5381) 2018-08-27 15:14:04 -04:00
Michael R Sweet 604783214d Fix JCL option support in PPD compiler (Issue #5379) 2018-08-27 10:31:29 -04:00
Michael R Sweet d128cfc601 Don't try to map cupsFinishingTemplate=none, fall back to individual options to get there. 2018-08-21 10:09:49 -04:00
Michael R Sweet 3416fe952b Fix memory leaks found by Coverity (Issue #5375) 2018-08-21 10:01:44 -04:00
Michael R Sweet 5c463d3fe0 Fix regression in fix for rdar://40436080. 2018-08-19 09:14:52 -04:00
Michael R Sweet a2c43163c2 Fix typo. 2018-08-19 09:05:34 -04:00
Michael R Sweet d5d6477801 Update lpadmin man page (Issue #5369) 2018-08-19 09:03:02 -04:00
Michael R Sweet 26dbc8a6b6 Fix whitespace. 2018-08-19 08:36:39 -04:00
Michael R Sweet c96cc7c0e2 Fix localization of IPP Everywhere PPD (Issue #5362) 2018-08-19 08:32:04 -04:00
Michael R Sweet fd7190c1c2 Fix shared printing using the IPP Everywhere driver (Issue #5361) 2018-08-19 07:49:10 -04:00
Michael R Sweet 7d4510a090 Sync up with changes from 2.2.x. 2018-08-18 09:01:32 -04:00
Michael R Sweet 06e79a5e74 Changelog. 2018-07-18 14:30:18 -04:00
Michael R Sweet c604931d24 Changelog. 2018-07-18 14:27:08 -04:00
Michael R Sweet 140af001d6 Merge pull request #5348 from snifbr/master
Some fixes about pt_BR translate
2018-07-18 14:25:09 -04:00
Michael R Sweet 4848b9c789 Merge pull request #5350 from benlees/master
Correct typos in rastertolabel
2018-07-18 14:22:57 -04:00
Michael R Sweet 672c812747 Explicitly list IPP_TAG_STRING in ippReadIO. 2018-07-18 11:23:17 -04:00
Michael R Sweet bbe495b0ea The scheduler was being backgrounded on macOS, causing applications to spin
(rdar://40436080)

scheduler/main.c:
- Start/end transactions on startup/shutdown.

scheduler/sysman.c:
- Remove transactions from cupsdSetBusy.
2018-07-17 23:52:38 -04:00
Michael R Sweet 67bd1f47a5 Fix regression in lpadmin fix (Issue #5305) 2018-07-17 21:57:41 -04:00
Michael R Sweet 6f1c647d73 Fix dependencies. 2018-07-17 17:48:00 -04:00
Michael R Sweet a32af27c4c Replace the rest of the uses of __attribute__ that need to be portable (Issue #5349) 2018-07-09 13:42:25 -04:00
Michael R Sweet be3b49a3f9 Move away from using __attribute__ directly (Issue #5349) 2018-07-09 12:17:47 -04:00
benlees 2ea1bc06b7 Additions to print density corrections
Missed correcting values below 50 (-14 would produce -15 in the output etc).
2018-07-08 11:33:51 +10:00
benlees c44a2ab142 Correct print density for Intellitech
Due to an incorrect rounding assumptions in sample.drv, selecting print density choice 14 produces an output of 13 in the driver and so on.
2018-07-08 10:57:30 +10:00
benlees e8fb750728 Intellitech print density should be signed
The print density ranges from -15 to +15.  The output should be a signed integer.
2018-07-08 10:21:51 +10:00
benlees 04e7ecda24 Merge pull request #1 from benlees/patch-1
Correct page height for Zebra CPCL output
2018-07-08 10:16:52 +10:00
benlees eadeefa22d Correct page height for Zebra CPCL output
PAGE-HEIGHT is being set to cupsWidth rather than cupsHeight.
2018-07-08 10:15:26 +10:00
Danilo Figueiredo Rocha 9d714317d0 Fixed wrong translation in header.tmpl 2018-07-04 16:42:26 -03:00
Danilo Figueiredo Rocha a552da601d Fixed wrong value parsed when selected (show completed jobs) 2018-07-04 16:37:44 -03:00
Michael R Sweet 77094a212d Fix whitespace issues. 2018-06-29 14:05:14 -04:00
Michael R Sweet 29899df225 Fix whitespace issues. 2018-06-29 14:04:32 -04:00
Michael R Sweet bf265b3aa9 Authentication in the web interface did not work on macOS (rdar://41444473)
cups/auth.c:
- cups_local_auth(): Don't check for AuthRef twice, log fopen errors for the
  root cert as well.

scheduler/client.c:
- Also allow local auth with AuthRef's.
2018-06-29 13:42:38 -04:00
Michael R Sweet 945c83b90e Fix auto-debug logging of job errors with systemd (Issue #5337) 2018-06-18 21:46:21 -04:00
Michael R Sweet 9dcb503fa1 Fix crash when AccessLog is NULL (Issue #5309) 2018-06-18 21:37:27 -04:00
Michael R Sweet 1738460d8b Fix compiler warning. 2018-06-18 21:32:55 -04:00
Michael R Sweet 997b67343f Use Enable-Printer and Resume-Printer operations so we don't create a bogus printer (Issue #5305) 2018-06-18 21:28:04 -04:00
Michael R Sweet 9fc5c8d42e Support idle exit, even when printer sharing is enabled but no printers are shared (Issue #5319) 2018-06-18 17:03:23 -04:00
Michael R Sweet 443f6d0c80 Restore default cups-lpd settings for macOS. 2018-06-18 16:41:02 -04:00
Michael R Sweet 7e041a5e55 Fix A6 crash bug in Epson 24-pin driver (Issue #5323) 2018-06-18 16:37:16 -04:00
Michael R Sweet bd121abd35 Ignore bogus cups-version attribute. 2018-06-18 14:33:29 -04:00
Michael R Sweet de72bb61c1 More tweaks for IPP Everywhere support in web interface. 2018-06-18 14:31:23 -04:00
Michael R Sweet 553f29c967 Support IPP Everywhere driver in web interface (Issue #5338) 2018-06-18 13:13:40 -04:00
Michael R Sweet 91505c0a32 Report all supported Job Creation attributes and their values (Issue #5340) 2018-06-18 12:44:49 -04:00
Michael R Sweet b5443ab9f2 Add options to force a TLS version. 2018-06-15 15:17:06 -04:00
Michael R Sweet 9f4c8267f9 Don't set maximum TLS version unless it is <max. Support TLS 1.3. 2018-06-15 11:26:16 -04:00
Michael R Sweet ef97be3b01 Turn off duplex if validate-job says it can't be done. 2018-06-13 14:32:16 -04:00
Michael R Sweet c3a9caacd9 Add all prototype attributes and values. 2018-06-12 17:05:07 -04:00
Michael R Sweet 6b2fb4354a Add more functionality to localization unit test program. 2018-06-12 13:05:33 -04:00
Michael R Sweet dc0b986f3e Changelog 2018-06-12 08:38:52 -04:00
Michael R Sweet 8c0b3c7b4b Merge pull request #5339 from AOSC-Dev/master
locale/zh_CN: complete translation
2018-06-12 08:36:51 -04:00
Mingcong Bai d6abdf44cd locale/zh_CN: complete translation 2018-06-12 16:27:26 +08:00
Michael R Sweet 1d677f11f1 Fix regressions in ippValidateAttribute (Issue #5322, Issue #5330) 2018-06-11 09:37:38 -04:00
Michael R Sweet a46d5dfe1d Merge pull request #5332 from felixonmars/patch-1
Fix a typo in snmp.c
2018-06-11 09:23:11 -04:00
Felix Yan 9befde0941 Fix a typo in snmp.c 2018-06-09 17:36:03 +08:00
Michael R Sweet d596e3307e Update paths for PWG raster sample files. 2018-06-07 16:50:04 -04:00
Michael R Sweet addb17b18d Specify GPG signing user. 2018-06-06 09:01:40 -04:00
Michael R Sweet 39897200c1 Bump version to 2.3b6, changelog. 2018-06-05 13:49:08 -04:00
Michael R Sweet 22a3eea9f6 Make sure all incoming value tags are treated the same as freed values. 2018-06-05 13:47:42 -04:00
Michael R Sweet 87cebdd235 Fix link to CUPS Programming Manual. 2018-06-05 12:32:08 -04:00
Michael R Sweet 464f939ece Update versions in README and INSTALL 2018-06-05 12:06:08 -04:00
Michael R Sweet af66a2f815 Update documentation and localization files for 2.3b5 release. 2018-06-05 11:58:32 -04:00
Michael R Sweet b27f41088b Changelog. 2018-06-05 11:47:46 -04:00
Michael R Sweet 09ca2aa580 Merge pull request #5317 from nils-van-zuijlen/typo-fr
Correct typos for French_France
2018-06-05 11:45:00 -04:00
Michael R Sweet 0541a2c9f4 Fix a parsing bug in the pstops filter (Issue #5321) 2018-06-05 11:36:07 -04:00
Michael R Sweet 53f8404482 Changelog. 2018-06-05 11:29:32 -04:00
Michael R Sweet 050d265700 Add a USB quirks rule for the HP LaserJet P1102 (Issue #5310) 2018-06-05 11:27:16 -04:00
Michael R Sweet d47f6aec43 Fix local privilege escalation to root and sandbox bypasses in scheduler
(rdar://37836779, rdar://37836995, rdar://37837252, rdar://37837581)
2018-06-05 08:49:59 -04:00
Michael R Sweet be7581b6e3 Validate notify-recipient-uri values. 2018-06-05 08:49:59 -04:00
Michael R Sweet 8eed438719 Block invalid group tags when parsing IPP messages. 2018-06-04 16:17:31 -04:00
Nils Van Zuijlen 4baf1b58e0 Correct typos for French_France 2018-05-24 22:04:45 +02:00
Michael R Sweet ce480a999e Add smb test URI. 2018-05-18 15:34:50 -04:00
Michael R Sweet fdaf028e8b Add more URI validation for scheme. 2018-05-14 15:24:13 -07:00
312 arquivos alterados com 24671 adições e 17217 exclusões
+15 -3
Ver Arquivo
@@ -1,11 +1,8 @@
*.a
*.bck
*.cgi
*.dylib
*.gz
*.o
*.so
*.so.*
*.tokens
.buildrev
autom4te.cache
@@ -16,7 +13,9 @@ cups-config
Makedefs
backend/dnssd
backend/http
backend/https
backend/ipp
backend/ipps
backend/lpd
backend/mdns
backend/snmp
@@ -39,6 +38,14 @@ conf/cupsd.conf
conf/mime.convs
conf/pam.std
conf/snmp.conf
cups/libcups.dylib
cups/libcups.2.dylib
cups/libcups.so
cups/libcups.so.2
cups/libcupsimage.dylib
cups/libcupsimage.2.dylib
cups/libcupsimage.so
cups/libcupsimage.so.2
cups/locale/
cups/rasterbench
cups/test.pwg
@@ -117,6 +124,7 @@ scheduler/cups.sh
scheduler/cups.xml
scheduler/cupsd
scheduler/cupsfilter
scheduler/org.cups.cups-lpd.plist
scheduler/org.cups.cups-lpdAT.service
scheduler/org.cups.cupsd.path
scheduler/org.cups.cupsd.service
@@ -153,6 +161,10 @@ test/ippserver-shared
test/ipptool
test/ipptool-static
test/pwg-raster-samples-*
vcnet/.vs
vcnet/packages
vcnet/Win32
vcnet/x64
xcode/CUPS.xcodeproj/project.xcworkspace/
xcode/CUPS.xcodeproj/xcuserdata/
+25
Ver Arquivo
@@ -0,0 +1,25 @@
#
# Travis CI configuration file for CUPS.
#
# Copyright © 2018 by Apple Inc.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
language: c
matrix:
include:
# Linux-specific build stuff
- dist: trusty
sudo: required
before_install:
- sudo apt-get update
- sudo apt-get install -y libavahi-client-dev libgnutls28-dev libkrb5-dev libnss-mdns libpam-dev libsystemd-dev libusb-1.0-0-dev zlib1g-dev
# macOS-specific build stuff
- os: osx
osx_image: xcode10
script: ./configure && make check
+75 -4
Ver Arquivo
@@ -1,8 +1,70 @@
CHANGES - 2.3rc1 - 2018-05-11
=============================
CHANGES - 2.3b6 - 2018-12-07
============================
Changes in CUPS v2.3rc1
-----------------------
Changes in CUPS v2.3b6
----------------------
- Localization update (Issue #5339, Issue #5348, Issue #5362, Issue #5408,
Issue #5410)
- Documentation updates (Issue #5369, Issue #5402, Issue #5403, Issue #5404)
- CVE-2018-4700: Linux session cookies used a predictable random number seed.
- All user commands now support the `--help` option (Issue #5326)
- The `lpoptions` command now works with IPP Everywhere printers that have not
yet been added as local queues (Issue #5045)
- The lpadmin command would create a non-working printer in some error cases
(Issue #5305)
- The scheduler would crash if an empty `AccessLog` directive was specified
(Issue #5309)
- The scheduler did not idle-exit on some Linux distributions (Issue #5319)
- Fixed a regression in the changes to ippValidateAttribute (Issue #5322,
Issue #5330)
- Fixed a crash bug in the Epson dot matrix driver (Issue #5323)
- Automatic debug logging of job errors did not work with systemd (Issue #5337)
- The web interface did not list the IPP Everywhere "driver" (Issue #5338)
- The scheduler did not report all of the supported job options and values
(Issue #5340)
- The IPP Everywhere "driver" now properly supports face-up printers
(Issue #5345)
- Fixed some typos in the label printer drivers (Issue #5350)
- Setting the `Community` name to the empty string in `snmp.conf` now disables
SNMP supply level monitoring by all the standard network backends
(Issue #5354)
- Multi-file jobs could get stuck if the backend failed (Issue #5359,
Issue #5413)
- The IPP Everywhere "driver" no longer does local filtering when printing to
a shared CUPS printer (Issue #5361)
- The lpadmin command now correctly reports IPP errors when configuring an
IPP Everywhere printer (Issue #5370)
- Fixed some memory leaks discovered by Coverity (Issue #5375)
- The PPD compiler incorrectly terminated JCL options (Issue #5379)
- The cupstestppd utility did not generate errors for missing/mismatched
CloseUI/JCLCloseUI keywords (Issue #5381)
- The scheduler now reports the actual location of the log file (Issue #5398)
- Added USB quirk rules (Issue #5395, Issue #5420, Issue #5443)
- The generated PPD files for IPP Everywhere printers did not contain the
cupsManualCopies keyword (Issue #5433)
- Kerberos credentials might be truncated (Issue #5435)
- The handling of `MaxJobTime 0` did not match the documentation (Issue #5438)
- Fixed a bug adding a queue with the `-E` option (Issue #5440)
- The `cupsaddsmb` program has been removed (Issue #5449)
- The `cupstestdsc` program has been removed (Issue #5450)
- The scheduler was being backgrounded on macOS, causing applications to spin
(rdar://40436080)
- The scheduler did not validate that required initial request attributes were
in the operation group (rdar://41098178)
- Authentication in the web interface did not work on macOS (rdar://41444473)
- Fixed an issue with HTTP Digest authentication (rdar://41709086)
- The scheduler could crash when job history was purged (rdar://42198057)
- Fixed a crash bug when mapping PPD duplex options to IPP attributes
(rdar://46183976)
- Fixed a memory leak for some IPP (extension) syntaxes.
- The `cupscgi`, `cupsmime`, and `cupsppdc` support libraries are no longer
installed as shared libraries.
- The `snmp` backend is now deprecated.
Changes in CUPS v2.3b5
----------------------
- The `ipptool` program no longer checks for duplicate attributes when running
in list or CSV mode (Issue #5278)
@@ -14,10 +76,19 @@ Changes in CUPS v2.3rc1
authentication schemes in a single response header (Issue #5289)
- Fixed policy limits containing the `All` operation (Issue #5296)
- The scheduler was always restarted after idle-exit with systemd (Issue #5297)
- Added a USB quirks rule for the HP LaserJet P1102 (Issue #5310)
- The mailto notifier did not wait for the welcome message (Issue #5312)
- Fixed a parsing bug in the pstops filter (Issue #5321)
- Documentation updates (Issue #5299, Issue #5301, Issue #5306)
- Localization updates (Issue #5317)
- The scheduler allowed environment variables to be specified in the
`cupsd.conf` file (rdar://37836779, rdar://37836995, rdar://37837252,
rdar://37837581)
- Fax queues did not support pause (p) or wait-for-dialtone (w) characters
(rdar://39212256)
- The scheduler did not validate notify-recipient-uri values properly
(rdar://40068936)
- The IPP parser allowed invalid group tags (rdar://40442124)
- Fixed a parsing bug in the new authentication code.
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v2.3b4 - 2018-03-22
INSTALL - CUPS v2.3b6 - 2018-12-07
==================================
This file describes how to compile and install CUPS from source code. For more
+24 -15
Ver Arquivo
@@ -1,10 +1,11 @@
#
# Common makefile definitions for CUPS.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
# Copyright © 2007-2018 by Apple Inc.
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
#
@@ -91,10 +92,8 @@ LOCALTARGET = @LOCALTARGET@
#
LIBCUPS = @LIBCUPS@
LIBCUPSCGI = @LIBCUPSCGI@
LIBCUPSIMAGE = @LIBCUPSIMAGE@
LIBCUPSMIME = @LIBCUPSMIME@
LIBCUPSPPDC = @LIBCUPSPPDC@
LIBCUPSOBJS = @LIBCUPSOBJS@
LIBCUPSSTATIC = @LIBCUPSSTATIC@
LIBGSSAPI = @LIBGSSAPI@
LIBMALLOC = @LIBMALLOC@
@@ -122,6 +121,13 @@ IPPALIASES = @IPPALIASES@
INSTALLXPC = @INSTALLXPC@
#
# Code signing...
#
CODE_SIGN = @CODE_SIGN@
CODE_SIGN_IDENTITY = -
#
# Program options...
#
@@ -132,10 +138,12 @@ INSTALLXPC = @INSTALLXPC@
# for extra debug info)
#
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) $(SSLFLAGS) \
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) $(SSLFLAGS) \
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) \
$(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
$(ONDEMANDFLAGS) $(OPTIONS)
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) \
$(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
$(ONDEMANDFLAGS) $(OPTIONS)
ARCHFLAGS = @ARCHFLAGS@
ARFLAGS = @ARFLAGS@
BACKLIBS = @BACKLIBS@
@@ -147,21 +155,21 @@ CXXLIBS = @CXXLIBS@
DBUS_NOTIFIER = @DBUS_NOTIFIER@
DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@
DNSSD_BACKEND = @DNSSD_BACKEND@
DSOFLAGS = -L../cups @DSOFLAGS@
DSOFLAGS = -L../cups @ARCHFLAGS@ @LDFLAGS@ @RELROFLAGS@ \
@DSOFLAGS@ $(OPTIM)
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
DNSSDLIBS = @DNSSDLIBS@
IPPFIND_BIN = @IPPFIND_BIN@
IPPFIND_MAN = @IPPFIND_MAN@
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
-L../scheduler @LDARCHFLAGS@ \
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
LDFLAGS = -L../cups @LDARCHFLAGS@ @LDFLAGS@ @RELROFLAGS@ \
@PIEFLAGS@ $(OPTIM)
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
ONDEMANDFLAGS = @ONDEMANDFLAGS@
ONDEMANDLIBS = @ONDEMANDLIBS@
OPTIM = @OPTIM@
OPTIONS =
OPTIONS = @WARNING_OPTIONS@
PAMLIBS = @PAMLIBS@
SERVERLIBS = @SERVERLIBS@
SSLFLAGS = @SSLFLAGS@
@@ -224,6 +232,7 @@ RCLEVELS = @RCLEVELS@
RCSTART = @RCSTART@
RCSTOP = @RCSTOP@
REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
RESOURCEDIR = @CUPS_RESOURCEDIR@
SBINDIR = $(BUILDROOT)@sbindir@
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
+5 -4
Ver Arquivo
@@ -1,10 +1,11 @@
#
# Top-level Makefile for CUPS.
#
# Copyright 2007-2016 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
# Copyright © 2007-2018 by Apple Inc.
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
include Makedefs
@@ -14,7 +15,7 @@ include Makedefs
# Directories to make...
#
DIRS = cups test $(BUILDDIRS)
DIRS = cups $(BUILDDIRS)
#
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v2.3b4 - 2018-03-22
README - CUPS v2.3b6 - 2018-12-07
=================================
Looking for compile instructions? Read the file `INSTALL.md` instead...
+35 -34
Ver Arquivo
@@ -1,8 +1,8 @@
ipp.o: ipp.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/string-private.h ../config.h ../cups/versioning.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h ../cups/ppd-private.h ../cups/ppd.h \
@@ -11,23 +11,23 @@ lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \
../cups/array.h ../cups/versioning.h ../cups/http.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/pwg.h backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../cups/debug-private.h \
../cups/array-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
../cups/string-private.h ../cups/array-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
dnssd.o: dnssd.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/string-private.h ../config.h ../cups/versioning.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
snmp.o: snmp.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/string-private.h ../config.h ../cups/versioning.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
@@ -35,13 +35,13 @@ socket.o: socket.c ../cups/http-private.h ../config.h ../cups/language.h \
../cups/array.h ../cups/versioning.h ../cups/http.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/pwg.h backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../cups/debug-private.h \
../cups/array-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
backend-private.h ../cups/cups-private.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/string-private.h ../cups/array-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
test1284.o: test1284.c ../cups/string-private.h ../config.h \
../cups/versioning.h ieee1284.c backend-private.h \
../cups/cups-private.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
@@ -49,23 +49,24 @@ test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
../cups/sidechannel.h ../cups/ppd-private.h ../cups/ppd.h \
../cups/raster.h
testbackend.o: testbackend.c ../cups/string-private.h ../config.h \
../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h \
../cups/versioning.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/language.h ../cups/pwg.h \
../cups/sidechannel.h
testsupplies.o: testsupplies.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/string-private.h ../config.h ../cups/versioning.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h
usb.o: usb.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/string-private.h ../config.h ../cups/versioning.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
../cups/sidechannel.h usb-darwin.c ../cups/file-private.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
../cups/sidechannel.h usb-darwin.c ../cups/debug-private.h \
../cups/file-private.h ../cups/ppd-private.h ../cups/ppd.h \
../cups/raster.h
+15 -3
Ver Arquivo
@@ -1,7 +1,7 @@
#
# Backend makefile for CUPS.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 2007-2018 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
@@ -203,6 +203,7 @@ test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -213,6 +214,7 @@ testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -224,6 +226,7 @@ testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
$(LD_CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -244,6 +247,7 @@ libbackend.a: $(LIBOBJS)
dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
if test `uname` = Darwin; then \
$(RM) mdns; \
$(LN) dnssd mdns; \
@@ -257,8 +261,11 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
$(RM) http
$(LN) ipp http
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
$(RM) http https ipps
for file in $(IPPALIASES); do \
$(LN) ipp $$file; \
done
#
@@ -268,6 +275,7 @@ ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -277,6 +285,7 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -286,12 +295,14 @@ snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
socket: socket.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -302,6 +313,7 @@ usb: usb.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
$(BACKLIBS) $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
+14 -35
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* DNS-SD discovery backend for CUPS.
*
* Copyright © 2008-2017 by Apple Inc.
* Copyright © 2008-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
@@ -82,23 +82,8 @@ static int browsers = 0; /* Number of running browsers */
*/
#ifdef HAVE_DNSSD
static void browse_callback(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *serviceName,
const char *regtype,
const char *replyDomain, void *context)
__attribute__((nonnull(1,5,6,7,8)));
static void browse_local_callback(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *serviceName,
const char *regtype,
const char *replyDomain,
void *context)
__attribute__((nonnull(1,5,6,7,8)));
static void browse_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context) _CUPS_NONNULL(1,5,6,7,8);
static void browse_local_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context) _CUPS_NONNULL(1,5,6,7,8);
#endif /* HAVE_DNSSD */
#ifdef HAVE_AVAHI
static void browse_callback(AvahiServiceBrowser *browser,
@@ -116,22 +101,10 @@ static void client_callback(AvahiClient *client,
#endif /* HAVE_AVAHI */
static int compare_devices(cups_device_t *a, cups_device_t *b);
static void exec_backend(char **argv) __attribute__((noreturn));
static cups_device_t *get_device(cups_array_t *devices,
const char *serviceName,
const char *regtype,
const char *replyDomain)
__attribute__((nonnull(1,2,3,4)));
static void exec_backend(char **argv) _CUPS_NORETURN;
static cups_device_t *get_device(cups_array_t *devices, const char *serviceName, const char *regtype, const char *replyDomain) _CUPS_NONNULL(1,2,3,4);
#ifdef HAVE_DNSSD
static void query_callback(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *fullName, uint16_t rrtype,
uint16_t rrclass, uint16_t rdlen,
const void *rdata, uint32_t ttl,
void *context)
__attribute__((nonnull(1,5,9,11)));
static void query_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullName, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context) _CUPS_NONNULL(1,5,9,11);
#elif defined(HAVE_AVAHI)
static int poll_callback(struct pollfd *pollfds,
unsigned int num_pollfds, int timeout,
@@ -147,8 +120,7 @@ static void query_callback(AvahiRecordBrowser *browser,
void *context);
#endif /* HAVE_DNSSD */
static void sigterm_handler(int sig);
static void unquote(char *dst, const char *src, size_t dstsize)
__attribute__((nonnull(1,2)));
static void unquote(char *dst, const char *src, size_t dstsize) _CUPS_NONNULL(1,2);
/*
@@ -1252,6 +1224,13 @@ query_callback(
strlcat(make_and_model, " ", sizeof(make_and_model));
strlcat(make_and_model, model, sizeof(make_and_model));
if (!_cups_strncasecmp(make_and_model, "EPSON EPSON ", 12))
_cups_strcpy(make_and_model, make_and_model + 6);
else if (!_cups_strncasecmp(make_and_model, "HP HP ", 6))
_cups_strcpy(make_and_model, make_and_model + 3);
else if (!_cups_strncasecmp(make_and_model, "Lexmark International Lexmark ", 30))
_cups_strcpy(make_and_model, make_and_model + 22);
device->make_and_model = strdup(make_and_model);
}
else
-23
Ver Arquivo
@@ -55,19 +55,12 @@ backendGetDeviceID(
char *ptr; /* Pointer into device ID */
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
"make_model=%p, make_model_size=%d, scheme=\"%s\", "
"uri=%p, uri_size=%d)\n", fd, device_id, device_id_size,
make_model, make_model_size, scheme ? scheme : "(null)",
uri, uri_size));
/*
* Range check input...
*/
if (!device_id || device_id_size < 32)
{
DEBUG_puts("backendGetDeviceID: Bad args!");
return (-1);
}
@@ -211,8 +204,6 @@ backendGetDeviceID(
}
else
{
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
strerror(errno)));
*device_id = '\0';
}
# endif /* __linux */
@@ -234,11 +225,6 @@ backendGetDeviceID(
else
device_id[device_id_size - 1] = '\0';
}
# ifdef DEBUG
else
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
strerror(errno)));
# endif /* DEBUG */
# endif /* __sun && ECPPIOC_GETDEVID */
}
@@ -252,14 +238,10 @@ backendGetDeviceID(
*ptr = ' ';
else if ((*ptr & 255) < ' ' || *ptr == 127)
{
DEBUG_printf(("backendGetDeviceID: Bad device_id character %d.",
*ptr & 255));
*device_id = '\0';
break;
}
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
if (scheme && uri)
*uri = '\0';
@@ -365,17 +347,12 @@ backendGetMakeModel(
*des; /* Description string */
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", make_model=%p, make_model_size=" CUPS_LLFMT ")\n", device_id, make_model, CUPS_LLCAST make_model_size));
/*
* Range check input...
*/
if (!device_id || !*device_id || !make_model || make_model_size < 32)
{
DEBUG_puts("backendGetMakeModel: Bad args!");
return (-1);
}
*make_model = '\0';
+149 -116
Ver Arquivo
@@ -421,9 +421,9 @@ main(int argc, /* I - Number of command-line args */
port = IPP_PORT; /* Default to port 631 */
if (!strcmp(scheme, "https") || !strcmp(scheme, "ipps"))
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
cupsSetEncryption(HTTP_ENCRYPTION_ALWAYS);
else
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
cupsSetEncryption(HTTP_ENCRYPTION_IF_REQUESTED);
/*
* See if there are any options...
@@ -510,13 +510,13 @@ main(int argc, /* I - Number of command-line args */
*/
if (!_cups_strcasecmp(value, "always"))
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
cupsSetEncryption(HTTP_ENCRYPTION_ALWAYS);
else if (!_cups_strcasecmp(value, "required"))
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
cupsSetEncryption(HTTP_ENCRYPTION_REQUIRED);
else if (!_cups_strcasecmp(value, "never"))
cupsSetEncryption(HTTP_ENCRYPT_NEVER);
cupsSetEncryption(HTTP_ENCRYPTION_NEVER);
else if (!_cups_strcasecmp(value, "ifrequested"))
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
cupsSetEncryption(HTTP_ENCRYPTION_IF_REQUESTED);
else
{
_cupsLangPrintFilter(stderr, "ERROR",
@@ -704,11 +704,11 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "DEBUG: Connecting to %s:%d\n", hostname, port);
_cupsLangPrintFilter(stderr, "INFO", _("Connecting to printer."));
if (httpReconnect(http))
if (httpReconnect2(http, 30000, NULL))
{
int error = errno; /* Connection error */
if (http->status == HTTP_PKI_ERROR)
if (http->status == HTTP_STATUS_CUPS_PKI_ERROR)
update_reasons(NULL, "+cups-certificate-error");
if (job_canceled)
@@ -911,7 +911,7 @@ main(int argc, /* I - Number of command-line args */
* Build the IPP request...
*/
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
@@ -926,7 +926,7 @@ main(int argc, /* I - Number of command-line args */
fputs("DEBUG: Getting supported attributes...\n", stderr);
if (http->version < HTTP_1_1)
if (http->version < HTTP_VERSION_1_1)
{
fprintf(stderr, "DEBUG: Printer responded with HTTP version %d.%d.\n",
http->version / 100, http->version % 100);
@@ -940,15 +940,15 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "DEBUG: Get-Printer-Attributes: %s (%s)\n",
ippErrorString(ipp_status), cupsLastErrorString());
if (ipp_status <= IPP_OK_CONFLICT)
if (ipp_status <= IPP_STATUS_OK_CONFLICTING)
password_tries = 0;
else
{
fprintf(stderr, "DEBUG: Get-Printer-Attributes returned %s.\n",
ippErrorString(ipp_status));
if (ipp_status == IPP_PRINTER_BUSY ||
ipp_status == IPP_SERVICE_UNAVAILABLE)
if (ipp_status == IPP_STATUS_ERROR_BUSY ||
ipp_status == IPP_STATUS_ERROR_SERVICE_UNAVAILABLE)
{
if (contimeout && (time(NULL) - start_time) > contimeout)
{
@@ -965,8 +965,8 @@ main(int argc, /* I - Number of command-line args */
delay = _cupsNextDelay(delay, &prev_delay);
}
else if ((ipp_status == IPP_BAD_REQUEST ||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version > 10)
else if ((ipp_status == IPP_STATUS_ERROR_BAD_REQUEST ||
ipp_status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) && version > 10)
{
/*
* Switch to IPP/1.1 or IPP/1.0...
@@ -989,9 +989,9 @@ main(int argc, /* I - Number of command-line args */
version = 10;
}
httpReconnect(http);
httpReconnect2(http, 30000, NULL);
}
else if (ipp_status == IPP_NOT_FOUND)
else if (ipp_status == IPP_STATUS_ERROR_NOT_FOUND)
{
_cupsLangPrintFilter(stderr, "ERROR",
_("The printer configuration is incorrect or the "
@@ -1001,8 +1001,8 @@ main(int argc, /* I - Number of command-line args */
return (CUPS_BACKEND_STOP);
}
else if (ipp_status == IPP_FORBIDDEN ||
ipp_status == IPP_AUTHENTICATION_CANCELED)
else if (ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED)
{
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
/* WWW-Authenticate field value */
@@ -1015,13 +1015,13 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
return (CUPS_BACKEND_AUTH_REQUIRED);
}
else if (ipp_status != IPP_NOT_AUTHORIZED)
else if (ipp_status != IPP_STATUS_ERROR_NOT_AUTHORIZED)
{
_cupsLangPrintFilter(stderr, "ERROR",
_("Unable to get printer status."));
sleep(10);
httpReconnect(http);
httpReconnect2(http, 30000, NULL);
}
ippDelete(supported);
@@ -1135,7 +1135,14 @@ main(int argc, /* I - Number of command-line args */
copies_sup = NULL; /* No */
}
cups_version = ippFindAttribute(supported, "cups-version", IPP_TAG_TEXT);
if ((cups_version = ippFindAttribute(supported, "cups-version", IPP_TAG_TEXT)) != NULL)
{
const char *val = ippGetString(cups_version, 0, NULL);
fprintf(stderr, "DEBUG: cups-version = \"%s\"\n", val);
if (!strcmp(val, "cups-version"))
cups_version = NULL; /* Bogus cups-version value returned by buggy printers! */
}
encryption_sup = ippFindAttribute(supported, "job-password-encryption-supported", IPP_TAG_KEYWORD);
@@ -1171,7 +1178,7 @@ main(int argc, /* I - Number of command-line args */
ippOpString(operations_sup->values[i].integer));
for (i = 0; i < operations_sup->num_values; i ++)
if (operations_sup->values[i].integer == IPP_PRINT_JOB)
if (operations_sup->values[i].integer == IPP_OP_PRINT_JOB)
break;
if (i >= operations_sup->num_values)
@@ -1179,7 +1186,7 @@ main(int argc, /* I - Number of command-line args */
"cups-ipp-missing-print-job");
for (i = 0; i < operations_sup->num_values; i ++)
if (operations_sup->values[i].integer == IPP_CANCEL_JOB)
if (operations_sup->values[i].integer == IPP_OP_CANCEL_JOB)
break;
if (i >= operations_sup->num_values)
@@ -1187,7 +1194,7 @@ main(int argc, /* I - Number of command-line args */
"cups-ipp-missing-cancel-job");
for (i = 0; i < operations_sup->num_values; i ++)
if (operations_sup->values[i].integer == IPP_GET_JOB_ATTRIBUTES)
if (operations_sup->values[i].integer == IPP_OP_GET_JOB_ATTRIBUTES)
break;
if (i >= operations_sup->num_values)
@@ -1195,7 +1202,7 @@ main(int argc, /* I - Number of command-line args */
"cups-ipp-missing-get-job-attributes");
for (i = 0; i < operations_sup->num_values; i ++)
if (operations_sup->values[i].integer == IPP_GET_PRINTER_ATTRIBUTES)
if (operations_sup->values[i].integer == IPP_OP_GET_PRINTER_ATTRIBUTES)
break;
if (i >= operations_sup->num_values)
@@ -1204,13 +1211,13 @@ main(int argc, /* I - Number of command-line args */
for (i = 0; i < operations_sup->num_values; i ++)
{
if (operations_sup->values[i].integer == IPP_VALIDATE_JOB)
if (operations_sup->values[i].integer == IPP_OP_VALIDATE_JOB)
validate_job = 1;
else if (operations_sup->values[i].integer == IPP_CREATE_JOB)
else if (operations_sup->values[i].integer == IPP_OP_CREATE_JOB)
create_job = 1;
else if (operations_sup->values[i].integer == IPP_SEND_DOCUMENT)
else if (operations_sup->values[i].integer == IPP_OP_SEND_DOCUMENT)
send_document = 1;
else if (operations_sup->values[i].integer == IPP_GET_JOB_ATTRIBUTES)
else if (operations_sup->values[i].integer == IPP_OP_GET_JOB_ATTRIBUTES)
get_job_attrs = 1;
}
@@ -1238,7 +1245,7 @@ main(int argc, /* I - Number of command-line args */
report_printer_state(supported);
}
while (!job_canceled && ipp_status > IPP_OK_CONFLICT);
while (!job_canceled && ipp_status > IPP_STATUS_OK_CONFLICTING);
if (job_canceled)
return (CUPS_BACKEND_OK);
@@ -1256,7 +1263,7 @@ main(int argc, /* I - Number of command-line args */
IPP_TAG_BOOLEAN);
if (printer_state == NULL ||
(printer_state->values[0].integer > IPP_PRINTER_PROCESSING &&
(printer_state->values[0].integer > IPP_PSTATE_PROCESSING &&
waitprinter) ||
printer_accepting == NULL ||
!printer_accepting->values[0].boolean)
@@ -1382,7 +1389,7 @@ main(int argc, /* I - Number of command-line args */
* (I hate compatibility hacks!)
*/
if (http->version < HTTP_1_1 && num_files == 0)
if (http->version < HTTP_VERSION_1_1 && num_files == 0)
{
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
{
@@ -1410,7 +1417,7 @@ main(int argc, /* I - Number of command-line args */
files = &compatfile;
num_files = 1;
}
else if (http->version < HTTP_1_1 && num_files == 1)
else if (http->version < HTTP_VERSION_1_1 && num_files == 1)
{
struct stat fileinfo; /* File information */
@@ -1443,8 +1450,8 @@ main(int argc, /* I - Number of command-line args */
monitor.create_job = create_job;
monitor.get_job_attrs = get_job_attrs;
monitor.encryption = cupsEncryption();
monitor.job_state = IPP_JOB_PENDING;
monitor.printer_state = IPP_PRINTER_IDLE;
monitor.job_state = IPP_JSTATE_PENDING;
monitor.printer_state = IPP_PSTATE_IDLE;
monitor.retryable = argc == 6 && document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf");
if (create_job)
@@ -1485,6 +1492,30 @@ main(int argc, /* I - Number of command-line args */
ippGetString(job_auth, 0, NULL), num_options,
&options);
if (ipp_status == IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED || ipp_status == IPP_STATUS_OK_CONFLICTING)
{
/*
* One or more options are not supported...
*/
ipp_attribute_t *attr; /* Unsupported attribute */
if ((attr = ippFindAttribute(response, "sides", IPP_TAG_ZERO)) != NULL)
{
/*
* The sides value is not supported, revert to one-sided as needed...
*/
const char *sides = cupsGetOption("sides", num_options, options);
if (!strncmp(sides, "two-sided-", 10))
{
fputs("DEBUG: Unable to do two-sided printing, setting sides to 'one-sided'.\n", stderr);
num_options = cupsAddOption("sides", "one-sided", num_options, &options);
}
}
}
ippDelete(response);
if (job_canceled)
@@ -1527,10 +1558,10 @@ main(int argc, /* I - Number of command-line args */
"cups-ipp-missing-validate-job");
break;
}
else if (ipp_status < IPP_REDIRECTION_OTHER_SITE ||
ipp_status == IPP_BAD_REQUEST)
else if (ipp_status < IPP_STATUS_REDIRECTION_OTHER_SITE ||
ipp_status == IPP_STATUS_ERROR_BAD_REQUEST)
break;
else if (job_auth == NULL && ipp_status > IPP_BAD_REQUEST)
else if (job_auth == NULL && ipp_status > IPP_STATUS_ERROR_BAD_REQUEST)
goto cleanup;
}
@@ -1555,8 +1586,8 @@ main(int argc, /* I - Number of command-line args */
if (job_canceled)
break;
request = new_request((num_files > 1 || create_job) ? IPP_CREATE_JOB :
IPP_PRINT_JOB,
request = new_request((num_files > 1 || create_job) ? IPP_OP_CREATE_JOB :
IPP_OP_PRINT_JOB,
version, uri, argv[2], monitor.job_name, num_options,
options, compression, copies_sup ? copies : 1,
document_format, pc, ppd, media_col_sup,
@@ -1581,7 +1612,7 @@ main(int argc, /* I - Number of command-line args */
fputs("DEBUG: Sending file using HTTP/1.1 chunking...\n", stderr);
http_status = cupsSendRequest(http, request, resource, length);
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
if (http_status == HTTP_STATUS_CONTINUE && request->state == IPP_STATE_DATA)
{
if (compression && strcmp(compression, "none"))
httpSetField(http, HTTP_FIELD_CONTENT_ENCODING, compression);
@@ -1600,7 +1631,7 @@ main(int argc, /* I - Number of command-line args */
http_status = cupsWriteRequestData(http, buffer, (size_t)bytes);
}
while (http_status == HTTP_CONTINUE &&
while (http_status == HTTP_STATUS_CONTINUE &&
(!job_canceled || compatsize > 0))
{
/*
@@ -1625,7 +1656,7 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "DEBUG: Read %d bytes...\n", (int)bytes);
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
!= HTTP_CONTINUE)
!= HTTP_STATUS_CONTINUE)
break;
}
else if (bytes == 0 || (errno != EINTR && errno != EAGAIN))
@@ -1633,7 +1664,7 @@ main(int argc, /* I - Number of command-line args */
}
}
if (http_status == HTTP_ERROR)
if (http_status == HTTP_STATUS_ERROR)
fprintf(stderr, "DEBUG: Error writing document data for "
"Print-Job: %s\n", strerror(httpError(http)));
@@ -1652,7 +1683,7 @@ main(int argc, /* I - Number of command-line args */
ippErrorString(ipp_status), cupsLastErrorString());
debug_attributes(response);
if (ipp_status > IPP_OK_CONFLICT)
if (ipp_status > IPP_STATUS_OK_CONFLICTING)
{
job_id = 0;
@@ -1704,7 +1735,7 @@ main(int argc, /* I - Number of command-line args */
else if (www_auth[0])
auth_info_required = "username,password";
}
else if (ipp_status == IPP_REQUEST_VALUE)
else if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
{
/*
* Print file is too large, abort this job...
@@ -1760,7 +1791,7 @@ main(int argc, /* I - Number of command-line args */
* Send the next file in the job...
*/
request = ippNewRequest(IPP_SEND_DOCUMENT);
request = ippNewRequest(IPP_OP_SEND_DOCUMENT);
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
@@ -1789,7 +1820,7 @@ main(int argc, /* I - Number of command-line args */
debug_attributes(request);
http_status = cupsSendRequest(http, request, resource, 0);
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
if (http_status == HTTP_STATUS_CONTINUE && request->state == IPP_STATE_DATA)
{
if (compression && strcmp(compression, "none"))
httpSetField(http, HTTP_FIELD_CONTENT_ENCODING, compression);
@@ -1813,11 +1844,11 @@ main(int argc, /* I - Number of command-line args */
if (fd >= 0)
{
while (!job_canceled && http_status == HTTP_CONTINUE &&
while (!job_canceled && http_status == HTTP_STATUS_CONTINUE &&
(bytes = read(fd, buffer, sizeof(buffer))) > 0)
{
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
!= HTTP_CONTINUE)
!= HTTP_STATUS_CONTINUE)
break;
else
{
@@ -1833,7 +1864,7 @@ main(int argc, /* I - Number of command-line args */
close(fd);
}
if (http_status == HTTP_ERROR)
if (http_status == HTTP_STATUS_ERROR)
fprintf(stderr, "DEBUG: Error writing document data for "
"Send-Document: %s\n", strerror(httpError(http)));
@@ -1845,7 +1876,7 @@ main(int argc, /* I - Number of command-line args */
debug_attributes(response);
ippDelete(response);
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING && !job_canceled)
{
ipp_status = cupsLastError();
@@ -1866,12 +1897,12 @@ main(int argc, /* I - Number of command-line args */
if (job_canceled)
break;
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
if (ipp_status <= IPP_STATUS_OK_CONFLICTING && argc > 6)
{
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
copies_remaining --;
}
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
argc == 6 &&
document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
{
@@ -1885,9 +1916,9 @@ main(int argc, /* I - Number of command-line args */
goto cleanup;
}
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_NOT_POSSIBLE ||
ipp_status == IPP_PRINTER_BUSY)
else if (ipp_status == IPP_STATUS_ERROR_SERVICE_UNAVAILABLE ||
ipp_status == IPP_STATUS_ERROR_NOT_POSSIBLE ||
ipp_status == IPP_STATUS_ERROR_BUSY)
{
if (argc == 6)
{
@@ -1903,14 +1934,14 @@ main(int argc, /* I - Number of command-line args */
}
continue;
}
else if (ipp_status == IPP_REQUEST_VALUE ||
ipp_status == IPP_ERROR_JOB_CANCELED ||
ipp_status == IPP_NOT_AUTHORIZED ||
else if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE ||
ipp_status == IPP_STATUS_ERROR_JOB_CANCELED ||
ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED ||
ipp_status == IPP_INTERNAL_ERROR)
ipp_status == IPP_STATUS_ERROR_INTERNAL)
{
/*
* Print file is too large, job was canceled, we need new
@@ -1940,7 +1971,7 @@ main(int argc, /* I - Number of command-line args */
goto cleanup;
}
else if (ipp_status == IPP_NOT_FOUND)
else if (ipp_status == IPP_STATUS_ERROR_NOT_FOUND)
{
/*
* Printer does not actually implement support for Create-Job/
@@ -1954,7 +1985,7 @@ main(int argc, /* I - Number of command-line args */
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
"cups-ipp-missing-send-document");
ipp_status = IPP_INTERNAL_ERROR; /* Force queue to stop */
ipp_status = IPP_STATUS_ERROR_INTERNAL; /* Force queue to stop */
goto cleanup;
}
@@ -1986,14 +2017,14 @@ main(int argc, /* I - Number of command-line args */
check_printer_state(http, uri, resource, argv[2], version);
if (cupsLastError() <= IPP_OK_CONFLICT)
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
password_tries = 0;
/*
* Build an IPP_GET_JOB_ATTRIBUTES request...
* Build an IPP_OP_GET_JOB_ATTRIBUTES request...
*/
request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
request = ippNewRequest(IPP_OP_GET_JOB_ATTRIBUTES);
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
@@ -2017,11 +2048,11 @@ main(int argc, /* I - Number of command-line args */
* Do the request...
*/
httpReconnect(http);
httpReconnect2(http, 30000, NULL);
response = cupsDoRequest(http, request, resource);
ipp_status = cupsLastError();
if (ipp_status == IPP_NOT_FOUND || ipp_status == IPP_NOT_POSSIBLE)
if (ipp_status == IPP_STATUS_ERROR_NOT_FOUND || ipp_status == IPP_STATUS_ERROR_NOT_POSSIBLE)
{
/*
* Job has gone away and/or the server has no job history...
@@ -2031,7 +2062,7 @@ main(int argc, /* I - Number of command-line args */
"cups-ipp-missing-job-history");
ippDelete(response);
ipp_status = IPP_OK;
ipp_status = IPP_STATUS_OK;
break;
}
@@ -2039,25 +2070,25 @@ main(int argc, /* I - Number of command-line args */
ippErrorString(ipp_status), cupsLastErrorString());
debug_attributes(response);
if (ipp_status <= IPP_OK_CONFLICT)
if (ipp_status <= IPP_STATUS_OK_CONFLICTING)
password_tries = 0;
else
{
if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
ipp_status != IPP_PRINTER_BUSY)
if (ipp_status != IPP_STATUS_ERROR_SERVICE_UNAVAILABLE &&
ipp_status != IPP_STATUS_ERROR_BUSY)
{
ippDelete(response);
ipp_status = IPP_OK;
ipp_status = IPP_STATUS_OK;
break;
}
else if (ipp_status == IPP_INTERNAL_ERROR)
else if (ipp_status == IPP_STATUS_ERROR_INTERNAL)
{
waitjob_tries ++;
if (waitjob_tries > 4)
{
ippDelete(response);
ipp_status = IPP_OK;
ipp_status = IPP_STATUS_OK;
break;
}
}
@@ -2073,11 +2104,11 @@ main(int argc, /* I - Number of command-line args */
*/
if (cups_version &&
job_state->values[0].integer >= IPP_JOB_PENDING &&
job_state->values[0].integer <= IPP_JOB_COMPLETED)
job_state->values[0].integer >= IPP_JSTATE_PENDING &&
job_state->values[0].integer <= IPP_JSTATE_COMPLETED)
update_reasons(NULL,
remote_job_states[job_state->values[0].integer -
IPP_JOB_PENDING]);
IPP_JSTATE_PENDING]);
if ((job_sheets = ippFindAttribute(response, "job-impressions-completed", IPP_TAG_INTEGER)) == NULL)
job_sheets = ippFindAttribute(response, "job-media-sheets-completed", IPP_TAG_INTEGER);
@@ -2097,9 +2128,9 @@ main(int argc, /* I - Number of command-line args */
break;
}
}
else if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
ipp_status != IPP_NOT_POSSIBLE &&
ipp_status != IPP_PRINTER_BUSY)
else if (ipp_status != IPP_STATUS_ERROR_SERVICE_UNAVAILABLE &&
ipp_status != IPP_STATUS_ERROR_NOT_POSSIBLE &&
ipp_status != IPP_STATUS_ERROR_BUSY)
{
/*
* If the printer does not return a job-state attribute, it does not
@@ -2109,7 +2140,7 @@ main(int argc, /* I - Number of command-line args */
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
"cups-ipp-missing-job-state");
ipp_status = IPP_INTERNAL_ERROR;
ipp_status = IPP_STATUS_ERROR_INTERNAL;
break;
}
}
@@ -2134,7 +2165,7 @@ main(int argc, /* I - Number of command-line args */
{
cancel_job(http, uri, job_id, resource, argv[2], version);
if (cupsLastError() > IPP_OK_CONFLICT)
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING)
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
}
@@ -2144,7 +2175,7 @@ main(int argc, /* I - Number of command-line args */
check_printer_state(http, uri, resource, argv[2], version);
if (cupsLastError() <= IPP_OK_CONFLICT)
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
password_tries = 0;
/*
@@ -2191,9 +2222,9 @@ main(int argc, /* I - Number of command-line args */
* Return the queue status...
*/
if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN ||
ipp_status == IPP_AUTHENTICATION_CANCELED ||
ipp_status <= IPP_OK_CONFLICT)
if (ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED ||
ipp_status <= IPP_STATUS_OK_CONFLICTING)
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED)
@@ -2205,25 +2236,25 @@ main(int argc, /* I - Number of command-line args */
else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
fputs("JOBSTATE: account-authorization-failed\n", stderr);
if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN ||
ipp_status == IPP_AUTHENTICATION_CANCELED)
if (ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED)
return (CUPS_BACKEND_AUTH_REQUIRED);
else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
return (CUPS_BACKEND_HOLD);
else if (ipp_status == IPP_INTERNAL_ERROR)
else if (ipp_status == IPP_STATUS_ERROR_INTERNAL)
return (CUPS_BACKEND_STOP);
else if (ipp_status == IPP_CONFLICT || ipp_status == IPP_STATUS_ERROR_REQUEST_ENTITY || ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
else if (ipp_status == IPP_STATUS_ERROR_CONFLICTING || ipp_status == IPP_STATUS_ERROR_REQUEST_ENTITY || ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
return (CUPS_BACKEND_FAILED);
else if (ipp_status == IPP_REQUEST_VALUE ||
else if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE ||
ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
ipp_status == IPP_DOCUMENT_FORMAT || job_canceled < 0)
ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || job_canceled < 0)
{
if (ipp_status == IPP_REQUEST_VALUE)
if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
_cupsLangPrintFilter(stderr, "ERROR", _("Print job too large."));
else if (ipp_status == IPP_DOCUMENT_FORMAT)
else if (ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED)
_cupsLangPrintFilter(stderr, "ERROR",
_("Printer cannot print supplied content."));
else if (ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES)
@@ -2234,7 +2265,7 @@ main(int argc, /* I - Number of command-line args */
return (CUPS_BACKEND_CANCEL);
}
else if (ipp_status > IPP_OK_CONFLICT && ipp_status != IPP_ERROR_JOB_CANCELED)
else if (ipp_status > IPP_STATUS_OK_CONFLICTING && ipp_status != IPP_STATUS_ERROR_JOB_CANCELED)
return (CUPS_BACKEND_RETRY_CURRENT);
else
return (CUPS_BACKEND_OK);
@@ -2258,7 +2289,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
_cupsLangPrintFilter(stderr, "INFO", _("Canceling print job."));
request = ippNewRequest(IPP_CANCEL_JOB);
request = ippNewRequest(IPP_OP_CANCEL_JOB);
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
@@ -2292,7 +2323,7 @@ check_printer_state(
ipp_t *request, /* IPP request */
*response; /* IPP response */
ipp_attribute_t *attr; /* Attribute in response */
ipp_pstate_t printer_state = IPP_PRINTER_STOPPED;
ipp_pstate_t printer_state = IPP_PSTATE_STOPPED;
/* Current printer-state */
@@ -2300,7 +2331,7 @@ check_printer_state(
* Send a Get-Printer-Attributes request and log the results...
*/
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
@@ -2426,14 +2457,14 @@ monitor_printer(
monitor->job_reasons = 0;
while (monitor->job_state < IPP_JOB_CANCELED && !job_canceled)
while (monitor->job_state < IPP_JSTATE_CANCELED && !job_canceled)
{
/*
* Reconnect to the printer as needed...
*/
if (httpGetFd(http) < 0)
httpReconnect(http);
httpReconnect2(http, 30000, NULL);
if (httpGetFd(http) >= 0)
{
@@ -2445,7 +2476,7 @@ monitor_printer(
monitor->resource,
monitor->user,
monitor->version);
if (cupsLastError() <= IPP_OK_CONFLICT)
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
password_tries = 0;
if (monitor->job_id == 0 && monitor->create_job)
@@ -2462,13 +2493,13 @@ monitor_printer(
*/
job_op = (monitor->job_id > 0 && monitor->get_job_attrs) ?
IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS;
IPP_OP_GET_JOB_ATTRIBUTES : IPP_OP_GET_JOBS;
request = ippNewRequest(job_op);
ippSetVersion(request, monitor->version / 10, monitor->version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, monitor->uri);
if (job_op == IPP_GET_JOB_ATTRIBUTES)
if (job_op == IPP_OP_GET_JOB_ATTRIBUTES)
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
monitor->job_id);
@@ -2489,16 +2520,16 @@ monitor_printer(
fprintf(stderr, "DEBUG: (monitor) %s: %s (%s)\n", ippOpString(job_op),
ippErrorString(cupsLastError()), cupsLastErrorString());
if (cupsLastError() <= IPP_OK_CONFLICT)
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
password_tries = 0;
if (job_op == IPP_GET_JOB_ATTRIBUTES)
if (job_op == IPP_OP_GET_JOB_ATTRIBUTES)
{
if ((attr = ippFindAttribute(response, "job-state",
IPP_TAG_ENUM)) != NULL)
monitor->job_state = (ipp_jstate_t)attr->values[0].integer;
else
monitor->job_state = IPP_JOB_COMPLETED;
monitor->job_state = IPP_JSTATE_COMPLETED;
}
else if (response)
{
@@ -2506,7 +2537,7 @@ monitor_printer(
{
job_id = 0;
job_name = NULL;
job_state = IPP_JOB_PENDING;
job_state = IPP_JSTATE_PENDING;
job_user = NULL;
while (attr && attr->group_tag != IPP_TAG_JOB)
@@ -2552,8 +2583,8 @@ monitor_printer(
ippEnumString("job-state", monitor->job_state));
if (!job_canceled &&
(monitor->job_state == IPP_JOB_CANCELED ||
monitor->job_state == IPP_JOB_ABORTED))
(monitor->job_state == IPP_JSTATE_CANCELED ||
monitor->job_state == IPP_JSTATE_ABORTED))
{
job_canceled = -1;
fprintf(stderr, "DEBUG: (monitor) job_canceled = -1\n");
@@ -2634,8 +2665,8 @@ monitor_printer(
ippEnumString("job-state", monitor->job_state));
if (!job_canceled &&
(monitor->job_state == IPP_JOB_CANCELED ||
monitor->job_state == IPP_JOB_ABORTED))
(monitor->job_state == IPP_JSTATE_CANCELED ||
monitor->job_state == IPP_JSTATE_ABORTED))
job_canceled = -1;
}
@@ -2657,14 +2688,14 @@ monitor_printer(
if (job_canceled > 0 && monitor->job_id > 0)
{
if (httpGetFd(http) < 0)
httpReconnect(http);
httpReconnect2(http, 30000, NULL);
if (httpGetFd(http) >= 0)
{
cancel_job(http, monitor->uri, monitor->job_id, monitor->resource,
monitor->user, monitor->version);
if (cupsLastError() > IPP_OK_CONFLICT)
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING)
{
fprintf(stderr, "DEBUG: (monitor) cancel_job() = %s\n", cupsLastErrorString());
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
@@ -2740,7 +2771,7 @@ new_request(
fprintf(stderr, "DEBUG: job-name=\"%s\"\n", title);
}
if (format && op != IPP_CREATE_JOB)
if (format && op != IPP_OP_CREATE_JOB)
{
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, format);
fprintf(stderr, "DEBUG: document-format=\"%s\"\n", format);
@@ -3581,6 +3612,8 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
}
}
cupsArrayDelete(new_reasons);
_cupsMutexUnlock(&report_mutex);
/*
+8 -8
Ver Arquivo
@@ -19,14 +19,14 @@
#include <sys/stat.h>
#include <stdio.h>
#ifdef WIN32
#ifdef _WIN32
# include <winsock.h>
#else
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
#endif /* WIN32 */
#endif /* _WIN32 */
#ifdef __APPLE__
# include <CoreFoundation/CFNumber.h>
# include <CoreFoundation/CFPreferences.h>
@@ -618,11 +618,11 @@ cups_rresvport(int *port, /* IO - Port number to bind to */
* -1...
*/
#ifdef WIN32
#ifdef _WIN32
closesocket(fd);
#else
close(fd);
#endif /* WIN32 */
#endif /* _WIN32 */
return (-1);
}
@@ -730,11 +730,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
ssize_t nbytes; /* Number of bytes written */
off_t tbytes; /* Total bytes written */
char buffer[32768]; /* Output buffer */
#ifdef WIN32
#ifdef _WIN32
DWORD tv; /* Timeout in milliseconds */
#else
struct timeval tv; /* Timeout in secs and usecs */
#endif /* WIN32 */
#endif /* _WIN32 */
/*
@@ -917,7 +917,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
* Set the timeout...
*/
#ifdef WIN32
#ifdef _WIN32
tv = (DWORD)(timeout * 1000);
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
@@ -928,7 +928,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
#endif /* WIN32 */
#endif /* _WIN32 */
fputs("STATE: -connecting-to-device\n", stderr);
_cupsLangPrintFilter(stderr, "INFO", _("Connected to printer."));
+12
Ver Arquivo
@@ -281,3 +281,15 @@
# Lexmark Optra E310 (Issue #5259)
0x043d 0x000c no-reattach
# HP LaserJet P1102 (Issue #5310)
0x03F0 0x002A no-reattach
# Lexmark MS317dn
0x043d 0x0226 no-reattach
# Star TSP743 (Issue #5443)
0x0519 0x0001 delay-close
# Zebra ZD420 (Issue #5395)
0x0a5f 0x0120 unidir no-reattach
+10 -5
Ver Arquivo
@@ -440,6 +440,7 @@ backend_init_supplies(
{
int i, /* Looping var */
type; /* Current marker type */
const char *community; /* SNMP community name */
cups_file_t *cachefile; /* Cache file */
const char *cachedir; /* CUPS_CACHEDIR value */
char addrstr[1024], /* Address string */
@@ -507,6 +508,10 @@ backend_init_supplies(
* See if we should be getting supply levels via SNMP...
*/
community = _cupsSNMPDefaultCommunity();
if (!*community)
return;
if ((ppd = ppdOpenFile(getenv("PPD"))) == NULL ||
((ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
ppdattr->value && _cups_strcasecmp(ppdattr->value, "true")))
@@ -528,7 +533,7 @@ backend_init_supplies(
*/
if (!_cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1,
_cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
community, CUPS_ASN1_GET_REQUEST, 1,
hrDeviceDescr))
return;
@@ -605,7 +610,7 @@ backend_init_supplies(
if (!_cupsSNMPWrite(snmp_fd, &current_addr, CUPS_SNMP_VERSION_1,
_cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
community, CUPS_ASN1_GET_REQUEST, 1,
prtGeneralCurrentLocalization))
return;
@@ -626,7 +631,7 @@ backend_init_supplies(
if (!_cupsSNMPWrite(snmp_fd, &current_addr, CUPS_SNMP_VERSION_1,
_cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
community, CUPS_ASN1_GET_REQUEST, 1,
oid))
return;
@@ -651,7 +656,7 @@ backend_init_supplies(
*/
_cupsSNMPWalk(snmp_fd, &current_addr, CUPS_SNMP_VERSION_1,
_cupsSNMPDefaultCommunity(), prtMarkerSuppliesEntry,
community, prtMarkerSuppliesEntry,
CUPS_SUPPLY_TIMEOUT, backend_walk_cb, NULL);
}
@@ -685,7 +690,7 @@ backend_init_supplies(
strlcpy(supplies[i].color, "none", sizeof(supplies[i].color));
_cupsSNMPWalk(snmp_fd, &current_addr, CUPS_SNMP_VERSION_1,
_cupsSNMPDefaultCommunity(), prtMarkerColorantValue,
community, prtMarkerColorantValue,
CUPS_SUPPLY_TIMEOUT, backend_walk_cb, NULL);
/*
+9 -7
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* AppSocket backend for CUPS.
*
* Copyright © 2007-2016 by Apple Inc.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -18,7 +18,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifdef WIN32
#ifdef _WIN32
# include <winsock.h>
#else
# include <unistd.h>
@@ -27,7 +27,7 @@
# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
#endif /* WIN32 */
#endif /* _WIN32 */
/*
@@ -397,8 +397,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
lseek(print_fd, 0, SEEK_SET);
}
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addrlist->addr), 1,
0, backendNetworkSideCB);
if ((bytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addrlist->addr), 1, 0, backendNetworkSideCB)) < 0)
tbytes = -1;
else
tbytes = bytes;
if (print_fd != 0 && tbytes >= 0)
_cupsLangPrintFilter(stderr, "INFO", _("Print file sent."));
@@ -406,7 +408,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
if (waiteof)
if (waiteof && tbytes >= 0)
{
/*
* Shutdown the socket and wait for the other end to finish...
@@ -443,7 +445,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (print_fd != 0)
close(print_fd);
return (CUPS_BACKEND_OK);
return (tbytes >= 0 ? CUPS_BACKEND_OK : CUPS_BACKEND_FAILED);
}
+2 -2
Ver Arquivo
@@ -13,12 +13,12 @@
*/
#include <cups/string-private.h>
#ifdef WIN32
#ifdef _WIN32
# include <io.h>
#else
# include <unistd.h>
# include <fcntl.h>
#endif /* WIN32 */
#endif /* _WIN32 */
#include "ieee1284.c"
+1 -1
Ver Arquivo
@@ -33,7 +33,7 @@ static int job_canceled = 0;
*/
static void sigterm_handler(int sig);
static void usage(void) __attribute__((noreturn));
static void usage(void) _CUPS_NORETURN;
static void walk_cb(const char *oid, const char *data, int datalen,
void *context);
+3 -3
Ver Arquivo
@@ -290,10 +290,10 @@ static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
#if defined(__i386__) || defined(__x86_64__)
static pid_t child_pid; /* Child PID */
static void run_legacy_backend(int argc, char *argv[], int fd) __attribute__((noreturn)); /* Starts child backend process running as a ppc executable */
static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a ppc executable */
#endif /* __i386__ || __x86_64__ */
static void sigterm_handler(int sig); /* SIGTERM handler */
static void sigquit_handler(int sig, siginfo_t *si, void *unused) __attribute__((noreturn));
static void sigquit_handler(int sig, siginfo_t *si, void *unused) _CUPS_NORETURN;
#ifdef PARSE_PS_ERRORS
static const char *next_line (const char *buffer);
@@ -2009,7 +2009,7 @@ static void parse_options(char *options,
value);
}
else if (!_cups_strcasecmp(name, "serial"))
strlcpy(serial, value, serial_size);
strlcpy(serial, value, (size_t)serial_size);
else if (!_cups_strcasecmp(name, "location") && location)
*location = (UInt32)strtoul(value, NULL, 16);
}
+2 -2
Ver Arquivo
@@ -19,13 +19,13 @@
#include "backend-private.h"
#ifdef WIN32
#ifdef _WIN32
# include <io.h>
#else
# include <unistd.h>
# include <fcntl.h>
# include <termios.h>
#endif /* WIN32 */
#endif /* _WIN32 */
/*
+21 -22
Ver Arquivo
@@ -1,25 +1,24 @@
lpc.o: lpc.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
../config.h ../cups/debug-private.h ../cups/versioning.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/thread-private.h
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
../config.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/thread-private.h
+5 -1
Ver Arquivo
@@ -1,7 +1,7 @@
#
# Berkeley commands makefile for CUPS.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 2007-2018 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
@@ -121,6 +121,7 @@ uninstall:
lpc: lpc.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -130,6 +131,7 @@ lpc: lpc.o ../cups/$(LIBCUPS)
lpq: lpq.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -139,6 +141,7 @@ lpq: lpq.o ../cups/$(LIBCUPS)
lpr: lpr.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -148,6 +151,7 @@ lpr: lpr.o ../cups/$(LIBCUPS)
lprm: lprm.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
-4
Ver Arquivo
@@ -230,8 +230,6 @@ show_status(http_t *http, /* I - HTTP connection to server */
};
DEBUG_printf(("show_status(http=%p, dests=\"%s\")\n", http, dests));
if (http == NULL)
return;
@@ -255,8 +253,6 @@ show_status(http_t *http, /* I - HTTP connection to server */
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
DEBUG_puts("show_status: request succeeded...");
/*
* Loop through the printers returned in the list and display
* their status...
+16 -10
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* "lpq" command for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -22,7 +23,7 @@ static http_t *connect_server(const char *, http_t *);
static int show_jobs(const char *, http_t *, const char *,
const char *, const int, const int);
static void show_printer(const char *, http_t *, const char *);
static void usage(void) __attribute__((noreturn));
static void usage(void) _CUPS_NORETURN;
/*
@@ -67,6 +68,8 @@ main(int argc, /* I - Number of command-line arguments */
{
interval = atoi(argv[i] + 1);
}
else if (!strcmp(argv[i], "--help"))
usage();
else if (argv[i][0] == '-')
{
for (opt = argv[i] + 1; *opt; opt ++)
@@ -348,9 +351,6 @@ show_jobs(const char *command, /* I - Command name */
};
DEBUG_printf(("show_jobs(http=%p, dest=%p, user=%p, id=%d, longstatus%d)\n",
http, dest, user, id, longstatus));
if (http == NULL)
return (0);
@@ -638,8 +638,14 @@ show_printer(const char *command, /* I - Command name */
static void
usage(void)
{
_cupsLangPuts(stderr,
_("Usage: lpq [-P dest] [-U username] [-h hostname[:port]] "
"[-l] [+interval]"));
_cupsLangPuts(stderr, _("Usage: lpq [options] [+interval]"));
_cupsLangPuts(stdout, _("Options:"));
_cupsLangPuts(stdout, _("-a Show jobs on all destinations"));
_cupsLangPuts(stdout, _("-E Encrypt the connection to the server"));
_cupsLangPuts(stdout, _("-h server[:port] Connect to the named server and port"));
_cupsLangPuts(stdout, _("-l Show verbose (long) output"));
_cupsLangPuts(stdout, _("-P destination Show status for the specified destination"));
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
exit(1);
}
+56 -11
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* "lpr" command for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -14,6 +15,13 @@
#include <cups/cups-private.h>
/*
* Local functions...
*/
static void usage(void) _CUPS_NORETURN;
/*
* 'main()' - Parse options and send files for printing.
*/
@@ -51,7 +59,9 @@ main(int argc, /* I - Number of command-line arguments */
for (i = 1; i < argc; i ++)
{
if (argv[i][0] == '-')
if (!strcmp(argv[i], "--help"))
usage();
else if (argv[i][0] == '-')
{
for (opt = argv[i] + 1; *opt; opt ++)
{
@@ -77,7 +87,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected username after \"-U\" option."), argv[0]);
return (1);
usage();
}
cupsSetUser(argv[i]);
@@ -97,7 +107,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected hostname after \"-H\" option."), argv[0]);
return (1);
usage();
}
else
cupsSetServer(argv[i]);
@@ -123,7 +133,7 @@ main(int argc, /* I - Number of command-line arguments */
_cupsLangPrintf(stderr,
_("%s: Error - expected value after \"-%c\" "
"option."), argv[0], ch);
return (1);
usage();
}
}
@@ -149,7 +159,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected option=value after \"-o\" option."), argv[0]);
return (1);
usage();
}
num_options = cupsParseOptions(argv[i], num_options, &options);
@@ -200,7 +210,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected destination after \"-P\" option."), argv[0]);
return (1);
usage();
}
printer = argv[i];
@@ -238,7 +248,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected copies after \"-#\" option."), argv[0]);
return (1);
usage();
}
num_copies = atoi(argv[i]);
@@ -268,7 +278,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected name after \"-%c\" option."), argv[0], ch);
return (1);
usage();
}
title = argv[i];
@@ -408,3 +418,38 @@ main(int argc, /* I - Number of command-line arguments */
return (0);
}
/*
* 'usage()' - Show program usage and exit.
*/
static void
usage(void)
{
_cupsLangPuts(stdout, _("Usage: lpr [options] [file(s)]"));
_cupsLangPuts(stdout, _("Options:"));
_cupsLangPuts(stdout, _("-# num-copies Specify the number of copies to print"));
_cupsLangPuts(stdout, _("-E Encrypt the connection to the server"));
_cupsLangPuts(stdout, _("-H server[:port] Connect to the named server and port"));
_cupsLangPuts(stdout, _("-m Send an email notification when the job completes"));
_cupsLangPuts(stdout, _("-o option[=value] Specify a printer-specific option"));
_cupsLangPuts(stdout, _("-o job-sheets=standard Print a banner page with the job"));
_cupsLangPuts(stdout, _("-o media=size Specify the media size to use"));
_cupsLangPuts(stdout, _("-o number-up=N Specify that input pages should be printed N-up (1, 2, 4, 6, 9, and 16 are supported)"));
_cupsLangPuts(stdout, _("-o orientation-requested=N\n"
" Specify portrait (3) or landscape (4) orientation"));
_cupsLangPuts(stdout, _("-o print-quality=N Specify the print quality - draft (3), normal (4), or best (5)"));
_cupsLangPuts(stdout, _("-o sides=one-sided Specify 1-sided printing"));
_cupsLangPuts(stdout, _("-o sides=two-sided-long-edge\n"
" Specify 2-sided portrait printing"));
_cupsLangPuts(stdout, _("-o sides=two-sided-short-edge\n"
" Specify 2-sided landscape printing"));
_cupsLangPuts(stdout, _("-q Specify the job should be held for printing"));
_cupsLangPuts(stdout, _("-r Remove the file(s) after submission"));
_cupsLangPuts(stdout, _("-P destination Specify the destination"));
_cupsLangPuts(stdout, _("-T title Specify the job title"));
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
exit(1);
}
+37 -7
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* "lprm" command for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -14,6 +15,13 @@
#include <cups/cups-private.h>
/*
* Local functions...
*/
static void usage(void) _CUPS_NORETURN;
/*
* 'main()' - Parse options and cancel jobs.
*/
@@ -48,7 +56,9 @@ main(int argc, /* I - Number of command-line arguments */
for (i = 1; i < argc; i ++)
{
if (argv[i][0] == '-' && argv[i][1] != '\0')
if (!strcmp(argv[i], "--help"))
usage();
else if (argv[i][0] == '-' && argv[i][1] != '\0')
{
for (opt = argv[i] + 1; *opt; opt ++)
{
@@ -98,7 +108,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected username after \"-U\" option."), argv[0]);
goto error;
usage();
}
cupsSetUser(argv[i]);
@@ -118,7 +128,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i >= argc)
{
_cupsLangPrintf(stderr, _("%s: Error - expected hostname after \"-h\" option."), argv[0]);
goto error;
usage();
}
else
cupsSetServer(argv[i]);
@@ -133,7 +143,7 @@ main(int argc, /* I - Number of command-line arguments */
default :
_cupsLangPrintf(stderr, _("%s: Error - unknown option \"%c\"."), argv[0], *opt);
goto error;
usage();
}
}
}
@@ -208,3 +218,23 @@ main(int argc, /* I - Number of command-line arguments */
return (1);
}
/*
* 'usage()' - Show program usage and exit.
*/
static void
usage(void)
{
_cupsLangPuts(stdout, _("Usage: lprm [options] [id]\n"
" lprm [options] -"));
_cupsLangPuts(stdout, _("Options:"));
_cupsLangPuts(stdout, _("- Cancel all jobs"));
_cupsLangPuts(stdout, _("-E Encrypt the connection to the server"));
_cupsLangPuts(stdout, _("-h server[:port] Connect to the named server and port"));
_cupsLangPuts(stdout, _("-P destination Specify the destination"));
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
exit(1);
}
+26 -26
Ver Arquivo
@@ -1,66 +1,66 @@
help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h \
../cups/debug-private.h ../cups/language-private.h ../config.h \
../cups/transcode.h ../cups/string-private.h ../cups/ipp-private.h \
../cups/dir.h
html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h \
../cups/http-private.h ../cups/ppd-private.h ../cups/ppd.h \
../cups/raster.h ../cups/pwg-private.h ../cups/adminutil.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h ../cups/http-private.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h \
../cups/pwg-private.h ../cups/adminutil.h
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
makedocset.o: makedocset.c cgi-private.h cgi.h ../cups/cups.h \
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/debug-private.h ../cups/language-private.h ../config.h \
../cups/transcode.h ../cups/string-private.h ../cups/ipp-private.h
printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
../cups/language-private.h ../config.h ../cups/transcode.h \
../cups/string-private.h ../cups/ipp-private.h
testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h ../cups/pwg.h help-index.h
+25 -106
Ver Arquivo
@@ -1,10 +1,11 @@
#
# CGI makefile for CUPS.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products.
# Copyright © 2007-2018 by Apple Inc.
# Copyright © 1997-2006 by Easy Software Products.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
include ../Makedefs
@@ -34,8 +35,7 @@ CGIS = \
jobs.cgi \
printers.cgi
LIBTARGETS = \
libcupscgi.a \
$(LIBCUPSCGI)
libcupscgi.a
UNITTARGETS = \
testcgi \
@@ -58,7 +58,7 @@ all: $(TARGETS)
# Make library targets...
#
libs: $(LIBTARGETS) $(UNITTESTS)
libs:
#
@@ -74,7 +74,6 @@ unittests: $(UNITTARGETS)
clean:
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset
$(RM) libcupscgi.so libcupscgi.dylib
#
@@ -122,42 +121,13 @@ install-exec:
#
install-headers:
if test "x$(privateinclude)" != x; then \
echo Installing private header files into $(PRIVATEINCLUDE)...; \
$(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
for file in cgi.h help-index.h; do \
$(INSTALL_DATA) $$file $(PRIVATEINCLUDE); \
done; \
fi
#
# Install libraries...
#
install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
if test $(LIBCUPSCGI) = "libcupscgi.so.1"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
$(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
fi
if test $(LIBCUPSCGI) = "libcupscgi.1.dylib"; then \
$(RM) $(LIBDIR)/libcupscgi.dylib; \
$(LN) $(LIBCUPSCGI) $(LIBDIR)/libcupscgi.dylib; \
fi
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPSCGI) $(SYMROOT); \
dsymutil $(SYMROOT)/$(LIBCUPSCGI); \
fi
installstatic:
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) -m 755 libcupscgi.a $(LIBDIR)
$(RANLIB) $(LIBDIR)/libcupscgi.a
$(CHMOD) 555 $(LIBDIR)/libcupscgi.a
install-libs:
#
@@ -169,54 +139,6 @@ uninstall:
$(RM) $(SERVERBIN)/cgi-bin/$$file; \
done
-$(RMDIR) $(SERVERBIN)/cgi-bin
$(RM) $(LIBDIR)/libcupscgi.1.dylib
$(RM) $(LIBDIR)/libcupscgi.a
$(RM) $(LIBDIR)/libcupscgi.dylib
$(RM) $(LIBDIR)/libcupscgi.so
$(RM) $(LIBDIR)/libcupscgi.so.1
-$(RMDIR) $(LIBDIR)
-if test "x$(privateinclude)" != x; then \
$(RM) $(PRIVATEINCLUDE)/cgi.h; \
$(RM) $(PRIVATEINCLUDE)/help-index.h; \
$(RMDIR) $(PRIVATEINCLUDE); \
fi
#
# libcupscgi.so.1
#
libcupscgi.so.1: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
$(RM) `basename $@ .1`
$(LN) $@ `basename $@ .1`
#
# libcupscgi.1.dylib
#
libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 1.0.0 \
-compatibility_version 1.0.0 \
-exported_symbols_list libcupscgi.exp \
$(LIBOBJS) $(LIBS)
$(RM) libcupscgi.dylib
$(LN) $@ libcupscgi.dylib
#
# libcupscgi.la
#
libcupscgi.la: $(LIBOBJS)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 1:0 $(LIBS)
#
@@ -234,56 +156,50 @@ libcupscgi.a: $(LIBOBJS)
# admin.cgi
#
admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
$(LD_CC) $(LDFLAGS) -o $@ admin.o libcupscgi.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
# classes.cgi
#
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
$(LD_CC) $(LDFLAGS) -o $@ classes.o libcupscgi.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
# help.cgi
#
help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
$(LD_CC) $(LDFLAGS) -o $@ help.o libcupscgi.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
# jobs.cgi
#
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
#
# makedocset
#
makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
$(LIBZ) $(LIBGSSAPI)
$(LD_CC) $(LDFLAGS) -o $@ jobs.o libcupscgi.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
# printers.cgi
#
printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
$(LD_CC) $(LDFLAGS) -o $@ printers.o libcupscgi.a $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -295,6 +211,7 @@ testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
$(LIBZ) $(LIBGSSAPI)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Testing CGI API...
./testcgi
@@ -308,6 +225,7 @@ testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
$(LIBZ) $(LIBGSSAPI)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Testing help index API...
./testhi
@@ -320,6 +238,7 @@ testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
$(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
+8 -6
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Administration CGI for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -928,6 +929,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
else if (!file &&
(!cgiGetVariable("PPD_NAME") || cgiGetVariable("SELECT_MAKE")))
{
int ipp_everywhere = !strncmp(var, "ipp://", 6) || !strncmp(var, "ipps://", 7) || (!strncmp(var, "dnssd://", 8) && (strstr(var, "_ipp._tcp") || strstr(var, "_ipps._tcp")));
if (modify && !cgiGetVariable("SELECT_MAKE"))
{
/*
@@ -1073,9 +1076,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
cgiStartHTML(title);
if (!cgiGetVariable("PPD_MAKE"))
cgiSetVariable("PPD_MAKE", cgiGetVariable("CURRENT_MAKE"));
if (!modify)
cgiSetVariable("CURRENT_MAKE_AND_MODEL",
cgiGetArray("PPD_MAKE_AND_MODEL", 0));
if (ipp_everywhere)
cgiSetVariable("SHOW_IPP_EVERYWHERE", "1");
cgiCopyTemplateLang("choose-model.tmpl");
cgiEndHTML();
}
+2 -2
Ver Arquivo
@@ -15,12 +15,12 @@
# include <time.h>
# include <sys/stat.h>
# ifdef WIN32
# ifdef _WIN32
# include <direct.h>
# include <io.h>
# else
# include <unistd.h>
# endif /* WIN32 */
# endif /* _WIN32 */
# include <cups/cups.h>
# include <cups/array.h>
+1 -46
Ver Arquivo
@@ -134,11 +134,7 @@ static int help_load_file(help_index_t *hi,
const char *filename,
const char *relative,
time_t mtime);
static help_node_t *help_new_node(const char *filename, const char *anchor,
const char *section, const char *text,
time_t mtime, off_t offset,
size_t length)
__attribute__((nonnull(1,3,4)));
static help_node_t *help_new_node(const char *filename, const char *anchor, const char *section, const char *text, time_t mtime, off_t offset, size_t length) _CUPS_NONNULL(1,3,4);
static int help_sort_by_name(help_node_t *p1, help_node_t *p2);
static int help_sort_by_score(help_node_t *p1, help_node_t *p2);
static int help_sort_words(help_word_t *w1, help_word_t *w2);
@@ -154,8 +150,6 @@ helpDeleteIndex(help_index_t *hi) /* I - Help index */
help_node_t *node; /* Current node */
DEBUG_printf(("helpDeleteIndex(hi=%p)", hi));
if (!hi)
return;
@@ -186,9 +180,6 @@ helpFindNode(help_index_t *hi, /* I - Index */
help_node_t key; /* Search key */
DEBUG_printf(("helpFindNode(hi=%p, filename=\"%s\", anchor=\"%s\")",
hi, filename, anchor));
/*
* Range check input...
*/
@@ -236,9 +227,6 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
help_word_t *word; /* Current word */
DEBUG_printf(("helpLoadIndex(hifile=\"%s\", directory=\"%s\")",
hifile, directory));
/*
* Create a new, empty index.
*/
@@ -441,8 +429,6 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
help_word_t *word; /* Current word */
DEBUG_printf(("helpSaveIndex(hi=%p, hifile=\"%s\")", hi, hifile));
/*
* Try creating a new index file...
*/
@@ -522,9 +508,6 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
int matches; /* Number of matches */
DEBUG_printf(("helpSearchIndex(hi=%p, query=\"%s\", filename=\"%s\")",
hi, query, filename));
/*
* Range check...
*/
@@ -646,8 +629,6 @@ help_add_word(help_node_t *n, /* I - Node */
key; /* Search key */
DEBUG_printf(("2help_add_word(n=%p, text=\"%s\")", n, text));
/*
* Create the words array as needed...
*/
@@ -699,8 +680,6 @@ help_delete_node(help_node_t *n) /* I - Node */
help_word_t *w; /* Current word */
DEBUG_printf(("2help_delete_node(n=%p)", n));
if (!n)
return;
@@ -734,8 +713,6 @@ help_delete_node(help_node_t *n) /* I - Node */
static void
help_delete_word(help_word_t *w) /* I - Word */
{
DEBUG_printf(("2help_delete_word(w=%p)", w));
if (!w)
return;
@@ -765,9 +742,6 @@ help_load_directory(
help_node_t *node; /* Current node */
DEBUG_printf(("2help_load_directory(hi=%p, directory=\"%s\", relative=\"%s\")",
hi, directory, relative));
/*
* Open the directory and scan it...
*/
@@ -877,9 +851,6 @@ help_load_file(
int wordlen; /* Length of word */
DEBUG_printf(("2help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", "
"mtime=%ld)", hi, filename, relative, (long)mtime));
if ((fp = cupsFileOpen(filename, "r")) == NULL)
return (-1);
@@ -1211,10 +1182,6 @@ help_new_node(const char *filename, /* I - Filename */
help_node_t *n; /* Node */
DEBUG_printf(("2help_new_node(filename=\"%s\", anchor=\"%s\", text=\"%s\", "
"mtime=%ld, offset=%ld, length=%ld)", filename, anchor, text,
(long)mtime, (long)offset, (long)length));
n = (help_node_t *)calloc(1, sizeof(help_node_t));
if (!n)
return (NULL);
@@ -1242,10 +1209,6 @@ help_sort_by_name(help_node_t *n1, /* I - First node */
int diff; /* Difference */
DEBUG_printf(("2help_sort_by_name(n1=%p(%s#%s), n2=%p(%s#%s)",
n1, n1->filename, n1->anchor,
n2, n2->filename, n2->anchor));
if ((diff = strcmp(n1->filename, n2->filename)) != 0)
return (diff);
@@ -1271,11 +1234,6 @@ help_sort_by_score(help_node_t *n1, /* I - First node */
int diff; /* Difference */
DEBUG_printf(("2help_sort_by_score(n1=%p(%d \"%s\" \"%s\"), "
"n2=%p(%d \"%s\" \"%s\")",
n1, n1->score, n1->section, n1->text,
n2, n2->score, n2->section, n2->text));
if (n1->score != n2->score)
return (n2->score - n1->score);
@@ -1299,8 +1257,5 @@ static int /* O - Difference */
help_sort_words(help_word_t *w1, /* I - Second word */
help_word_t *w2) /* I - Second word */
{
DEBUG_printf(("2help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))",
w1, w1->text, w2, w2->text));
return (_cups_strcasecmp(w1->text, w2->text));
}
+4 -6
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Search routines for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -35,8 +36,6 @@ cgiCompileSearch(const char *query) /* I - Query string */
char *lword; /* Last word in query */
DEBUG_printf(("cgiCompileSearch(query=\"%s\")\n", query));
/*
* Range check input...
*/
@@ -292,8 +291,6 @@ cgiCompileSearch(const char *query) /* I - Query string */
* Compile the regular expression...
*/
DEBUG_printf((" s=\"%s\"\n", s));
if (regcomp(re, s, REG_EXTENDED | REG_ICASE))
{
free(re);
@@ -361,4 +358,5 @@ void
cgiFreeSearch(void *search) /* I - Search context */
{
regfree((regex_t *)search);
free(search);
}
+3 -33
Ver Arquivo
@@ -222,14 +222,6 @@ cgiGetVariable(const char *name) /* I - Name of variable */
var = cgi_find_variable(name);
#ifdef DEBUG
if (var == NULL)
DEBUG_printf(("cgiGetVariable(\"%s\") is returning NULL...\n", name));
else
DEBUG_printf(("cgiGetVariable(\"%s\") is returning \"%s\"...\n", name,
var->values[var->nvalues - 1]));
#endif /* DEBUG */
return ((var == NULL) ? NULL : _cupsStrRetain(var->values[var->nvalues - 1]));
}
@@ -534,9 +526,6 @@ cgi_add_variable(const char *name, /* I - Variable name */
if (name == NULL || value == NULL || element < 0 || element > 100000)
return;
DEBUG_printf(("cgi_add_variable: Adding variable \'%s\' with value "
"\'%s\'...\n", name, value));
if (form_count >= form_alloc)
{
_cgi_var_t *temp_vars; /* Temporary form pointer */
@@ -715,8 +704,6 @@ cgi_initialize_get(void)
char *data; /* Pointer to form data string */
DEBUG_puts("cgi_initialize_get: Initializing variables using GET method...");
/*
* Check to see if there is anything for us to read...
*/
@@ -756,8 +743,6 @@ cgi_initialize_multipart(
size_t blen; /* Length of boundary string */
DEBUG_printf(("cgi_initialize_multipart(boundary=\"%s\")\n", boundary));
/*
* Read multipart form data until we run out...
*/
@@ -970,8 +955,6 @@ cgi_initialize_post(void)
int status; /* Return status */
DEBUG_puts("cgi_initialize_post: Initializing variables using POST method...");
/*
* Check to see if there is anything for us to read...
*/
@@ -1203,6 +1186,7 @@ cgi_set_sid(void)
const char *remote_addr, /* REMOTE_ADDR */
*server_name, /* SERVER_NAME */
*server_port; /* SERVER_PORT */
struct timeval curtime; /* Current time */
if ((remote_addr = getenv("REMOTE_ADDR")) == NULL)
@@ -1212,7 +1196,8 @@ cgi_set_sid(void)
if ((server_port = getenv("SERVER_PORT")) == NULL)
server_port = "SERVER_PORT";
CUPS_SRAND(time(NULL));
gettimeofday(&curtime, NULL);
CUPS_SRAND(curtime.tv_sec + curtime.tv_usec);
snprintf(buffer, sizeof(buffer), "%s:%s:%s:%02X%02X%02X%02X%02X%02X%02X%02X",
remote_addr, server_name, server_port,
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
@@ -1234,26 +1219,11 @@ cgi_set_sid(void)
static void
cgi_sort_variables(void)
{
#ifdef DEBUG
int i;
DEBUG_puts("cgi_sort_variables: Sorting variables...");
#endif /* DEBUG */
if (form_count < 2)
return;
qsort(form_vars, (size_t)form_count, sizeof(_cgi_var_t),
(int (*)(const void *, const void *))cgi_compare_variables);
#ifdef DEBUG
DEBUG_puts("cgi_sort_variables: Sorted variable list is:");
for (i = 0; i < form_count; i ++)
DEBUG_printf(("cgi_sort_variables: %d: %s (%d) = \"%s\" ...\n", i,
form_vars[i].name, form_vars[i].nvalues,
form_vars[i].values[0]));
#endif /* DEBUG */
}
+23 -6
Ver Arquivo
@@ -1,10 +1,11 @@
dnl
dnl Common configuration stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl Copyright © 2007-2018 by Apple Inc.
dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
dnl information.
dnl
dnl Set the name of the config header file...
@@ -432,16 +433,31 @@ COMPONENTS="all"
AC_ARG_WITH(components, [ --with-components set components to build:
- "all" (default) builds everything
- "core" builds libcups and ipptool],
- "core" builds libcups and ipptool
- "libcups" builds just libcups
- "libcupslite" builds just libcups without driver support],
COMPONENTS="$withval")
cupsimagebase="cupsimage"
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
case "$COMPONENTS" in
all)
BUILDDIRS="filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
BUILDDIRS="test filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
;;
core)
BUILDDIRS="data locale"
BUILDDIRS="test locale"
;;
libcups)
BUILDDIRS="locale"
cupsimagebase=""
;;
libcupslite)
BUILDDIRS="locale"
cupsimagebase=""
LIBCUPSOBJS="\$(COREOBJS)"
;;
*)
@@ -450,3 +466,4 @@ case "$COMPONENTS" in
esac
AC_SUBST(BUILDDIRS)
AC_SUBST(LIBCUPSOBJS)
+55 -83
Ver Arquivo
@@ -1,7 +1,7 @@
dnl
dnl Compiler stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2007-2018 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
@@ -10,18 +10,20 @@ dnl
dnl Clear the debugging and non-shared library options unless the user asks
dnl for them...
INSTALL_STRIP=""
OPTIM=""
AC_SUBST(INSTALL_STRIP)
AC_ARG_WITH(optim, [ --with-optim set optimization flags ],
OPTIM="$withval",
OPTIM="")
AC_SUBST(OPTIM)
AC_ARG_WITH(optim, [ --with-optim set optimization flags ])
AC_ARG_ENABLE(debug, [ --enable-debug build with debugging symbols])
AC_ARG_ENABLE(debug_guards, [ --enable-debug-guards build with memory allocation guards])
AC_ARG_ENABLE(debug_printfs, [ --enable-debug-printfs build with CUPS_DEBUG_LOG support])
AC_ARG_ENABLE(unit_tests, [ --enable-unit-tests build and run unit tests])
dnl For debugging, keep symbols, otherwise strip them...
if test x$enable_debug = xyes; then
if test x$enable_debug = xyes -a "x$OPTIM" = x; then
OPTIM="-g"
else
INSTALL_STRIP="-s"
@@ -79,6 +81,9 @@ AC_SUBST(LDARCHFLAGS)
dnl Read-only data/program support on Linux...
AC_ARG_ENABLE(relro, [ --enable-relro build with the GCC relro option])
dnl Clang/GCC address sanitizer...
AC_ARG_ENABLE(sanitizer, [ --enable-sanitizer build with AddressSanitizer])
dnl Update compiler options...
CXXLIBS="${CXXLIBS:=}"
AC_SUBST(CXXLIBS)
@@ -89,15 +94,28 @@ AC_SUBST(PIEFLAGS)
RELROFLAGS=""
AC_SUBST(RELROFLAGS)
WARNING_OPTIONS=""
AC_SUBST(WARNING_OPTIONS)
if test -n "$GCC"; then
# Add GCC-specific compiler options...
# Address sanitizer is a useful tool to use when developing/debugging
# code but adds about 2x overhead...
if test x$enable_sanitizer = xyes; then
# Use -fsanitize=address with debugging...
OPTIM="$OPTIM -g -fsanitize=address"
else
# Otherwise use the Fortify enhancements to catch any unbounded
# string operations...
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
fi
# Default optimization options...
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
# Default to optimize-for-size and debug
OPTIM="-Os -g"
else
OPTIM="$with_optim $OPTIM"
fi
# Default to optimize-for-size and debug
OPTIM="-Os -g"
fi
# Generate position-independent code as needed...
@@ -150,81 +168,29 @@ if test -n "$GCC"; then
CFLAGS="$OLDCFLAGS"
fi
if test "x$with_optim" = x; then
# Add useful warning options for tracking down problems...
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
# Add useful warning options for tracking down problems...
WARNING_OPTIONS="-Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion"
AC_MSG_CHECKING(whether compiler supports -Wno-unused-result)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-unused-result"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wno-unused-result"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
AC_MSG_CHECKING(whether compiler supports -Wsign-conversion)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wsign-conversion"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wsign-conversion"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
AC_MSG_CHECKING(whether compiler supports -Wno-tautological-compare)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wno-tautological-compare"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
AC_MSG_CHECKING(whether compiler supports -Wno-format-truncation)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-format-truncation"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wno-format-truncation"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
# Additional warning options for development testing...
if test -d .svn; then
OPTIM="-Werror $OPTIM"
fi
fi
case "$host_os_name" in
darwin*)
# -D_FORTIFY_SOURCE=2 adds additional object size
# checking, basically wrapping all string functions
# with buffer-limited ones. Not strictly needed for
# CUPS since we already use buffer-limited calls, but
# this will catch any additions that are broken.
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
;;
linux*)
# The -z relro option is provided by the Linux linker command to
# make relocatable data read-only.
if test x$enable_relro = xyes; then
RELROFLAGS="-Wl,-z,relro,-z,now"
fi
# Test GCC version for certain warning flags since -Werror
# doesn't trigger...
gccversion=`$CC --version | head -1 | awk '{print $NF}'`
case "$gccversion" in
7.* | 8.*)
WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-tautological-compare"
;;
esac
# Additional warning options for development testing...
if test -d .git; then
WARNING_OPTIONS="-Werror -Wno-error=deprecated-declarations $WARNING_OPTIONS"
fi
else
# Add vendor-specific compiler options...
case $host_os_name in
sunos*)
# Solaris
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-xO2"
else
OPTIM="$with_optim $OPTIM"
fi
OPTIM="-xO2"
fi
if test $PICFLAG = 1; then
@@ -232,13 +198,13 @@ else
fi
;;
*)
# Running some other operating system; inform the user they
# should contribute the necessary options to
# cups-support@cups.org...
echo "Building CUPS with default compiler optimizations; contact"
echo "cups-devel@cups.org with uname and compiler options needed"
echo "for your platform, or set the CFLAGS and LDFLAGS environment"
echo "variables before running configure."
# Running some other operating system; inform the user
# they should contribute the necessary options via
# Github...
echo "Building CUPS with default compiler optimizations; contact the CUPS developers on Github"
echo "(https://github.com/apple/cups/issues) with the uname and compiler options needed for"
echo "your platform, or set the CFLAGS and LDFLAGS environment variables before running"
echo "configure."
;;
esac
fi
@@ -249,5 +215,11 @@ case $host_os_name in
# glibc 2.8 and higher breaks peer credentials unless you
# define _GNU_SOURCE...
OPTIM="$OPTIM -D_GNU_SOURCE"
# The -z relro option is provided by the Linux linker command to
# make relocatable data read-only.
if test x$enable_relro = xyes; then
RELROFLAGS="-Wl,-z,relro,-z,now"
fi
;;
esac
+22 -6
Ver Arquivo
@@ -1,10 +1,11 @@
dnl
dnl Default cupsd configuration settings for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
dnl Copyright © 2007-2018 by Apple Inc.
dnl Copyright © 2006-2007 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
dnl information.
dnl
dnl Default languages...
@@ -19,20 +20,35 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
AC_SUBST(LANGUAGES)
dnl macOS bundle-based localization support
AC_ARG_WITH(bundledir, [ --with-bundledir set macOS localization bundle directory ],
CUPS_BUNDLEDIR="$withval",
AC_ARG_WITH(bundledir, [ --with-bundledir set localization bundle directory ],
CUPS_BUNDLEDIR="$withval",[
if test "x$host_os_name" = xdarwin -a $host_os_version -ge 100; then
CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
LANGUAGES=""
else
CUPS_BUNDLEDIR=""
fi)
fi])
AC_SUBST(CUPS_BUNDLEDIR)
if test "x$CUPS_BUNDLEDIR" != x; then
AC_DEFINE_UNQUOTED(CUPS_BUNDLEDIR, "$CUPS_BUNDLEDIR")
fi
AC_ARG_WITH(bundlelang, [ --with-bundlelang set localization bundle base language (English or en) ],
cups_bundlelang="$withval",[
if test $host_os_version -ge 190; then
cups_bundlelang="en"
else
cups_bundlelang="English"
fi])
if test "x$cups_bundlelang" != x -a "x$CUPS_BUNDLEDIR" != x; then
CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/$cups_bundlelang.lproj"
else
CUPS_RESOURCEDIR=""
fi
AC_SUBST(CUPS_RESOURCEDIR)
dnl Default executable file permissions
AC_ARG_WITH(exe_file_perm, [ --with-exe-file-perm set default executable permissions value, default=0555],
CUPS_EXE_FILE_PERM="$withval",
+7 -2
Ver Arquivo
@@ -1,10 +1,11 @@
dnl
dnl Operating system stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2007-2018 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
dnl information.
dnl
dnl Get the build and host platforms and split the host_os value
@@ -22,6 +23,8 @@ if test "$host_os_name" = darwin -a $host_os_version -lt 120; then
AC_MSG_ERROR([Sorry, this version of CUPS requires macOS 10.8 or higher.])
fi
echo host_os_version=$host_os_version
dnl Determine whether we are cross-compiling...
if test "$build" = "$host"; then
# No, build local targets
@@ -31,3 +34,5 @@ else
LOCALTARGET=""
fi
AC_SUBST(LOCALTARGET)
AC_PATH_PROGS(CODE_SIGN, codesign true)
+40 -36
Ver Arquivo
@@ -1,10 +1,11 @@
dnl
dnl Shared library support for CUPS.
dnl
dnl Copyright 2007-2018 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright © 2007-2018 by Apple Inc.
dnl Copyright © 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
dnl information.
dnl
PICFLAG=1
@@ -14,60 +15,56 @@ AC_ARG_ENABLE(shared, [ --disable-shared do not create shared libraries]
cupsbase="cups"
LIBCUPSBASE="lib$cupsbase"
LIBCUPSIMAGE=""
LIBCUPSSTATIC="lib$cupsbase.a"
if test x$enable_shared != xno; then
case "$host_os_name" in
sunos*)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G"
;;
linux* | gnu* | *bsd*)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
;;
darwin*)
LIBCUPS="lib$cupsbase.2.dylib"
LIBCUPSCGI="libcupscgi.1.dylib"
LIBCUPSIMAGE="libcupsimage.2.dylib"
LIBCUPSMIME="libcupsmime.1.dylib"
LIBCUPSPPDC="libcupsppdc.1.dylib"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.2.dylib"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
DSOFLAGS="$DSOFLAGS -Wl,-no_warn_inits -dynamiclib -single_module -lc"
;;
*)
echo "Warning: shared libraries may not be supported. Trying -shared"
echo " option with compiler."
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
;;
esac
else
PICFLAG=0
LIBCUPS="lib$cupsbase.a"
LIBCUPSCGI="libcupscgi.a"
LIBCUPSIMAGE="libcupsimage.a"
LIBCUPSMIME="libcupsmime.a"
LIBCUPSPPDC="libcupsppdc.a"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.a"
fi
DSO=":"
DSOXX=":"
fi
@@ -77,24 +74,31 @@ AC_SUBST(DSOXX)
AC_SUBST(DSOFLAGS)
AC_SUBST(LIBCUPS)
AC_SUBST(LIBCUPSBASE)
AC_SUBST(LIBCUPSCGI)
AC_SUBST(LIBCUPSIMAGE)
AC_SUBST(LIBCUPSMIME)
AC_SUBST(LIBCUPSPPDC)
AC_SUBST(LIBCUPSSTATIC)
if test x$enable_shared = xno; then
LINKCUPS="../cups/lib$cupsbase.a"
LINKCUPSIMAGE="../cups/libcupsimage.a"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
if test "x$cupsimagebase" != x; then
LINKCUPSIMAGE="../cups/lib$cupsimagebase.a"
EXTLINKCUPSIMAGE="-l$cupsimagebase"
else
LINKCUPSIMAGE=""
EXTLINKCUPSIMAGE=""
fi
else
LINKCUPS="-l${cupsbase}"
LINKCUPSIMAGE="-lcupsimage"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
if test "x$cupsimagebase" != x; then
LINKCUPSIMAGE="-l$cupsimagebase"
EXTLINKCUPSIMAGE="-l$cupsimagebase"
else
LINKCUPSIMAGE=""
EXTLINKCUPSIMAGE=""
fi
fi
AC_SUBST(EXTLINKCUPS)
externo
+203 -203
Ver Arquivo
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for CUPS 2.3b4.
# Generated by GNU Autoconf 2.68 for CUPS 2.3b6.
#
# Report bugs to <https://github.com/apple/cups/issues>.
#
@@ -560,8 +560,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='CUPS'
PACKAGE_TARNAME='cups'
PACKAGE_VERSION='2.3b4'
PACKAGE_STRING='CUPS 2.3b4'
PACKAGE_VERSION='2.3b6'
PACKAGE_STRING='CUPS 2.3b6'
PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
PACKAGE_URL='https://www.cups.org/'
@@ -630,6 +630,7 @@ CUPS_LOG_FILE_PERM
CUPS_CUPSD_FILE_PERM
CUPS_CONFIG_FILE_PERM
CUPS_EXE_FILE_PERM
CUPS_RESOURCEDIR
CUPS_BUNDLEDIR
LANGUAGES
XINETD
@@ -665,6 +666,7 @@ KRB5CONFIG
LIBGSSAPI
CUPS_LISTEN_DOMAINSOCKET
CUPS_DEFAULT_DOMAINSOCKET
WARNING_OPTIONS
RELROFLAGS
PIEFLAGS
CXXLIBS
@@ -687,10 +689,7 @@ LINKCUPS
EXTLINKCUPSIMAGE
EXTLINKCUPS
LIBCUPSSTATIC
LIBCUPSPPDC
LIBCUPSMIME
LIBCUPSIMAGE
LIBCUPSCGI
LIBCUPSBASE
LIBCUPS
DSOFLAGS
@@ -718,6 +717,7 @@ CUPS_DATADIR
CUPS_CACHEDIR
PRIVATEINCLUDE
privateinclude
LIBCUPSOBJS
BUILDDIRS
INSTALLXPC
CUPS_SYSTEM_AUTHKEY
@@ -769,6 +769,7 @@ AWK
CUPS_BUILD
CUPS_REVISION
CUPS_VERSION
CODE_SIGN
LOCALTARGET
host_os
host_vendor
@@ -851,6 +852,7 @@ enable_unit_tests
with_archflags
with_ldarchflags
enable_relro
enable_sanitizer
with_domainsocket
enable_gssapi
with_gssservicename
@@ -877,6 +879,7 @@ with_rcstop
with_xinetd
with_languages
with_bundledir
with_bundlelang
with_exe_file_perm
with_config_file_perm
with_cupsd_file_perm
@@ -1455,7 +1458,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures CUPS 2.3b4 to adapt to many kinds of systems.
\`configure' configures CUPS 2.3b6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1520,7 +1523,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of CUPS 2.3b4:";;
short | recursive ) echo "Configuration of CUPS 2.3b6:";;
esac
cat <<\_ACEOF
@@ -1543,6 +1546,7 @@ Optional Features:
--enable-debug-printfs build with CUPS_DEBUG_LOG support
--enable-unit-tests build and run unit tests
--enable-relro build with the GCC relro option
--enable-sanitizer build with AddressSanitizer
--disable-gssapi disable GSSAPI support
--disable-threads disable multi-threading support
--disable-ssl disable SSL/TLS support
@@ -1572,6 +1576,8 @@ Optional Packages:
--with-components set components to build:
- "all" (default) builds everything
- "core" builds libcups and ipptool
- "libcups" builds just libcups
- "libcupslite" builds just libcups without driver support
--with-privateinclude set path for private include files, default=none
--with-lpdconfig set URI for LPD config file
--with-smbconfig set URI for Samba config file
@@ -1598,7 +1604,8 @@ Optional Packages:
--with-rcstop set stop number for rc scripts
--with-xinetd set path for xinetd config files
--with-languages set installed languages, default=all
--with-bundledir set macOS localization bundle directory
--with-bundledir set localization bundle directory
--with-bundlelang set localization bundle base language (English or en)
--with-exe-file-perm set default executable permissions value, default=0555
--with-config-file-perm set default ConfigFilePerm value, default=0640
--with-cupsd-file-perm set default cupsd permissions, default=0500
@@ -1697,7 +1704,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
CUPS configure 2.3b4
CUPS configure 2.3b6
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2161,7 +2168,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by CUPS $as_me 2.3b4, which was
It was created by CUPS $as_me 2.3b6, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2623,6 +2630,8 @@ if test "$host_os_name" = darwin -a $host_os_version -lt 120; then
as_fn_error $? "Sorry, this version of CUPS requires macOS 10.8 or higher." "$LINENO" 5
fi
echo host_os_version=$host_os_version
if test "$build" = "$host"; then
# No, build local targets
LOCALTARGET="local"
@@ -2632,11 +2641,57 @@ else
fi
for ac_prog in codesign true
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_CODE_SIGN+:} false; then :
$as_echo_n "(cached) " >&6
else
case $CODE_SIGN in
[\\/]* | ?:[\\/]*)
ac_cv_path_CODE_SIGN="$CODE_SIGN" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_CODE_SIGN="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
CODE_SIGN=$ac_cv_path_CODE_SIGN
if test -n "$CODE_SIGN"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CODE_SIGN" >&5
$as_echo "$CODE_SIGN" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CODE_SIGN" && break
done
ac_config_headers="$ac_config_headers config.h"
CUPS_VERSION="2.3b4"
CUPS_VERSION="2.3b6"
CUPS_REVISION=""
CUPS_BUILD="cups-$CUPS_VERSION"
@@ -6055,13 +6110,26 @@ if test "${with_components+set}" = set; then :
fi
cupsimagebase="cupsimage"
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
case "$COMPONENTS" in
all)
BUILDDIRS="filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
BUILDDIRS="test filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
;;
core)
BUILDDIRS="data locale"
BUILDDIRS="test locale"
;;
libcups)
BUILDDIRS="locale"
cupsimagebase=""
;;
libcupslite)
BUILDDIRS="locale"
cupsimagebase=""
LIBCUPSOBJS="\$(COREOBJS)"
;;
*)
@@ -6074,6 +6142,7 @@ esac
if test "$prefix" = "NONE"; then
prefix="/"
fi
@@ -6543,60 +6612,56 @@ fi
cupsbase="cups"
LIBCUPSBASE="lib$cupsbase"
LIBCUPSIMAGE=""
LIBCUPSSTATIC="lib$cupsbase.a"
if test x$enable_shared != xno; then
case "$host_os_name" in
sunos*)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G"
;;
linux* | gnu* | *bsd*)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
;;
darwin*)
LIBCUPS="lib$cupsbase.2.dylib"
LIBCUPSCGI="libcupscgi.1.dylib"
LIBCUPSIMAGE="libcupsimage.2.dylib"
LIBCUPSMIME="libcupsmime.1.dylib"
LIBCUPSPPDC="libcupsppdc.1.dylib"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.2.dylib"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
DSOFLAGS="$DSOFLAGS -Wl,-no_warn_inits -dynamiclib -single_module -lc"
;;
*)
echo "Warning: shared libraries may not be supported. Trying -shared"
echo " option with compiler."
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
fi
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
;;
esac
else
PICFLAG=0
LIBCUPS="lib$cupsbase.a"
LIBCUPSCGI="libcupscgi.a"
LIBCUPSIMAGE="libcupsimage.a"
LIBCUPSMIME="libcupsmime.a"
LIBCUPSPPDC="libcupsppdc.a"
if test "x$cupsimagebase" != x; then
LIBCUPSIMAGE="lib$cupsimagebase.a"
fi
DSO=":"
DSOXX=":"
fi
@@ -6609,21 +6674,28 @@ fi
if test x$enable_shared = xno; then
LINKCUPS="../cups/lib$cupsbase.a"
LINKCUPSIMAGE="../cups/libcupsimage.a"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
if test "x$cupsimagebase" != x; then
LINKCUPSIMAGE="../cups/lib$cupsimagebase.a"
EXTLINKCUPSIMAGE="-l$cupsimagebase"
else
LINKCUPSIMAGE=""
EXTLINKCUPSIMAGE=""
fi
else
LINKCUPS="-l${cupsbase}"
LINKCUPSIMAGE="-lcupsimage"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
if test "x$cupsimagebase" != x; then
LINKCUPSIMAGE="-l$cupsimagebase"
EXTLINKCUPSIMAGE="-l$cupsimagebase"
else
LINKCUPSIMAGE=""
EXTLINKCUPSIMAGE=""
fi
fi
@@ -6736,16 +6808,18 @@ fi
INSTALL_STRIP=""
OPTIM=""
# Check whether --with-optim was given.
if test "${with_optim+set}" = set; then :
withval=$with_optim;
withval=$with_optim; OPTIM="$withval"
else
OPTIM=""
fi
# Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
enableval=$enable_debug;
@@ -6767,7 +6841,7 @@ if test "${enable_unit_tests+set}" = set; then :
fi
if test x$enable_debug = xyes; then
if test x$enable_debug = xyes -a "x$OPTIM" = x; then
OPTIM="-g"
else
INSTALL_STRIP="-s"
@@ -6833,6 +6907,12 @@ if test "${enable_relro+set}" = set; then :
fi
# Check whether --enable-sanitizer was given.
if test "${enable_sanitizer+set}" = set; then :
enableval=$enable_sanitizer;
fi
CXXLIBS="${CXXLIBS:=}"
@@ -6842,15 +6922,28 @@ PIEFLAGS=""
RELROFLAGS=""
WARNING_OPTIONS=""
if test -n "$GCC"; then
# Add GCC-specific compiler options...
# Address sanitizer is a useful tool to use when developing/debugging
# code but adds about 2x overhead...
if test x$enable_sanitizer = xyes; then
# Use -fsanitize=address with debugging...
OPTIM="$OPTIM -g -fsanitize=address"
else
# Otherwise use the Fortify enhancements to catch any unbounded
# string operations...
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
fi
# Default optimization options...
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
# Default to optimize-for-size and debug
OPTIM="-Os -g"
else
OPTIM="$with_optim $OPTIM"
fi
# Default to optimize-for-size and debug
OPTIM="-Os -g"
fi
# Generate position-independent code as needed...
@@ -6956,149 +7049,29 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$OLDCFLAGS"
fi
if test "x$with_optim" = x; then
# Add useful warning options for tracking down problems...
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
# Add useful warning options for tracking down problems...
WARNING_OPTIONS="-Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-unused-result" >&5
$as_echo_n "checking whether compiler supports -Wno-unused-result... " >&6; }
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-unused-result"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
OPTIM="$OPTIM -Wno-unused-result"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$OLDCFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wsign-conversion" >&5
$as_echo_n "checking whether compiler supports -Wsign-conversion... " >&6; }
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wsign-conversion"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
OPTIM="$OPTIM -Wsign-conversion"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$OLDCFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-tautological-compare" >&5
$as_echo_n "checking whether compiler supports -Wno-tautological-compare... " >&6; }
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
OPTIM="$OPTIM -Wno-tautological-compare"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$OLDCFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-format-truncation" >&5
$as_echo_n "checking whether compiler supports -Wno-format-truncation... " >&6; }
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-format-truncation"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
OPTIM="$OPTIM -Wno-format-truncation"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$OLDCFLAGS"
# Additional warning options for development testing...
if test -d .svn; then
OPTIM="-Werror $OPTIM"
fi
fi
case "$host_os_name" in
darwin*)
# -D_FORTIFY_SOURCE=2 adds additional object size
# checking, basically wrapping all string functions
# with buffer-limited ones. Not strictly needed for
# CUPS since we already use buffer-limited calls, but
# this will catch any additions that are broken.
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
;;
linux*)
# The -z relro option is provided by the Linux linker command to
# make relocatable data read-only.
if test x$enable_relro = xyes; then
RELROFLAGS="-Wl,-z,relro,-z,now"
fi
# Test GCC version for certain warning flags since -Werror
# doesn't trigger...
gccversion=`$CC --version | head -1 | awk '{print $NF}'`
case "$gccversion" in
7.* | 8.*)
WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-tautological-compare"
;;
esac
# Additional warning options for development testing...
if test -d .git; then
WARNING_OPTIONS="-Werror -Wno-error=deprecated-declarations $WARNING_OPTIONS"
fi
else
# Add vendor-specific compiler options...
case $host_os_name in
sunos*)
# Solaris
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-xO2"
else
OPTIM="$with_optim $OPTIM"
fi
OPTIM="-xO2"
fi
if test $PICFLAG = 1; then
@@ -7106,13 +7079,13 @@ else
fi
;;
*)
# Running some other operating system; inform the user they
# should contribute the necessary options to
# cups-support@cups.org...
echo "Building CUPS with default compiler optimizations; contact"
echo "cups-devel@cups.org with uname and compiler options needed"
echo "for your platform, or set the CFLAGS and LDFLAGS environment"
echo "variables before running configure."
# Running some other operating system; inform the user
# they should contribute the necessary options via
# Github...
echo "Building CUPS with default compiler optimizations; contact the CUPS developers on Github"
echo "(https://github.com/apple/cups/issues) with the uname and compiler options needed for"
echo "your platform, or set the CFLAGS and LDFLAGS environment variables before running"
echo "configure."
;;
esac
fi
@@ -7123,6 +7096,12 @@ case $host_os_name in
# glibc 2.8 and higher breaks peer credentials unless you
# define _GNU_SOURCE...
OPTIM="$OPTIM -D_GNU_SOURCE"
# The -z relro option is provided by the Linux linker command to
# make relocatable data read-only.
if test x$enable_relro = xyes; then
RELROFLAGS="-Wl,-z,relro,-z,now"
fi
;;
esac
@@ -9477,7 +9456,8 @@ fi
if test "${with_bundledir+set}" = set; then :
withval=$with_bundledir; CUPS_BUNDLEDIR="$withval"
else
if test "x$host_os_name" = xdarwin -a $host_os_version -ge 100; then
if test "x$host_os_name" = xdarwin -a $host_os_version -ge 100; then
CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
LANGUAGES=""
else
@@ -9495,6 +9475,27 @@ _ACEOF
fi
# Check whether --with-bundlelang was given.
if test "${with_bundlelang+set}" = set; then :
withval=$with_bundlelang; cups_bundlelang="$withval"
else
if test $host_os_version -ge 190; then
cups_bundlelang="en"
else
cups_bundlelang="English"
fi
fi
if test "x$cups_bundlelang" != x -a "x$CUPS_BUNDLEDIR" != x; then
CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/$cups_bundlelang.lproj"
else
CUPS_RESOURCEDIR=""
fi
# Check whether --with-exe_file_perm was given.
if test "${with_exe_file_perm+set}" = set; then :
withval=$with_exe_file_perm; CUPS_EXE_FILE_PERM="$withval"
@@ -10066,7 +10067,7 @@ fi
ac_config_files="$ac_config_files Makedefs conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf cups-config desktop/cups.desktop doc/index.html man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
ac_config_files="$ac_config_files Makedefs conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf cups-config desktop/cups.desktop doc/index.html man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -10586,7 +10587,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by CUPS $as_me 2.3b4, which was
This file was extended by CUPS $as_me 2.3b6, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -10649,7 +10650,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
CUPS config.status 2.3b4
CUPS config.status 2.3b6
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
@@ -10785,7 +10786,6 @@ do
"man/cups-files.conf.man") CONFIG_FILES="$CONFIG_FILES man/cups-files.conf.man" ;;
"man/cups-lpd.man") CONFIG_FILES="$CONFIG_FILES man/cups-lpd.man" ;;
"man/cups-snmp.man") CONFIG_FILES="$CONFIG_FILES man/cups-snmp.man" ;;
"man/cupsaddsmb.man") CONFIG_FILES="$CONFIG_FILES man/cupsaddsmb.man" ;;
"man/cupsd.conf.man") CONFIG_FILES="$CONFIG_FILES man/cupsd.conf.man" ;;
"man/cupsd.man") CONFIG_FILES="$CONFIG_FILES man/cupsd.man" ;;
"man/lpoptions.man") CONFIG_FILES="$CONFIG_FILES man/lpoptions.man" ;;
+1 -2
Ver Arquivo
@@ -12,7 +12,7 @@ dnl We need at least autoconf 2.60...
AC_PREREQ(2.60)
dnl Package name and version...
AC_INIT([CUPS], [2.3b4], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
AC_INIT([CUPS], [2.3b6], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
@@ -70,7 +70,6 @@ AC_OUTPUT(Makedefs
man/cups-files.conf.man
man/cups-lpd.man
man/cups-snmp.man
man/cupsaddsmb.man
man/cupsd.conf.man
man/cupsd.man
man/lpoptions.man
+346 -270
Ver Arquivo
@@ -1,327 +1,403 @@
adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd.h raster.h adminutil.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h ppd.h cups.h raster.h adminutil.h
array.o: array.c ../cups/cups.h file.h versioning.h ipp.h http.h array.h \
language.h pwg.h string-private.h ../config.h debug-private.h \
array-private.h
language.h pwg.h string-private.h ../config.h ../cups/versioning.h \
debug-internal.h debug-private.h array-private.h ../cups/array.h
auth.o: auth.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h
backend.o: backend.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h backend.h ppd.h raster.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
backend.h ppd.h cups.h raster.h
debug.o: debug.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
dest.o: dest.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
dest-job.o: dest-job.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
dest-localization.o: dest-localization.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
dest-options.o: dest-options.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
dir.o: dir.c string-private.h ../config.h debug-private.h \
../cups/versioning.h dir.h
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
dir.o: dir.c string-private.h ../config.h ../cups/versioning.h \
debug-internal.h debug-private.h dir.h versioning.h
encode.o: encode.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
file.o: file.c file-private.h cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
getdevices.o: getdevices.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h adminutil.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h adminutil.h cups.h
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/language.h \
array.h versioning.h ../cups/http.h ipp-private.h ../cups/cups.h \
file.h ipp.h pwg.h
file.h ipp.h http.h language.h pwg.h
getputfile.o: getputfile.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
globals.o: globals.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
hash.o: hash.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
http.o: http.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
http-addr.o: http-addr.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
http-addrlist.o: http-addrlist.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
http-support.o: http-support.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
ipp.o: ipp.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/cups.h file.h ipp.h http.h language.h pwg.h http-private.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
hash.o: hash.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
http.o: http.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
http-addr.o: http-addr.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
http-addrlist.o: http-addrlist.c cups-private.h string-private.h \
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
http-support.o: http-support.c cups-private.h string-private.h \
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
ipp.o: ipp.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
ipp-file.o: ipp-file.c ipp-private.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h string-private.h ../config.h \
debug-private.h
../cups/versioning.h debug-internal.h debug-private.h
ipp-vars.o: ipp-vars.c ../cups/cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h ipp-private.h string-private.h ../config.h
array.h language.h pwg.h ipp-private.h string-private.h ../config.h \
../cups/versioning.h debug-internal.h debug-private.h
ipp-support.o: ipp-support.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
langprintf.o: langprintf.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
language.o: language.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
md5.o: md5.c md5-private.h string-private.h ../config.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
md5.o: md5.c md5-internal.h ../cups/versioning.h string-private.h \
../config.h
md5passwd.o: md5passwd.c ../cups/cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h http-private.h ../config.h ipp-private.h \
string-private.h
array.h language.h pwg.h http-private.h ../config.h ../cups/language.h \
../cups/http.h ipp-private.h string-private.h ../cups/versioning.h
notify.o: notify.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
options.o: options.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
ppd.o: ppd.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/cups.h file.h ipp.h http.h language.h pwg.h http-private.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h raster.h
debug-internal.h debug-private.h
ppd.o: ppd.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
ppd-attr.o: ppd-attr.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-cache.o: ppd-cache.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-conflicts.o: ppd-conflicts.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-custom.o: ppd-custom.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-emit.o: ppd-emit.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd.h raster.h
ppd-localize.o: ppd-localize.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-mark.o: ppd-mark.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
ppd-page.o: ppd-page.c string-private.h ../config.h debug-private.h \
../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \
language.h pwg.h raster.h
ppd-util.o: ppd-util.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
request.o: request.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
sidechannel.o: sidechannel.c sidechannel.h versioning.h cups-private.h \
string-private.h ../config.h debug-private.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
pwg-private.h thread-private.h
snmp.o: snmp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h snmp-private.h
snprintf.o: snprintf.c string-private.h ../config.h
string.o: string.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
thread.o: thread.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
tls.o: tls.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/cups.h file.h ipp.h http.h language.h pwg.h http-private.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
tls-darwin.c
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
ppd-cache.o: ppd-cache.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
ppd-conflicts.o: ppd-conflicts.c cups-private.h string-private.h \
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
ppd-custom.o: ppd-custom.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
ppd-emit.o: ppd-emit.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h ppd.h cups.h raster.h
ppd-localize.o: ppd-localize.c cups-private.h string-private.h \
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
ppd-mark.o: ppd-mark.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
ppd-page.o: ppd-page.c string-private.h ../config.h ../cups/versioning.h \
debug-internal.h debug-private.h ppd.h cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h raster.h
ppd-util.o: ppd-util.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
debug-private.h
pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
raster-error.o: raster-error.c cups-private.h string-private.h \
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
raster-private.h raster.h cups.h ../cups/debug-private.h \
../cups/string-private.h debug-internal.h debug-private.h
raster-interpret.o: raster-interpret.c ../cups/raster-private.h raster.h \
cups.h file.h versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/cups.h ../cups/debug-private.h ../cups/versioning.h \
../cups/string-private.h ../config.h ../cups/ppd-private.h \
../cups/ppd.h pwg-private.h debug-internal.h debug-private.h
raster-stream.o: raster-stream.c raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h ../cups/cups.h \
../cups/debug-private.h ../cups/versioning.h ../cups/string-private.h \
../config.h debug-internal.h debug-private.h
request.o: request.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
sidechannel.o: sidechannel.c sidechannel.h versioning.h cups-private.h \
string-private.h ../config.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
array.h language.h pwg.h http-private.h ../cups/language.h \
../cups/http.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h debug-internal.h debug-private.h
snmp.o: snmp.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
snmp-private.h debug-internal.h debug-private.h
snprintf.o: snprintf.c string-private.h ../config.h ../cups/versioning.h
string.o: string.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
thread.o: thread.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
tls.o: tls.c cups-private.h string-private.h ../config.h \
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h tls-darwin.c
transcode.o: transcode.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
usersys.o: usersys.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
util.o: util.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
error.o: error.c ../cups/raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h
interpret.o: interpret.c ../cups/raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h \
../cups/ppd.h
raster.o: raster.c ../cups/raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
debug-internal.h debug-private.h
raster-interstub.o: raster-interstub.c ../cups/ppd-private.h \
../cups/cups.h file.h versioning.h ipp.h http.h array.h language.h \
pwg.h ../cups/ppd.h cups.h raster.h pwg-private.h
raster-stubs.o: raster-stubs.c raster-private.h raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h ../cups/cups.h \
../cups/debug-private.h ../cups/versioning.h ../cups/string-private.h \
../config.h
rasterbench.o: rasterbench.c ../config.h ../cups/raster.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h pwg.h
testadmin.o: testadmin.c adminutil.h cups.h file.h versioning.h ipp.h \
http.h array.h language.h pwg.h string-private.h ../config.h
testarray.o: testarray.c string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h dir.h
http.h array.h language.h pwg.h string-private.h ../config.h \
../cups/versioning.h
testarray.o: testarray.c string-private.h ../config.h \
../cups/versioning.h debug-private.h array-private.h ../cups/array.h \
versioning.h dir.h
testcache.o: testcache.c ppd-private.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h cups.h raster.h \
pwg-private.h file-private.h cups-private.h string-private.h \
../config.h debug-private.h array-private.h ipp-private.h \
http-private.h language-private.h ../cups/transcode.h thread-private.h
testclient.o: testclient.c ../cups/cups.h file.h versioning.h ipp.h \
http.h array.h language.h pwg.h ../cups/raster.h \
../cups/string-private.h ../config.h ../cups/thread-private.h
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h thread-private.h
testclient.o: testclient.c ../config.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h ../cups/raster.h cups.h \
../cups/string-private.h ../cups/versioning.h ../cups/thread-private.h
testconflicts.o: testconflicts.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h ppd.h raster.h string-private.h ../config.h
array.h language.h pwg.h ppd.h raster.h string-private.h ../config.h \
../cups/versioning.h
testcreds.o: testcreds.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
testcups.o: testcups.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd.h raster.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd.h cups.h raster.h
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
language.h pwg.h
testfile.o: testfile.c string-private.h ../config.h debug-private.h \
../cups/versioning.h file.h
testfile.o: testfile.c string-private.h ../config.h ../cups/versioning.h \
debug-private.h file.h versioning.h
testgetdests.o: testgetdests.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h
testhttp.o: testhttp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
testi18n.o: testi18n.c string-private.h ../config.h language-private.h \
../cups/transcode.h language.h array.h versioning.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
testi18n.o: testi18n.c string-private.h ../config.h ../cups/versioning.h \
language-private.h ../cups/transcode.h language.h array.h versioning.h
testipp.o: testipp.c file.h versioning.h string-private.h ../config.h \
ipp-private.h ../cups/cups.h ipp.h http.h array.h language.h pwg.h
../cups/versioning.h ipp-private.h ../cups/cups.h ipp.h http.h array.h \
language.h pwg.h
testoptions.o: testoptions.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
testlang.o: testlang.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h
testppd.o: testppd.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h ppd-private.h ../cups/ppd.h raster.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
ppd-private.h ../cups/ppd.h cups.h raster.h raster-private.h \
../cups/debug-private.h ../cups/string-private.h
testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h cups.h raster.h \
pwg-private.h file-private.h cups-private.h string-private.h \
../config.h debug-private.h array-private.h ipp-private.h \
http-private.h language-private.h ../cups/transcode.h thread-private.h
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h thread-private.h
testraster.o: testraster.c ../cups/raster-private.h raster.h cups.h \
file.h versioning.h ipp.h http.h array.h language.h pwg.h \
../cups/debug-private.h ../cups/string-private.h ../config.h \
../cups/ppd.h
../cups/cups.h ../cups/debug-private.h ../cups/versioning.h \
../cups/string-private.h ../config.h
testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h snmp-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
snmp-private.h
tlscheck.o: tlscheck.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
thread-private.h
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
pwg.h http-private.h ../cups/language.h ../cups/http.h \
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
+90 -57
Ver Arquivo
@@ -15,12 +15,9 @@ include ../Makedefs
# Object files...
#
LIBOBJS = \
adminutil.o \
COREOBJS = \
array.o \
auth.o \
backchannel.o \
backend.o \
debug.o \
dest.o \
dest-job.o \
@@ -29,8 +26,6 @@ LIBOBJS = \
dir.o \
encode.o \
file.o \
getdevices.o \
getifaddrs.o \
getputfile.o \
globals.o \
hash.o \
@@ -48,6 +43,26 @@ LIBOBJS = \
md5passwd.o \
notify.o \
options.o \
pwg-media.o \
raster-error.o \
raster-stream.o \
raster-stubs.o \
request.o \
snprintf.o \
string.o \
tempfile.o \
thread.o \
tls.o \
transcode.o \
usersys.o \
util.o
DRIVEROBJS = \
adminutil.o \
backchannel.o \
backend.o \
getdevices.o \
getifaddrs.o \
ppd.o \
ppd-attr.o \
ppd-cache.o \
@@ -58,22 +73,18 @@ LIBOBJS = \
ppd-mark.o \
ppd-page.o \
ppd-util.o \
pwg-media.o \
request.o \
raster-interpret.o \
raster-interstub.o \
sidechannel.o \
snmp.o \
snprintf.o \
string.o \
tempfile.o \
thread.o \
tls.o \
transcode.o \
usersys.o \
util.o
snmp.o
LIBOBJS = \
$(LIBCUPSOBJS)
IMAGEOBJS = \
error.o \
interpret.o \
raster.o
raster-interstub.o \
raster-stubs.o
TESTOBJS = \
rasterbench.o \
testadmin.o \
@@ -131,7 +142,6 @@ HEADERSPRIV = \
http-private.h \
ipp-private.h \
language-private.h \
md5-private.h \
ppd-private.h \
pwg-private.h \
raster-private.h \
@@ -268,7 +278,7 @@ install-headers:
# Install libraries...
#
install-libs: $(INSTALLSTATIC)
install-libs: $(LIBTARGETS) $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
@@ -280,23 +290,25 @@ install-libs: $(INSTALLSTATIC)
$(RM) $(LIBDIR)/libcups.dylib; \
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
fi
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
-if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
-if test "x$(LIBCUPSIMAGE)" != x; then \
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR); \
fi
-if test "x$(LIBCUPSIMAGE)" = "xlibcupsimage.so.2"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
fi
-if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
-if test "x$(LIBCUPSIMAGE)" = "xlibcupsimage.2.dylib"; then \
$(RM) $(LIBDIR)/libcupsimage.dylib; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
fi
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPS) $(SYMROOT); \
dsymutil $(SYMROOT)/$(LIBCUPS); \
cp $(LIBCUPSIMAGE) $(SYMROOT); \
dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
if test "x$(LIBCUPSIMAGE)" != x; then \
cp $(LIBCUPSIMAGE) $(SYMROOT); \
dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
fi; \
fi
installstatic:
@@ -315,7 +327,7 @@ installstatic:
uninstall:
$(RM) $(LIBDIR)/libcups.2.dylib
$(RM) $(LIBDIR)/$(LIBCUPSSTATIC)
$(RM) $(LIBDIR)/libcups.a
$(RM) $(LIBDIR)/libcups.dylib
$(RM) $(LIBDIR)/libcups.so
$(RM) $(LIBDIR)/libcups.so.2
@@ -329,6 +341,12 @@ uninstall:
$(RM) $(INCLUDEDIR)/cups/$$file; \
done
-$(RMDIR) $(INCLUDEDIR)/cups
if test "x$(privateinclude)" != x; then \
for file in $(HEADERSPRIV); do \
$(RM) $(PRIVATEINCLUDE)/cups/$$file; \
done
$(RMDIR) $(PRIVATEINCLUDE)/cups; \
fi
#
@@ -337,8 +355,8 @@ uninstall:
libcups.so.2: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
@@ -347,21 +365,16 @@ libcups.so.2: $(LIBOBJS)
# libcups.2.dylib
#
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
echo Creating export list for $@...
nm -gm $(LIBOBJS) 2>/dev/null | grep "__text" | grep -v weak | \
awk '{print $$NF}' | \
grep -v -E -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault)$$' | \
sort >t.exp
libcups.2.dylib: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.14.0 \
-compatibility_version 2.0.0 \
-exported_symbols_list t.exp \
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
$(RM) libcups.dylib t.exp
$(LIBOBJS) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
$(RM) libcups.dylib
$(LN) $@ libcups.dylib
@@ -399,7 +412,7 @@ libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
(nm $(LIBOBJS) $(IMAGEOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
grep -v -E \
-e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel' \
-e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel|SNMP' \
-e 'Block$$' | \
sed -e '1,$$s/^_//' | sort >>libcups2.def
@@ -410,8 +423,7 @@ libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
-L../cups $(LINKCUPS)
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
@@ -426,7 +438,8 @@ libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
-install_name $(libdir)/$@ \
-current_version 2.3.0 \
-compatibility_version 2.0.0 \
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
$(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
$(RM) libcupsimage.dylib
$(LN) $@ libcupsimage.dylib
@@ -438,8 +451,7 @@ libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
libcupsimage.la: $(IMAGEOBJS) libcups.la
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
-L../cups $(LINKCUPS) \
-rpath $(LIBDIR) -version-info 2:3
$(LINKCUPS) -rpath $(LIBDIR) -version-info 2:3
#
@@ -454,12 +466,14 @@ libcupsimage.a: $(IMAGEOBJS)
#
# rasterbench
# rasterbench (dependency on static CUPS library is intentional)
#
rasterbench: rasterbench.o libcupsimage.a
rasterbench: rasterbench.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
$(LD_CC) $(LDFLAGS) -o $@ rasterbench.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -470,6 +484,7 @@ testadmin: testadmin.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -480,6 +495,7 @@ testarray: testarray.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running array API tests...
./testarray
@@ -492,17 +508,18 @@ testcache: testcache.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
# testclient (dependency on static libraries is intentional)
#
testclient: testclient.o $(LIBCUPSSTATIC) libcupsimage.a
testclient: testclient.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testclient.o \
libcupsimage.a $(LIBCUPSSTATIC) \
$(LD_CC) $(LDFLAGS) -o $@ testclient.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -513,6 +530,7 @@ testconflicts: testconflicts.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -523,6 +541,7 @@ testcreds: testcreds.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -533,6 +552,7 @@ testcups: testcups.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -543,6 +563,7 @@ testdest: testdest.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -553,6 +574,7 @@ testfile: testfile.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running file API tests...
./testfile
@@ -565,6 +587,7 @@ testgetdests: testgetdests.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testgetdests.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -575,6 +598,7 @@ testhttp: testhttp.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running HTTP API tests...
./testhttp
@@ -587,6 +611,7 @@ testipp: testipp.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running IPP API tests...
./testipp
@@ -599,6 +624,7 @@ testi18n: testi18n.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running internationalization API tests...
./testi18n
@@ -611,6 +637,7 @@ testlang: testlang.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Creating locale directory structure...
$(RM) -r locale
$(MKDIR) locale/en
@@ -635,6 +662,7 @@ testoptions: testoptions.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running option API tests...
./testoptions
@@ -647,6 +675,7 @@ testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running PPD API tests...
./testppd
@@ -659,19 +688,21 @@ testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running PWG API tests...
./testpwg test.ppd
#
# testraster
# testraster (dependency on static CUPS library is intentional)
#
testraster: testraster.o $(LIBCUPSSTATIC) libcupsimage.a
testraster: testraster.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o \
$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
$(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running raster API tests...
./testraster
@@ -684,6 +715,7 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -694,6 +726,7 @@ tlscheck: tlscheck.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
+15 -755
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Administration utility API definitions for CUPS.
*
* Copyright 2007-2016 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2001-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -12,26 +13,21 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include "ppd.h"
#include "adminutil.h"
#include <fcntl.h>
#include <sys/stat.h>
#ifdef WIN32
#else
#ifndef _WIN32
# include <unistd.h>
# include <sys/wait.h>
#endif /* WIN32 */
#endif /* !_WIN32 */
/*
* Local functions...
*/
static int do_samba_command(const char *command,
const char *address,
const char *subcommand,
const char *authfile,
FILE *logfile);
static http_status_t get_cupsd_conf(http_t *http, _cups_globals_t *cg,
time_t last_update, char *name,
size_t namelen, int *remote);
@@ -57,318 +53,10 @@ cupsAdminCreateWindowsPPD(
char *buffer, /* I - Filename buffer */
int bufsize) /* I - Size of filename buffer */
{
const char *src; /* Source PPD filename */
cups_file_t *srcfp, /* Source PPD file */
*dstfp; /* Destination PPD file */
ipp_t *request, /* IPP request */
*response; /* IPP response */
ipp_attribute_t *suppattr, /* IPP -supported attribute */
*defattr; /* IPP -default attribute */
cups_lang_t *language; /* Current language */
char line[256], /* Line from PPD file */
junk[256], /* Extra junk to throw away */
*ptr, /* Pointer into line */
uri[1024], /* Printer URI */
option[41], /* Option */
choice[41]; /* Choice */
int jcloption, /* In a JCL option? */
jclorder, /* Next JCL order dependency */
linenum; /* Current line number */
time_t curtime; /* Current time */
struct tm *curdate; /* Current date */
static const char * const pattrs[] = /* Printer attributes we want */
{
"job-hold-until-supported",
"job-hold-until-default",
"job-sheets-supported",
"job-sheets-default",
"job-priority-supported",
"job-priority-default"
};
/*
* Range check the input...
*/
if (buffer)
*buffer = '\0';
if (!http)
http = _cupsConnect();
if (!http || !dest || !buffer || bufsize < 2)
return (NULL);
/*
* Get the PPD file...
*/
if ((src = cupsGetPPD2(http, dest)) == NULL)
return (NULL);
/*
* Get the supported banner pages, etc. for the printer...
*/
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
"localhost", 0, "/printers/%s", dest);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]),
NULL, pattrs);
/*
* Do the request and get back a response...
*/
response = cupsDoRequest(http, request, "/");
if (!response || cupsLastError() > IPP_STATUS_OK_CONFLICTING)
{
unlink(src);
return (NULL);
}
/*
* Open the original PPD file...
*/
if ((srcfp = cupsFileOpen(src, "rb")) == NULL)
return (NULL);
/*
* Create a temporary output file using the destination buffer...
*/
if ((dstfp = cupsTempFile2(buffer, bufsize)) == NULL)
{
cupsFileClose(srcfp);
unlink(src);
return (NULL);
}
/*
* Write a new header explaining that this isn't the original PPD...
*/
cupsFilePuts(dstfp, "*PPD-Adobe: \"4.3\"\n");
curtime = time(NULL);
curdate = gmtime(&curtime);
cupsFilePrintf(dstfp, "*%% Modified on %04d%02d%02d%02d%02d%02d+0000 "
"for CUPS Windows Driver\n",
curdate->tm_year + 1900, curdate->tm_mon + 1, curdate->tm_mday,
curdate->tm_hour, curdate->tm_min, curdate->tm_sec);
/*
* Read the existing PPD file, converting all PJL commands to CUPS
* job ticket comments...
*/
jcloption = 0;
jclorder = 0;
linenum = 0;
language = cupsLangDefault();
while (cupsFileGets(srcfp, line, sizeof(line)))
{
linenum ++;
if (!strncmp(line, "*PPD-Adobe:", 11))
{
/*
* Already wrote the PPD header...
*/
continue;
}
else if (!strncmp(line, "*JCLBegin:", 10) ||
!strncmp(line, "*JCLToPSInterpreter:", 20) ||
!strncmp(line, "*JCLEnd:", 8) ||
!strncmp(line, "*Protocols:", 11))
{
/*
* Don't use existing JCL keywords; we'll create our own, below...
*/
cupsFilePrintf(dstfp, "*%% Commented out for CUPS Windows Driver...\n"
"*%%%s\n", line + 1);
continue;
}
else if (!strncmp(line, "*JCLOpenUI", 10))
{
jcloption = 1;
cupsFilePrintf(dstfp, "%s\n", line);
}
else if (!strncmp(line, "*JCLCloseUI", 11))
{
jcloption = 0;
cupsFilePrintf(dstfp, "%s\n", line);
}
else if (jcloption && !strncmp(line, "*OrderDependency:", 17))
{
for (ptr = line + 17; _cups_isspace(*ptr); ptr ++);
ptr = strchr(ptr, ' ');
if (ptr)
{
cupsFilePrintf(dstfp, "*OrderDependency: %d%s\n", jclorder, ptr);
jclorder ++;
}
else
cupsFilePrintf(dstfp, "%s\n", line);
}
else if (jcloption &&
strncmp(line, "*End", 4) &&
strncmp(line, "*Default", 8))
{
if ((ptr = strchr(line, ':')) == NULL)
{
snprintf(line, sizeof(line),
_cupsLangString(language, _("Missing value on line %d.")),
linenum);
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
cupsFileClose(srcfp);
cupsFileClose(dstfp);
unlink(src);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
if ((ptr = strchr(ptr, '\"')) == NULL)
{
snprintf(line, sizeof(line),
_cupsLangString(language,
_("Missing double quote on line %d.")),
linenum);
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
cupsFileClose(srcfp);
cupsFileClose(dstfp);
unlink(src);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
if (sscanf(line, "*%40s%*[ \t]%40[^:/]", option, choice) != 2)
{
snprintf(line, sizeof(line),
_cupsLangString(language,
_("Bad option + choice on line %d.")),
linenum);
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, line, 0);
cupsFileClose(srcfp);
cupsFileClose(dstfp);
unlink(src);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
if (strchr(ptr + 1, '\"') == NULL)
{
/*
* Skip remaining...
*/
while (cupsFileGets(srcfp, junk, sizeof(junk)) != NULL)
{
linenum ++;
if (!strncmp(junk, "*End", 4))
break;
}
}
snprintf(ptr + 1, sizeof(line) - (size_t)(ptr - line + 1),
"%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
line);
}
else
cupsFilePrintf(dstfp, "%s\n", line);
}
cupsFileClose(srcfp);
unlink(src);
if (linenum == 0)
{
_cupsSetError(IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, _("Empty PPD file."), 1);
cupsFileClose(dstfp);
unlink(buffer);
*buffer = '\0';
return (NULL);
}
/*
* Now add the CUPS-specific attributes and options...
*/
cupsFilePuts(dstfp, "\n*% CUPS Job Ticket support and options...\n");
cupsFilePuts(dstfp, "*Protocols: PJL\n");
cupsFilePuts(dstfp, "*JCLBegin: \"%!PS-Adobe-3.0<0A>\"\n");
cupsFilePuts(dstfp, "*JCLToPSInterpreter: \"\"\n");
cupsFilePuts(dstfp, "*JCLEnd: \"\"\n");
cupsFilePuts(dstfp, "\n*OpenGroup: CUPS/CUPS Options\n\n");
if ((defattr = ippFindAttribute(response, "job-hold-until-default",
IPP_TAG_ZERO)) != NULL &&
(suppattr = ippFindAttribute(response, "job-hold-until-supported",
IPP_TAG_ZERO)) != NULL)
write_option(dstfp, jclorder ++, "cupsJobHoldUntil", "Hold Until",
"job-hold-until", suppattr, defattr, 0, 1);
if ((defattr = ippFindAttribute(response, "job-priority-default",
IPP_TAG_INTEGER)) != NULL &&
(suppattr = ippFindAttribute(response, "job-priority-supported",
IPP_TAG_RANGE)) != NULL)
write_option(dstfp, jclorder ++, "cupsJobPriority", "Priority",
"job-priority", suppattr, defattr, 0, 1);
if ((defattr = ippFindAttribute(response, "job-sheets-default",
IPP_TAG_ZERO)) != NULL &&
(suppattr = ippFindAttribute(response, "job-sheets-supported",
IPP_TAG_ZERO)) != NULL)
{
write_option(dstfp, jclorder ++, "cupsJobSheetsStart", "Start Banner",
"job-sheets", suppattr, defattr, 0, 2);
write_option(dstfp, jclorder, "cupsJobSheetsEnd", "End Banner",
"job-sheets", suppattr, defattr, 1, 2);
}
cupsFilePuts(dstfp, "*CloseGroup: CUPS\n");
cupsFileClose(dstfp);
ippDelete(response);
return (buffer);
return (NULL);
}
@@ -387,435 +75,7 @@ cupsAdminExportSamba(
const char *samba_password, /* I - Samba password */
FILE *logfile) /* I - Log file, if any */
{
int status; /* Status of Samba commands */
int have_drivers; /* Have drivers? */
char file[1024], /* File to test for */
authfile[1024], /* Temporary authentication file */
address[1024], /* Address for command */
subcmd[1024], /* Sub-command */
message[1024]; /* Error message */
cups_file_t *fp; /* Authentication file */
cups_lang_t *language; /* Current language */
_cups_globals_t *cg = _cupsGlobals();
/* Global data */
/*
* Range check input...
*/
if (!dest || !ppd || !samba_server || !samba_user || !samba_password)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
return (0);
}
/*
* Create a temporary authentication file for Samba...
*/
if ((fp = cupsTempFile2(authfile, sizeof(authfile))) == NULL)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, NULL, 0);
return (0);
}
cupsFilePrintf(fp, "username = %s\n", samba_user);
cupsFilePrintf(fp, "password = %s\n", samba_password);
cupsFileClose(fp);
/*
* See which drivers are available; the new CUPS v6 and Adobe drivers
* depend on the Windows 2k PS driver, so copy that driver first:
*
* Files:
*
* ps5ui.dll
* pscript.hlp
* pscript.ntf
* pscript5.dll
*/
have_drivers = 0;
language = cupsLangDefault();
snprintf(file, sizeof(file), "%s/drivers/pscript5.dll", cg->cups_datadir);
if (!access(file, 0))
{
have_drivers |= 1;
/*
* Windows 2k driver is installed; do the smbclient commands needed
* to copy the Win2k drivers over...
*/
snprintf(address, sizeof(address), "//%s/print$", samba_server);
snprintf(subcmd, sizeof(subcmd),
"mkdir W32X86;"
"put %s W32X86/%s.ppd;"
"put %s/drivers/ps5ui.dll W32X86/ps5ui.dll;"
"put %s/drivers/pscript.hlp W32X86/pscript.hlp;"
"put %s/drivers/pscript.ntf W32X86/pscript.ntf;"
"put %s/drivers/pscript5.dll W32X86/pscript5.dll",
ppd, dest, cg->cups_datadir, cg->cups_datadir,
cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy Windows 2000 printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* See if we also have the CUPS driver files; if so, use them!
*/
snprintf(file, sizeof(file), "%s/drivers/cupsps6.dll", cg->cups_datadir);
if (!access(file, 0))
{
/*
* Copy the CUPS driver files over...
*/
snprintf(subcmd, sizeof(subcmd),
"put %s/drivers/cups6.ini W32X86/cups6.ini;"
"put %s/drivers/cupsps6.dll W32X86/cupsps6.dll;"
"put %s/drivers/cupsui6.dll W32X86/cupsui6.dll",
cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy CUPS printer driver "
"files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* Do the rpcclient command needed for the CUPS drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows NT x86\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,"
"cups6.ini,cupsps6.dll,cupsui6.dll\"",
dest, dest, dest);
}
else
{
/*
* Don't have the CUPS drivers, so just use the standard Windows
* drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows NT x86\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"",
dest, dest, dest);
}
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to install Windows 2000 printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
}
/*
* See if we have the Win9x PS driver...
*/
snprintf(file, sizeof(file), "%s/drivers/ADOBEPS4.DRV", cg->cups_datadir);
if (!access(file, 0))
{
have_drivers |= 2;
/*
* Do the smbclient commands needed for the Adobe Win9x drivers...
*/
snprintf(address, sizeof(address), "//%s/print$", samba_server);
snprintf(subcmd, sizeof(subcmd),
"mkdir WIN40;"
"put %s WIN40/%s.PPD;"
"put %s/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;"
"put %s/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;"
"put %s/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;"
"put %s/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;"
"put %s/drivers/PSMON.DLL WIN40/PSMON.DLL;",
ppd, dest, cg->cups_datadir, cg->cups_datadir,
cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy Windows 9x printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* Do the rpcclient commands needed for the Adobe Win9x drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows 4.0\" \"%s:ADOBEPS4.DRV:%s.PPD:NULL:"
"ADOBEPS4.HLP:PSMON.DLL:RAW:"
"ADOBEPS4.DRV,%s.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM,"
"ICONLIB.DLL\"",
dest, dest, dest);
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to install Windows 9x printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
}
/*
* See if we have the 64-bit Windows PS driver...
*
* Files:
*
* x64/ps5ui.dll
* x64/pscript.hlp
* x64/pscript.ntf
* x64/pscript5.dll
*/
snprintf(file, sizeof(file), "%s/drivers/x64/pscript5.dll", cg->cups_datadir);
if (!access(file, 0))
{
have_drivers |= 4;
/*
* 64-bit Windows driver is installed; do the smbclient commands needed
* to copy the Win64 drivers over...
*/
snprintf(address, sizeof(address), "//%s/print$", samba_server);
snprintf(subcmd, sizeof(subcmd),
"mkdir x64;"
"put %s x64/%s.ppd;"
"put %s/drivers/x64/ps5ui.dll x64/ps5ui.dll;"
"put %s/drivers/x64/pscript.hlp x64/pscript.hlp;"
"put %s/drivers/x64/pscript.ntf x64/pscript.ntf;"
"put %s/drivers/x64/pscript5.dll x64/pscript5.dll",
ppd, dest, cg->cups_datadir, cg->cups_datadir,
cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy 64-bit Windows printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* See if we also have the CUPS driver files; if so, use them!
*/
snprintf(file, sizeof(file), "%s/drivers/x64/cupsps6.dll", cg->cups_datadir);
if (!access(file, 0))
{
/*
* Copy the CUPS driver files over...
*/
snprintf(subcmd, sizeof(subcmd),
"put %s/drivers/x64/cups6.ini x64/cups6.ini;"
"put %s/drivers/x64/cupsps6.dll x64/cupsps6.dll;"
"put %s/drivers/x64/cupsui6.dll x64/cupsui6.dll",
cg->cups_datadir, cg->cups_datadir, cg->cups_datadir);
if ((status = do_samba_command("smbclient", address, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to copy 64-bit CUPS printer driver "
"files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
/*
* Do the rpcclient command needed for the CUPS drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows x64\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,"
"cups6.ini,cupsps6.dll,cupsui6.dll\"",
dest, dest, dest);
}
else
{
/*
* Don't have the CUPS drivers, so just use the standard Windows
* drivers...
*/
snprintf(subcmd, sizeof(subcmd),
"adddriver \"Windows x64\" \"%s:"
"pscript5.dll:%s.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:"
"pscript5.dll,%s.ppd,ps5ui.dll,pscript.hlp,pscript.ntf\"",
dest, dest, dest);
}
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to install Windows 2000 printer "
"driver files (%d).")), status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
}
if (logfile && !(have_drivers & 1))
{
if (!have_drivers)
strlcpy(message,
_cupsLangString(language,
_("No Windows printer drivers are installed.")),
sizeof(message));
else
strlcpy(message,
_cupsLangString(language,
_("Warning, no Windows 2000 printer drivers "
"are installed.")),
sizeof(message));
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
_cupsLangPuts(logfile, message);
}
if (have_drivers == 0)
{
_cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, message, 0);
unlink(authfile);
return (0);
}
/*
* Finally, associate the drivers we just added with the queue...
*/
snprintf(subcmd, sizeof(subcmd), "setdriver %s %s", dest, dest);
if ((status = do_samba_command("rpcclient", samba_server, subcmd,
authfile, logfile)) != 0)
{
snprintf(message, sizeof(message),
_cupsLangString(language,
_("Unable to set Windows printer driver (%d).")),
status);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, message, 0);
if (logfile)
_cupsLangPuts(logfile, message);
unlink(authfile);
return (0);
}
unlink(authfile);
return (1);
return (0);
}
@@ -2081,7 +1341,7 @@ do_samba_command(const char *command, /* I - Command to run */
const char *authfile, /* I - Samba authentication file */
FILE *logfile) /* I - Optional log file */
{
#ifdef WIN32
#ifdef _WIN32
return (1); /* Always fail on Windows... */
#else
@@ -2148,7 +1408,7 @@ do_samba_command(const char *command, /* I - Command to run */
return (WEXITSTATUS(status));
else
return (-WTERMSIG(status));
#endif /* WIN32 */
#endif /* _WIN32 */
}
@@ -2166,9 +1426,9 @@ get_cupsd_conf(
int *remote) /* O - Remote file? */
{
int fd; /* Temporary file descriptor */
#ifndef WIN32
#ifndef _WIN32
struct stat info; /* cupsd.conf file information */
#endif /* WIN32 */
#endif /* _WIN32 */
http_status_t status; /* Status of getting cupsd.conf */
char host[HTTP_MAX_HOST]; /* Hostname for connection */
@@ -2185,7 +1445,7 @@ get_cupsd_conf(
snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot);
*remote = 0;
#ifndef WIN32
#ifndef _WIN32
if (!_cups_strcasecmp(host, "localhost") && !access(name, R_OK))
{
/*
@@ -2212,7 +1472,7 @@ get_cupsd_conf(
status = HTTP_STATUS_OK;
}
else
#endif /* !WIN32 */
#endif /* !_WIN32 */
{
/*
* Read cupsd.conf via a HTTP GET request...
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
<!--
PPD API introduction for CUPS.
Copyright © 2007-2012 by Apple Inc.
Copyright © 2007-2018 by Apple Inc.
Copyright © 1997-2006 by Easy Software Products, all rights reserved.
Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -10,7 +10,7 @@
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
<blockquote>The PPD API is deprecated starting in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
<blockquote>The PPD API is deprecated starting in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
<p>The CUPS PPD API provides read-only access the data in PostScript Printer
Description ("PPD") files which are used for all printers with a driver. With
+2 -2
Ver Arquivo
@@ -30,9 +30,9 @@ extern "C" {
*/
extern int _cupsArrayAddStrings(cups_array_t *a, const char *s,
char delim) _CUPS_API_1_5;
char delim) _CUPS_PRIVATE;
extern cups_array_t *_cupsArrayNewStrings(const char *s, char delim)
_CUPS_API_1_5;
_CUPS_PRIVATE;
# ifdef __cplusplus
}
+1 -1
Ver Arquivo
@@ -13,7 +13,7 @@
#include <cups/cups.h>
#include "string-private.h"
#include "debug-private.h"
#include "debug-internal.h"
#include "array-private.h"
+19 -131
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Authentication functions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -15,13 +15,14 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <fcntl.h>
#include <sys/stat.h>
#if defined(WIN32) || defined(__EMX__)
#if defined(_WIN32) || defined(__EMX__)
# include <io.h>
#else
# include <unistd.h>
#endif /* WIN32 || __EMX__ */
#endif /* _WIN32 || __EMX__ */
#if HAVE_AUTHORIZATION_H
# include <Security/Authorization.h>
@@ -113,9 +114,7 @@ cupsDoAuthentication(
*www_auth, /* WWW-Authenticate header */
*schemedata; /* Scheme-specific data */
char scheme[256], /* Scheme name */
prompt[1024], /* Prompt for user */
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
prompt[1024]; /* Prompt for user */
int localauth; /* Local authentication result */
_cups_globals_t *cg; /* Global data */
@@ -253,6 +252,7 @@ cupsDoAuthentication(
httpEncode64_2(encode, sizeof(encode), http->userpass, (int)strlen(http->userpass));
httpSetAuthString(http, "Basic", encode);
break;
}
else if (!_cups_strcasecmp(scheme, "Digest"))
{
@@ -260,124 +260,15 @@ cupsDoAuthentication(
* Digest authentication...
*/
int i; /* Looping var */
char algorithm[65], /* Hashing algorithm */
opaque[HTTP_MAX_VALUE],
/* Opaque data from server */
cnonce[65], /* cnonce value */
kd[65], /* Final MD5/SHA-256 digest */
ha1[65], /* Hash of username:realm:password */
ha2[65], /* Hash of method:request-uri */
hdata[65], /* Hash of auth data */
temp[1024], /* Temporary string */
digest[1024]; /* Digest auth data */
unsigned char hash[32]; /* Hash buffer */
const char *hashalg; /* Hashing algorithm */
size_t hashsize; /* Size of hash */
char nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
if (strcmp(nonce, http->nonce))
{
strlcpy(http->nonce, nonce, sizeof(http->nonce));
http->nonce_count = 1;
}
else
http->nonce_count ++;
cups_auth_param(schemedata, "opaque", opaque, sizeof(opaque));
cups_auth_param(schemedata, "algorithm", http->algorithm, sizeof(http->algorithm));
cups_auth_param(schemedata, "opaque", http->opaque, sizeof(http->opaque));
cups_auth_param(schemedata, "nonce", nonce, sizeof(nonce));
cups_auth_param(schemedata, "realm", realm, sizeof(realm));
cups_auth_param(schemedata, "realm", http->realm, sizeof(http->realm));
for (i = 0; i < 64; i ++)
cnonce[i] = "0123456789ABCDEF"[CUPS_RAND() & 15];
cnonce[64] = '\0';
if (cups_auth_param(schemedata, "algorithm", algorithm, sizeof(algorithm)))
{
/*
* Follow RFC 2617/7616...
*/
if (!_cups_strcasecmp(algorithm, "MD5"))
{
/*
* RFC 2617 Digest with MD5
*/
hashalg = "md5";
}
else if (!_cups_strcasecmp(algorithm, "SHA-256"))
{
/*
* RFC 7616 Digest with SHA-256
*/
hashalg = "sha2-256";
}
else
{
/*
* Some other algorithm we don't support, skip this one...
*/
continue;
}
/*
* Calculate digest value...
*/
/* H(A1) = H(username:realm:password) */
snprintf(temp, sizeof(temp), "%s:%s:%s", cupsUser(), realm, strchr(http->userpass, ':') + 1);
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha1, sizeof(ha1));
/* H(A2) = H(method:uri) */
snprintf(temp, sizeof(temp), "%s:%s", method, resource);
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha2, sizeof(ha2));
/* H(data) = H(nonce:nc:cnonce:qop:H(A2)) */
snprintf(temp, sizeof(temp), "%s:%08x:%s:auth:%s", nonce, http->nonce_count, cnonce, ha2);
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, hdata, sizeof(hdata));
/* KD = H(H(A1):H(data)) */
snprintf(temp, sizeof(temp), "%s:%s", ha1, hdata);
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, kd, sizeof(kd));
/* Pass the RFC 2617/7616 WWW-Authenticate header */
if (opaque[0])
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", algorithm=%s, qop=auth, opaque=\"%s\", cnonce=\"%s\", nc=%08x, uri=\"%s\", response=\"%s\"", cupsUser(), realm, nonce, algorithm, opaque, cnonce, http->nonce_count, resource, kd);
else
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", algorithm=%s, qop=auth, cnonce=\"%s\", nc=%08x, uri=\"%s\", response=\"%s\"", cupsUser(), realm, nonce, algorithm, cnonce, http->nonce_count, resource, kd);
}
else
{
/*
* Use old RFC 2069 Digest method...
*/
/* H(A1) = H(username:realm:password) */
snprintf(temp, sizeof(temp), "%s:%s:%s", cupsUser(), realm, strchr(http->userpass, ':') + 1);
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha1, sizeof(ha1));
/* H(A2) = H(method:uri) */
snprintf(temp, sizeof(temp), "%s:%s", method, resource);
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha2, sizeof(ha2));
/* KD = H(H(A1):nonce:H(A2)) */
snprintf(temp, sizeof(temp), "%s:%s:%s", ha1, nonce, ha2);
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, kd, sizeof(kd));
/* Pass the RFC 2069 WWW-Authenticate header */
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"", cupsUser(), realm, nonce, resource, kd);
}
httpSetAuthString(http, "Digest", digest);
if (_httpSetDigestAuthString(http, nonce, method, resource))
break;
}
}
@@ -551,7 +442,7 @@ _cupsSetNegotiateAuthString(
*/
int authsize = 10 + /* "Negotiate " */
(int)output_token.length * 4 / 3 + 1 + 1;
(((int)output_token.length * 4 / 3 + 3) & ~3) + 1;
/* Base64 + nul */
httpSetAuthString(http, NULL, NULL);
@@ -1005,9 +896,9 @@ static int /* O - 0 if available */
/* -1 error */
cups_local_auth(http_t *http) /* I - HTTP connection to server */
{
#if defined(WIN32) || defined(__EMX__)
#if defined(_WIN32) || defined(__EMX__)
/*
* Currently WIN32 and OS-2 do not support the CUPS server...
* Currently _WIN32 and OS-2 do not support the CUPS server...
*/
return (1);
@@ -1115,10 +1006,6 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
if (cups_auth_find(www_auth, "Negotiate"))
return (1);
# endif /* HAVE_GSSAPI */
# ifdef HAVE_AUTHORIZATION_H
if (cups_auth_find(www_auth, "AuthRef"))
return (1);
# endif /* HAVE_AUTHORIZATION_H */
# if defined(SO_PEERCRED) && defined(AF_LOCAL)
/*
@@ -1168,7 +1055,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
* No certificate for this PID; see if we can get the root certificate...
*/
DEBUG_printf(("9cups_local_auth: Unable to open file %s: %s", filename, strerror(errno)));
DEBUG_printf(("9cups_local_auth: Unable to open file \"%s\": %s", filename, strerror(errno)));
if (!cups_auth_param(schemedata, "trc", trc, sizeof(trc)))
{
@@ -1180,7 +1067,8 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
}
snprintf(filename, sizeof(filename), "%s/certs/0", cg->cups_statedir);
fp = fopen(filename, "r");
if ((fp = fopen(filename, "r")) == NULL)
DEBUG_printf(("9cups_local_auth: Unable to open file \"%s\": %s", filename, strerror(errno)));
}
if (fp)
@@ -1211,5 +1099,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
}
return (1);
#endif /* WIN32 || __EMX__ */
#endif /* _WIN32 || __EMX__ */
}
+6 -6
Ver Arquivo
@@ -13,12 +13,12 @@
#include "cups.h"
#include <errno.h>
#ifdef WIN32
#ifdef _WIN32
# include <io.h>
# include <fcntl.h>
#else
# include <sys/time.h>
#endif /* WIN32 */
#endif /* _WIN32 */
/*
@@ -71,11 +71,11 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read into */
* Read bytes from the pipe...
*/
#ifdef WIN32
#ifdef _WIN32
return ((ssize_t)_read(3, buffer, (unsigned)bytes));
#else
return (read(3, buffer, bytes));
#endif /* WIN32 */
#endif /* _WIN32 */
}
@@ -133,11 +133,11 @@ cupsBackChannelWrite(
* Write bytes to the pipe...
*/
#ifdef WIN32
#ifdef _WIN32
count = (ssize_t)_write(3, buffer, (unsigned)(bytes - total));
#else
count = write(3, buffer, bytes - total);
#endif /* WIN32 */
#endif /* _WIN32 */
if (count < 0)
{
+35 -26
Ver Arquivo
@@ -16,7 +16,6 @@
*/
# include "string-private.h"
# include "debug-private.h"
# include "array-private.h"
# include "ipp-private.h"
# include "http-private.h"
@@ -51,6 +50,13 @@ typedef struct _cups_buffer_s /**** Read/write buffer ****/
d[1]; /* Data buffer */
} _cups_buffer_t;
typedef struct _cups_raster_error_s /**** Error buffer structure ****/
{
char *start, /* Start of buffer */
*current, /* Current position in buffer */
*end; /* End of buffer */
} _cups_raster_error_t;
typedef struct _cups_globals_s /**** CUPS global state data ****/
{
/* Multiple places... */
@@ -122,6 +128,9 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
char pwg_name[65], /* PWG media name for custom size */
ppd_name[41]; /* PPD media name for custom size */
/* raster-error.c */
_cups_raster_error_t raster_error; /* Raster error information */
/* request.c */
http_t *http; /* Current server connection */
ipp_status_t last_error; /* Last IPP error */
@@ -219,38 +228,38 @@ struct _cups_dinfo_s /* Destination capability and status
*/
# ifdef __APPLE__
extern CFStringRef _cupsAppleCopyDefaultPaperID(void);
extern CFStringRef _cupsAppleCopyDefaultPrinter(void);
extern int _cupsAppleGetUseLastPrinter(void);
extern void _cupsAppleSetDefaultPaperID(CFStringRef name);
extern void _cupsAppleSetDefaultPrinter(CFStringRef name);
extern void _cupsAppleSetUseLastPrinter(int uselast);
extern CFStringRef _cupsAppleCopyDefaultPaperID(void) _CUPS_PRIVATE;
extern CFStringRef _cupsAppleCopyDefaultPrinter(void) _CUPS_PRIVATE;
extern int _cupsAppleGetUseLastPrinter(void) _CUPS_PRIVATE;
extern void _cupsAppleSetDefaultPaperID(CFStringRef name) _CUPS_PRIVATE;
extern void _cupsAppleSetDefaultPrinter(CFStringRef name) _CUPS_PRIVATE;
extern void _cupsAppleSetUseLastPrinter(int uselast) _CUPS_PRIVATE;
# endif /* __APPLE__ */
extern char *_cupsBufferGet(size_t size);
extern void _cupsBufferRelease(char *b);
extern char *_cupsBufferGet(size_t size) _CUPS_PRIVATE;
extern void _cupsBufferRelease(char *b) _CUPS_PRIVATE;
extern http_t *_cupsConnect(void);
extern char *_cupsCreateDest(const char *name, const char *info, const char *device_id, const char *device_uri, char *uri, size_t urisize);
extern ipp_attribute_t *_cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, _ipp_option_t *map, const char *name, const char *value);
extern int _cupsGet1284Values(const char *device_id, cups_option_t **values);
extern const char *_cupsGetDestResource(cups_dest_t *dest, unsigned flags, char *resource, size_t resourcesize);
extern int _cupsGetDests(http_t *http, ipp_op_t op, const char *name, cups_dest_t **dests, cups_ptype_t type, cups_ptype_t mask);
extern const char *_cupsGetPassword(const char *prompt);
extern void _cupsGlobalLock(void);
extern _cups_globals_t *_cupsGlobals(void);
extern void _cupsGlobalUnlock(void);
extern http_t *_cupsConnect(void) _CUPS_PRIVATE;
extern char *_cupsCreateDest(const char *name, const char *info, const char *device_id, const char *device_uri, char *uri, size_t urisize) _CUPS_PRIVATE;
extern ipp_attribute_t *_cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, _ipp_option_t *map, const char *name, const char *value) _CUPS_PRIVATE;
extern int _cupsGet1284Values(const char *device_id, cups_option_t **values) _CUPS_PRIVATE;
extern const char *_cupsGetDestResource(cups_dest_t *dest, unsigned flags, char *resource, size_t resourcesize) _CUPS_PRIVATE;
extern int _cupsGetDests(http_t *http, ipp_op_t op, const char *name, cups_dest_t **dests, cups_ptype_t type, cups_ptype_t mask) _CUPS_PRIVATE;
extern const char *_cupsGetPassword(const char *prompt) _CUPS_PRIVATE;
extern void _cupsGlobalLock(void) _CUPS_PRIVATE;
extern _cups_globals_t *_cupsGlobals(void) _CUPS_PRIVATE;
extern void _cupsGlobalUnlock(void) _CUPS_PRIVATE;
# ifdef HAVE_GSSAPI
extern const char *_cupsGSSServiceName(void);
extern const char *_cupsGSSServiceName(void) _CUPS_PRIVATE;
# endif /* HAVE_GSSAPI */
extern int _cupsNextDelay(int current, int *previous);
extern void _cupsSetDefaults(void);
extern void _cupsSetError(ipp_status_t status, const char *message, int localize);
extern void _cupsSetHTTPError(http_status_t status);
extern int _cupsNextDelay(int current, int *previous) _CUPS_PRIVATE;
extern void _cupsSetDefaults(void) _CUPS_INTERNAL;
extern void _cupsSetError(ipp_status_t status, const char *message, int localize) _CUPS_PRIVATE;
extern void _cupsSetHTTPError(http_status_t status) _CUPS_INTERNAL;
# ifdef HAVE_GSSAPI
extern int _cupsSetNegotiateAuthString(http_t *http, const char *method, const char *resource);
extern int _cupsSetNegotiateAuthString(http_t *http, const char *method, const char *resource) _CUPS_PRIVATE;
# endif /* HAVE_GSSAPI */
extern char *_cupsUserDefault(char *name, size_t namesize);
extern char *_cupsUserDefault(char *name, size_t namesize) _CUPS_INTERNAL;
/*
+30 -30
Ver Arquivo
@@ -15,12 +15,12 @@
*/
# include <sys/types.h>
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
# include <stddef.h>
/* Windows does not support the ssize_t type, so map it to long... */
typedef long ssize_t; /* @private@ */
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
# endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
# include "file.h"
# include "ipp.h"
@@ -328,55 +328,55 @@ typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
* Functions...
*/
extern int cupsCancelJob(const char *name, int job_id);
extern int cupsCancelJob(const char *name, int job_id) _CUPS_PUBLIC;
extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
const char *resource,
const char *filename);
const char *filename) _CUPS_PUBLIC;
extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request,
const char *resource);
const char *resource) _CUPS_PUBLIC;
extern http_encryption_t cupsEncryption(void);
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs) _CUPS_PUBLIC;
extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
extern const char *cupsGetDefault(void);
extern const char *cupsGetDefault(void) _CUPS_PUBLIC;
extern int cupsGetJobs(cups_job_t **jobs, const char *name,
int myjobs, int whichjobs);
int myjobs, int whichjobs) _CUPS_PUBLIC;
extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
extern ipp_status_t cupsLastError(void);
extern ipp_status_t cupsLastError(void) _CUPS_PUBLIC;
extern int cupsPrintFile(const char *name, const char *filename,
const char *title, int num_options,
cups_option_t *options);
cups_option_t *options) _CUPS_PUBLIC;
extern int cupsPrintFiles(const char *name, int num_files,
const char **files, const char *title,
int num_options, cups_option_t *options);
int num_options, cups_option_t *options) _CUPS_PUBLIC;
extern char *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead.");
extern int cupsTempFd(char *filename, int len);
extern int cupsTempFd(char *filename, int len) _CUPS_PUBLIC;
extern int cupsAddDest(const char *name, const char *instance,
int num_dests, cups_dest_t **dests);
extern void cupsFreeDests(int num_dests, cups_dest_t *dests);
int num_dests, cups_dest_t **dests) _CUPS_PUBLIC;
extern void cupsFreeDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
extern cups_dest_t *cupsGetDest(const char *name, const char *instance,
int num_dests, cups_dest_t *dests);
extern int cupsGetDests(cups_dest_t **dests);
extern void cupsSetDests(int num_dests, cups_dest_t *dests);
int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
extern int cupsGetDests(cups_dest_t **dests) _CUPS_PUBLIC;
extern void cupsSetDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
extern int cupsAddOption(const char *name, const char *value,
int num_options, cups_option_t **options);
int num_options, cups_option_t **options) _CUPS_PUBLIC;
extern void cupsEncodeOptions(ipp_t *ipp, int num_options,
cups_option_t *options);
cups_option_t *options) _CUPS_PUBLIC;
extern void cupsFreeOptions(int num_options,
cups_option_t *options);
cups_option_t *options) _CUPS_PUBLIC;
extern const char *cupsGetOption(const char *name, int num_options,
cups_option_t *options);
cups_option_t *options) _CUPS_PUBLIC;
extern int cupsParseOptions(const char *arg, int num_options,
cups_option_t **options);
cups_option_t **options) _CUPS_PUBLIC;
extern const char *cupsGetPassword(const char *prompt);
extern const char *cupsServer(void);
extern void cupsSetEncryption(http_encryption_t e);
extern void cupsSetPasswordCB(cups_password_cb_t cb);
extern void cupsSetServer(const char *server);
extern void cupsSetUser(const char *user);
extern const char *cupsUser(void);
extern const char *cupsGetPassword(const char *prompt) _CUPS_PUBLIC;
extern const char *cupsServer(void) _CUPS_PUBLIC;
extern void cupsSetEncryption(http_encryption_t e) _CUPS_PUBLIC;
extern void cupsSetPasswordCB(cups_password_cb_t cb) _CUPS_PUBLIC;
extern void cupsSetServer(const char *server) _CUPS_PUBLIC;
extern void cupsSetUser(const char *user) _CUPS_PUBLIC;
extern const char *cupsUser(void) _CUPS_PUBLIC;
/**** New in CUPS 1.1.20 ****/
extern int cupsDoAuthentication(http_t *http, const char *method,
@@ -384,7 +384,7 @@ extern int cupsDoAuthentication(http_t *http, const char *method,
_CUPS_API_1_1_20;
extern http_status_t cupsGetFile(http_t *http, const char *resource,
const char *filename) _CUPS_API_1_1_20;
extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd) _CUPS_API_1_1_20;
extern http_status_t cupsPutFile(http_t *http, const char *resource,
const char *filename) _CUPS_API_1_1_20;
extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd)
+84
Ver Arquivo
@@ -0,0 +1,84 @@
/*
* Internal debugging macros for CUPS.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2005 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_DEBUG_INTERNAL_H_
# define _CUPS_DEBUG_INTERNAL_H_
/*
* Include necessary headers...
*/
# include "debug-private.h"
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* The debug macros are used if you compile with DEBUG defined.
*
* Usage:
*
* DEBUG_puts("string")
* DEBUG_printf(("format string", arg, arg, ...));
*
* Note the extra parenthesis around the DEBUG_printf macro...
*
* Newlines are not required on the end of messages, as both add one when
* writing the output.
*
* If the first character is a digit, then it represents the "log level" of the
* message from 0 to 9. The default level is 1. The following defines the
* current levels we use:
*
* 0 = public APIs, other than value accessor functions
* 1 = return values for public APIs
* 2 = public value accessor APIs, progress for public APIs
* 3 = return values for value accessor APIs
* 4 = private APIs, progress for value accessor APIs
* 5 = return values for private APIs
* 6 = progress for private APIs
* 7 = static functions
* 8 = return values for static functions
* 9 = progress for static functions
*/
# ifdef DEBUG
# define DEBUG_puts(x) _cups_debug_puts(x)
# define DEBUG_printf(x) _cups_debug_printf x
# else
# define DEBUG_puts(x)
# define DEBUG_printf(x)
# endif /* DEBUG */
/*
* Prototypes...
*/
# ifdef DEBUG
extern int _cups_debug_fd _CUPS_INTERNAL;
extern int _cups_debug_level _CUPS_INTERNAL;
extern void _cups_debug_printf(const char *format, ...) _CUPS_FORMAT(1,2) _CUPS_INTERNAL;
extern void _cups_debug_puts(const char *s) _CUPS_INTERNAL;
# endif /* DEBUG */
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_DEBUG_INTERNAL_H_ */
+12 -52
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Private debugging macros for CUPS.
* Private debugging APIs for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2005 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_DEBUG_PRIVATE_H_
@@ -32,51 +33,17 @@ extern "C" {
*
* Usage:
*
* DEBUG_puts("string")
* DEBUG_printf(("format string", arg, arg, ...));
*
* Note the extra parenthesis around the DEBUG_printf macro...
*
* Newlines are not required on the end of messages, as both add one when
* writing the output.
*
* If the first character is a digit, then it represents the "log level" of the
* message from 0 to 9. The default level is 1. The following defines the
* current levels we use:
*
* 0 = public APIs, other than value accessor functions
* 1 = return values for public APIs
* 2 = public value accessor APIs, progress for public APIs
* 3 = return values for value accessor APIs
* 4 = private APIs, progress for value accessor APIs
* 5 = return values for private APIs
* 6 = progress for private APIs
* 7 = static functions
* 8 = return values for static functions
* 9 = progress for static functions
* DEBUG_set("logfile", "level", "filter", 1)
*
* The DEBUG_set macro allows an application to programmatically enable (or
* disable) debug logging. The arguments correspond to the CUPS_DEBUG_LOG,
* CUPS_DEBUG_LEVEL, and CUPS_DEBUG_FILTER environment variables.
* CUPS_DEBUG_LEVEL, and CUPS_DEBUG_FILTER environment variables. The 1 on the
* end forces the values to override the environment.
*/
# ifdef DEBUG
# ifdef WIN32
# ifdef LIBCUPS2_EXPORTS
# define DLLExport __declspec(dllexport)
# else
# define DLLExport
# endif /* LIBCUPS2_EXPORTS */
# else
# define DLLExport
# endif /* WIN32 */
# define DEBUG_puts(x) _cups_debug_puts(x)
# define DEBUG_printf(x) _cups_debug_printf x
# define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1)
# else
# define DLLExport
# define DEBUG_puts(x)
# define DEBUG_printf(x)
# define DEBUG_set(logfile,level,filter)
# endif /* DEBUG */
@@ -85,18 +52,11 @@ extern "C" {
* Prototypes...
*/
extern int _cups_debug_fd;
extern int _cups_debug_level;
extern void DLLExport _cups_debug_printf(const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
extern void DLLExport _cups_debug_puts(const char *s);
extern void DLLExport _cups_debug_set(const char *logfile,
const char *level, const char *filter,
int force);
# ifdef WIN32
extern int _cups_gettimeofday(struct timeval *tv, void *tz);
extern void _cups_debug_set(const char *logfile, const char *level, const char *filter, int force) _CUPS_PRIVATE;
# ifdef _WIN32
extern int _cups_gettimeofday(struct timeval *tv, void *tz) _CUPS_PRIVATE;
# define gettimeofday(a,b) _cups_gettimeofday(a, b)
# endif /* WIN32 */
# endif /* _WIN32 */
# ifdef __cplusplus
}
+28 -8
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* Debugging functions for CUPS.
*
* Copyright 2008-2015 by Apple Inc.
* Copyright © 2008-2018 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -11,8 +12,9 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include "thread-private.h"
#ifdef WIN32
#ifdef _WIN32
# include <sys/timeb.h>
# include <time.h>
# include <io.h>
@@ -30,11 +32,12 @@ _cups_gettimeofday(struct timeval *tv, /* I - Timeval struct */
#else
# include <sys/time.h>
# include <unistd.h>
#endif /* WIN32 */
#endif /* _WIN32 */
#include <regex.h>
#include <fcntl.h>
#ifdef DEBUG
/*
* Globals...
*/
@@ -45,7 +48,6 @@ int _cups_debug_level = 1;
/* Log level (0 to 9) */
#ifdef DEBUG
/*
* Local globals...
*/
@@ -77,7 +79,7 @@ debug_thread_id(void)
* '_cups_debug_printf()' - Write a formatted line to the log.
*/
void DLLExport
void
_cups_debug_printf(const char *format, /* I - Printf-style format string */
...) /* I - Additional arguments as needed */
{
@@ -162,7 +164,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
* '_cups_debug_puts()' - Write a single line to the log.
*/
void DLLExport
void
_cups_debug_puts(const char *s) /* I - String to output */
{
struct timeval curtime; /* Current time */
@@ -242,7 +244,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
* '_cups_debug_set()' - Enable or disable debug logging.
*/
void DLLExport
void
_cups_debug_set(const char *logfile, /* I - Log file or NULL */
const char *level, /* I - Log level or NULL */
const char *filter, /* I - Filter string or NULL */
@@ -312,6 +314,24 @@ _cups_debug_set(const char *logfile, /* I - Log file or NULL */
_cupsMutexUnlock(&debug_init_mutex);
}
#else
/*
* '_cups_debug_set()' - Enable or disable debug logging.
*/
void
_cups_debug_set(const char *logfile, /* I - Log file or NULL */
const char *level, /* I - Log level or NULL */
const char *filter, /* I - Filter string or NULL */
int force) /* I - Force initialization */
{
(void)logfile;
(void)level;
(void)filter;
(void)force;
}
#endif /* DEBUG */
+1
Ver Arquivo
@@ -11,6 +11,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
+1
Ver Arquivo
@@ -11,6 +11,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
+1
Ver Arquivo
@@ -12,6 +12,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
+7 -6
Ver Arquivo
@@ -13,6 +13,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <sys/stat.h>
#ifdef HAVE_NOTIFY_H
@@ -2031,9 +2032,9 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
cups_option_t *option; /* Current option */
_ipp_option_t *match; /* Matching attribute for option */
FILE *fp; /* File pointer */
#ifndef WIN32
#ifndef _WIN32
const char *home; /* HOME environment variable */
#endif /* WIN32 */
#endif /* _WIN32 */
char filename[1024]; /* lpoptions file */
int num_temps; /* Number of temporary destinations */
cups_dest_t *temps = NULL, /* Temporary destinations */
@@ -2067,7 +2068,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
#ifndef WIN32
#ifndef _WIN32
if (getuid())
{
/*
@@ -2087,7 +2088,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
}
}
#endif /* !WIN32 */
#endif /* !_WIN32 */
/*
* Try to open the file...
@@ -2099,7 +2100,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
return (-1);
}
#ifndef WIN32
#ifndef _WIN32
/*
* Set the permissions to 0644 when saving to the /etc/cups/lpoptions
* file...
@@ -2107,7 +2108,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
if (!getuid())
fchmod(fileno(fp), 0644);
#endif /* !WIN32 */
#endif /* !_WIN32 */
/*
* Write each printer; each line looks like:
+6 -6
Ver Arquivo
@@ -14,7 +14,7 @@
*/
#include "string-private.h"
#include "debug-private.h"
#include "debug-internal.h"
#include "dir.h"
@@ -22,7 +22,7 @@
* Windows implementation...
*/
#ifdef WIN32
#ifdef _WIN32
# include <windows.h>
/*
@@ -141,7 +141,7 @@ cupsDirOpen(const char *directory) /* I - Directory name */
cups_dentry_t * /* O - Directory entry or @code NULL@ if there are no more */
cupsDirRead(cups_dir_t *dp) /* I - Directory pointer */
{
WIN32_FIND_DATA entry; /* Directory entry data */
WIN32_FIND_DATAA entry; /* Directory entry data */
/*
@@ -161,11 +161,11 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory pointer */
* No, find the first file...
*/
dp->dir = FindFirstFile(dp->directory, &entry);
dp->dir = FindFirstFileA(dp->directory, &entry);
if (dp->dir == INVALID_HANDLE_VALUE)
return (NULL);
}
else if (!FindNextFile(dp->dir, &entry))
else if (!FindNextFileA(dp->dir, &entry))
return (NULL);
/*
@@ -418,4 +418,4 @@ cupsDirRewind(cups_dir_t *dp) /* I - Directory pointer */
rewinddir(dp->dir);
}
#endif /* WIN32 */
#endif /* _WIN32 */
+34 -1
Ver Arquivo
@@ -13,6 +13,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
@@ -129,6 +130,9 @@ static const _ipp_option_t ipp_options[] =
cups_schemes },
{ 1, "finishings", IPP_TAG_ENUM, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 1, "finishings-col", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 1, "finishings-col-default", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_PRINTER },
{ 1, "finishings-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 0, "fit-to-page", IPP_TAG_BOOLEAN, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
@@ -142,6 +146,7 @@ static const _ipp_option_t ipp_options[] =
{ 1, "include-schemes", IPP_TAG_NAME, IPP_TAG_OPERATION,
IPP_TAG_ZERO,
cups_schemes },
{ 0, "ipp-attribute-fidelity", IPP_TAG_BOOLEAN, IPP_TAG_OPERATION },
{ 0, "job-account-id", IPP_TAG_NAME, IPP_TAG_JOB },
{ 0, "job-account-id-default",IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 0, "job-accounting-user-id", IPP_TAG_NAME, IPP_TAG_JOB },
@@ -150,6 +155,7 @@ static const _ipp_option_t ipp_options[] =
{ 0, "job-cancel-after", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "job-cancel-after-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "job-hold-until", IPP_TAG_KEYWORD, IPP_TAG_JOB },
{ 0, "job-hold-until-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "job-id", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_OPERATION },
{ 0, "job-impressions-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
@@ -158,6 +164,8 @@ static const _ipp_option_t ipp_options[] =
{ 0, "job-k-octets-completed",IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-media-sheets", IPP_TAG_INTEGER, IPP_TAG_OPERATION },
{ 0, "job-media-sheets-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-name", IPP_TAG_NAME, IPP_TAG_OPERATION,
IPP_TAG_JOB },
{ 0, "job-page-limit", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "job-pages", IPP_TAG_INTEGER, IPP_TAG_OPERATION },
{ 0, "job-pages-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
@@ -168,6 +176,7 @@ static const _ipp_option_t ipp_options[] =
IPP_TAG_ZERO,
ipp_job_creation },
{ 0, "job-priority", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "job-priority-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "job-quota-period", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 1, "job-sheets", IPP_TAG_NAME, IPP_TAG_JOB },
{ 1, "job-sheets-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
@@ -212,6 +221,9 @@ static const _ipp_option_t ipp_options[] =
IPP_TAG_DOCUMENT },
{ 0, "mirror", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ 0, "mirror-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "multiple-document-handling", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "multiple-document-handling-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "natural-scaling", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "natural-scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "notify-charset", IPP_TAG_CHARSET, IPP_TAG_SUBSCRIPTION },
@@ -227,18 +239,26 @@ static const _ipp_option_t ipp_options[] =
{ 0, "number-up", IPP_TAG_INTEGER, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "number-up-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "number-up-layout", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "number-up-layout-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "orientation-requested", IPP_TAG_ENUM, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "orientation-requested-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 0, "output-bin", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "output-bin-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 1, "overrides", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "page-bottom", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "page-bottom-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "page-delivery", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "page-delivery-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "page-left", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "page-left-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 1, "page-ranges", IPP_TAG_RANGE, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 1, "page-ranges-default", IPP_TAG_RANGE, IPP_TAG_PRINTER },
{ 0, "page-right", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "page-right-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "page-top", IPP_TAG_INTEGER, IPP_TAG_JOB },
@@ -279,9 +299,21 @@ static const _ipp_option_t ipp_options[] =
{ 0, "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ 0, "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "print-color-mode", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "print-color-mode-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "print-content-optimize", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "print-content-optimize-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 0, "print-rendering-intent", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "print-rendering-intent-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "print-scaling", IPP_TAG_KEYWORD, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "print-scaling-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 1, "printer-alert", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 1, "printer-alert-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 1, "printer-commands", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
@@ -303,6 +335,7 @@ static const _ipp_option_t ipp_options[] =
{ 1, "printer-output-tray", IPP_TAG_STRING, IPP_TAG_PRINTER },
{ 0, "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "printer-resolution-default", IPP_TAG_RESOLUTION, IPP_TAG_PRINTER },
{ 0, "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 0, "printer-state-change-time", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 1, "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
-266
Ver Arquivo
@@ -1,266 +0,0 @@
/*
* Raster error handling for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
/*
* Include necessary headers...
*/
#include <cups/raster-private.h>
/*
* Local structures...
*/
typedef struct _cups_raster_error_s /**** Error buffer structure ****/
{
char *start, /* Start of buffer */
*current, /* Current position in buffer */
*end; /* End of buffer */
} _cups_raster_error_t;
/*
* Local functions...
*/
static _cups_raster_error_t *get_error_buffer(void);
/*
* '_cupsRasterAddError()' - Add an error message to the error buffer.
*/
void
_cupsRasterAddError(const char *f, /* I - Printf-style error message */
...) /* I - Additional arguments as needed */
{
_cups_raster_error_t *buf = get_error_buffer();
/* Error buffer */
va_list ap; /* Pointer to additional arguments */
char s[2048]; /* Message string */
ssize_t bytes; /* Bytes in message string */
DEBUG_printf(("_cupsRasterAddError(f=\"%s\", ...)", f));
va_start(ap, f);
bytes = vsnprintf(s, sizeof(s), f, ap);
va_end(ap);
if (bytes <= 0)
return;
DEBUG_printf(("1_cupsRasterAddError: %s", s));
bytes ++;
if ((size_t)bytes >= sizeof(s))
return;
if (bytes > (ssize_t)(buf->end - buf->current))
{
/*
* Allocate more memory...
*/
char *temp; /* New buffer */
size_t size; /* Size of buffer */
size = (size_t)(buf->end - buf->start + 2 * bytes + 1024);
if (buf->start)
temp = realloc(buf->start, size);
else
temp = malloc(size);
if (!temp)
return;
/*
* Update pointers...
*/
buf->end = temp + size;
buf->current = temp + (buf->current - buf->start);
buf->start = temp;
}
/*
* Append the message to the end of the current string...
*/
memcpy(buf->current, s, (size_t)bytes);
buf->current += bytes - 1;
}
/*
* '_cupsRasterClearError()' - Clear the error buffer.
*/
void
_cupsRasterClearError(void)
{
_cups_raster_error_t *buf = get_error_buffer();
/* Error buffer */
buf->current = buf->start;
if (buf->start)
*(buf->start) = '\0';
}
/*
* 'cupsRasterErrorString()' - Return the last error from a raster function.
*
* If there are no recent errors, NULL is returned.
*
* @since CUPS 1.3/macOS 10.5@
*/
const char * /* O - Last error */
cupsRasterErrorString(void)
{
_cups_raster_error_t *buf = get_error_buffer();
/* Error buffer */
if (buf->current == buf->start)
return (NULL);
else
return (buf->start);
}
#ifdef HAVE_PTHREAD_H
/*
* Implement per-thread globals...
*/
# include <pthread.h>
/*
* Local globals...
*/
static pthread_key_t raster_key = 0; /* Thread local storage key */
static pthread_once_t raster_key_once = PTHREAD_ONCE_INIT;
/* One-time initialization object */
/*
* Local functions...
*/
static void raster_init(void);
static void raster_destructor(void *value);
/*
* 'get_error_buffer()' - Return a pointer to thread local storage.
*/
_cups_raster_error_t * /* O - Pointer to error buffer */
get_error_buffer(void)
{
_cups_raster_error_t *buf; /* Pointer to error buffer */
/*
* Initialize the global data exactly once...
*/
DEBUG_puts("3get_error_buffer()");
pthread_once(&raster_key_once, raster_init);
/*
* See if we have allocated the data yet...
*/
if ((buf = (_cups_raster_error_t *)pthread_getspecific(raster_key))
== NULL)
{
DEBUG_puts("4get_error_buffer: allocating memory for thread.");
/*
* No, allocate memory as set the pointer for the key...
*/
buf = calloc(1, sizeof(_cups_raster_error_t));
pthread_setspecific(raster_key, buf);
DEBUG_printf(("4get_error_buffer: buf=%p", (void *)buf));
}
/*
* Return the pointer to the data...
*/
return (buf);
}
/*
* 'raster_init()' - Initialize error buffer once.
*/
static void
raster_init(void)
{
pthread_key_create(&raster_key, raster_destructor);
DEBUG_printf(("3raster_init(): raster_key=%x(%u)", (unsigned)raster_key, (unsigned)raster_key));
}
/*
* 'raster_destructor()' - Free memory allocated by get_error_buffer().
*/
static void
raster_destructor(void *value) /* I - Data to free */
{
_cups_raster_error_t *buf = (_cups_raster_error_t *)value;
/* Error buffer */
DEBUG_printf(("3raster_destructor(value=%p)", value));
if (buf->start)
free(buf->start);
free(value);
}
#else
/*
* Implement static globals...
*/
/*
* 'get_error_buffer()' - Return a pointer to thread local storage.
*/
_cups_raster_error_t * /* O - Pointer to error buffer */
get_error_buffer(void)
{
static _cups_raster_error_t buf = { 0, 0, 0 };
/* Error buffer */
return (&buf);
}
#endif /* HAVE_PTHREAD_H */
+9 -41
Ver Arquivo
@@ -6,10 +6,11 @@
* our own file functions allows us to provide transparent support of
* different line endings, gzip'd print files, PPD files, etc.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_FILE_PRIVATE_H_
@@ -25,13 +26,10 @@
# include <stdarg.h>
# include <fcntl.h>
# ifdef HAVE_LIBZ
# include <zlib.h>
# endif /* HAVE_LIBZ */
# ifdef WIN32
# ifdef _WIN32
# include <io.h>
# include <sys/locking.h>
# endif /* WIN32 */
# endif /* _WIN32 */
/*
@@ -82,43 +80,13 @@ typedef enum /**** _cupsFileCheck file type values ****/
typedef void (*_cups_fc_func_t)(void *context, _cups_fc_result_t result,
const char *message);
struct _cups_file_s /**** CUPS file structure... ****/
{
int fd; /* File descriptor */
char mode, /* Mode ('r' or 'w') */
compressed, /* Compression used? */
is_stdio, /* stdin/out/err? */
eof, /* End of file? */
buf[4096], /* Buffer */
*ptr, /* Pointer into buffer */
*end; /* End of buffer data */
off_t pos, /* Position in file */
bufpos; /* File position for start of buffer */
#ifdef HAVE_LIBZ
z_stream stream; /* (De)compression stream */
Bytef cbuf[4096]; /* (De)compression buffer */
uLong crc; /* (De)compression CRC */
#endif /* HAVE_LIBZ */
char *printf_buffer; /* cupsFilePrintf buffer */
size_t printf_size; /* Size of cupsFilePrintf buffer */
};
/*
* Prototypes...
*/
extern _cups_fc_result_t _cupsFileCheck(const char *filename,
_cups_fc_filetype_t filetype,
int dorootchecks,
_cups_fc_func_t cb,
void *context);
extern void _cupsFileCheckFilter(void *context,
_cups_fc_result_t result,
const char *message);
extern _cups_fc_result_t _cupsFileCheck(const char *filename, _cups_fc_filetype_t filetype, int dorootchecks, _cups_fc_func_t cb, void *context) _CUPS_PRIVATE;
extern void _cupsFileCheckFilter(void *context, _cups_fc_result_t result, const char *message) _CUPS_PRIVATE;
extern int _cupsFilePeekAhead(cups_file_t *fp, int ch);
# ifdef __cplusplus
}
+74 -27
Ver Arquivo
@@ -6,10 +6,11 @@
* our own file functions allows us to provide transparent support of
* different line endings, gzip'd print files, PPD files, etc.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -17,9 +18,43 @@
*/
#include "file-private.h"
#include "debug-internal.h"
#include <sys/stat.h>
#include <sys/types.h>
# ifdef HAVE_LIBZ
# include <zlib.h>
# endif /* HAVE_LIBZ */
/*
* Internal structures...
*/
struct _cups_file_s /**** CUPS file structure... ****/
{
int fd; /* File descriptor */
char mode, /* Mode ('r' or 'w') */
compressed, /* Compression used? */
is_stdio, /* stdin/out/err? */
eof, /* End of file? */
buf[4096], /* Buffer */
*ptr, /* Pointer into buffer */
*end; /* End of buffer data */
off_t pos, /* Position in file */
bufpos; /* File position for start of buffer */
#ifdef HAVE_LIBZ
z_stream stream; /* (De)compression stream */
Bytef cbuf[4096]; /* (De)compression buffer */
uLong crc; /* (De)compression CRC */
#endif /* HAVE_LIBZ */
char *printf_buffer; /* cupsFilePrintf buffer */
size_t printf_size; /* Size of cupsFilePrintf buffer */
};
/*
* Local functions...
@@ -34,7 +69,7 @@ static ssize_t cups_read(cups_file_t *fp, char *buf, size_t bytes);
static ssize_t cups_write(cups_file_t *fp, const char *buf, size_t bytes);
#ifndef WIN32
#ifndef _WIN32
/*
* '_cupsFileCheck()' - Check the permissions of the given filename.
*/
@@ -300,7 +335,7 @@ _cupsFileCheckFilter(
fprintf(stderr, "%s: %s\n", prefix, message);
}
#endif /* !WIN32 */
#endif /* !_WIN32 */
/*
@@ -520,22 +555,22 @@ cupsFileFind(const char *filename, /* I - File to find */
while (*path)
{
#ifdef WIN32
#ifdef _WIN32
if (*path == ';' || (*path == ':' && ((bufptr - buffer) > 1 || !isalpha(buffer[0] & 255))))
#else
if (*path == ';' || *path == ':')
#endif /* WIN32 */
#endif /* _WIN32 */
{
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
*bufptr++ = '/';
strlcpy(bufptr, filename, (size_t)(bufend - bufptr));
#ifdef WIN32
#ifdef _WIN32
if (!access(buffer, 0))
#else
if (!access(buffer, executable ? X_OK : 0))
#endif /* WIN32 */
#endif /* _WIN32 */
{
DEBUG_printf(("1cupsFileFind: Returning \"%s\"", buffer));
return (buffer);
@@ -986,11 +1021,11 @@ cupsFileLock(cups_file_t *fp, /* I - CUPS file */
* Try the lock...
*/
#ifdef WIN32
#ifdef _WIN32
return (_locking(fp->fd, block ? _LK_LOCK : _LK_NBLCK, 0));
#else
return (lockf(fp->fd, block ? F_LOCK : F_TLOCK, 0));
#endif /* WIN32 */
#endif /* _WIN32 */
}
@@ -1078,11 +1113,11 @@ cupsFileOpen(const char *filename, /* I - Name of file */
}
if (fd >= 0)
#ifdef WIN32
#ifdef _WIN32
_chsize(fd, 0);
#else
ftruncate(fd, 0);
#endif /* WIN32 */
#endif /* _WIN32 */
break;
case 's' : /* Read/write socket */
@@ -1249,14 +1284,26 @@ cupsFileOpenFd(int fd, /* I - File descriptor */
* Don't pass this file to child processes...
*/
#ifndef WIN32
#ifndef _WIN32
fcntl(fp->fd, F_SETFD, fcntl(fp->fd, F_GETFD) | FD_CLOEXEC);
#endif /* !WIN32 */
#endif /* !_WIN32 */
return (fp);
}
/*
* '_cupsFilePeekAhead()' - See if the requested character is buffered up.
*/
int /* O - 1 if present, 0 otherwise */
_cupsFilePeekAhead(cups_file_t *fp, /* I - CUPS file */
int ch) /* I - Character */
{
return (fp && fp->ptr && memchr(fp->ptr, ch, (size_t)(fp->end - fp->ptr)));
}
/*
* 'cupsFilePeekChar()' - Peek at the next character from a file.
*
@@ -2013,11 +2060,11 @@ cupsFileUnlock(cups_file_t *fp) /* I - CUPS file */
* Unlock...
*/
#ifdef WIN32
#ifdef _WIN32
return (_locking(fp->fd, _LK_UNLCK, 0));
#else
return (lockf(fp->fd, F_ULOCK, 0));
#endif /* WIN32 */
#endif /* _WIN32 */
}
@@ -2547,9 +2594,9 @@ cups_open(const char *filename, /* I - Filename */
{
int fd; /* File descriptor */
struct stat fileinfo; /* File information */
#ifndef WIN32
#ifndef _WIN32
struct stat linkinfo; /* Link information */
#endif /* !WIN32 */
#endif /* !_WIN32 */
/*
@@ -2577,18 +2624,18 @@ cups_open(const char *filename, /* I - Filename */
return (-1);
}
#ifdef WIN32
#ifdef _WIN32
if (fileinfo.st_mode & _S_IFDIR)
#else
if (S_ISDIR(fileinfo.st_mode))
#endif /* WIN32 */
#endif /* _WIN32 */
{
close(fd);
errno = EISDIR;
return (-1);
}
#ifndef WIN32
#ifndef _WIN32
/*
* Then use lstat to determine whether the filename is a symlink...
*/
@@ -2616,7 +2663,7 @@ cups_open(const char *filename, /* I - Filename */
errno = EPERM;
return (-1);
}
#endif /* !WIN32 */
#endif /* !_WIN32 */
return (fd);
}
@@ -2642,7 +2689,7 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
for (;;)
{
#ifdef WIN32
#ifdef _WIN32
if (fp->mode == 's')
total = (ssize_t)recv(fp->fd, buf, (unsigned)bytes, 0);
else
@@ -2652,7 +2699,7 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
total = recv(fp->fd, buf, bytes, 0);
else
total = read(fp->fd, buf, bytes);
#endif /* WIN32 */
#endif /* _WIN32 */
DEBUG_printf(("9cups_read: total=" CUPS_LLFMT, CUPS_LLCAST total));
@@ -2699,7 +2746,7 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
total = 0;
while (bytes > 0)
{
#ifdef WIN32
#ifdef _WIN32
if (fp->mode == 's')
count = (ssize_t)send(fp->fd, buf, (unsigned)bytes, 0);
else
@@ -2709,7 +2756,7 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
count = send(fp->fd, buf, bytes, 0);
else
count = write(fp->fd, buf, bytes);
#endif /* WIN32 */
#endif /* _WIN32 */
DEBUG_printf(("9cups_write: count=" CUPS_LLFMT, CUPS_LLCAST count));
+16 -28
Ver Arquivo
@@ -6,10 +6,11 @@
* our own file functions allows us to provide transparent support of
* different line endings, gzip'd print files, PPD files, etc.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_FILE_H_
@@ -23,11 +24,11 @@
# include "versioning.h"
# include <stddef.h>
# include <sys/types.h>
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
# define __CUPS_SSIZE_T_DEFINED
/* Windows does not support the ssize_t type, so map it to off_t... */
typedef off_t ssize_t; /* @private@ */
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
# endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
/*
@@ -61,34 +62,22 @@ typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/
extern int cupsFileClose(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileCompression(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileEOF(cups_file_t *fp) _CUPS_API_1_2;
extern const char *cupsFileFind(const char *filename, const char *path,
int executable, char *buffer,
int bufsize) _CUPS_API_1_2;
extern const char *cupsFileFind(const char *filename, const char *path, int executable, char *buffer, int bufsize) _CUPS_API_1_2;
extern int cupsFileFlush(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileGetChar(cups_file_t *fp) _CUPS_API_1_2;
extern char *cupsFileGetConf(cups_file_t *fp, char *buf,
size_t buflen, char **value,
int *linenum) _CUPS_API_1_2;
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf,
size_t buflen) _CUPS_API_1_2;
extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen)
_CUPS_API_1_2;
extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen, char **value, int *linenum) _CUPS_API_1_2;
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
extern int cupsFileLock(cups_file_t *fp, int block) _CUPS_API_1_2;
extern int cupsFileNumber(cups_file_t *fp) _CUPS_API_1_2;
extern cups_file_t *cupsFileOpen(const char *filename, const char *mode)
_CUPS_API_1_2;
extern cups_file_t *cupsFileOpen(const char *filename, const char *mode) _CUPS_API_1_2;
extern cups_file_t *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2;
extern int cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...)
__attribute__((__format__ (__printf__, 2, 3)))
_CUPS_API_1_2;
extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_API_1_2;
extern int cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive,
const char *value) _CUPS_API_1_4;
extern int cupsFilePuts(cups_file_t *fp, const char *s)
_CUPS_API_1_2;
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes)
_CUPS_API_1_2;
extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive, const char *value) _CUPS_API_1_4;
extern int cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2;
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2;
extern off_t cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2;
extern off_t cupsFileSeek(cups_file_t *fp, off_t pos) _CUPS_API_1_2;
extern cups_file_t *cupsFileStderr(void) _CUPS_API_1_2;
@@ -96,8 +85,7 @@ extern cups_file_t *cupsFileStdin(void) _CUPS_API_1_2;
extern cups_file_t *cupsFileStdout(void) _CUPS_API_1_2;
extern off_t cupsFileTell(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileUnlock(cups_file_t *fp) _CUPS_API_1_2;
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf,
size_t bytes) _CUPS_API_1_2;
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes) _CUPS_API_1_2;
# ifdef __cplusplus
+1
Ver Arquivo
@@ -11,6 +11,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include "adminutil.h"
+68 -6
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Get/put file functions for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -12,13 +13,14 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <fcntl.h>
#include <sys/stat.h>
#if defined(WIN32) || defined(__EMX__)
#if defined(_WIN32) || defined(__EMX__)
# include <io.h>
#else
# include <unistd.h>
#endif /* WIN32 || __EMX__ */
#endif /* _WIN32 || __EMX__ */
/*
@@ -39,6 +41,8 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
http_status_t status; /* HTTP status from server */
char if_modified_since[HTTP_MAX_VALUE];
/* If-Modified-Since header */
int new_auth = 0; /* Using new auth information? */
int digest; /* Are we using Digest authentication? */
/*
@@ -79,9 +83,33 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
}
httpClearFields(http);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
httpSetField(http, HTTP_FIELD_IF_MODIFIED_SINCE, if_modified_since);
digest = http->authstring && !strncmp(http->authstring, "Digest ", 7);
if (digest && !new_auth)
{
/*
* Update the Digest authentication string...
*/
_httpSetDigestAuthString(http, http->nextnonce, "GET", resource);
}
#ifdef HAVE_GSSAPI
if (http->authstring && !strncmp(http->authstring, "Negotiate", 9) && !new_auth)
{
/*
* Do not use cached Kerberos credentials since they will look like a
* "replay" attack...
*/
_cupsSetNegotiateAuthString(http, "GET", resource);
}
#endif /* HAVE_GSSAPI */
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
if (httpGet(http, resource))
{
if (httpReconnect2(http, 30000, NULL))
@@ -96,6 +124,8 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
}
}
new_auth = 0;
while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
if (status == HTTP_STATUS_UNAUTHORIZED)
@@ -110,6 +140,8 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
* See if we can do authentication...
*/
new_auth = 1;
if (cupsDoAuthentication(http, "GET", resource))
{
status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
@@ -261,6 +293,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
int retries; /* Number of retries */
char buffer[8192]; /* Buffer for file */
http_status_t status; /* HTTP status from server */
int new_auth = 0; /* Using new auth information? */
int digest; /* Are we using Digest authentication? */
/*
@@ -303,10 +337,34 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
http->authstring));
httpClearFields(http);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "chunked");
httpSetExpect(http, HTTP_STATUS_CONTINUE);
digest = http->authstring && !strncmp(http->authstring, "Digest ", 7);
if (digest && !new_auth)
{
/*
* Update the Digest authentication string...
*/
_httpSetDigestAuthString(http, http->nextnonce, "PUT", resource);
}
#ifdef HAVE_GSSAPI
if (http->authstring && !strncmp(http->authstring, "Negotiate", 9) && !new_auth)
{
/*
* Do not use cached Kerberos credentials since they will look like a
* "replay" attack...
*/
_cupsSetNegotiateAuthString(http, "PUT", resource);
}
#endif /* HAVE_GSSAPI */
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
if (httpPut(http, resource))
{
if (httpReconnect2(http, 30000, NULL))
@@ -377,6 +435,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
DEBUG_printf(("2cupsPutFd: status=%d", status));
new_auth = 0;
if (status == HTTP_STATUS_UNAUTHORIZED)
{
/*
@@ -389,6 +449,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
* See if we can do authentication...
*/
new_auth = 1;
if (cupsDoAuthentication(http, "PUT", resource))
{
status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
+21 -19
Ver Arquivo
@@ -28,23 +28,23 @@ static _cups_threadkey_t cups_globals_key = _CUPS_THREADKEY_INITIALIZER;
static pthread_once_t cups_globals_key_once = PTHREAD_ONCE_INIT;
/* One-time initialization object */
#endif /* HAVE_PTHREAD_H */
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static _cups_mutex_t cups_global_mutex = _CUPS_MUTEX_INITIALIZER;
/* Global critical section */
#endif /* HAVE_PTHREAD_H || WIN32 */
#endif /* HAVE_PTHREAD_H || _WIN32 */
/*
* Local functions...
*/
#ifdef WIN32
#ifdef _WIN32
static void cups_fix_path(char *path);
#endif /* WIN32 */
#endif /* _WIN32 */
static _cups_globals_t *cups_globals_alloc(void);
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static void cups_globals_free(_cups_globals_t *g);
#endif /* HAVE_PTHREAD_H || WIN32 */
#endif /* HAVE_PTHREAD_H || _WIN32 */
#ifdef HAVE_PTHREAD_H
static void cups_globals_init(void);
#endif /* HAVE_PTHREAD_H */
@@ -59,7 +59,7 @@ _cupsGlobalLock(void)
{
#ifdef HAVE_PTHREAD_H
pthread_mutex_lock(&cups_global_mutex);
#elif defined(WIN32)
#elif defined(_WIN32)
EnterCriticalSection(&cups_global_mutex.m_criticalSection);
#endif /* HAVE_PTHREAD_H */
}
@@ -114,13 +114,13 @@ _cupsGlobalUnlock(void)
{
#ifdef HAVE_PTHREAD_H
pthread_mutex_unlock(&cups_global_mutex);
#elif defined(WIN32)
#elif defined(_WIN32)
LeaveCriticalSection(&cups_global_mutex.m_criticalSection);
#endif /* HAVE_PTHREAD_H */
}
#ifdef WIN32
#ifdef _WIN32
/*
* 'DllMain()' - Main entry for library.
*/
@@ -164,7 +164,7 @@ DllMain(HINSTANCE hinst, /* I - DLL module handle */
return (TRUE);
}
#endif /* WIN32 */
#endif /* _WIN32 */
/*
@@ -176,13 +176,13 @@ cups_globals_alloc(void)
{
_cups_globals_t *cg = malloc(sizeof(_cups_globals_t));
/* Pointer to global data */
#ifdef WIN32
#ifdef _WIN32
HKEY key; /* Registry key */
DWORD size; /* Size of string */
static char installdir[1024] = "", /* Install directory */
confdir[1024] = "", /* Server root directory */
localedir[1024] = ""; /* Locale directory */
#endif /* WIN32 */
#endif /* _WIN32 */
if (!cg)
@@ -213,7 +213,7 @@ cups_globals_alloc(void)
* Then set directories as appropriate...
*/
#ifdef WIN32
#ifdef _WIN32
if (!installdir[0])
{
/*
@@ -222,8 +222,7 @@ cups_globals_alloc(void)
strlcpy(installdir, "C:/Program Files/cups.org", sizeof(installdir));
if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\cups.org", 0, KEY_READ,
&key))
if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\cups.org", 0, KEY_READ, &key))
{
/*
* Grab the installation directory...
@@ -232,7 +231,7 @@ cups_globals_alloc(void)
char *ptr; /* Pointer into installdir */
size = sizeof(installdir);
RegQueryValueEx(key, "installdir", NULL, NULL, installdir, &size);
RegQueryValueExA(key, "installdir", NULL, NULL, installdir, &size);
RegCloseKey(key);
for (ptr = installdir; *ptr;)
@@ -309,7 +308,7 @@ cups_globals_alloc(void)
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
cg->localedir = CUPS_LOCALEDIR;
}
#endif /* WIN32 */
#endif /* _WIN32 */
return (cg);
}
@@ -319,7 +318,7 @@ cups_globals_alloc(void)
* 'cups_globals_free()' - Free global data.
*/
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static void
cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
{
@@ -352,9 +351,12 @@ cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings);
if (cg->raster_error.start)
free(cg->raster_error.start);
free(cg);
}
#endif /* HAVE_PTHREAD_H || WIN32 */
#endif /* HAVE_PTHREAD_H || _WIN32 */
#ifdef HAVE_PTHREAD_H
+1 -1
Ver Arquivo
@@ -17,7 +17,7 @@
#elif defined(HAVE_GNUTLS)
# include <gnutls/crypto.h>
#else
# include "md5-private.h"
# include "md5-internal.h"
#endif /* __APPLE__ */
+5 -4
Ver Arquivo
@@ -12,6 +12,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <sys/stat.h>
#ifdef HAVE_RESOLV_H
# include <resolv.h>
@@ -63,11 +64,11 @@ int /* O - 0 on success, -1 on failure */
httpAddrClose(http_addr_t *addr, /* I - Listen address or @code NULL@ */
int fd) /* I - Socket file descriptor */
{
#ifdef WIN32
#ifdef _WIN32
if (closesocket(fd))
#else
if (close(fd))
#endif /* WIN32 */
#endif /* _WIN32 */
return (-1);
#ifdef AF_LOCAL
@@ -252,9 +253,9 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
* Close on exec...
*/
#ifndef WIN32
#ifndef _WIN32
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
#endif /* !WIN32 */
#endif /* !_WIN32 */
#ifdef SO_NOSIGPIPE
/*
+29 -20
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* HTTP address list routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -12,15 +13,16 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#ifdef HAVE_RESOLV_H
# include <resolv.h>
#endif /* HAVE_RESOLV_H */
#ifdef HAVE_POLL
# include <poll.h>
#endif /* HAVE_POLL */
#ifndef WIN32
#ifndef _WIN32
# include <fcntl.h>
#endif /* WIN32 */
#endif /* _WIN32 */
/*
@@ -55,14 +57,14 @@ httpAddrConnect2(
int *cancel) /* I - Pointer to "cancel" variable */
{
int val; /* Socket option value */
#ifndef WIN32
int flags; /* Socket flags */
#endif /* !WIN32 */
int remaining; /* Remaining timeout */
#ifndef _WIN32
int i, j, /* Looping vars */
nfds, /* Number of file descriptors */
fds[100], /* Socket file descriptors */
flags, /* Socket flags */
result; /* Result from select() or poll() */
#endif /* !_WIN32 */
int remaining; /* Remaining timeout */
int nfds, /* Number of file descriptors */
fds[100]; /* Socket file descriptors */
http_addrlist_t *addrs[100]; /* Addresses */
#ifndef HAVE_POLL
int max_fd = -1; /* Highest file descriptor */
@@ -78,8 +80,10 @@ httpAddrConnect2(
# endif /* HAVE_POLL */
#endif /* O_NONBLOCK */
#ifdef DEBUG
# ifndef _WIN32
socklen_t len; /* Length of value */
http_addr_t peer; /* Peer address */
# endif /* !_WIN32 */
char temp[256]; /* Temporary address string */
#endif /* DEBUG */
@@ -207,11 +211,11 @@ httpAddrConnect2(
return (addrlist);
}
#ifdef WIN32
#ifdef _WIN32
if (WSAGetLastError() != WSAEINPROGRESS && WSAGetLastError() != WSAEWOULDBLOCK)
#else
if (errno != EINPROGRESS && errno != EWOULDBLOCK)
#endif /* WIN32 */
#endif /* _WIN32 */
{
DEBUG_printf(("1httpAddrConnect2: Unable to connect to %s:%d: %s", httpAddrString(&(addrlist->addr), temp, sizeof(temp)), httpAddrPort(&(addrlist->addr)), strerror(errno)));
httpAddrClose(NULL, fds[nfds]);
@@ -219,9 +223,9 @@ httpAddrConnect2(
continue;
}
#ifndef WIN32
#ifndef _WIN32
fcntl(fds[nfds], F_SETFL, flags);
#endif /* !WIN32 */
#endif /* !_WIN32 */
#ifndef HAVE_POLL
if (fds[nfds] > max_fd)
@@ -290,11 +294,11 @@ httpAddrConnect2(
DEBUG_printf(("1httpAddrConnect2: select() returned %d (%d)", result, errno));
# endif /* HAVE_POLL */
}
# ifdef WIN32
# ifdef _WIN32
while (result < 0 && (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEWOULDBLOCK));
# else
while (result < 0 && (errno == EINTR || errno == EAGAIN));
# endif /* WIN32 */
# endif /* _WIN32 */
if (result > 0)
{
@@ -371,11 +375,11 @@ httpAddrConnect2(
httpAddrClose(NULL, fds[nfds]);
}
#ifdef WIN32
#ifdef _WIN32
_cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, "Connection failed", 0);
#else
_cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, strerror(errno), 0);
#endif /* WIN32 */
#endif /* _WIN32 */
return (NULL);
}
@@ -612,6 +616,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
if (!temp)
{
httpAddrFreeList(first);
freeaddrinfo(results);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
return (NULL);
}
@@ -647,7 +652,11 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
if (error == EAI_FAIL)
cg->need_res_init = 1;
# ifdef _WIN32 /* Really, Microsoft?!? */
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerrorA(error), 0);
# else
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerror(error), 0);
# endif /* _WIN32 */
}
#else
@@ -842,11 +851,11 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
temp->addr.ipv6.sin6_family = AF_INET6;
temp->addr.ipv6.sin6_port = htons(portnum);
# ifdef WIN32
# ifdef _WIN32
temp->addr.ipv6.sin6_addr.u.Byte[15] = 1;
# else
temp->addr.ipv6.sin6_addr.s6_addr32[3] = htonl(1);
# endif /* WIN32 */
# endif /* _WIN32 */
if (!first)
first = temp;
+38 -79
Ver Arquivo
@@ -25,7 +25,8 @@
# endif /* __sun */
# include <limits.h>
# ifdef WIN32
# ifdef _WIN32
# define _WINSOCK_DEPRECATED_NO_WARNINGS 1
# include <io.h>
# include <winsock2.h>
# define CUPS_SOCAST (const char *)
@@ -34,7 +35,7 @@
# include <fcntl.h>
# include <sys/socket.h>
# define CUPS_SOCAST
# endif /* WIN32 */
# endif /* _WIN32 */
# ifdef HAVE_GSSAPI
# ifdef HAVE_GSS_GSSAPI_H
@@ -72,60 +73,13 @@ typedef int socklen_t;
# include <CoreFoundation/CoreFoundation.h>
# include <Security/Security.h>
# include <Security/SecureTransport.h>
# ifdef HAVE_SECURETRANSPORTPRIV_H
# include <Security/SecureTransportPriv.h>
# endif /* HAVE_SECURETRANSPORTPRIV_H */
# ifdef HAVE_SECITEM_H
# include <Security/SecItem.h>
# endif /* HAVE_SECITEM_H */
# ifdef HAVE_SECBASEPRIV_H
# include <Security/SecBasePriv.h>
# endif /* HAVE_SECBASEPRIV_H */
# ifdef HAVE_SECCERTIFICATE_H
# include <Security/SecCertificate.h>
# include <Security/SecIdentity.h>
# endif /* HAVE_SECCERTIFICATE_H */
# ifdef HAVE_SECCERTIFICATEPRIV_H
# include <Security/SecCertificatePriv.h>
# else
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
# ifndef _SECURITY_VERSION_GREATER_THAN_57610_
typedef CF_OPTIONS(uint32_t, SecKeyUsage) {
kSecKeyUsageAll = 0x7FFFFFFF
};
# endif /* !_SECURITY_VERSION_GREATER_THAN_57610_ */
extern const void * kSecCSRChallengePassword;
extern const void * kSecSubjectAltName;
extern const void * kSecCertificateKeyUsage;
extern const void * kSecCSRBasicContraintsPathLen;
extern const void * kSecCertificateExtensions;
extern const void * kSecCertificateExtensionsEncoded;
extern const void * kSecOidCommonName;
extern const void * kSecOidCountryName;
extern const void * kSecOidStateProvinceName;
extern const void * kSecOidLocalityName;
extern const void * kSecOidOrganization;
extern const void * kSecOidOrganizationalUnit;
extern SecCertificateRef SecCertificateCreateWithBytes(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
extern bool SecCertificateIsValid(SecCertificateRef certificate, CFAbsoluteTime verifyTime);
extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate);
extern SecCertificateRef SecGenerateSelfSignedCertificate(CFArrayRef subject, CFDictionaryRef parameters, SecKeyRef publicKey, SecKeyRef privateKey);
extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificateRef certificate, SecKeyRef privateKey);
# ifdef __cplusplus
}
# endif /* __cplusplus */
# endif /* HAVE_SECCERTIFICATEPRIV_H */
# ifdef HAVE_SECITEMPRIV_H
# include <Security/SecItemPriv.h>
# endif /* HAVE_SECITEMPRIV_H */
# ifdef HAVE_SECIDENTITYSEARCHPRIV_H
# include <Security/SecIdentitySearchPriv.h>
# endif /* HAVE_SECIDENTITYSEARCHPRIV_H */
# ifdef HAVE_SECPOLICYPRIV_H
# include <Security/SecPolicyPriv.h>
# endif /* HAVE_SECPOLICYPRIV_H */
# elif defined(HAVE_SSPISSL)
# include <wincrypt.h>
# include <wintrust.h>
@@ -135,7 +89,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate
# include <sspi.h>
# endif /* HAVE_GNUTLS */
# ifndef WIN32
# ifndef _WIN32
# include <net/if.h>
# include <resolv.h>
# ifdef HAVE_GETIFADDRS
@@ -146,11 +100,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate
# include <sys/sockio.h>
# endif /* HAVE_SYS_SOCKIO_H */
# endif /* HAVE_GETIFADDRS */
# endif /* !WIN32 */
# ifdef HAVE_LIBZ
# include <zlib.h>
# endif /* HAVE_LIBZ */
# endif /* !_WIN32 */
/*
@@ -349,10 +299,19 @@ struct _http_s /**** HTTP connection structure ****/
_http_mode_t mode; /* _HTTP_MODE_CLIENT or _HTTP_MODE_SERVER */
# ifdef HAVE_LIBZ
_http_coding_t coding; /* _HTTP_CODING_xxx */
z_stream stream; /* (De)compression stream */
Bytef *sbuffer; /* (De)compression buffer */
void *stream; /* (De)compression stream */
unsigned char *sbuffer; /* (De)compression buffer */
# endif /* HAVE_LIBZ */
/**** New in CUPS 2.2.9 ****/
char algorithm[65], /* Algorithm from WWW-Authenticate */
nextnonce[HTTP_MAX_VALUE],
/* Next nonce value from Authentication-Info */
opaque[HTTP_MAX_VALUE],
/* Opaque value from WWW-Authenticate */
realm[HTTP_MAX_VALUE];
/* Realm from WWW-Authenticate */
/**** New in CUPS 2.3 ****/
char *fields[HTTP_FIELD_MAX],
/* Allocated field values */
@@ -376,7 +335,7 @@ extern const char *_cups_hstrerror(int error);
* Some OS's don't have getifaddrs() and freeifaddrs()...
*/
# if !defined(WIN32) && !defined(HAVE_GETIFADDRS)
# if !defined(_WIN32) && !defined(HAVE_GETIFADDRS)
# ifdef ifa_dstaddr
# undef ifa_dstaddr
# endif /* ifa_dstaddr */
@@ -407,41 +366,41 @@ struct ifaddrs /**** Interface Structure ****/
# define ifa_dstaddr ifa_ifu.ifu_dstaddr
# endif /* !ifa_dstaddr */
extern int _cups_getifaddrs(struct ifaddrs **addrs);
extern int _cups_getifaddrs(struct ifaddrs **addrs) _CUPS_PRIVATE;
# define getifaddrs _cups_getifaddrs
extern void _cups_freeifaddrs(struct ifaddrs *addrs);
extern void _cups_freeifaddrs(struct ifaddrs *addrs) _CUPS_PRIVATE;
# define freeifaddrs _cups_freeifaddrs
# endif /* !WIN32 && !HAVE_GETIFADDRS */
# endif /* !_WIN32 && !HAVE_GETIFADDRS */
/*
* Prototypes...
*/
extern void _httpAddrSetPort(http_addr_t *addr, int port);
extern void _httpAddrSetPort(http_addr_t *addr, int port) _CUPS_PRIVATE;
extern http_tls_credentials_t
_httpCreateCredentials(cups_array_t *credentials);
_httpCreateCredentials(cups_array_t *credentials) _CUPS_PRIVATE;
extern char *_httpDecodeURI(char *dst, const char *src,
size_t dstsize);
extern void _httpDisconnect(http_t *http);
size_t dstsize) _CUPS_PRIVATE;
extern void _httpDisconnect(http_t *http) _CUPS_PRIVATE;
extern char *_httpEncodeURI(char *dst, const char *src,
size_t dstsize);
extern void _httpFreeCredentials(http_tls_credentials_t credentials);
size_t dstsize) _CUPS_PRIVATE;
extern void _httpFreeCredentials(http_tls_credentials_t credentials) _CUPS_PRIVATE;
extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
size_t resolved_size, int options,
int (*cb)(void *context),
void *context);
extern const char *_httpStatus(cups_lang_t *lang, http_status_t status);
extern void _httpTLSInitialize(void);
extern size_t _httpTLSPending(http_t *http);
extern int _httpTLSRead(http_t *http, char *buf, int len);
extern int _httpTLSSetCredentials(http_t *http);
extern void _httpTLSSetOptions(int options, int min_version, int max_version);
extern int _httpTLSStart(http_t *http);
extern void _httpTLSStop(http_t *http);
extern int _httpTLSWrite(http_t *http, const char *buf, int len);
extern int _httpUpdate(http_t *http, http_status_t *status);
extern int _httpWait(http_t *http, int msec, int usessl);
void *context) _CUPS_PRIVATE;
extern int _httpSetDigestAuthString(http_t *http, const char *nonce, const char *method, const char *resource) _CUPS_PRIVATE;
extern const char *_httpStatus(cups_lang_t *lang, http_status_t status) _CUPS_PRIVATE;
extern void _httpTLSInitialize(void) _CUPS_PRIVATE;
extern size_t _httpTLSPending(http_t *http) _CUPS_PRIVATE;
extern int _httpTLSRead(http_t *http, char *buf, int len) _CUPS_PRIVATE;
extern void _httpTLSSetOptions(int options, int min_version, int max_version) _CUPS_PRIVATE;
extern int _httpTLSStart(http_t *http) _CUPS_PRIVATE;
extern void _httpTLSStop(http_t *http) _CUPS_PRIVATE;
extern int _httpTLSWrite(http_t *http, const char *buf, int len) _CUPS_PRIVATE;
extern int _httpUpdate(http_t *http, http_status_t *status) _CUPS_PRIVATE;
extern int _httpWait(http_t *http, int msec, int usessl) _CUPS_PRIVATE;
/*
+155 -10
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* HTTP support routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -12,15 +13,16 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#ifdef HAVE_DNSSD
# include <dns_sd.h>
# ifdef WIN32
# ifdef _WIN32
# include <io.h>
# elif defined(HAVE_POLL)
# include <poll.h>
# else
# include <sys/select.h>
# endif /* WIN32 */
# endif /* _WIN32 */
#elif defined(HAVE_AVAHI)
# include <avahi-client/client.h>
# include <avahi-client/lookup.h>
@@ -1026,7 +1028,7 @@ httpSeparateURI(
*ptr = '\0';
if (*uri != ':')
if (*uri != ':' || *scheme == '.' || !*scheme)
{
*scheme = '\0';
return (HTTP_URI_STATUS_BAD_SCHEME);
@@ -1296,6 +1298,152 @@ httpSeparateURI(
}
/*
* '_httpSetDigestAuthString()' - Calculate a Digest authentication response
* using the appropriate RFC 2068/2617/7616
* algorithm.
*/
int /* O - 1 on success, 0 on failure */
_httpSetDigestAuthString(
http_t *http, /* I - HTTP connection */
const char *nonce, /* I - Nonce value */
const char *method, /* I - HTTP method */
const char *resource) /* I - HTTP resource path */
{
char kd[65], /* Final MD5/SHA-256 digest */
ha1[65], /* Hash of username:realm:password */
ha2[65], /* Hash of method:request-uri */
username[HTTP_MAX_VALUE],
/* username:password */
*password, /* Pointer to password */
temp[1024], /* Temporary string */
digest[1024]; /* Digest auth data */
unsigned char hash[32]; /* Hash buffer */
size_t hashsize; /* Size of hash */
DEBUG_printf(("2_httpSetDigestAuthString(http=%p, nonce=\"%s\", method=\"%s\", resource=\"%s\")", (void *)http, nonce, method, resource));
if (nonce && *nonce && strcmp(nonce, http->nonce))
{
strlcpy(http->nonce, nonce, sizeof(http->nonce));
if (nonce == http->nextnonce)
http->nextnonce[0] = '\0';
http->nonce_count = 1;
}
else
http->nonce_count ++;
strlcpy(username, http->userpass, sizeof(username));
if ((password = strchr(username, ':')) != NULL)
*password++ = '\0';
else
return (0);
if (http->algorithm[0])
{
/*
* Follow RFC 2617/7616...
*/
int i; /* Looping var */
char cnonce[65]; /* cnonce value */
const char *hashalg; /* Hashing algorithm */
for (i = 0; i < 64; i ++)
cnonce[i] = "0123456789ABCDEF"[CUPS_RAND() & 15];
cnonce[64] = '\0';
if (!_cups_strcasecmp(http->algorithm, "MD5"))
{
/*
* RFC 2617 Digest with MD5
*/
hashalg = "md5";
}
else if (!_cups_strcasecmp(http->algorithm, "SHA-256"))
{
/*
* RFC 7616 Digest with SHA-256
*/
hashalg = "sha2-256";
}
else
{
/*
* Some other algorithm we don't support, skip this one...
*/
return (0);
}
/*
* Calculate digest value...
*/
/* H(A1) = H(username:realm:password) */
snprintf(temp, sizeof(temp), "%s:%s:%s", username, http->realm, password);
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha1, sizeof(ha1));
/* H(A2) = H(method:uri) */
snprintf(temp, sizeof(temp), "%s:%s", method, resource);
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha2, sizeof(ha2));
/* KD = H(H(A1):nonce:nc:cnonce:qop:H(A2)) */
snprintf(temp, sizeof(temp), "%s:%s:%08x:%s:%s:%s", ha1, http->nonce, http->nonce_count, cnonce, "auth", ha2);
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, kd, sizeof(kd));
/*
* Pass the RFC 2617/7616 WWW-Authenticate header...
*/
if (http->opaque[0])
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", algorithm=%s, qop=auth, opaque=\"%s\", cnonce=\"%s\", nc=%08x, uri=\"%s\", response=\"%s\"", cupsUser(), http->realm, http->nonce, http->algorithm, http->opaque, cnonce, http->nonce_count, resource, kd);
else
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", algorithm=%s, qop=auth, cnonce=\"%s\", nc=%08x, uri=\"%s\", response=\"%s\"", username, http->realm, http->nonce, http->algorithm, cnonce, http->nonce_count, resource, kd);
}
else
{
/*
* Use old RFC 2069 Digest method...
*/
/* H(A1) = H(username:realm:password) */
snprintf(temp, sizeof(temp), "%s:%s:%s", username, http->realm, password);
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha1, sizeof(ha1));
/* H(A2) = H(method:uri) */
snprintf(temp, sizeof(temp), "%s:%s", method, resource);
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, ha2, sizeof(ha2));
/* KD = H(H(A1):nonce:H(A2)) */
snprintf(temp, sizeof(temp), "%s:%s:%s", ha1, http->nonce, ha2);
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
cupsHashString(hash, hashsize, kd, sizeof(kd));
/*
* Pass the old RFC 2069 WWW-Authenticate header...
*/
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"", username, http->realm, http->nonce, resource, kd);
}
httpSetAuthString(http, "Digest", digest);
return (1);
}
/*
* 'httpStateString()' - Return the string describing a HTTP state value.
*
@@ -1616,9 +1764,6 @@ _httpResolveURI(
_http_uribuf_t uribuf; /* URI buffer */
int offline = 0; /* offline-report state set? */
# ifdef HAVE_DNSSD
# ifdef WIN32
# pragma comment(lib, "dnssd.lib")
# endif /* WIN32 */
DNSServiceRef ref, /* DNS-SD master service reference */
domainref = NULL,/* DNS-SD service reference for domain */
ippref = NULL, /* DNS-SD service reference for network IPP */
@@ -1747,11 +1892,11 @@ _httpResolveURI(
FD_ZERO(&input_set);
FD_SET(DNSServiceRefSockFD(ref), &input_set);
# ifdef WIN32
# ifdef _WIN32
stimeout.tv_sec = (long)timeout;
# else
stimeout.tv_sec = timeout;
# endif /* WIN32 */
# endif /* _WIN32 */
stimeout.tv_usec = 0;
fds = select(DNSServiceRefSockFD(ref)+1, &input_set, NULL, NULL,
+134 -96
Ver Arquivo
@@ -16,18 +16,22 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <fcntl.h>
#include <math.h>
#ifdef WIN32
#ifdef _WIN32
# include <tchar.h>
#else
# include <signal.h>
# include <sys/time.h>
# include <sys/resource.h>
#endif /* WIN32 */
#endif /* _WIN32 */
#ifdef HAVE_POLL
# include <poll.h>
#endif /* HAVE_POLL */
# ifdef HAVE_LIBZ
# include <zlib.h>
# endif /* HAVE_LIBZ */
/*
@@ -101,7 +105,8 @@ static const char * const http_fields[] =
"WWW-Authenticate",
"Accept-Encoding",
"Allow",
"Server"
"Server",
"Authentication-Info"
};
@@ -1144,11 +1149,11 @@ httpGets(char *line, /* I - Line to read into */
* Pre-load the buffer as needed...
*/
#ifdef WIN32
#ifdef _WIN32
WSASetLastError(0);
#else
errno = 0;
#endif /* WIN32 */
#endif /* _WIN32 */
while (http->used == 0)
{
@@ -1162,11 +1167,11 @@ httpGets(char *line, /* I - Line to read into */
continue;
DEBUG_puts("3httpGets: Timed out!");
#ifdef WIN32
#ifdef _WIN32
http->error = WSAETIMEDOUT;
#else
http->error = ETIMEDOUT;
#endif /* WIN32 */
#endif /* _WIN32 */
return (NULL);
}
@@ -1180,7 +1185,7 @@ httpGets(char *line, /* I - Line to read into */
* Nope, can't get a line this time...
*/
#ifdef WIN32
#ifdef _WIN32
DEBUG_printf(("3httpGets: recv() error %d!", WSAGetLastError()));
if (WSAGetLastError() == WSAEINTR)
@@ -1217,7 +1222,7 @@ httpGets(char *line, /* I - Line to read into */
http->error = errno;
continue;
}
#endif /* WIN32 */
#endif /* _WIN32 */
return (NULL);
}
@@ -1484,9 +1489,9 @@ void
httpInitialize(void)
{
static int initialized = 0; /* Have we been called before? */
#ifdef WIN32
#ifdef _WIN32
WSADATA winsockdata; /* WinSock data */
#endif /* WIN32 */
#endif /* _WIN32 */
_cupsGlobalLock();
@@ -1496,7 +1501,7 @@ httpInitialize(void)
return;
}
#ifdef WIN32
#ifdef _WIN32
WSAStartup(MAKEWORD(2,2), &winsockdata);
#elif !defined(SO_NOSIGPIPE)
@@ -1518,7 +1523,7 @@ httpInitialize(void)
# else
signal(SIGPIPE, SIG_IGN);
# endif /* !SO_NOSIGPIPE */
#endif /* WIN32 */
#endif /* _WIN32 */
# ifdef HAVE_SSL
_httpTLSInitialize();
@@ -1674,7 +1679,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
#ifdef HAVE_LIBZ
if (http->used == 0 &&
(http->coding == _HTTP_CODING_IDENTITY ||
(http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0)))
(http->coding >= _HTTP_CODING_GUNZIP && ((z_stream *)http->stream)->avail_in == 0)))
#else
if (http->used == 0)
#endif /* HAVE_LIBZ */
@@ -1723,16 +1728,16 @@ httpPeek(http_t *http, /* I - HTTP connection */
int zerr; /* Decompressor error */
z_stream stream; /* Copy of decompressor stream */
if (http->used > 0 && http->stream.avail_in < HTTP_MAX_BUFFER)
if (http->used > 0 && ((z_stream *)http->stream)->avail_in < HTTP_MAX_BUFFER)
{
size_t buflen = buflen = HTTP_MAX_BUFFER - http->stream.avail_in;
size_t buflen = buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
/* Number of bytes to copy */
if (http->stream.avail_in > 0 &&
http->stream.next_in > http->sbuffer)
memmove(http->sbuffer, http->stream.next_in, http->stream.avail_in);
if (((z_stream *)http->stream)->avail_in > 0 &&
((z_stream *)http->stream)->next_in > http->sbuffer)
memmove(http->sbuffer, ((z_stream *)http->stream)->next_in, ((z_stream *)http->stream)->avail_in);
http->stream.next_in = http->sbuffer;
((z_stream *)http->stream)->next_in = http->sbuffer;
if (buflen > (size_t)http->data_remaining)
buflen = (size_t)http->data_remaining;
@@ -1743,8 +1748,8 @@ httpPeek(http_t *http, /* I - HTTP connection */
DEBUG_printf(("1httpPeek: Copying %d more bytes of data into "
"decompression buffer.", (int)buflen));
memcpy(http->sbuffer + http->stream.avail_in, http->buffer, buflen);
http->stream.avail_in += buflen;
memcpy(http->sbuffer + ((z_stream *)http->stream)->avail_in, http->buffer, buflen);
((z_stream *)http->stream)->avail_in += buflen;
http->used -= (int)buflen;
http->data_remaining -= (off_t)buflen;
@@ -1753,9 +1758,9 @@ httpPeek(http_t *http, /* I - HTTP connection */
}
DEBUG_printf(("2httpPeek: length=%d, avail_in=%d", (int)length,
(int)http->stream.avail_in));
(int)((z_stream *)http->stream)->avail_in));
if (inflateCopy(&stream, &(http->stream)) != Z_OK)
if (inflateCopy(&stream, (z_stream *)http->stream) != Z_OK)
{
DEBUG_puts("2httpPeek: Unable to copy decompressor stream.");
http->error = ENOMEM;
@@ -1772,14 +1777,14 @@ httpPeek(http_t *http, /* I - HTTP connection */
{
DEBUG_printf(("2httpPeek: zerr=%d", zerr));
#ifdef DEBUG
http_debug_hex("2httpPeek", (char *)http->sbuffer, (int)http->stream.avail_in);
http_debug_hex("2httpPeek", (char *)http->sbuffer, (int)((z_stream *)http->stream)->avail_in);
#endif /* DEBUG */
http->error = EIO;
return (-1);
}
bytes = (ssize_t)(length - http->stream.avail_out);
bytes = (ssize_t)(length - ((z_stream *)http->stream)->avail_out);
# else
DEBUG_puts("2httpPeek: No inflateCopy on this platform, httpPeek does not "
@@ -1806,7 +1811,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
if (bytes < 0)
{
#ifdef WIN32
#ifdef _WIN32
if (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEWOULDBLOCK)
bytes = 0;
else
@@ -1816,7 +1821,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
bytes = 0;
else
http->error = errno;
#endif /* WIN32 */
#endif /* _WIN32 */
}
else if (bytes == 0)
{
@@ -1946,31 +1951,31 @@ httpRead2(http_t *http, /* I - HTTP connection */
{
do
{
if (http->stream.avail_in > 0)
if (((z_stream *)http->stream)->avail_in > 0)
{
int zerr; /* Decompressor error */
DEBUG_printf(("2httpRead2: avail_in=%d, avail_out=%d",
(int)http->stream.avail_in, (int)length));
(int)((z_stream *)http->stream)->avail_in, (int)length));
http->stream.next_out = (Bytef *)buffer;
http->stream.avail_out = (uInt)length;
((z_stream *)http->stream)->next_out = (Bytef *)buffer;
((z_stream *)http->stream)->avail_out = (uInt)length;
if ((zerr = inflate(&(http->stream), Z_SYNC_FLUSH)) < Z_OK)
if ((zerr = inflate((z_stream *)http->stream, Z_SYNC_FLUSH)) < Z_OK)
{
DEBUG_printf(("2httpRead2: zerr=%d", zerr));
#ifdef DEBUG
http_debug_hex("2httpRead2", (char *)http->sbuffer, (int)http->stream.avail_in);
http_debug_hex("2httpRead2", (char *)http->sbuffer, (int)((z_stream *)http->stream)->avail_in);
#endif /* DEBUG */
http->error = EIO;
return (-1);
}
bytes = (ssize_t)(length - http->stream.avail_out);
bytes = (ssize_t)(length - ((z_stream *)http->stream)->avail_out);
DEBUG_printf(("2httpRead2: avail_in=%d, avail_out=%d, bytes=%d",
http->stream.avail_in, http->stream.avail_out,
((z_stream *)http->stream)->avail_in, ((z_stream *)http->stream)->avail_out,
(int)bytes));
}
else
@@ -1978,16 +1983,16 @@ httpRead2(http_t *http, /* I - HTTP connection */
if (bytes == 0)
{
ssize_t buflen = HTTP_MAX_BUFFER - (ssize_t)http->stream.avail_in;
ssize_t buflen = HTTP_MAX_BUFFER - (ssize_t)((z_stream *)http->stream)->avail_in;
/* Additional bytes for buffer */
if (buflen > 0)
{
if (http->stream.avail_in > 0 &&
http->stream.next_in > http->sbuffer)
memmove(http->sbuffer, http->stream.next_in, http->stream.avail_in);
if (((z_stream *)http->stream)->avail_in > 0 &&
((z_stream *)http->stream)->next_in > http->sbuffer)
memmove(http->sbuffer, ((z_stream *)http->stream)->next_in, ((z_stream *)http->stream)->avail_in);
http->stream.next_in = http->sbuffer;
((z_stream *)http->stream)->next_in = http->sbuffer;
DEBUG_printf(("1httpRead2: Reading up to %d more bytes of data into "
"decompression buffer.", (int)buflen));
@@ -1997,10 +2002,10 @@ httpRead2(http_t *http, /* I - HTTP connection */
if (buflen > http->data_remaining)
buflen = (ssize_t)http->data_remaining;
bytes = http_read_buffered(http, (char *)http->sbuffer + http->stream.avail_in, (size_t)buflen);
bytes = http_read_buffered(http, (char *)http->sbuffer + ((z_stream *)http->stream)->avail_in, (size_t)buflen);
}
else if (http->data_encoding == HTTP_ENCODING_CHUNKED)
bytes = http_read_chunk(http, (char *)http->sbuffer + http->stream.avail_in, (size_t)buflen);
bytes = http_read_chunk(http, (char *)http->sbuffer + ((z_stream *)http->stream)->avail_in, (size_t)buflen);
else
bytes = 0;
@@ -2013,7 +2018,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
"decompression buffer.", CUPS_LLCAST bytes));
http->data_remaining -= bytes;
http->stream.avail_in += (uInt)bytes;
((z_stream *)http->stream)->avail_in += (uInt)bytes;
if (http->data_remaining <= 0 &&
http->data_encoding == HTTP_ENCODING_CHUNKED)
@@ -2092,7 +2097,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
if (
#ifdef HAVE_LIBZ
(http->coding == _HTTP_CODING_IDENTITY ||
(http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0)) &&
(http->coding >= _HTTP_CODING_GUNZIP && ((z_stream *)http->stream)->avail_in == 0)) &&
#endif /* HAVE_LIBZ */
((http->data_remaining <= 0 &&
http->data_encoding == HTTP_ENCODING_LENGTH) ||
@@ -2377,11 +2382,11 @@ httpReconnect2(http_t *http, /* I - HTTP connection */
* Unable to connect...
*/
#ifdef WIN32
#ifdef _WIN32
http->error = WSAGetLastError();
#else
http->error = errno;
#endif /* WIN32 */
#endif /* _WIN32 */
http->status = HTTP_STATUS_ERROR;
DEBUG_printf(("1httpReconnect2: httpAddrConnect failed: %s",
@@ -2694,11 +2699,11 @@ httpShutdown(http_t *http) /* I - HTTP connection */
_httpTLSStop(http);
#endif /* HAVE_SSL */
#ifdef WIN32
#ifdef _WIN32
shutdown(http->fd, SD_RECEIVE); /* Microsoft-ism... */
#else
shutdown(http->fd, SHUT_RD);
#endif /* WIN32 */
#endif /* _WIN32 */
}
@@ -2874,7 +2879,12 @@ _httpUpdate(http_t *http, /* I - HTTP connection */
httpSetCookie(http, value);
}
else if ((field = httpFieldValue(line)) != HTTP_FIELD_UNKNOWN)
{
http_add_field(http, field, value, 1);
if (field == HTTP_FIELD_AUTHENTICATION_INFO)
httpGetSubField2(http, HTTP_FIELD_AUTHENTICATION_INFO, "nextnonce", http->nextnonce, (int)sizeof(http->nextnonce));
}
#ifdef DEBUG
else
DEBUG_printf(("1_httpUpdate: unknown field %s seen!", line));
@@ -3027,12 +3037,12 @@ _httpWait(http_t *http, /* I - HTTP connection */
DEBUG_printf(("6_httpWait: select() returned %d...", nfds));
}
# ifdef WIN32
# ifdef _WIN32
while (nfds < 0 && (WSAGetLastError() == WSAEINTR ||
WSAGetLastError() == WSAEWOULDBLOCK));
# else
while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
# endif /* WIN32 */
# endif /* _WIN32 */
#endif /* HAVE_POLL */
DEBUG_printf(("5_httpWait: returning with nfds=%d, errno=%d...", nfds,
@@ -3068,7 +3078,7 @@ httpWait(http_t *http, /* I - HTTP connection */
}
#ifdef HAVE_LIBZ
if (http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in > 0)
if (http->coding >= _HTTP_CODING_GUNZIP && ((z_stream *)http->stream)->avail_in > 0)
{
DEBUG_puts("3httpWait: Returning 1 since there is buffered data ready.");
return (1);
@@ -3164,17 +3174,17 @@ httpWrite2(http_t *http, /* I - HTTP connection */
size_t slen; /* Bytes to write */
ssize_t sret; /* Bytes written */
http->stream.next_in = (Bytef *)buffer;
http->stream.avail_in = (uInt)length;
((z_stream *)http->stream)->next_in = (Bytef *)buffer;
((z_stream *)http->stream)->avail_in = (uInt)length;
while (deflate(&(http->stream), Z_NO_FLUSH) == Z_OK)
while (deflate((z_stream *)http->stream, Z_NO_FLUSH) == Z_OK)
{
DEBUG_printf(("1httpWrite2: avail_out=%d", http->stream.avail_out));
DEBUG_printf(("1httpWrite2: avail_out=%d", ((z_stream *)http->stream)->avail_out));
if (http->stream.avail_out > 0)
if (((z_stream *)http->stream)->avail_out > 0)
continue;
slen = _HTTP_MAX_SBUFFER - http->stream.avail_out;
slen = _HTTP_MAX_SBUFFER - ((z_stream *)http->stream)->avail_out;
DEBUG_printf(("1httpWrite2: Writing intermediate chunk, len=%d", (int)slen));
@@ -3191,8 +3201,8 @@ httpWrite2(http_t *http, /* I - HTTP connection */
return (-1);
}
http->stream.next_out = (Bytef *)http->sbuffer;
http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
((z_stream *)http->stream)->next_out = (Bytef *)http->sbuffer;
((z_stream *)http->stream)->avail_out = (uInt)_HTTP_MAX_SBUFFER;
}
bytes = (ssize_t)length;
@@ -3681,13 +3691,13 @@ http_content_coding_finish(
{
case _HTTP_CODING_DEFLATE :
case _HTTP_CODING_GZIP :
http->stream.next_in = dummy;
http->stream.avail_in = 0;
((z_stream *)http->stream)->next_in = dummy;
((z_stream *)http->stream)->avail_in = 0;
do
{
zerr = deflate(&(http->stream), Z_FINISH);
bytes = _HTTP_MAX_SBUFFER - http->stream.avail_out;
zerr = deflate((z_stream *)http->stream, Z_FINISH);
bytes = _HTTP_MAX_SBUFFER - ((z_stream *)http->stream)->avail_out;
if (bytes > 0)
{
@@ -3699,15 +3709,18 @@ http_content_coding_finish(
http_write(http, (char *)http->sbuffer, bytes);
}
http->stream.next_out = (Bytef *)http->sbuffer;
http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
((z_stream *)http->stream)->next_out = (Bytef *)http->sbuffer;
((z_stream *)http->stream)->avail_out = (uInt)_HTTP_MAX_SBUFFER;
}
while (zerr == Z_OK);
deflateEnd(&(http->stream));
deflateEnd((z_stream *)http->stream);
free(http->sbuffer);
free(http->stream);
http->sbuffer = NULL;
http->stream = NULL;
if (http->wused)
httpFlushWrite(http);
@@ -3715,9 +3728,13 @@ http_content_coding_finish(
case _HTTP_CODING_INFLATE :
case _HTTP_CODING_GUNZIP :
inflateEnd(&(http->stream));
inflateEnd((z_stream *)http->stream);
free(http->sbuffer);
free(http->stream);
http->sbuffer = NULL;
http->stream = NULL;
break;
default :
@@ -3787,8 +3804,6 @@ http_content_coding_start(
return;
}
memset(&(http->stream), 0, sizeof(http->stream));
switch (coding)
{
case _HTTP_CODING_DEFLATE :
@@ -3809,18 +3824,30 @@ http_content_coding_start(
* documentation.
*/
if ((zerr = deflateInit2(&(http->stream), Z_DEFAULT_COMPRESSION,
Z_DEFLATED,
coding == _HTTP_CODING_DEFLATE ? -11 : 27, 7,
Z_DEFAULT_STRATEGY)) < Z_OK)
if ((http->stream = calloc(1, sizeof(z_stream))) == NULL)
{
free(http->sbuffer);
http->sbuffer = NULL;
http->status = HTTP_STATUS_ERROR;
http->error = errno;
return;
}
if ((zerr = deflateInit2((z_stream *)http->stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, coding == _HTTP_CODING_DEFLATE ? -11 : 27, 7, Z_DEFAULT_STRATEGY)) < Z_OK)
{
http->status = HTTP_STATUS_ERROR;
http->error = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
free(http->sbuffer);
free(http->stream);
http->sbuffer = NULL;
http->stream = NULL;
http->status = HTTP_STATUS_ERROR;
http->error = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
return;
}
http->stream.next_out = (Bytef *)http->sbuffer;
http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
((z_stream *)http->stream)->next_out = (Bytef *)http->sbuffer;
((z_stream *)http->stream)->avail_out = (uInt)_HTTP_MAX_SBUFFER;
break;
case _HTTP_CODING_INFLATE :
@@ -3837,19 +3864,30 @@ http_content_coding_start(
* -15 is raw inflate, 31 is gunzip, per ZLIB documentation.
*/
if ((zerr = inflateInit2(&(http->stream),
coding == _HTTP_CODING_INFLATE ? -15 : 31))
< Z_OK)
if ((http->stream = calloc(1, sizeof(z_stream))) == NULL)
{
free(http->sbuffer);
http->sbuffer = NULL;
http->status = HTTP_STATUS_ERROR;
http->error = errno;
return;
}
if ((zerr = inflateInit2((z_stream *)http->stream, coding == _HTTP_CODING_INFLATE ? -15 : 31)) < Z_OK)
{
free(http->sbuffer);
free(http->stream);
http->sbuffer = NULL;
http->stream = NULL;
http->status = HTTP_STATUS_ERROR;
http->error = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
return;
}
http->stream.avail_in = 0;
http->stream.next_in = http->sbuffer;
((z_stream *)http->stream)->avail_in = 0;
((z_stream *)http->stream)->next_in = http->sbuffer;
break;
default :
@@ -3915,7 +3953,7 @@ http_create(
if ((http = calloc(sizeof(http_t), 1)) == NULL)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
httpAddrFreeList(addrlist);
httpAddrFreeList(myaddrlist);
return (NULL);
}
@@ -4052,7 +4090,7 @@ http_read(http_t *http, /* I - HTTP connection */
if (bytes < 0)
{
#ifdef WIN32
#ifdef _WIN32
if (WSAGetLastError() != WSAEINTR)
{
http->error = WSAGetLastError();
@@ -4088,7 +4126,7 @@ http_read(http_t *http, /* I - HTTP connection */
http->error = errno;
return (-1);
}
#endif /* WIN32 */
#endif /* _WIN32 */
}
}
while (bytes < 0);
@@ -4102,7 +4140,7 @@ http_read(http_t *http, /* I - HTTP connection */
if (bytes < 0)
{
#ifdef WIN32
#ifdef _WIN32
if (WSAGetLastError() == WSAEINTR)
bytes = 0;
else
@@ -4112,7 +4150,7 @@ http_read(http_t *http, /* I - HTTP connection */
bytes = 0;
else
http->error = errno;
#endif /* WIN32 */
#endif /* _WIN32 */
}
else if (bytes == 0)
{
@@ -4474,7 +4512,7 @@ static void
http_set_timeout(int fd, /* I - File descriptor */
double timeout) /* I - Timeout in seconds */
{
#ifdef WIN32
#ifdef _WIN32
DWORD tv = (DWORD)(timeout * 1000);
/* Timeout in milliseconds */
@@ -4489,7 +4527,7 @@ http_set_timeout(int fd, /* I - File descriptor */
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, CUPS_SOCAST &tv, sizeof(tv));
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, CUPS_SOCAST &tv, sizeof(tv));
#endif /* WIN32 */
#endif /* _WIN32 */
}
@@ -4657,12 +4695,12 @@ http_write(http_t *http, /* I - HTTP connection */
nfds = select(http->fd + 1, NULL, &output_set, NULL, &timeout);
}
# ifdef WIN32
# ifdef _WIN32
while (nfds < 0 && (WSAGetLastError() == WSAEINTR ||
WSAGetLastError() == WSAEWOULDBLOCK));
# else
while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
# endif /* WIN32 */
# endif /* _WIN32 */
#endif /* HAVE_POLL */
if (nfds < 0)
@@ -4672,11 +4710,11 @@ http_write(http_t *http, /* I - HTTP connection */
}
else if (nfds == 0 && (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data)))
{
#ifdef WIN32
#ifdef _WIN32
http->error = WSAEWOULDBLOCK;
#else
http->error = EWOULDBLOCK;
#endif /* WIN32 */
#endif /* _WIN32 */
return (-1);
}
}
@@ -4695,7 +4733,7 @@ http_write(http_t *http, /* I - HTTP connection */
if (bytes < 0)
{
#ifdef WIN32
#ifdef _WIN32
if (WSAGetLastError() == WSAEINTR)
continue;
else if (WSAGetLastError() == WSAEWOULDBLOCK)
@@ -4729,7 +4767,7 @@ http_write(http_t *http, /* I - HTTP connection */
http->error = errno;
continue;
}
#endif /* WIN32 */
#endif /* _WIN32 */
DEBUG_printf(("3http_write: error writing data (%s).",
strerror(http->error)));
+66 -125
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Hyper-Text Transport Protocol definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_HTTP_H_
@@ -19,7 +20,7 @@
# include <string.h>
# include <time.h>
# include <sys/types.h>
# ifdef WIN32
# ifdef _WIN32
# ifndef __CUPS_SSIZE_T_DEFINED
# define __CUPS_SSIZE_T_DEFINED
/* Windows does not support the ssize_t type, so map it to off_t... */
@@ -48,7 +49,7 @@ typedef off_t ssize_t; /* @private@ */
# if defined(LOCAL_PEERCRED) && !defined(SO_PEERCRED)
# define SO_PEERCRED LOCAL_PEERCRED
# endif /* LOCAL_PEERCRED && !SO_PEERCRED */
# endif /* WIN32 */
# endif /* _WIN32 */
/*
@@ -79,7 +80,7 @@ extern "C" {
# define s6_addr32 _S6_un._S6_u32
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
# define s6_addr32 __u6_addr.__u6_addr32
# elif defined(WIN32)
# elif defined(_WIN32)
/*
* Windows only defines byte and 16-bit word members of the union and
* requires special casing of all raw address code...
@@ -175,6 +176,7 @@ typedef enum http_field_e /**** HTTP field names ****/
HTTP_FIELD_ACCEPT_ENCODING, /* Accepting-Encoding field @since CUPS 1.7/macOS 10.9@ */
HTTP_FIELD_ALLOW, /* Allow field @since CUPS 1.7/macOS 10.9@ */
HTTP_FIELD_SERVER, /* Server field @since CUPS 1.7/macOS 10.9@ */
HTTP_FIELD_AUTHENTICATION_INFO, /* Authentication-Info field (@since CUPS 2.2.9) */
HTTP_FIELD_MAX /* Maximum field index */
} http_field_t;
@@ -448,53 +450,43 @@ typedef int (*http_timeout_cb_t)(http_t *http, void *user_data);
* Prototypes...
*/
extern void httpBlocking(http_t *http, int b);
extern int httpCheck(http_t *http);
extern void httpClearFields(http_t *http);
extern void httpClose(http_t *http);
extern http_t *httpConnect(const char *host, int port)
_CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
extern http_t *httpConnectEncrypt(const char *host, int port,
http_encryption_t encryption)
_CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
extern int httpDelete(http_t *http, const char *uri);
extern int httpEncryption(http_t *http, http_encryption_t e);
extern int httpError(http_t *http);
extern void httpFlush(http_t *http);
extern int httpGet(http_t *http, const char *uri);
extern char *httpGets(char *line, int length, http_t *http);
extern const char *httpGetDateString(time_t t);
extern time_t httpGetDateTime(const char *s);
extern const char *httpGetField(http_t *http, http_field_t field);
extern struct hostent *httpGetHostByName(const char *name);
extern char *httpGetSubField(http_t *http, http_field_t field,
const char *name, char *value);
extern int httpHead(http_t *http, const char *uri);
extern void httpInitialize(void);
extern int httpOptions(http_t *http, const char *uri);
extern int httpPost(http_t *http, const char *uri);
extern int httpPrintf(http_t *http, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int httpPut(http_t *http, const char *uri);
extern void httpBlocking(http_t *http, int b) _CUPS_PUBLIC;
extern int httpCheck(http_t *http) _CUPS_PUBLIC;
extern void httpClearFields(http_t *http) _CUPS_PUBLIC;
extern void httpClose(http_t *http) _CUPS_PUBLIC;
extern http_t *httpConnect(const char *host, int port) _CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
extern http_t *httpConnectEncrypt(const char *host, int port, http_encryption_t encryption) _CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
extern int httpDelete(http_t *http, const char *uri) _CUPS_PUBLIC;
extern int httpEncryption(http_t *http, http_encryption_t e) _CUPS_PUBLIC;
extern int httpError(http_t *http) _CUPS_PUBLIC;
extern void httpFlush(http_t *http) _CUPS_PUBLIC;
extern int httpGet(http_t *http, const char *uri) _CUPS_PUBLIC;
extern char *httpGets(char *line, int length, http_t *http) _CUPS_PUBLIC;
extern const char *httpGetDateString(time_t t) _CUPS_PUBLIC;
extern time_t httpGetDateTime(const char *s) _CUPS_PUBLIC;
extern const char *httpGetField(http_t *http, http_field_t field) _CUPS_PUBLIC;
extern struct hostent *httpGetHostByName(const char *name) _CUPS_PUBLIC;
extern char *httpGetSubField(http_t *http, http_field_t field, const char *name, char *value) _CUPS_PUBLIC;
extern int httpHead(http_t *http, const char *uri) _CUPS_PUBLIC;
extern void httpInitialize(void) _CUPS_PUBLIC;
extern int httpOptions(http_t *http, const char *uri) _CUPS_PUBLIC;
extern int httpPost(http_t *http, const char *uri) _CUPS_PUBLIC;
extern int httpPrintf(http_t *http, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_PUBLIC;
extern int httpPut(http_t *http, const char *uri) _CUPS_PUBLIC;
extern int httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED_MSG("Use httpRead2 instead.");
extern int httpReconnect(http_t *http) _CUPS_DEPRECATED_1_6_MSG("Use httpReconnect2 instead.");
extern void httpSeparate(const char *uri, char *method,
char *username, char *host, int *port,
char *resource) _CUPS_DEPRECATED_MSG("Use httpSeparateURI instead.");
extern void httpSetField(http_t *http, http_field_t field,
const char *value);
extern const char *httpStatus(http_status_t status);
extern int httpTrace(http_t *http, const char *uri);
extern http_status_t httpUpdate(http_t *http);
extern void httpSeparate(const char *uri, char *method, char *username, char *host, int *port, char *resource) _CUPS_DEPRECATED_1_2_MSG("Use httpSeparateURI instead.");
extern void httpSetField(http_t *http, http_field_t field, const char *value) _CUPS_PUBLIC;
extern const char *httpStatus(http_status_t status) _CUPS_PUBLIC;
extern int httpTrace(http_t *http, const char *uri) _CUPS_PUBLIC;
extern http_status_t httpUpdate(http_t *http) _CUPS_PUBLIC;
extern int httpWrite(http_t *http, const char *buffer, int length) _CUPS_DEPRECATED_MSG("Use httpWrite2 instead.");
extern char *httpEncode64(char *out, const char *in) _CUPS_DEPRECATED_MSG("Use httpEncode64_2 instead.");
extern char *httpDecode64(char *out, const char *in) _CUPS_DEPRECATED_MSG("Use httpDecode64_2 instead.");
extern int httpGetLength(http_t *http) _CUPS_DEPRECATED_MSG("Use httpGetLength2 instead.");
extern char *httpMD5(const char *, const char *, const char *,
char [33]) _CUPS_DEPRECATED_MSG("Use cupsDoAuth or cupsHashData instead.");
extern char *httpMD5Final(const char *, const char *, const char *,
char [33]) _CUPS_DEPRECATED_MSG("Use cupsDoAuth or cupsHashData instead.");
extern char *httpMD5String(const unsigned char *, char [33]) _CUPS_DEPRECATED_MSG("Use cupsHashString instead.");
extern int httpGetLength(http_t *http) _CUPS_DEPRECATED_1_2_MSG("Use httpGetLength2 instead.");
extern char *httpMD5(const char *, const char *, const char *, char [33]) _CUPS_DEPRECATED_MSG("Use cupsDoAuth or cupsHashData instead.");
extern char *httpMD5Final(const char *, const char *, const char *, char [33]) _CUPS_DEPRECATED_2_2_MSG("Use cupsDoAuth or cupsHashData instead.");
extern char *httpMD5String(const unsigned char *, char [33]) _CUPS_DEPRECATED_2_2_MSG("Use cupsHashString instead.");
/**** New in CUPS 1.1.19 ****/
extern void httpClearCookie(http_t *http) _CUPS_API_1_1_19;
@@ -504,40 +496,21 @@ extern int httpWait(http_t *http, int msec) _CUPS_API_1_1_19;
/**** New in CUPS 1.1.21 ****/
extern char *httpDecode64_2(char *out, int *outlen, const char *in) _CUPS_API_1_1_21;
extern char *httpEncode64_2(char *out, int outlen, const char *in,
int inlen) _CUPS_API_1_1_21;
extern void httpSeparate2(const char *uri,
char *method, int methodlen,
char *username, int usernamelen,
char *host, int hostlen, int *port,
char *resource, int resourcelen) _CUPS_DEPRECATED_MSG("Use httpSeparateURI instead.");
extern char *httpEncode64_2(char *out, int outlen, const char *in, int inlen) _CUPS_API_1_1_21;
extern void httpSeparate2(const char *uri, char *method, int methodlen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen) _CUPS_DEPRECATED_1_2_MSG("Use httpSeparateURI instead.");
/**** New in CUPS 1.2/macOS 10.5 ****/
extern int httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;
extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2;
extern int httpAddrEqual(const http_addr_t *addr1,
const http_addr_t *addr2) _CUPS_API_1_2;
extern int httpAddrEqual(const http_addr_t *addr1, const http_addr_t *addr2) _CUPS_API_1_2;
extern void httpAddrFreeList(http_addrlist_t *addrlist) _CUPS_API_1_2;
extern http_addrlist_t *httpAddrGetList(const char *hostname, int family,
const char *service) _CUPS_API_1_2;
extern http_addrlist_t *httpAddrGetList(const char *hostname, int family, const char *service) _CUPS_API_1_2;
extern int httpAddrLength(const http_addr_t *addr) _CUPS_API_1_2;
extern int httpAddrLocalhost(const http_addr_t *addr) _CUPS_API_1_2;
extern char *httpAddrLookup(const http_addr_t *addr,
char *name, int namelen) _CUPS_API_1_2;
extern char *httpAddrString(const http_addr_t *addr,
char *s, int slen) _CUPS_API_1_2;
extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding,
char *uri, int urilen,
const char *scheme,
const char *username,
const char *host, int port,
const char *resource) _CUPS_API_1_2;
extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding,
char *uri, int urilen,
const char *scheme,
const char *username,
const char *host, int port,
const char *resourcef, ...) _CUPS_API_1_2;
extern char *httpAddrLookup(const http_addr_t *addr, char *name, int namelen) _CUPS_API_1_2;
extern char *httpAddrString(const http_addr_t *addr, char *s, int slen) _CUPS_API_1_2;
extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resource) _CUPS_API_1_2;
extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resourcef, ...) _CUPS_FORMAT(8, 9) _CUPS_API_1_2;
extern int httpFlushWrite(http_t *http) _CUPS_API_1_2;
extern int httpGetBlocking(http_t *http) _CUPS_API_1_2;
extern const char *httpGetDateString2(time_t t, char *s, int slen) _CUPS_API_1_2;
@@ -545,76 +518,44 @@ extern int httpGetFd(http_t *http) _CUPS_API_1_2;
extern const char *httpGetHostname(http_t *http, char *s, int slen) _CUPS_API_1_2;
extern off_t httpGetLength2(http_t *http) _CUPS_API_1_2;
extern http_status_t httpGetStatus(http_t *http) _CUPS_API_1_2;
extern char *httpGetSubField2(http_t *http, http_field_t field,
const char *name, char *value,
int valuelen) _CUPS_API_1_2;
extern char *httpGetSubField2(http_t *http, http_field_t field, const char *name, char *value, int valuelen) _CUPS_API_1_2;
extern ssize_t httpRead2(http_t *http, char *buffer, size_t length) _CUPS_API_1_2;
extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding,
const char *uri,
char *scheme, int schemelen,
char *username, int usernamelen,
char *host, int hostlen, int *port,
char *resource, int resourcelen) _CUPS_API_1_2;
extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding, const char *uri, char *scheme, int schemelen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen) _CUPS_API_1_2;
extern void httpSetExpect(http_t *http, http_status_t expect) _CUPS_API_1_2;
extern void httpSetLength(http_t *http, size_t length) _CUPS_API_1_2;
extern ssize_t httpWrite2(http_t *http, const char *buffer,
size_t length) _CUPS_API_1_2;
extern ssize_t httpWrite2(http_t *http, const char *buffer, size_t length) _CUPS_API_1_2;
/**** New in CUPS 1.3/macOS 10.5 ****/
extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3;
extern void httpSetAuthString(http_t *http, const char *scheme,
const char *data) _CUPS_API_1_3;
extern void httpSetAuthString(http_t *http, const char *scheme, const char *data) _CUPS_API_1_3;
/**** New in CUPS 1.5/macOS 10.7 ****/
extern int httpAddCredential(cups_array_t *credentials,
const void *data, size_t datalen)
_CUPS_API_1_5;
extern int httpCopyCredentials(http_t *http,
cups_array_t **credentials)
_CUPS_API_1_5;
extern int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen) _CUPS_API_1_5;
extern int httpCopyCredentials(http_t *http, cups_array_t **credentials) _CUPS_API_1_5;
extern void httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5;
extern int httpSetCredentials(http_t *http, cups_array_t *certs)
_CUPS_API_1_5;
extern void httpSetTimeout(http_t *http, double timeout,
http_timeout_cb_t cb, void *user_data)
_CUPS_API_1_5;
extern int httpSetCredentials(http_t *http, cups_array_t *certs) _CUPS_API_1_5;
extern void httpSetTimeout(http_t *http, double timeout, http_timeout_cb_t cb, void *user_data) _CUPS_API_1_5;
/**** New in CUPS 1.6/macOS 10.8 ****/
extern http_addrlist_t *httpAddrConnect2(http_addrlist_t *addrlist, int *sock,
int msec, int *cancel)
_CUPS_API_1_6;
extern http_addrlist_t *httpAddrConnect2(http_addrlist_t *addrlist, int *sock, int msec, int *cancel) _CUPS_API_1_6;
extern http_state_t httpGetState(http_t *http) _CUPS_API_1_6;
extern http_version_t httpGetVersion(http_t *http) _CUPS_API_1_6;
extern int httpReconnect2(http_t *http, int msec, int *cancel)
_CUPS_API_1_6;
extern int httpReconnect2(http_t *http, int msec, int *cancel) _CUPS_API_1_6;
/**** New in CUPS 1.7/macOS 10.9 ****/
extern http_t *httpAcceptConnection(int fd, int blocking)
_CUPS_API_1_7;
extern http_t *httpAcceptConnection(int fd, int blocking) _CUPS_API_1_7;
extern http_addrlist_t *httpAddrCopyList(http_addrlist_t *src) _CUPS_API_1_7;
extern int httpAddrListen(http_addr_t *addr, int port)
_CUPS_API_1_7;
extern int httpAddrListen(http_addr_t *addr, int port) _CUPS_API_1_7;
extern int httpAddrPort(http_addr_t *addr) _CUPS_API_1_7;
extern char *httpAssembleUUID(const char *server, int port,
const char *name, int number,
char *buffer, size_t bufsize)
_CUPS_API_1_7;
extern http_t *httpConnect2(const char *host, int port,
http_addrlist_t *addrlist,
int family, http_encryption_t encryption,
int blocking, int msec, int *cancel)
_CUPS_API_1_7;
extern char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize) _CUPS_API_1_7;
extern http_t *httpConnect2(const char *host, int port, http_addrlist_t *addrlist, int family, http_encryption_t encryption, int blocking, int msec, int *cancel) _CUPS_API_1_7;
extern const char *httpGetContentEncoding(http_t *http) _CUPS_API_1_7;
extern http_status_t httpGetExpect(http_t *http) _CUPS_API_1_7;
extern ssize_t httpPeek(http_t *http, char *buffer, size_t length)
_CUPS_API_1_7;
extern http_state_t httpReadRequest(http_t *http, char *resource,
size_t resourcelen) _CUPS_API_1_7;
extern void httpSetDefaultField(http_t *http, http_field_t field,
const char *value) _CUPS_API_1_7;
extern http_state_t httpWriteResponse(http_t *http,
http_status_t status) _CUPS_API_1_7;
extern ssize_t httpPeek(http_t *http, char *buffer, size_t length) _CUPS_API_1_7;
extern http_state_t httpReadRequest(http_t *http, char *resource, size_t resourcelen) _CUPS_API_1_7;
extern void httpSetDefaultField(http_t *http, http_field_t field, const char *value) _CUPS_API_1_7;
extern http_state_t httpWriteResponse(http_t *http, http_status_t status) _CUPS_API_1_7;
/* New in CUPS 2.0/macOS 10.10 */
extern int httpAddrClose(http_addr_t *addr, int fd) _CUPS_API_2_0;
+26 -6
Ver Arquivo
@@ -14,7 +14,7 @@
#include "ipp-private.h"
#include "string-private.h"
#include "debug-private.h"
#include "debug-internal.h"
/*
@@ -23,7 +23,7 @@
static ipp_t *parse_collection(_ipp_file_t *f, _ipp_vars_t *v, void *user_data);
static int parse_value(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, ipp_t *ipp, ipp_attribute_t **attr, int element);
static void report_error(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *message, ...) __attribute((__format__ (__printf__, 4, 5)));
static void report_error(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *message, ...) _CUPS_FORMAT(4, 5);
/*
@@ -217,6 +217,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
* Skip whitespace and comments...
*/
DEBUG_printf(("1_ippFileReadToken: linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
while ((ch = cupsFileGetChar(f->fp)) != EOF)
{
if (_cups_isspace(ch))
@@ -226,7 +228,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
*/
if (ch == '\n')
{
f->linenum ++;
DEBUG_printf(("1_ippFileReadToken: LF in leading whitespace, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
}
}
else if (ch == '#')
{
@@ -234,6 +239,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
* Comment...
*/
DEBUG_puts("1_ippFileReadToken: Skipping comment in leading whitespace...");
while ((ch = cupsFileGetChar(f->fp)) != EOF)
{
if (ch == '\n')
@@ -241,7 +248,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
}
if (ch == '\n')
{
f->linenum ++;
DEBUG_printf(("1_ippFileReadToken: LF at end of comment, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
}
else
break;
}
@@ -262,7 +272,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
while (ch != EOF)
{
if (ch == '\n')
{
f->linenum ++;
DEBUG_printf(("1_ippFileReadToken: LF in token, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
}
if (ch == quote)
{
@@ -271,7 +284,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
*/
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" at closing quote.", token));
return (1);
}
else if (!quote && _cups_isspace(ch))
@@ -281,7 +294,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
*/
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" before whitespace.", token));
return (1);
}
else if (!quote && (ch == '\'' || ch == '\"'))
@@ -291,6 +304,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
*/
quote = ch;
DEBUG_printf(("1_ippFileReadToken: Start of quoted string, quote=%c, pos=%ld", quote, (long)cupsFileTell(f->fp)));
}
else if (!quote && ch == '#')
{
@@ -300,7 +315,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
cupsFileSeek(f->fp, cupsFileTell(f->fp) - 1);
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" before comment.", token));
return (1);
}
else if (!quote && (ch == '{' || ch == '}' || ch == ','))
@@ -338,6 +353,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
* Quoted character...
*/
DEBUG_printf(("1_ippFileReadToken: Quoted character at pos=%ld", (long)cupsFileTell(f->fp)));
if ((ch = cupsFileGetChar(f->fp)) == EOF)
{
*token = '\0';
@@ -345,7 +362,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
return (0);
}
else if (ch == '\n')
{
f->linenum ++;
DEBUG_printf(("1_ippFileReadToken: quoted LF, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
}
}
if (tokptr < tokend)
@@ -376,7 +396,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
}
*tokptr = '\0';
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" at EOF.", token));
return (tokptr > token);
}
+10 -10
Ver Arquivo
@@ -192,21 +192,21 @@ struct _ipp_file_s /**** File Parser */
/* encode.c */
#ifdef DEBUG
extern const char *_ippCheckOptions(void);
extern const char *_ippCheckOptions(void) _CUPS_PRIVATE;
#endif /* DEBUG */
extern _ipp_option_t *_ippFindOption(const char *name);
extern _ipp_option_t *_ippFindOption(const char *name) _CUPS_PRIVATE;
/* ipp-file.c */
extern ipp_t *_ippFileParse(_ipp_vars_t *v, const char *filename, void *user_data);
extern int _ippFileReadToken(_ipp_file_t *f, char *token, size_t tokensize);
extern ipp_t *_ippFileParse(_ipp_vars_t *v, const char *filename, void *user_data) _CUPS_PRIVATE;
extern int _ippFileReadToken(_ipp_file_t *f, char *token, size_t tokensize) _CUPS_PRIVATE;
/* ipp-vars.c */
extern void _ippVarsDeinit(_ipp_vars_t *v);
extern void _ippVarsExpand(_ipp_vars_t *v, char *dst, const char *src, size_t dstsize) __attribute__((nonnull(1,2,3)));
extern const char *_ippVarsGet(_ipp_vars_t *v, const char *name);
extern void _ippVarsInit(_ipp_vars_t *v, _ipp_fattr_cb_t attrcb, _ipp_ferror_cb_t errorcb, _ipp_ftoken_cb_t tokencb);
extern const char *_ippVarsPasswordCB(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data);
extern int _ippVarsSet(_ipp_vars_t *v, const char *name, const char *value);
extern void _ippVarsDeinit(_ipp_vars_t *v) _CUPS_PRIVATE;
extern void _ippVarsExpand(_ipp_vars_t *v, char *dst, const char *src, size_t dstsize) _CUPS_NONNULL(1,2,3) _CUPS_PRIVATE;
extern const char *_ippVarsGet(_ipp_vars_t *v, const char *name) _CUPS_PRIVATE;
extern void _ippVarsInit(_ipp_vars_t *v, _ipp_fattr_cb_t attrcb, _ipp_ferror_cb_t errorcb, _ipp_ftoken_cb_t tokencb) _CUPS_PRIVATE;
extern const char *_ippVarsPasswordCB(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data) _CUPS_PRIVATE;
extern int _ippVarsSet(_ipp_vars_t *v, const char *name, const char *value) _CUPS_PRIVATE;
/*
+322 -183
Ver Arquivo
@@ -13,6 +13,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
@@ -138,117 +139,117 @@ static const char * const ipp_std_ops[] =
/* 0x0000 - 0x000f */
"0x0000",
"0x0001",
"Print-Job",
"Print-URI",
"Validate-Job",
"Create-Job",
"Send-Document",
"Send-URI",
"Cancel-Job",
"Get-Job-Attributes",
"Get-Jobs",
"Get-Printer-Attributes",
"Hold-Job",
"Release-Job",
"Restart-Job",
"Print-Job", /* RFC 8011 */
"Print-URI", /* RFC 8011 */
"Validate-Job", /* RFC 8011 */
"Create-Job", /* RFC 8011 */
"Send-Document", /* RFC 8011 */
"Send-URI", /* RFC 8011 */
"Cancel-Job", /* RFC 8011 */
"Get-Job-Attributes", /* RFC 8011 */
"Get-Jobs", /* RFC 8011 */
"Get-Printer-Attributes", /* RFC 8011 */
"Hold-Job", /* RFC 8011 */
"Release-Job", /* RFC 8011 */
"Restart-Job", /* RFC 8011 */
"0x000f",
/* 0x0010 - 0x001f */
"Pause-Printer",
"Resume-Printer",
"Purge-Jobs",
"Set-Printer-Attributes",
"Set-Job-Attributes",
"Get-Printer-Supported-Values",
"Create-Printer-Subscriptions",
"Create-Job-Subscriptions",
"Get-Subscription-Attributes",
"Get-Subscriptions",
"Renew-Subscription",
"Cancel-Subscription",
"Get-Notifications",
"Pause-Printer", /* RFC 8011 */
"Resume-Printer", /* RFC 8011 */
"Purge-Jobs", /* RFC 8011 */
"Set-Printer-Attributes", /* RFC 3380 */
"Set-Job-Attributes", /* RFC 3380 */
"Get-Printer-Supported-Values", /* RFC 3380 */
"Create-Printer-Subscriptions", /* RFC 3995 */
"Create-Job-Subscriptions", /* RFC 3995 */
"Get-Subscription-Attributes", /* RFC 3995 */
"Get-Subscriptions", /* RFC 3995 */
"Renew-Subscription", /* RFC 3995 */
"Cancel-Subscription", /* RFC 3995 */
"Get-Notifications", /* RFC 3996 */
"(Send-Notifications)",
"(Get-Resource-Attributes)",
"Get-Resource-Attributes", /* IPP System */
"(Get-Resource-Data)",
/* 0x0020 - 0x002f */
"(Get-Resources)",
"Get-Resources", /* IPP System */
"(Get-Printer-Support-Files)",
"Enable-Printer",
"Disable-Printer",
"Pause-Printer-After-Current-Job",
"Hold-New-Jobs",
"Release-Held-New-Jobs",
"Deactivate-Printer",
"Activate-Printer",
"Restart-Printer",
"Shutdown-Printer",
"Startup-Printer",
"Reprocess-Job",
"Cancel-Current-Job",
"Suspend-Current-Job",
"Resume-Job",
"Enable-Printer", /* RFC 3998 */
"Disable-Printer", /* RFC 3998 */
"Pause-Printer-After-Current-Job", /* RFC 3998 */
"Hold-New-Jobs", /* RFC 3998 */
"Release-Held-New-Jobs", /* RFC 3998 */
"Deactivate-Printer", /* RFC 3998 */
"Activate-Printer", /* RFC 3998 */
"Restart-Printer", /* RFC 3998 */
"Shutdown-Printer", /* RFC 3998 */
"Startup-Printer", /* RFC 3998 */
"Reprocess-Job", /* RFC 3998 */
"Cancel-Current-Job", /* RFC 3998 */
"Suspend-Current-Job", /* RFC 3998 */
"Resume-Job", /* RFC 3998 */
/* 0x0030 - 0x003f */
"Promote-Job",
"Schedule-Job-After",
"Promote-Job", /* RFC 3998 */
"Schedule-Job-After", /* RFC 3998 */
"0x0032",
"Cancel-Document",
"Get-Document-Attributes",
"Get-Documents",
"Delete-Document",
"Set-Document-Attributes",
"Cancel-Jobs",
"Cancel-My-Jobs",
"Resubmit-Job",
"Close-Job",
"Identify-Printer",
"Validate-Document",
"Add-Document-Images",
"Acknowledge-Document",
"Cancel-Document", /* IPP DocObject */
"Get-Document-Attributes", /* IPP DocObject */
"Get-Documents", /* IPP DocObject */
"Delete-Document", /* IPP DocObject */
"Set-Document-Attributes", /* IPP DocObject */
"Cancel-Jobs", /* IPP JPS2 */
"Cancel-My-Jobs", /* IPP JPS2 */
"Resubmit-Job", /* IPP JPS2 */
"Close-Job", /* IPP JPS2 */
"Identify-Printer", /* IPP JPS3 */
"Validate-Document", /* IPP JPS3 */
"Add-Document-Images", /* IPP Scan */
"Acknowledge-Document", /* IPP INFRA */
/* 0x0040 - 0x004f */
"Acknowledge-Identify-Printer",
"Acknowledge-Job",
"Fetch-Document",
"Fetch-Job",
"Get-Output-Device-Attributes",
"Update-Active-Jobs",
"Deregister-Output-Device",
"Update-Document-Status",
"Update-Job-Status",
"Update-Output-Device-Attributes",
"Get-Next-Document-Data",
"Allocate-Printer-Resources",
"Create-Printer",
"Deallocate-Printer-Resources",
"Delete-Printer",
"Get-Printers",
"Acknowledge-Identify-Printer", /* IPP INFRA */
"Acknowledge-Job", /* IPP INFRA */
"Fetch-Document", /* IPP INFRA */
"Fetch-Job", /* IPP INFRA */
"Get-Output-Device-Attributes", /* IPP INFRA */
"Update-Active-Jobs", /* IPP INFRA */
"Deregister-Output-Device", /* IPP INFRA */
"Update-Document-Status", /* IPP INFRA */
"Update-Job-Status", /* IPP INFRA */
"Update-Output-Device-Attributes", /* IPP INFRA */
"Get-Next-Document-Data", /* IPP Scan */
"Allocate-Printer-Resources", /* IPP System */
"Create-Printer", /* IPP System */
"Deallocate-Printer-Resources", /* IPP System */
"Delete-Printer", /* IPP System */
"Get-Printers", /* IPP System */
/* 0x0050 - 0x005f */
"Shutdown-One-Printer",
"Startup-One-Printer",
"Cancel-Resource",
"Create-Resource",
"Install-Resource",
"Send-Resource-Data",
"Set-Resource-Attributes",
"Create-Resource-Subscriptions",
"Create-System-Subscriptions",
"Disable-All-Printers",
"Enable-All-Printers",
"Get-System-Attributes",
"Get-System-Supported-Values",
"Pause-All-Printers",
"Pause-All-Printers-After-Current-Job",
"Register-Output-Device",
"Shutdown-One-Printer", /* IPP System */
"Startup-One-Printer", /* IPP System */
"Cancel-Resource", /* IPP System */
"Create-Resource", /* IPP System */
"Install-Resource", /* IPP System */
"Send-Resource-Data", /* IPP System */
"Set-Resource-Attributes", /* IPP System */
"Create-Resource-Subscriptions", /* IPP System */
"Create-System-Subscriptions", /* IPP System */
"Disable-All-Printers", /* IPP System */
"Enable-All-Printers", /* IPP System */
"Get-System-Attributes", /* IPP System */
"Get-System-Supported-Values", /* IPP System */
"Pause-All-Printers", /* IPP System */
"Pause-All-Printers-After-Current-Job", /* IPP System */
"Register-Output-Device", /* IPP System */
/* 0x0060 - 0x0064 */
"Restart-System",
"Resume-All-Printers",
"Set-System-Attributes",
"Shutdown-All-Printers",
"Startup-All-Printers"
"Restart-System", /* IPP System */
"Resume-All-Printers", /* IPP System */
"Set-System-Attributes", /* IPP System */
"Shutdown-All-Printers", /* IPP System */
"Startup-All-Printers" /* IPP System */
},
* const ipp_cups_ops[] =
{
@@ -286,14 +287,15 @@ static const char * const ipp_std_ops[] =
"unsupported-attributes-tag",
/* 0x05 */
"subscription-attributes-tag",
/* 0x06 */
/* 0x06 - RFC 3995 */
"event-notification-attributes-tag",
/* 0x07 */
"(resource-attributes-tag)",
/* 0x08 */
/* 0x07 - RFC 3995 */
"resource-attributes-tag",
/* 0x08 - IPP System */
"document-attributes-tag",
/* 0x09 */
"0x0a", /* 0x0a */
/* 0x09 - IPP DocObject */
"system-attributes-tag",
/* 0x0a - IPP System */
"0x0b", /* 0x0b */
"0x0c", /* 0x0c */
"0x0d", /* 0x0d */
@@ -304,9 +306,9 @@ static const char * const ipp_std_ops[] =
"unknown", /* 0x12 */
"no-value", /* 0x13 */
"0x14", /* 0x14 */
"not-settable", /* 0x15 */
"delete-attribute", /* 0x16 */
"admin-define", /* 0x17 */
"not-settable", /* 0x15 - RFC 3380 */
"delete-attribute", /* 0x16 - RFC 3380 */
"admin-define", /* 0x17 - RFC 3380 */
"0x18", /* 0x18 */
"0x19", /* 0x19 */
"0x1a", /* 0x1a */
@@ -364,7 +366,7 @@ static const char * const ipp_document_states[] =
"pending",
"4",
"processing",
"processing-stopped", /* IPPSIX */
"processing-stopped", /* IPP INFRA */
"canceled",
"aborted",
"completed"
@@ -383,8 +385,8 @@ static const char * const ipp_document_states[] =
"bale",
"booklet-maker",
"jog-offset",
"coat", /* Finishings 2.0 */
"laminate", /* Finishings 2.0 */
"coat", /* IPP Finishings 2.0 */
"laminate", /* IPP Finishings 2.0 */
"17",
"18",
"19",
@@ -400,10 +402,10 @@ static const char * const ipp_document_states[] =
"staple-dual-top",
"staple-dual-right",
"staple-dual-bottom",
"staple-triple-left", /* Finishings 2.0 */
"staple-triple-top", /* Finishings 2.0 */
"staple-triple-right",/* Finishings 2.0 */
"staple-triple-bottom",/* Finishings 2.0 */
"staple-triple-left", /* IPP Finishings 2.0 */
"staple-triple-top", /* IPP Finishings 2.0 */
"staple-triple-right",/* IPP Finishings 2.0 */
"staple-triple-bottom",/* IPP Finishings 2.0 */
"36",
"37",
"38",
@@ -438,38 +440,38 @@ static const char * const ipp_document_states[] =
"67",
"68",
"69",
"punch-top-left", /* Finishings 2.0 */
"punch-bottom-left", /* Finishings 2.0 */
"punch-top-right", /* Finishings 2.0 */
"punch-bottom-right", /* Finishings 2.0 */
"punch-dual-left", /* Finishings 2.0 */
"punch-dual-top", /* Finishings 2.0 */
"punch-dual-right", /* Finishings 2.0 */
"punch-dual-bottom", /* Finishings 2.0 */
"punch-triple-left", /* Finishings 2.0 */
"punch-triple-top", /* Finishings 2.0 */
"punch-triple-right", /* Finishings 2.0 */
"punch-triple-bottom",/* Finishings 2.0 */
"punch-quad-left", /* Finishings 2.0 */
"punch-quad-top", /* Finishings 2.0 */
"punch-quad-right", /* Finishings 2.0 */
"punch-quad-bottom", /* Finishings 2.0 */
"punch-multiple-left",/* Finishings 2.1/Canon */
"punch-multiple-top", /* Finishings 2.1/Canon */
"punch-multiple-right",/* Finishings 2.1/Canon */
"punch-multiple-bottom",/* Finishings 2.1/Canon */
"fold-accordian", /* Finishings 2.0 */
"fold-double-gate", /* Finishings 2.0 */
"fold-gate", /* Finishings 2.0 */
"fold-half", /* Finishings 2.0 */
"fold-half-z", /* Finishings 2.0 */
"fold-left-gate", /* Finishings 2.0 */
"fold-letter", /* Finishings 2.0 */
"fold-parallel", /* Finishings 2.0 */
"fold-poster", /* Finishings 2.0 */
"fold-right-gate", /* Finishings 2.0 */
"fold-z", /* Finishings 2.0 */
"fold-engineering-z" /* Finishings 2.1 */
"punch-top-left", /* IPP Finishings 2.0 */
"punch-bottom-left", /* IPP Finishings 2.0 */
"punch-top-right", /* IPP Finishings 2.0 */
"punch-bottom-right", /* IPP Finishings 2.0 */
"punch-dual-left", /* IPP Finishings 2.0 */
"punch-dual-top", /* IPP Finishings 2.0 */
"punch-dual-right", /* IPP Finishings 2.0 */
"punch-dual-bottom", /* IPP Finishings 2.0 */
"punch-triple-left", /* IPP Finishings 2.0 */
"punch-triple-top", /* IPP Finishings 2.0 */
"punch-triple-right", /* IPP Finishings 2.0 */
"punch-triple-bottom",/* IPP Finishings 2.0 */
"punch-quad-left", /* IPP Finishings 2.0 */
"punch-quad-top", /* IPP Finishings 2.0 */
"punch-quad-right", /* IPP Finishings 2.0 */
"punch-quad-bottom", /* IPP Finishings 2.0 */
"punch-multiple-left",/* IPP Finishings 2.1/Canon */
"punch-multiple-top", /* IPP Finishings 2.1/Canon */
"punch-multiple-right",/* IPP Finishings 2.1/Canon */
"punch-multiple-bottom",/* IPP Finishings 2.1/Canon */
"fold-accordian", /* IPP Finishings 2.0 */
"fold-double-gate", /* IPP Finishings 2.0 */
"fold-gate", /* IPP Finishings 2.0 */
"fold-half", /* IPP Finishings 2.0 */
"fold-half-z", /* IPP Finishings 2.0 */
"fold-left-gate", /* IPP Finishings 2.0 */
"fold-letter", /* IPP Finishings 2.0 */
"fold-parallel", /* IPP Finishings 2.0 */
"fold-poster", /* IPP Finishings 2.0 */
"fold-right-gate", /* IPP Finishings 2.0 */
"fold-z", /* IPP Finishings 2.0 */
"fold-engineering-z" /* IPP Finishings 2.1 */
},
* const ipp_finishings_vendor[] =
{
@@ -888,6 +890,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
int i, j, /* Looping vars */
count, /* Number of values */
added; /* Was name added? */
ipp_op_t op; /* IPP operation code */
ipp_attribute_t *requested; /* requested-attributes attribute */
cups_array_t *ra; /* Requested attributes array */
const char *value; /* Current value */
@@ -923,7 +926,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"document-state-message",
"document-state-reasons",
"document-uri",
"document-uuid",
"document-uuid", /* IPP JPS3 */
"errors-count",
"finishings-actual",
"finishings-col-actual",
@@ -991,6 +994,12 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
};
static const char * const document_template[] =
{ /* document-template group */
"chamber-humidity", /* IPP 3D */
"chamber-humidity-default", /* IPP 3D */
"chamber-humidity-supported", /* IPP 3D */
"chamber-temperature", /* IPP 3D */
"chamber-temperature-default", /* IPP 3D */
"chamber-temperature-supported", /* IPP 3D */
"copies",
"copies-default",
"copies-supported",
@@ -1182,6 +1191,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
};
static const char * const job_description[] =
{ /* job-description group */
"chamber-humidity-actual", /* IPP 3D */
"chamber-temperature-actual", /* IPP 3D */
"compression-supplied",
"copies-actual",
"cover-back-actual",
@@ -1241,7 +1252,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"job-name",
"job-originating-host-name", /* CUPS extension */
"job-originating-user-name",
"job-originating-user-uri",
"job-originating-user-uri", /* IPP JPS3 */
"job-pages",
"job-pages-col",
"job-pages-completed",
@@ -1252,6 +1263,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"job-printer-up-time",
"job-printer-uri",
"job-priority-actual",
"job-resource-ids", /* IPP System */
"job-save-printer-make-and-model",
"job-sheet-message-actual",
"job-sheets-actual",
@@ -1260,7 +1272,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"job-state-message",
"job-state-reasons",
"job-uri",
"job-uuid",
"job-uuid", /* IPP JPS3 */
"materials-col-actual", /* IPP 3D */
"media-actual",
"media-col-actual",
@@ -1274,6 +1286,10 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"original-requesting-user-name",
"output-bin-actual",
"output-device-assigned",
"output-device-job-state", /* IPP INFRA */
"output-device-job-state-message", /* IPP INFRA */
"output-device-job-state-reasons", /* IPP INFRA */
"output-device-uuid-assigned", /* IPP INFRA */
"overrides-actual",
"page-delivery-actual",
"page-order-received-actual",
@@ -1311,6 +1327,12 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
static const char * const job_template[] =
{ /* job-template group */
"accuracy-units-supported", /* IPP 3D */
"chamber-humidity", /* IPP 3D */
"chamber-humidity-default", /* IPP 3D */
"chamber-humidity-supported", /* IPP 3D */
"chamber-temperature", /* IPP 3D */
"chamber-temperature-default", /* IPP 3D */
"chamber-temperature-supported", /* IPP 3D */
"confirmation-sheet-print", /* IPP FaxOut */
"confirmation-sheet-print-default",
"copies",
@@ -1486,8 +1508,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"output-bin-default",
"output-bin-supported",
"output-device",
"output-device-default",
"output-device-supported",
"output-device-uuid-supported", /* IPP INFRA */
"output-mode", /* CUPS extension */
"output-mode-default", /* CUPS extension */
"output-mode-supported", /* CUPS extension */
@@ -1601,6 +1623,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
static const char * const printer_description[] =
{ /* printer-description group */
"auth-info-required", /* CUPS extension */
"chamber-humidity-current", /* IPP 3D */
"chamber-temperature-current", /* IPP 3D */
"charset-configured",
"charset-supported",
"color-supported",
@@ -1680,16 +1704,20 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"pdf-features-supported", /* IPP 3D */
"pdf-versions-supported", /* CUPS extension */
"pdl-override-supported",
"platform-shape", /* IPP 3D */
"port-monitor", /* CUPS extension */
"port-monitor-supported", /* CUPS extension */
"preferred-attributes-supported",
"printer-alert",
"printer-alert-description",
"printer-camera-image-uri", /* IPP 3D */
"printer-charge-info",
"printer-charge-info-uri",
"printer-commands", /* CUPS extension */
"printer-config-change-date-time",
"printer-config-change-time",
"printer-config-changes", /* IPP System */
"printer-contact-col", /* IPP System */
"printer-current-time",
"printer-detailed-status-messages",
"printer-device-id",
@@ -1707,7 +1735,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"printer-get-attributes-supported",
"printer-icc-profiles",
"printer-icons",
"printer-id", /* CUPS extension */
"printer-id", /* IPP System */
"printer-info",
"printer-input-tray", /* IPP JPS3 */
"printer-is-accepting-jobs",
@@ -1727,7 +1755,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"printer-organization",
"printer-organizational-unit",
"printer-output-tray", /* IPP JPS3 */
"printer-queue-id", /* CUPS extension */
"printer-service-type", /* IPP System */
"printer-settable-attributes-supported",
"printer-state",
"printer-state-change-date-time",
@@ -1763,17 +1791,54 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"xri-security-supported",
"xri-uri-scheme-supported"
};
static const char * const resource_description[] =
{ /* resource-description group - IPP System */
"resource-info",
"resource-name"
};
static const char * const resource_status[] =
{ /* resource-status group - IPP System */
"date-time-at-canceled",
"date-time-at-creation",
"date-time-at-installed",
"resource-data-uri",
"resource-format",
"resource-id",
"resource-k-octets",
"resource-state",
"resource-state-message",
"resource-state-reasons",
"resource-string-version",
"resource-type",
"resource-use-count",
"resource-uuid",
"resource-version",
"time-at-canceled",
"time-at-creation",
"time-at-installed"
};
static const char * const resource_template[] =
{ /* resource-template group - IPP System */
"resource-format",
"resource-format-supported",
"resource-info",
"resource-name",
"resource-type",
"resource-type-supported"
};
static const char * const subscription_description[] =
{ /* subscription-description group */
"notify-job-id",
"notify-lease-expiration-time",
"notify-printer-up-time",
"notify-printer-uri",
"notify-resource-id", /* IPP System */
"notify-system-uri", /* IPP System */
"notify-sequence-number",
"notify-subscriber-user-name",
"notify-subscriber-user-uri",
"notify-subscription-id",
"notify-subscription-uuid"
"notify-subscription-uuid" /* IPP JPS3 */
};
static const char * const subscription_template[] =
{ /* subscription-template group */
@@ -1795,21 +1860,73 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"notify-time-interval",
"notify-user-data"
};
static const char * const system_description[] =
{ /* system-description group - IPP System */
"charset-configured",
"charset-supported",
"generated-natural-language-supported",
"ipp-features-supported",
"ipp-versions-supported",
"natural-language-configured",
"operations-supported",
"power-calendar-policy-col",
"power-event-policy-col",
"power-timeout-policy-col",
"printer-creation-attributes-supported",
"resource-settable-attributes-supported",
"system-contact-col",
"system-current-time",
"system-default-printer-id",
"system-device-id",
"system-geo-location",
"system-info",
"system-location",
"system-mandatory-printer-attributes",
"system-make-and-model",
"system-message-from-operator",
"system-name",
"system-settable-attributes-supported",
"system-strings-languages-supported",
"system-strings-uri",
"system-xri-supported"
};
static const char * const system_status[] =
{ /* system-status group - IPP System */
"power-log-col",
"power-state-capabilities-col",
"power-state-counters-col",
"power-state-monitor-col",
"power-state-transitions-col",
"system-config-change-date-time",
"system-config-change-time",
"system-config-changes",
"system-configured-printers",
"system-configured-resources",
"system-serial-number",
"system-state",
"system-state-change-date-time",
"system-state-change-time",
"system-state-message",
"system-state-reasons",
"system-up-time",
"system-uuid"
};
/*
* Get the requested-attributes attribute...
*/
if ((requested = ippFindAttribute(request, "requested-attributes",
IPP_TAG_KEYWORD)) == NULL)
op = ippGetOperation(request);
if ((requested = ippFindAttribute(request, "requested-attributes", IPP_TAG_KEYWORD)) == NULL)
{
/*
* The Get-Jobs operation defaults to "job-id" and "job-uri", all others
* default to "all"...
*/
if (ippGetOperation(request) == IPP_OP_GET_JOBS)
if (op == IPP_OP_GET_JOBS)
{
ra = cupsArrayNew((cups_array_func_t)strcmp, NULL);
cupsArrayAdd(ra, "job-id");
@@ -1840,12 +1957,9 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
added = 0;
value = ippGetString(requested, i, NULL);
if (!strcmp(value, "document-description") || !strcmp(value, "all"))
if (!strcmp(value, "document-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_JOB_ATTRIBUTES || op == IPP_OP_GET_JOBS || op == IPP_OP_GET_DOCUMENT_ATTRIBUTES || op == IPP_OP_GET_DOCUMENTS)))
{
for (j = 0;
j < (int)(sizeof(document_description) /
sizeof(document_description[0]));
j ++)
for (j = 0; j < (int)(sizeof(document_description) / sizeof(document_description[0])); j ++)
cupsArrayAdd(ra, (void *)document_description[j]);
added = 1;
@@ -1853,67 +1967,92 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
if (!strcmp(value, "document-template") || !strcmp(value, "all"))
{
for (j = 0;
j < (int)(sizeof(document_template) / sizeof(document_template[0]));
j ++)
for (j = 0; j < (int)(sizeof(document_template) / sizeof(document_template[0])); j ++)
cupsArrayAdd(ra, (void *)document_template[j]);
added = 1;
}
if (!strcmp(value, "job-description") || !strcmp(value, "all"))
if (!strcmp(value, "job-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_JOB_ATTRIBUTES || op == IPP_OP_GET_JOBS)))
{
for (j = 0;
j < (int)(sizeof(job_description) / sizeof(job_description[0]));
j ++)
for (j = 0; j < (int)(sizeof(job_description) / sizeof(job_description[0])); j ++)
cupsArrayAdd(ra, (void *)job_description[j]);
added = 1;
}
if (!strcmp(value, "job-template") || !strcmp(value, "all"))
if (!strcmp(value, "job-template") || (!strcmp(value, "all") && (op == IPP_OP_GET_JOB_ATTRIBUTES || op == IPP_OP_GET_JOBS || op == IPP_OP_GET_PRINTER_ATTRIBUTES)))
{
for (j = 0;
j < (int)(sizeof(job_template) / sizeof(job_template[0]));
j ++)
for (j = 0; j < (int)(sizeof(job_template) / sizeof(job_template[0])); j ++)
cupsArrayAdd(ra, (void *)job_template[j]);
added = 1;
}
if (!strcmp(value, "printer-description") || !strcmp(value, "all"))
if (!strcmp(value, "printer-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_PRINTER_ATTRIBUTES || op == IPP_OP_GET_PRINTERS || op == IPP_OP_CUPS_GET_DEFAULT || op == IPP_OP_CUPS_GET_PRINTERS || op == IPP_OP_CUPS_GET_CLASSES)))
{
for (j = 0;
j < (int)(sizeof(printer_description) /
sizeof(printer_description[0]));
j ++)
for (j = 0; j < (int)(sizeof(printer_description) / sizeof(printer_description[0])); j ++)
cupsArrayAdd(ra, (void *)printer_description[j]);
added = 1;
}
if (!strcmp(value, "subscription-description") || !strcmp(value, "all"))
if (!strcmp(value, "resource-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_RESOURCE_ATTRIBUTES || op == IPP_OP_GET_RESOURCES)))
{
for (j = 0;
j < (int)(sizeof(subscription_description) /
sizeof(subscription_description[0]));
j ++)
for (j = 0; j < (int)(sizeof(resource_description) / sizeof(resource_description[0])); j ++)
cupsArrayAdd(ra, (void *)resource_description[j]);
added = 1;
}
if (!strcmp(value, "resource-status") || (!strcmp(value, "all") && (op == IPP_OP_GET_RESOURCE_ATTRIBUTES || op == IPP_OP_GET_RESOURCES)))
{
for (j = 0; j < (int)(sizeof(resource_status) / sizeof(resource_status[0])); j ++)
cupsArrayAdd(ra, (void *)resource_status[j]);
added = 1;
}
if (!strcmp(value, "resource-template") || (!strcmp(value, "all") && (op == IPP_OP_GET_RESOURCE_ATTRIBUTES || op == IPP_OP_GET_RESOURCES || op == IPP_OP_GET_SYSTEM_ATTRIBUTES)))
{
for (j = 0; j < (int)(sizeof(resource_template) / sizeof(resource_template[0])); j ++)
cupsArrayAdd(ra, (void *)resource_template[j]);
added = 1;
}
if (!strcmp(value, "subscription-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES || op == IPP_OP_GET_SUBSCRIPTIONS)))
{
for (j = 0; j < (int)(sizeof(subscription_description) / sizeof(subscription_description[0])); j ++)
cupsArrayAdd(ra, (void *)subscription_description[j]);
added = 1;
}
if (!strcmp(value, "subscription-template") || !strcmp(value, "all"))
if (!strcmp(value, "subscription-template") || (!strcmp(value, "all") && (op == IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES || op == IPP_OP_GET_SUBSCRIPTIONS)))
{
for (j = 0;
j < (int)(sizeof(subscription_template) /
sizeof(subscription_template[0]));
j ++)
for (j = 0; j < (int)(sizeof(subscription_template) / sizeof(subscription_template[0])); j ++)
cupsArrayAdd(ra, (void *)subscription_template[j]);
added = 1;
}
if (!strcmp(value, "system-description") || (!strcmp(value, "all") && op == IPP_OP_GET_SYSTEM_ATTRIBUTES))
{
for (j = 0; j < (int)(sizeof(system_description) / sizeof(system_description[0])); j ++)
cupsArrayAdd(ra, (void *)system_description[j]);
added = 1;
}
if (!strcmp(value, "system-status") || (!strcmp(value, "all") && op == IPP_OP_GET_SYSTEM_ATTRIBUTES))
{
for (j = 0; j < (int)(sizeof(system_status) / sizeof(system_status[0])); j ++)
cupsArrayAdd(ra, (void *)system_status[j]);
added = 1;
}
if (!added)
cupsArrayAdd(ra, (void *)value);
}
+1
Ver Arquivo
@@ -15,6 +15,7 @@
#include <cups/cups.h>
#include "ipp-private.h"
#include "string-private.h"
#include "debug-internal.h"
/*
+90 -163
Ver Arquivo
@@ -13,10 +13,11 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <regex.h>
#ifdef WIN32
#ifdef _WIN32
# include <io.h>
#endif /* WIN32 */
#endif /* _WIN32 */
/*
@@ -28,12 +29,8 @@ static ipp_attribute_t *ipp_add_attr(ipp_t *ipp, const char *name,
int num_values);
static void ipp_free_values(ipp_attribute_t *attr, int element,
int count);
static char *ipp_get_code(const char *locale, char *buffer,
size_t bufsize)
__attribute__((nonnull(1,2)));
static char *ipp_lang_code(const char *locale, char *buffer,
size_t bufsize)
__attribute__((nonnull(1,2)));
static char *ipp_get_code(const char *locale, char *buffer, size_t bufsize) _CUPS_NONNULL(1,2);
static char *ipp_lang_code(const char *locale, char *buffer, size_t bufsize) _CUPS_NONNULL(1,2);
static size_t ipp_length(ipp_t *ipp, int collection);
static ssize_t ipp_read_http(http_t *http, ipp_uchar_t *buffer,
size_t length);
@@ -1478,6 +1475,7 @@ ippCopyAttribute(
int quickcopy) /* I - 1 for a referenced copy, 0 for normal */
{
int i; /* Looping var */
ipp_tag_t srctag; /* Source value tag */
ipp_attribute_t *dstattr; /* Destination attribute */
_ipp_value_t *srcval, /* Source value */
*dstval; /* Destination value */
@@ -1496,9 +1494,10 @@ ippCopyAttribute(
* Copy it...
*/
quickcopy = quickcopy ? IPP_TAG_CUPS_CONST : 0;
quickcopy = (quickcopy && (srcattr->value_tag & IPP_TAG_CUPS_CONST)) ? IPP_TAG_CUPS_CONST : 0;
srctag = srcattr->value_tag & IPP_TAG_CUPS_MASK;
switch (srcattr->value_tag & ~IPP_TAG_CUPS_CONST)
switch (srctag)
{
case IPP_TAG_ZERO :
dstattr = ippAddSeparator(dst);
@@ -1511,139 +1510,70 @@ ippCopyAttribute(
case IPP_TAG_NOTSETTABLE :
case IPP_TAG_DELETEATTR :
case IPP_TAG_ADMINDEFINE :
dstattr = ippAddOutOfBand(dst, srcattr->group_tag, srcattr->value_tag & ~IPP_TAG_CUPS_CONST, srcattr->name);
dstattr = ippAddOutOfBand(dst, srcattr->group_tag, srctag, srcattr->name);
break;
case IPP_TAG_INTEGER :
case IPP_TAG_ENUM :
dstattr = ippAddIntegers(dst, srcattr->group_tag, srcattr->value_tag,
srcattr->name, srcattr->num_values, NULL);
if (!dstattr)
break;
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
dstval->integer = srcval->integer;
break;
case IPP_TAG_BOOLEAN :
dstattr = ippAddBooleans(dst, srcattr->group_tag, srcattr->name,
srcattr->num_values, NULL);
if (!dstattr)
break;
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
dstval->boolean = srcval->boolean;
case IPP_TAG_DATE :
case IPP_TAG_RESOLUTION :
case IPP_TAG_RANGE :
if ((dstattr = ipp_add_attr(dst, srcattr->name, srcattr->group_tag, srctag, srcattr->num_values)) != NULL)
memcpy(dstattr->values, srcattr->values, (size_t)srcattr->num_values * sizeof(_ipp_value_t));
break;
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
case IPP_TAG_RESERVED_STRING :
case IPP_TAG_KEYWORD :
case IPP_TAG_URI :
case IPP_TAG_URISCHEME :
case IPP_TAG_CHARSET :
case IPP_TAG_LANGUAGE :
case IPP_TAG_MIMETYPE :
dstattr = ippAddStrings(dst, srcattr->group_tag,
(ipp_tag_t)(srcattr->value_tag | quickcopy),
srcattr->name, srcattr->num_values, NULL, NULL);
if (!dstattr)
if ((dstattr = ippAddStrings(dst, srcattr->group_tag, (ipp_tag_t)(srctag | quickcopy), srcattr->name, srcattr->num_values, NULL, NULL)) == NULL)
break;
if (quickcopy)
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
dstval->string.text = srcval->string.text;
/*
* Can safely quick-copy these string values...
*/
memcpy(dstattr->values, srcattr->values, (size_t)srcattr->num_values * sizeof(_ipp_value_t));
}
else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
dstval->string.text = _cupsStrAlloc(srcval->string.text);
}
else
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
dstval->string.text = _cupsStrRetain(srcval->string.text);
}
break;
/*
* Otherwise do a normal reference counted copy...
*/
case IPP_TAG_DATE :
if (srcattr->num_values != 1)
return (NULL);
dstattr = ippAddDate(dst, srcattr->group_tag, srcattr->name,
srcattr->values[0].date);
break;
case IPP_TAG_RESOLUTION :
dstattr = ippAddResolutions(dst, srcattr->group_tag, srcattr->name,
srcattr->num_values, IPP_RES_PER_INCH,
NULL, NULL);
if (!dstattr)
break;
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
{
dstval->resolution.xres = srcval->resolution.xres;
dstval->resolution.yres = srcval->resolution.yres;
dstval->resolution.units = srcval->resolution.units;
}
break;
case IPP_TAG_RANGE :
dstattr = ippAddRanges(dst, srcattr->group_tag, srcattr->name,
srcattr->num_values, NULL, NULL);
if (!dstattr)
break;
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
{
dstval->range.lower = srcval->range.lower;
dstval->range.upper = srcval->range.upper;
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
dstval->string.text = _cupsStrAlloc(srcval->string.text);
}
break;
case IPP_TAG_TEXTLANG :
case IPP_TAG_NAMELANG :
dstattr = ippAddStrings(dst, srcattr->group_tag,
(ipp_tag_t)(srcattr->value_tag | quickcopy),
srcattr->name, srcattr->num_values, NULL, NULL);
if (!dstattr)
if ((dstattr = ippAddStrings(dst, srcattr->group_tag, (ipp_tag_t)(srctag | quickcopy), srcattr->name, srcattr->num_values, NULL, NULL)) == NULL)
break;
if (quickcopy)
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
{
dstval->string.language = srcval->string.language;
dstval->string.text = srcval->string.text;
}
/*
* Can safely quick-copy these string values...
*/
memcpy(dstattr->values, srcattr->values, (size_t)srcattr->num_values * sizeof(_ipp_value_t));
}
else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
/*
* Otherwise do a normal reference counted copy...
*/
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
{
if (srcval == srcattr->values)
dstval->string.language = _cupsStrAlloc(srcval->string.language);
@@ -1653,32 +1583,13 @@ ippCopyAttribute(
dstval->string.text = _cupsStrAlloc(srcval->string.text);
}
}
else
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
{
if (srcval == srcattr->values)
dstval->string.language = _cupsStrRetain(srcval->string.language);
else
dstval->string.language = dstattr->values[0].string.language;
dstval->string.text = _cupsStrRetain(srcval->string.text);
}
}
break;
case IPP_TAG_BEGIN_COLLECTION :
dstattr = ippAddCollections(dst, srcattr->group_tag, srcattr->name,
srcattr->num_values, NULL);
if (!dstattr)
if ((dstattr = ippAddCollections(dst, srcattr->group_tag, srcattr->name, srcattr->num_values, NULL)) == NULL)
break;
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
{
dstval->collection = srcval->collection;
srcval->collection->use ++;
@@ -1687,15 +1598,10 @@ ippCopyAttribute(
case IPP_TAG_STRING :
default :
/* TODO: Implement quick copy for unknown/octetString values */
dstattr = ippAddIntegers(dst, srcattr->group_tag, srcattr->value_tag,
srcattr->name, srcattr->num_values, NULL);
if (!dstattr)
if ((dstattr = ipp_add_attr(dst, srcattr->name, srcattr->group_tag, srctag, srcattr->num_values)) == NULL)
break;
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
i > 0;
i --, srcval ++, dstval ++)
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
{
dstval->unknown.length = srcval->unknown.length;
@@ -3084,6 +2990,13 @@ ippReadIO(void *src, /* I - Data source */
ipp->state = IPP_STATE_DATA;
break;
}
else if (tag == IPP_TAG_ZERO || (tag == IPP_TAG_OPERATION && ipp->curtag != IPP_TAG_ZERO))
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid group tag."), 1);
DEBUG_printf(("1ippReadIO: bad tag 0x%02x.", tag));
_cupsBufferRelease((char *)buffer);
return (IPP_STATE_ERROR);
}
else if (tag < IPP_TAG_UNSUPPORTED_VALUE)
{
/*
@@ -3381,7 +3294,10 @@ ippReadIO(void *src, /* I - Data source */
value->boolean = (char)buffer[0];
break;
case IPP_TAG_NOVALUE :
case IPP_TAG_UNSUPPORTED_VALUE :
case IPP_TAG_DEFAULT :
case IPP_TAG_UNKNOWN :
case IPP_TAG_NOVALUE :
case IPP_TAG_NOTSETTABLE :
case IPP_TAG_DELETEATTR :
case IPP_TAG_ADMINDEFINE :
@@ -3401,6 +3317,7 @@ ippReadIO(void *src, /* I - Data source */
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
case IPP_TAG_RESERVED_STRING :
case IPP_TAG_KEYWORD :
case IPP_TAG_URI :
case IPP_TAG_URISCHEME :
@@ -3655,6 +3572,7 @@ ippReadIO(void *src, /* I - Data source */
DEBUG_printf(("2ippReadIO: member name=\"%s\"", attr->name));
break;
case IPP_TAG_STRING :
default : /* Other unsupported values */
if (tag == IPP_TAG_STRING && n > IPP_MAX_LENGTH)
{
@@ -4316,7 +4234,7 @@ ippSetString(ipp_t *ipp, /* I - IPP message */
if (!ipp || !attr || !*attr ||
(value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG &&
value_tag != IPP_TAG_NAMELANG) || value_tag > IPP_TAG_MIMETYPE ||
!strvalue)
element < 0 || element > (*attr)->num_values || !strvalue)
return (0);
/*
@@ -5022,16 +4940,19 @@ ippValidateAttribute(
break;
}
if (*ptr < ' ' || *ptr == 0x7f)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
return (0);
}
else if (*ptr)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
return (0);
}
if (*ptr)
{
if (*ptr < ' ' || *ptr == 0x7f)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
return (0);
}
else
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
return (0);
}
}
if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
{
@@ -5080,16 +5001,19 @@ ippValidateAttribute(
break;
}
if (*ptr < ' ' || *ptr == 0x7f)
if (*ptr)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
return (0);
}
else if (*ptr)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
return (0);
}
if (*ptr < ' ' || *ptr == 0x7f)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
return (0);
}
else
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
return (0);
}
}
if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
{
@@ -6376,6 +6300,7 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
}
break;
case IPP_TAG_UNSUPPORTED_VALUE :
case IPP_TAG_DEFAULT :
case IPP_TAG_UNKNOWN :
case IPP_TAG_NOVALUE :
@@ -6717,14 +6642,14 @@ ipp_read_http(http_t *http, /* I - Client connection */
if ((bytes = httpRead2(http, (char *)buffer, length - (size_t)tbytes)) < 0)
{
#ifdef WIN32
#ifdef _WIN32
break;
#else
if (errno != EAGAIN && errno != EINTR)
break;
bytes = 0;
#endif /* WIN32 */
#endif /* _WIN32 */
}
else if (bytes == 0)
break;
@@ -6752,11 +6677,11 @@ ipp_read_file(int *fd, /* I - File descriptor */
ipp_uchar_t *buffer, /* O - Read buffer */
size_t length) /* I - Number of bytes to read */
{
#ifdef WIN32
#ifdef _WIN32
return ((ssize_t)read(*fd, buffer, (unsigned)length));
#else
return (read(*fd, buffer, length));
#endif /* WIN32 */
#endif /* _WIN32 */
}
@@ -6855,7 +6780,9 @@ ipp_set_value(ipp_t *ipp, /* IO - IPP message */
* Reset pointers in the list...
*/
#ifndef __clang_analyzer__
DEBUG_printf(("4debug_free: %p %s", (void *)*attr, temp->name));
#endif /* !__clang_analyzer__ */
DEBUG_printf(("4debug_alloc: %p %s %s%s (%d)", (void *)temp, temp->name, temp->num_values > 1 ? "1setOf " : "", ippTagString(temp->value_tag), temp->num_values));
if (ipp->current == *attr && ipp->prev)
@@ -6924,9 +6851,9 @@ ipp_write_file(int *fd, /* I - File descriptor */
ipp_uchar_t *buffer, /* I - Data to write */
size_t length) /* I - Number of bytes to write */
{
#ifdef WIN32
#ifdef _WIN32
return ((ssize_t)write(*fd, buffer, (unsigned)length));
#else
return (write(*fd, buffer, length));
#endif /* WIN32 */
#endif /* _WIN32 */
}
+24 -24
Ver Arquivo
@@ -746,52 +746,52 @@ typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr);
*/
extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group,
const char *name, char value);
const char *name, char value) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group,
const char *name, int num_values,
const char *values);
const char *values) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group,
const char *name, const ipp_uchar_t *value);
const char *name, const ipp_uchar_t *value) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group,
ipp_tag_t value_tag, const char *name,
int value);
int value) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group,
ipp_tag_t value_tag, const char *name,
int num_values, const int *values);
int num_values, const int *values) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group,
const char *name, int lower, int upper);
const char *name, int lower, int upper) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group,
const char *name, int num_values,
const int *lower, const int *upper);
const int *lower, const int *upper) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group,
const char *name, ipp_res_t units,
int xres, int yres);
int xres, int yres) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group,
const char *name, int num_values,
ipp_res_t units, const int *xres,
const int *yres);
extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp);
const int *yres) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group,
ipp_tag_t value_tag, const char *name,
const char *language, const char *value);
const char *language, const char *value) _CUPS_PUBLIC;
extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group,
ipp_tag_t value_tag, const char *name,
int num_values, const char *language,
const char * const *values);
extern time_t ippDateToTime(const ipp_uchar_t *date);
extern void ippDelete(ipp_t *ipp);
extern const char *ippErrorString(ipp_status_t error);
const char * const *values) _CUPS_PUBLIC;
extern time_t ippDateToTime(const ipp_uchar_t *date) _CUPS_PUBLIC;
extern void ippDelete(ipp_t *ipp) _CUPS_PUBLIC;
extern const char *ippErrorString(ipp_status_t error) _CUPS_PUBLIC;
extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name,
ipp_tag_t value_tag);
ipp_tag_t value_tag) _CUPS_PUBLIC;
extern ipp_attribute_t *ippFindNextAttribute(ipp_t *ipp, const char *name,
ipp_tag_t value_tag);
extern size_t ippLength(ipp_t *ipp);
extern ipp_t *ippNew(void);
extern ipp_state_t ippRead(http_t *http, ipp_t *ipp);
extern const ipp_uchar_t *ippTimeToDate(time_t t);
extern ipp_state_t ippWrite(http_t *http, ipp_t *ipp);
extern int ippPort(void);
extern void ippSetPort(int p);
ipp_tag_t value_tag) _CUPS_PUBLIC;
extern size_t ippLength(ipp_t *ipp) _CUPS_PUBLIC;
extern ipp_t *ippNew(void) _CUPS_PUBLIC;
extern ipp_state_t ippRead(http_t *http, ipp_t *ipp) _CUPS_PUBLIC;
extern const ipp_uchar_t *ippTimeToDate(time_t t) _CUPS_PUBLIC;
extern ipp_state_t ippWrite(http_t *http, ipp_t *ipp) _CUPS_PUBLIC;
extern int ippPort(void) _CUPS_PUBLIC;
extern void ippSetPort(int p) _CUPS_PUBLIC;
/**** New in CUPS 1.1.19 ****/
extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group,
+1
Ver Arquivo
@@ -12,6 +12,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
+20 -23
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Private localization support for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
#ifndef _CUPS_LANGUAGE_PRIVATE_H_
@@ -14,6 +15,7 @@
* Include necessary headers...
*/
# include "config.h"
# include <stdio.h>
# include <cups/transcode.h>
# ifdef __APPLE__
@@ -57,27 +59,22 @@ typedef struct _cups_message_s /**** Message catalog entry ****/
*/
# ifdef __APPLE__
extern const char *_cupsAppleLanguage(const char *locale, char *language, size_t langsize);
extern const char *_cupsAppleLocale(CFStringRef languageName, char *locale, size_t localesize);
extern const char *_cupsAppleLanguage(const char *locale, char *language, size_t langsize) _CUPS_PRIVATE;
extern const char *_cupsAppleLocale(CFStringRef languageName, char *locale, size_t localesize) _CUPS_PRIVATE;
# endif /* __APPLE__ */
extern void _cupsCharmapFlush(void);
extern const char *_cupsEncodingName(cups_encoding_t encoding);
extern void _cupsLangPrintError(const char *prefix,
const char *message);
extern int _cupsLangPrintFilter(FILE *fp, const char *prefix,
const char *message, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern int _cupsLangPrintf(FILE *fp, const char *message, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int _cupsLangPuts(FILE *fp, const char *message);
extern const char *_cupsLangString(cups_lang_t *lang,
const char *message);
extern void _cupsMessageFree(cups_array_t *a);
extern cups_array_t *_cupsMessageLoad(const char *filename, int flags);
extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
extern cups_array_t *_cupsMessageNew(void *context);
extern int _cupsMessageSave(const char *filename, int flags, cups_array_t *a);
extern void _cupsSetLocale(char *argv[]);
extern void _cupsCharmapFlush(void) _CUPS_INTERNAL;
extern const char *_cupsEncodingName(cups_encoding_t encoding) _CUPS_PRIVATE;
extern void _cupsLangPrintError(const char *prefix, const char *message) _CUPS_PRIVATE;
extern int _cupsLangPrintFilter(FILE *fp, const char *prefix, const char *message, ...) _CUPS_FORMAT(3, 4) _CUPS_PRIVATE;
extern int _cupsLangPrintf(FILE *fp, const char *message, ...) _CUPS_FORMAT(2, 3) _CUPS_PRIVATE;
extern int _cupsLangPuts(FILE *fp, const char *message) _CUPS_PRIVATE;
extern const char *_cupsLangString(cups_lang_t *lang, const char *message) _CUPS_PRIVATE;
extern void _cupsMessageFree(cups_array_t *a) _CUPS_PRIVATE;
extern cups_array_t *_cupsMessageLoad(const char *filename, int flags) _CUPS_PRIVATE;
extern const char *_cupsMessageLookup(cups_array_t *a, const char *m) _CUPS_PRIVATE;
extern cups_array_t *_cupsMessageNew(void *context) _CUPS_PRIVATE;
extern int _cupsMessageSave(const char *filename, int flags, cups_array_t *a) _CUPS_PRIVATE;
extern void _cupsSetLocale(char *argv[]) _CUPS_PRIVATE;
# ifdef __cplusplus
+3 -2
Ver Arquivo
@@ -12,14 +12,15 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#ifdef HAVE_LANGINFO_H
# include <langinfo.h>
#endif /* HAVE_LANGINFO_H */
#ifdef WIN32
#ifdef _WIN32
# include <io.h>
#else
# include <unistd.h>
#endif /* WIN32 */
#endif /* _WIN32 */
#ifdef HAVE_COREFOUNDATION_H
# include <CoreFoundation/CoreFoundation.h>
#endif /* HAVE_COREFOUNDATION_H */
+5 -5
Ver Arquivo
@@ -90,11 +90,11 @@ typedef struct cups_lang_s /**** Language Cache Structure ****/
* Prototypes...
*/
extern cups_lang_t *cupsLangDefault(void);
extern const char *cupsLangEncoding(cups_lang_t *lang);
extern void cupsLangFlush(void);
extern void cupsLangFree(cups_lang_t *lang);
extern cups_lang_t *cupsLangGet(const char *language);
extern cups_lang_t *cupsLangDefault(void) _CUPS_PUBLIC;
extern const char *cupsLangEncoding(cups_lang_t *lang) _CUPS_PUBLIC;
extern void cupsLangFlush(void) _CUPS_PUBLIC;
extern void cupsLangFree(cups_lang_t *lang) _CUPS_PUBLIC;
extern cups_lang_t *cupsLangGet(const char *language) _CUPS_PUBLIC;
# ifdef __cplusplus
}
+12 -12
Ver Arquivo
@@ -14,6 +14,7 @@ _cupsConvertOptions
_cupsCreateDest
_cupsEncodeOption
_cupsEncodingName
_cupsFilePeekAhead
_cupsGet1284Values
_cupsGetDestResource
_cupsGetDests
@@ -40,19 +41,17 @@ _cupsRWLockWrite
_cupsRWUnlock
_cupsRasterAddError
_cupsRasterClearError
_cupsRasterColorSpaceString
_cupsRasterDelete
_cupsRasterErrorString
_cupsRasterExecPS
_cupsSNMPClose
_cupsSNMPCopyOID
_cupsSNMPDefaultCommunity
_cupsSNMPIsOID
_cupsSNMPIsOIDPrefixed
_cupsSNMPOIDToString
_cupsSNMPOpen
_cupsSNMPRead
_cupsSNMPSetDebug
_cupsSNMPStringToOID
_cupsSNMPWalk
_cupsSNMPWrite
_cupsRasterInitPWGHeader
_cupsRasterInterpretPPD
_cupsRasterNew
_cupsRasterReadHeader
_cupsRasterReadPixels
_cupsRasterWriteHeader
_cupsRasterWritePixels
_cupsSetDefaults
_cupsSetError
_cupsSetHTTPError
@@ -84,6 +83,7 @@ _httpDisconnect
_httpEncodeURI
_httpFreeCredentials
_httpResolveURI
_httpSetDigestAuthString
_httpStatus
_httpTLSInitialize
_httpTLSPending
+8 -6
Ver Arquivo
@@ -44,8 +44,10 @@
1999-05-03 lpd Original version.
*/
#ifndef _CUPS_MD5_PRIVATE_H_
# define _CUPS_MD5_PRIVATE_H_
#ifndef _CUPS_MD5_INTERNAL_H_
# define _CUPS_MD5_INTERNAL_H_
# include <cups/versioning.h>
/* Define the state of the MD5 Algorithm. */
typedef struct _cups_md5_state_s {
@@ -59,15 +61,15 @@ extern "C" {
# endif /* __cplusplus */
/* Initialize the algorithm. */
void _cupsMD5Init(_cups_md5_state_t *pms);
void _cupsMD5Init(_cups_md5_state_t *pms) _CUPS_INTERNAL;
/* Append a string to the message. */
void _cupsMD5Append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes);
void _cupsMD5Append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes) _CUPS_INTERNAL;
/* Finish the message and return the digest. */
void _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16]);
void _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16]) _CUPS_INTERNAL;
# ifdef __cplusplus
} /* end extern "C" */
# endif /* __cplusplus */
#endif /* !_CUPS_MD5_PRIVATE_H_ */
#endif /* !_CUPS_MD5_INTERNAL_H_ */
+1 -1
Ver Arquivo
@@ -40,7 +40,7 @@
1999-05-03 lpd Original version.
*/
#include "md5-private.h"
#include "md5-internal.h"
#include "string-private.h"
#if !defined(__APPLE__) && !defined(HAVE_GNUTLS)
+1
Ver Arquivo
@@ -12,6 +12,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
+1
Ver Arquivo
@@ -12,6 +12,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
+1
Ver Arquivo
@@ -14,6 +14,7 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
/*
+167 -93
Ver Arquivo
@@ -13,6 +13,7 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
#include <math.h>
@@ -291,11 +292,11 @@ _cupsConvertOptions(
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, keyword);
else if (pc->sides_option && (choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL)
{
if (!_cups_strcasecmp(choice->choice, pc->sides_1sided))
if (pc->sides_1sided && !_cups_strcasecmp(choice->choice, pc->sides_1sided))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "one-sided");
else if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_long))
else if (pc->sides_2sided_long && !_cups_strcasecmp(choice->choice, pc->sides_2sided_long))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "two-sided-long-edge");
if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_short))
else if (pc->sides_2sided_short && !_cups_strcasecmp(choice->choice, pc->sides_2sided_short))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", NULL, "two-sided-short-edge");
}
@@ -367,7 +368,7 @@ _cupsConvertOptions(
if ((finishing_template = cupsGetOption("cupsFinishingTemplate", num_options, options)) == NULL)
finishing_template = cupsGetOption("finishing-template", num_options, options);
if (finishing_template)
if (finishing_template && strcmp(finishing_template, "none"))
{
ipp_t *fin_col = ippNew(); /* finishings-col value */
@@ -3135,8 +3136,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
cupsFilePrintf(fp, "*Manufacturer: \"%s\"\n", make);
cupsFilePrintf(fp, "*ModelName: \"%s\"\n", model);
cupsFilePrintf(fp, "*Product: \"(%s)\"\n", model);
cupsFilePrintf(fp, "*NickName: \"%s\"\n", model);
cupsFilePrintf(fp, "*ShortNickName: \"%s\"\n", model);
cupsFilePrintf(fp, "*NickName: \"%s - IPP Everywhere\"\n", model);
cupsFilePrintf(fp, "*ShortNickName: \"%s - IPP Everywhere\"\n", model);
if ((attr = ippFindAttribute(response, "color-supported", IPP_TAG_BOOLEAN)) != NULL && ippGetBoolean(attr, 0))
cupsFilePuts(fp, "*ColorDevice: True\n");
@@ -3184,22 +3185,22 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
/* Type of password */
if (maxlen > (int)(sizeof(pattern) - 1))
maxlen = sizeof(pattern) - 1;
maxlen = (int)sizeof(pattern) - 1;
if (!repertoire || !strcmp(repertoire, "iana_us-ascii_digits"))
memset(pattern, '1', maxlen);
memset(pattern, '1', (size_t)maxlen);
else if (!strcmp(repertoire, "iana_us-ascii_letters"))
memset(pattern, 'A', maxlen);
memset(pattern, 'A', (size_t)maxlen);
else if (!strcmp(repertoire, "iana_us-ascii_complex"))
memset(pattern, 'C', maxlen);
memset(pattern, 'C', (size_t)maxlen);
else if (!strcmp(repertoire, "iana_us-ascii_any"))
memset(pattern, '.', maxlen);
memset(pattern, '.', (size_t)maxlen);
else if (!strcmp(repertoire, "iana_utf-8_digits"))
memset(pattern, 'N', maxlen);
memset(pattern, 'N', (size_t)maxlen);
else if (!strcmp(repertoire, "iana_utf-8_letters"))
memset(pattern, 'U', maxlen);
memset(pattern, 'U', (size_t)maxlen);
else
memset(pattern, '*', maxlen);
memset(pattern, '*', (size_t)maxlen);
pattern[maxlen] = '\0';
@@ -3221,7 +3222,19 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if (ippContainsString(attr, "image/png"))
cupsFilePuts(fp, "*cupsFilter2: \"image/png image/png 0 -\"\n");
if (is_pdf)
cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
{
/*
* Don't locally filter PDF content when printing to a CUPS shared
* printer, otherwise the options will be applied twice...
*/
if (ippContainsString(attr, "application/vnd.cups-pdf"))
cupsFilePuts(fp, "*cupsFilter2: \"application/pdf application/pdf 0 -\"\n");
else
cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n");
}
else
cupsFilePuts(fp, "*cupsManualCopies: true\n");
if (is_apple)
cupsFilePuts(fp, "*cupsFilter2: \"image/urf image/urf 100 -\"\n");
if (is_pwg)
@@ -3684,7 +3697,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if (!strcmp(sources[j], keyword))
{
snprintf(msgid, sizeof(msgid), "media-source.%s", keyword);
cupsFilePrintf(fp, "*InputSlot %s/%s: \"<</MediaPosition %d>>setpagedevice\"\n", ppdname, _cupsLangString(lang, msgid), j);
cupsFilePrintf(fp, "*InputSlot %s: \"<</MediaPosition %d>>setpagedevice\"\n", ppdname, j);
cupsFilePrintf(fp, "*%s.InputSlot %s/%s: \"\"\n", lang->language, ppdname, _cupsLangString(lang, msgid));
break;
}
}
@@ -3716,7 +3730,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
msgstr = keyword;
cupsFilePrintf(fp, "*MediaType %s/%s: \"<</MediaType(%s)>>setpagedevice\"\n", ppdname, msgstr, ppdname);
cupsFilePrintf(fp, "*MediaType %s: \"<</MediaType(%s)>>setpagedevice\"\n", ppdname, ppdname);
cupsFilePrintf(fp, "*%s.MediaType %s/%s: \"\"\n", lang->language, ppdname, msgstr);
}
cupsFilePuts(fp, "*CloseUI: *MediaType\n");
}
@@ -3739,102 +3754,102 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
{
keyword = ippGetString(attr, i, NULL);
#define PRINTF_COLORMODEL if (!wrote_color) { cupsFilePrintf(fp, "*OpenUI *ColorModel/%s: PickOne\n*OrderDependency: 10 AnySetup *ColorModel\n", _cupsLangString(lang, _("Color Mode"))); wrote_color = 1; }
#define PRINTF_COLOROPTION(name,text,cspace,bpp) cupsFilePrintf(fp, "*ColorModel %s/%s: \"<</cupsColorSpace %d/cupsBitsPerColor %d/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", name, _cupsLangString(lang, text), cspace, bpp)
#define PRINTF_COLORMODEL if (!wrote_color) { cupsFilePrintf(fp, "*OpenUI *ColorModel: PickOne\n*OrderDependency: 10 AnySetup *ColorModel\n*%s.Translation ColorModel/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Color Mode"))); wrote_color = 1; }
#define PRINTF_COLOROPTION(name,text,cspace,bpp) { cupsFilePrintf(fp, "*ColorModel %s: \"<</cupsColorSpace %d/cupsBitsPerColor %d/cupsColorOrder 0/cupsCompression 0>>setpagedevice\"\n", name, cspace, bpp); cupsFilePrintf(fp, "*%s.ColorModel %s/%s: \"\"\n", lang->language, name, _cupsLangString(lang, text)); }
if (!strcasecmp(keyword, "black_1") || !strcmp(keyword, "bi-level") || !strcmp(keyword, "process-bi-level"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("FastGray", _("Fast Grayscale"), CUPS_CSPACE_K, 1);
PRINTF_COLOROPTION("FastGray", _("Fast Grayscale"), CUPS_CSPACE_K, 1)
if (!default_color)
if (!default_color)
default_color = "FastGray";
}
else if (!strcasecmp(keyword, "sgray_8") || !strcmp(keyword, "W8") || !strcmp(keyword, "monochrome") || !strcmp(keyword, "process-monochrome"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("Gray", _("Grayscale"), CUPS_CSPACE_SW, 8);
PRINTF_COLOROPTION("Gray", _("Grayscale"), CUPS_CSPACE_SW, 8)
if (!default_color || !strcmp(default_color, "FastGray"))
if (!default_color || !strcmp(default_color, "FastGray"))
default_color = "Gray";
}
else if (!strcasecmp(keyword, "sgray_16") || !strcmp(keyword, "W8-16"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
if (!strcmp(keyword, "W8-16"))
{
PRINTF_COLOROPTION("Gray", _("Grayscale"), CUPS_CSPACE_SW, 8);
if (!strcmp(keyword, "W8-16"))
{
PRINTF_COLOROPTION("Gray", _("Grayscale"), CUPS_CSPACE_SW, 8)
if (!default_color || !strcmp(default_color, "FastGray"))
default_color = "Gray";
}
}
PRINTF_COLOROPTION("Gray16", _("Deep Gray"), CUPS_CSPACE_SW, 16);
PRINTF_COLOROPTION("Gray16", _("Deep Gray"), CUPS_CSPACE_SW, 16)
}
else if (!strcasecmp(keyword, "srgb_8") || !strncmp(keyword, "SRGB24", 7) || !strcmp(keyword, "color"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("RGB", _("Color"), CUPS_CSPACE_SRGB, 8);
PRINTF_COLOROPTION("RGB", _("Color"), CUPS_CSPACE_SRGB, 8)
default_color = "RGB";
}
else if (!strcasecmp(keyword, "adobe-rgb_16") || !strcmp(keyword, "ADOBERGB48") || !strcmp(keyword, "ADOBERGB24-48"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("AdobeRGB", _("Deep Color"), CUPS_CSPACE_ADOBERGB, 16);
PRINTF_COLOROPTION("AdobeRGB", _("Deep Color"), CUPS_CSPACE_ADOBERGB, 16)
if (!default_color)
if (!default_color)
default_color = "AdobeRGB";
}
else if ((!strcasecmp(keyword, "adobe-rgb_8") && !ippContainsString(attr, "adobe-rgb_16")) || !strcmp(keyword, "ADOBERGB24"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("AdobeRGB", _("Deep Color"), CUPS_CSPACE_ADOBERGB, 8);
PRINTF_COLOROPTION("AdobeRGB", _("Deep Color"), CUPS_CSPACE_ADOBERGB, 8)
if (!default_color)
if (!default_color)
default_color = "AdobeRGB";
}
else if ((!strcasecmp(keyword, "black_8") && !ippContainsString(attr, "black_16")) || !strcmp(keyword, "DEVW8"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceGray", _("Device Gray"), CUPS_CSPACE_W, 8);
PRINTF_COLOROPTION("DeviceGray", _("Device Gray"), CUPS_CSPACE_W, 8)
}
else if (!strcasecmp(keyword, "black_16") || !strcmp(keyword, "DEVW16") || !strcmp(keyword, "DEVW8-16"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceGray", _("Device Gray"), CUPS_CSPACE_W, 16);
PRINTF_COLOROPTION("DeviceGray", _("Device Gray"), CUPS_CSPACE_W, 16)
}
else if ((!strcasecmp(keyword, "cmyk_8") && !ippContainsString(attr, "cmyk_16")) || !strcmp(keyword, "DEVCMYK32"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("CMYK", _("Device CMYK"), CUPS_CSPACE_CMYK, 8);
PRINTF_COLOROPTION("CMYK", _("Device CMYK"), CUPS_CSPACE_CMYK, 8)
}
else if (!strcasecmp(keyword, "cmyk_16") || !strcmp(keyword, "DEVCMYK32-64") || !strcmp(keyword, "DEVCMYK64"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("CMYK", _("Device CMYK"), CUPS_CSPACE_CMYK, 16);
PRINTF_COLOROPTION("CMYK", _("Device CMYK"), CUPS_CSPACE_CMYK, 16)
}
else if ((!strcasecmp(keyword, "rgb_8") && ippContainsString(attr, "rgb_16")) || !strcmp(keyword, "DEVRGB24"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceRGB", _("Device RGB"), CUPS_CSPACE_RGB, 8);
PRINTF_COLOROPTION("DeviceRGB", _("Device RGB"), CUPS_CSPACE_RGB, 8)
}
else if (!strcasecmp(keyword, "rgb_16") || !strcmp(keyword, "DEVRGB24-48") || !strcmp(keyword, "DEVRGB48"))
{
PRINTF_COLORMODEL
PRINTF_COLORMODEL
PRINTF_COLOROPTION("DeviceRGB", _("Device RGB"), CUPS_CSPACE_RGB, 16);
PRINTF_COLOROPTION("DeviceRGB", _("Device RGB"), CUPS_CSPACE_RGB, 16)
}
}
@@ -3850,13 +3865,17 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((attr = ippFindAttribute(response, "sides-supported", IPP_TAG_KEYWORD)) != NULL && ippContainsString(attr, "two-sided-long-edge"))
{
cupsFilePrintf(fp, "*OpenUI *Duplex/%s: PickOne\n"
cupsFilePrintf(fp, "*OpenUI *Duplex: PickOne\n"
"*OrderDependency: 10 AnySetup *Duplex\n"
"*%s.Translation Duplex/%s: \"\"\n"
"*DefaultDuplex: None\n"
"*Duplex None/%s: \"<</Duplex false>>setpagedevice\"\n"
"*Duplex DuplexNoTumble/%s: \"<</Duplex true/Tumble false>>setpagedevice\"\n"
"*Duplex DuplexTumble/%s: \"<</Duplex true/Tumble true>>setpagedevice\"\n"
"*CloseUI: *Duplex\n", _cupsLangString(lang, _("2-Sided Printing")), _cupsLangString(lang, _("Off (1-Sided)")), _cupsLangString(lang, _("Long-Edge (Portrait)")), _cupsLangString(lang, _("Short-Edge (Landscape)")));
"*Duplex None: \"<</Duplex false>>setpagedevice\"\n"
"*%s.Duplex None/%s: \"\"\n"
"*Duplex DuplexNoTumble: \"<</Duplex true/Tumble false>>setpagedevice\"\n"
"*%s.Duplex DuplexNoTumble/%s: \"\"\n"
"*Duplex DuplexTumble: \"<</Duplex true/Tumble true>>setpagedevice\"\n"
"*%s.Duplex DuplexTumble/%s: \"\"\n"
"*CloseUI: *Duplex\n", lang->language, _cupsLangString(lang, _("2-Sided Printing")), lang->language, _cupsLangString(lang, _("Off (1-Sided)")), lang->language, _cupsLangString(lang, _("Long-Edge (Portrait)")), lang->language, _cupsLangString(lang, _("Short-Edge (Landscape)")));
if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL)
{
@@ -3913,9 +3932,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((attr = ippFindAttribute(response, "output-bin-supported", IPP_TAG_ZERO)) != NULL && (count = ippGetCount(attr)) > 1)
{
ipp_attribute_t *trays = ippFindAttribute(response, "printer-output-tray", IPP_TAG_STRING);
/* printer-output-tray attribute, if any */
const char *tray_ptr; /* printer-output-tray value */
int tray_len; /* Len of printer-output-tray value */
char tray[IPP_MAX_OCTETSTRING];
/* printer-output-tray string value */
cupsFilePrintf(fp, "*OpenUI *OutputBin: PickOne\n"
"*OrderDependency: 10 AnySetup *OutputBin\n"
"*DefaultOutputBin: %s\n", ppdname);
if (!strcmp(ppdname, "FaceUp"))
cupsFilePuts(fp, "*DefaultOutputOrder: Reverse\n");
else
cupsFilePuts(fp, "*DefaultOutputOrder: Normal\n");
for (i = 0; i < count; i ++)
{
keyword = ippGetString(attr, i, NULL);
@@ -3927,7 +3958,26 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
msgstr = keyword;
cupsFilePrintf(fp, "*OutputBin %s/%s: \"\"\n", ppdname, msgstr);
cupsFilePrintf(fp, "*OutputBin %s: \"\"\n", ppdname);
cupsFilePrintf(fp, "*%s.OutputBin %s/%s: \"\"\n", lang->language, ppdname, msgstr);
if ((tray_ptr = ippGetOctetString(trays, i, &tray_len)) != NULL)
{
if (tray_len >= (int)sizeof(tray))
tray_len = (int)sizeof(tray) - 1;
memcpy(tray, tray_ptr, (size_t)tray_len);
tray[tray_len] = '\0';
if (strstr(tray, "stackingorder=lastToFirst;"))
cupsFilePrintf(fp, "*PageStackOrder %s: Reverse\n", ppdname);
else
cupsFilePrintf(fp, "*PageStackOrder %s: Normal\n", ppdname);
}
else if (!strcmp(ppdname, "FaceUp"))
cupsFilePrintf(fp, "*PageStackOrder %s: Reverse\n", ppdname);
else
cupsFilePrintf(fp, "*PageStackOrder %s: Normal\n", ppdname);
}
cupsFilePuts(fp, "*CloseUI: *OutputBin\n");
}
@@ -3962,10 +4012,12 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
{
cupsArrayAdd(fin_options, "*StapleLocation");
cupsFilePrintf(fp, "*OpenUI *StapleLocation/%s: PickOne\n", _cupsLangString(lang, _("Staple")));
cupsFilePuts(fp, "*OpenUI *StapleLocation: PickOne\n");
cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *StapleLocation\n");
cupsFilePrintf(fp, "*%s.Translation StapleLocation/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Staple")));
cupsFilePuts(fp, "*DefaultStapleLocation: None\n");
cupsFilePrintf(fp, "*StapleLocation None/%s: \"\"\n", _cupsLangString(lang, _("None")));
cupsFilePuts(fp, "*StapleLocation None: \"\"\n");
cupsFilePrintf(fp, "*%s.StapleLocation None/%s: \"\"\n", lang->language, _cupsLangString(lang, _("None")));
for (; i < count; i ++)
{
@@ -3985,7 +4037,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
msgstr = keyword;
cupsFilePrintf(fp, "*StapleLocation %s/%s: \"\"\n", keyword, msgstr);
cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", keyword);
cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, keyword, msgstr);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, keyword);
}
@@ -4009,10 +4062,12 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
{
cupsArrayAdd(fin_options, "*FoldType");
cupsFilePrintf(fp, "*OpenUI *FoldType/%s: PickOne\n", _cupsLangString(lang, _("Fold")));
cupsFilePuts(fp, "*OpenUI *FoldType: PickOne\n");
cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *FoldType\n");
cupsFilePrintf(fp, "*%s.Translation FoldType/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Fold")));
cupsFilePuts(fp, "*DefaultFoldType: None\n");
cupsFilePrintf(fp, "*FoldType None/%s: \"\"\n", _cupsLangString(lang, _("None")));
cupsFilePuts(fp, "*FoldType None: \"\"\n");
cupsFilePrintf(fp, "*%s.FoldType None/%s: \"\"\n", lang->language, _cupsLangString(lang, _("None")));
for (; i < count; i ++)
{
@@ -4032,7 +4087,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
msgstr = keyword;
cupsFilePrintf(fp, "*FoldType %s/%s: \"\"\n", keyword, msgstr);
cupsFilePrintf(fp, "*FoldType %s: \"\"\n", keyword);
cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, keyword, msgstr);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, keyword);
}
@@ -4056,10 +4112,12 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
{
cupsArrayAdd(fin_options, "*PunchMedia");
cupsFilePrintf(fp, "*OpenUI *PunchMedia/%s: PickOne\n", _cupsLangString(lang, _("Punch")));
cupsFilePuts(fp, "*OpenUI *PunchMedia: PickOne\n");
cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *PunchMedia\n");
cupsFilePrintf(fp, "*%s.Translation PunchMedia/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Punch")));
cupsFilePuts(fp, "*DefaultPunchMedia: None\n");
cupsFilePrintf(fp, "*PunchMedia None/%s: \"\"\n", _cupsLangString(lang, _("None")));
cupsFilePuts(fp, "*PunchMedia None: \"\"\n");
cupsFilePrintf(fp, "*%s.PunchMedia None/%s: \"\"\n", lang->language, _cupsLangString(lang, _("None")));
for (i = 0; i < count; i ++)
{
@@ -4079,7 +4137,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
msgstr = keyword;
cupsFilePrintf(fp, "*PunchMedia %s/%s: \"\"\n", keyword, msgstr);
cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", keyword);
cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, keyword, msgstr);
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, keyword);
}
@@ -4094,8 +4153,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
{
cupsArrayAdd(fin_options, "*Booklet");
cupsFilePrintf(fp, "*OpenUI *Booklet/%s: Boolean\n", _cupsLangString(lang, _("Booklet")));
cupsFilePuts(fp, "*OpenUI *Booklet: Boolean\n");
cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *Booklet\n");
cupsFilePrintf(fp, "*%s.Translation Booklet/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Booklet")));
cupsFilePuts(fp, "*DefaultBooklet: False\n");
cupsFilePuts(fp, "*Booklet False: \"\"\n");
cupsFilePuts(fp, "*Booklet True: \"\"\n");
@@ -4112,10 +4172,12 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
ipp_attribute_t *finishing_attr; /* Current finishing member attribute */
cups_array_t *templates; /* Finishing templates */
cupsFilePrintf(fp, "*OpenUI *cupsFinishingTemplate/%s: PickOne\n", _cupsLangString(lang, _("Finishing Preset")));
cupsFilePuts(fp, "*OpenUI *cupsFinishingTemplate: PickOne\n");
cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *cupsFinishingTemplate\n");
cupsFilePrintf(fp, "*%s.Translation cupsFinishingTemplate/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Finishing Preset")));
cupsFilePuts(fp, "*DefaultcupsFinishingTemplate: none\n");
cupsFilePrintf(fp, "*cupsFinishingTemplate none/%s: \"\"\n", _cupsLangString(lang, _("None")));
cupsFilePuts(fp, "*cupsFinishingTemplate none: \"\"\n");
cupsFilePrintf(fp, "*%s.cupsFinishingTemplate none/%s: \"\"\n", lang->language, _cupsLangString(lang, _("None")));
templates = cupsArrayNew((cups_array_func_t)strcmp, NULL);
count = ippGetCount(attr);
@@ -4138,7 +4200,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
msgstr = keyword;
cupsFilePrintf(fp, "*cupsFinishingTemplate %s/%s: \"\n", keyword, msgstr);
cupsFilePrintf(fp, "*cupsFinishingTemplate %s: \"\n", keyword);
for (finishing_attr = ippFirstAttribute(finishing_col); finishing_attr; finishing_attr = ippNextAttribute(finishing_col))
{
if (ippGetValueTag(finishing_attr) == IPP_TAG_BEGIN_COLLECTION)
@@ -4151,6 +4213,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
}
}
cupsFilePuts(fp, "\"\n");
cupsFilePrintf(fp, "*%s.cupsFinishingTemplate %s/%s: \"\"\n", lang->language, keyword, msgstr);
cupsFilePuts(fp, "*End\n");
}
@@ -4218,16 +4281,19 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
cupsFilePrintf(fp, "*DefaultResolution: %ddpi\n", lowdpi);
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality/%s: PickOne\n"
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
"*DefaultcupsPrintQuality: Normal\n", _cupsLangString(lang, _("Print Quality")));
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality: PickOne\n"
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
"*%s.Translation cupsPrintQuality/%s: \"\"\n"
"*DefaultcupsPrintQuality: Normal\n", lang->language, _cupsLangString(lang, _("Print Quality")));
if ((lowdpi & 1) == 0)
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), lowdpi, lowdpi / 2);
cupsFilePrintf(fp, "*cupsPrintQuality Draft: \"<</HWResolution[%d %d]>>setpagedevice\"\n*%s.cupsPrintQuality Draft/%s: \"\"\n", lowdpi, lowdpi / 2, lang->language, _cupsLangString(lang, _("Draft")));
else if (ippContainsInteger(quality, IPP_QUALITY_DRAFT))
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), lowdpi, lowdpi);
cupsFilePrintf(fp, "*cupsPrintQuality Normal/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Normal")), lowdpi, lowdpi);
cupsFilePrintf(fp, "*cupsPrintQuality Draft: \"<</HWResolution[%d %d]>>setpagedevice\"\n*%s.cupsPrintQuality Draft/%s: \"\"\n", lowdpi, lowdpi, lang->language, _cupsLangString(lang, _("Draft")));
cupsFilePrintf(fp, "*cupsPrintQuality Normal: \"<</HWResolution[%d %d]>>setpagedevice\"\n*%s.cupsPrintQuality Normal/%s: \"\"\n", lowdpi, lowdpi, lang->language, _cupsLangString(lang, _("Normal")));
if (hidpi > lowdpi || ippContainsInteger(quality, IPP_QUALITY_HIGH))
cupsFilePrintf(fp, "*cupsPrintQuality High/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("High")), hidpi, hidpi);
cupsFilePrintf(fp, "*cupsPrintQuality High: \"<</HWResolution[%d %d]>>setpagedevice\"\n*%s.cupsPrintQuality High/%s: \"\"\n", hidpi, hidpi, lang->language, _cupsLangString(lang, _("High")));
cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
}
}
@@ -4277,20 +4343,26 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
pwg_ppdize_resolution(attr, resolutions[count / 2], &xres, &yres, ppdname, sizeof(ppdname));
cupsFilePrintf(fp, "*DefaultResolution: %s\n", ppdname);
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality/%s: PickOne\n"
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
"*DefaultcupsPrintQuality: Normal\n", _cupsLangString(lang, _("Print Quality")));
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality: PickOne\n"
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
"*%s.Translation cupsPrintQuality/%s: \"\"\n"
"*DefaultcupsPrintQuality: Normal\n", lang->language, _cupsLangString(lang, _("Print Quality")));
if (count > 2 || ippContainsInteger(quality, IPP_QUALITY_DRAFT))
{
pwg_ppdize_resolution(attr, resolutions[0], &xres, &yres, NULL, 0);
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), xres, yres);
cupsFilePrintf(fp, "*cupsPrintQuality Draft: \"<</HWResolution[%d %d]>>setpagedevice\"\n", xres, yres);
cupsFilePrintf(fp, "*%s.cupsPrintQuality Draft/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Draft")));
}
pwg_ppdize_resolution(attr, resolutions[count / 2], &xres, &yres, NULL, 0);
cupsFilePrintf(fp, "*cupsPrintQuality Normal/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Normal")), xres, yres);
cupsFilePrintf(fp, "*cupsPrintQuality Normal: \"<</HWResolution[%d %d]>>setpagedevice\"\n", xres, yres);
cupsFilePrintf(fp, "*%s.cupsPrintQuality Normal/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Normal")));
if (count > 1 || ippContainsInteger(quality, IPP_QUALITY_HIGH))
{
pwg_ppdize_resolution(attr, resolutions[count - 1], &xres, &yres, NULL, 0);
cupsFilePrintf(fp, "*cupsPrintQuality High/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("High")), xres, yres);
cupsFilePrintf(fp, "*cupsPrintQuality High: \"<</HWResolution[%d %d]>>setpagedevice\"\n", xres, yres);
cupsFilePrintf(fp, "*%s.cupsPrintQuality High/%s: \"\"\n", lang->language, _cupsLangString(lang, _("High")));
}
cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
@@ -4311,14 +4383,17 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
cupsFilePrintf(fp, "*DefaultResolution: %s\n", ppdname);
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality/%s: PickOne\n"
cupsFilePrintf(fp, "*OpenUI *cupsPrintQuality: PickOne\n"
"*OrderDependency: 10 AnySetup *cupsPrintQuality\n"
"*DefaultcupsPrintQuality: Normal\n", _cupsLangString(lang, _("Print Quality")));
"*%s.Translation cupsPrintQuality/%s: \"\"\n"
"*DefaultcupsPrintQuality: Normal\n", lang->language, _cupsLangString(lang, _("Print Quality")));
if (ippContainsInteger(quality, IPP_QUALITY_DRAFT))
cupsFilePrintf(fp, "*cupsPrintQuality Draft/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Draft")), xres, yres);
cupsFilePrintf(fp, "*cupsPrintQuality Normal/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("Normal")), xres, yres);
cupsFilePrintf(fp, "*cupsPrintQuality Draft: \"<</HWResolution[%d %d]>>setpagedevice\"\n*%s.cupsPrintQuality Draft/%s: \"\"\n", xres, yres, lang->language, _cupsLangString(lang, _("Draft")));
cupsFilePrintf(fp, "*cupsPrintQuality Normal: \"<</HWResolution[%d %d]>>setpagedevice\"\n*%s.cupsPrintQuality Normal/%s: \"\"\n", xres, yres, lang->language, _cupsLangString(lang, _("Normal")));
if (ippContainsInteger(quality, IPP_QUALITY_HIGH))
cupsFilePrintf(fp, "*cupsPrintQuality High/%s: \"<</HWResolution[%d %d]>>setpagedevice\"\n", _cupsLangString(lang, _("High")), xres, yres);
cupsFilePrintf(fp, "*cupsPrintQuality High: \"<</HWResolution[%d %d]>>setpagedevice\"\n*%s.cupsPrintQuality High/%s: \"\"\n", xres, yres, lang->language, _cupsLangString(lang, _("High")));
cupsFilePuts(fp, "*CloseUI: *cupsPrintQuality\n");
}
@@ -4342,11 +4417,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
if (!preset || !preset_name)
continue;
if ((localized_name = _cupsMessageLookup(strings, preset_name)) == preset_name)
cupsFilePrintf(fp, "*APPrinterPreset %s: \"\n", preset_name);
else
cupsFilePrintf(fp, "*APPrinterPreset %s/%s: \"\n", preset_name, localized_name);
cupsFilePrintf(fp, "*APPrinterPreset %s: \"\n", preset_name);
for (member = ippFirstAttribute(preset); member; member = ippNextAttribute(preset))
{
member_name = ippGetName(member);
@@ -4464,6 +4535,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
}
cupsFilePuts(fp, "\"\n*End\n");
if ((localized_name = _cupsMessageLookup(strings, preset_name)) != preset_name)
cupsFilePrintf(fp, "*%s.APPrinterPreset %s/%s: \"\"\n", lang->language, preset_name, localized_name);
}
}
+1
Ver Arquivo
@@ -16,6 +16,7 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
/*
+1
Ver Arquivo
@@ -16,6 +16,7 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
/*
+5 -4
Ver Arquivo
@@ -15,12 +15,13 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include "ppd.h"
#if defined(WIN32) || defined(__EMX__)
#if defined(_WIN32) || defined(__EMX__)
# include <io.h>
#else
# include <unistd.h>
#endif /* WIN32 || __EMX__ */
#endif /* _WIN32 || __EMX__ */
/*
@@ -323,11 +324,11 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
while (buflength > 0)
{
#ifdef WIN32
#ifdef _WIN32
if ((bytes = (ssize_t)write(fd, bufptr, (unsigned)buflength)) < 0)
#else
if ((bytes = write(fd, bufptr, buflength)) < 0)
#endif /* WIN32 */
#endif /* _WIN32 */
{
if (errno == EAGAIN || errno == EINTR)
continue;
+1
Ver Arquivo
@@ -16,6 +16,7 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
/*
+1
Ver Arquivo
@@ -16,6 +16,7 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
/*
+1 -1
Ver Arquivo
@@ -15,7 +15,7 @@
*/
#include "string-private.h"
#include "debug-private.h"
#include "debug-internal.h"
#include "ppd.h"
+33 -31
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* Private PPD definitions for CUPS.
*
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
@@ -155,59 +155,61 @@ struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
* Prototypes...
*/
extern int _cupsConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options);
extern int _cupsConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options) _CUPS_PRIVATE;
extern int _cupsRasterInterpretPPD(cups_page_header2_t *h, ppd_file_t *ppd, int num_options, cups_option_t *options, cups_interpret_cb_t func) _CUPS_PRIVATE;
extern _ppd_cache_t *_ppdCacheCreateWithFile(const char *filename,
ipp_t **attrs);
extern _ppd_cache_t *_ppdCacheCreateWithPPD(ppd_file_t *ppd);
extern void _ppdCacheDestroy(_ppd_cache_t *pc);
ipp_t **attrs) _CUPS_PRIVATE;
extern _ppd_cache_t *_ppdCacheCreateWithPPD(ppd_file_t *ppd) _CUPS_PRIVATE;
extern void _ppdCacheDestroy(_ppd_cache_t *pc) _CUPS_PRIVATE;
extern const char *_ppdCacheGetBin(_ppd_cache_t *pc,
const char *output_bin);
const char *output_bin) _CUPS_PRIVATE;
extern int _ppdCacheGetFinishingOptions(_ppd_cache_t *pc,
ipp_t *job,
ipp_finishings_t value,
int num_options,
cups_option_t **options);
extern int _ppdCacheGetFinishingValues(ppd_file_t *ppd, _ppd_cache_t *pc, int max_values, int *values);
cups_option_t **options) _CUPS_PRIVATE;
extern int _ppdCacheGetFinishingValues(ppd_file_t *ppd, _ppd_cache_t *pc, int max_values, int *values) _CUPS_PRIVATE;
extern const char *_ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
const char *keyword);
const char *keyword) _CUPS_PRIVATE;
extern const char *_ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
const char *keyword);
const char *keyword) _CUPS_PRIVATE;
extern const char *_ppdCacheGetOutputBin(_ppd_cache_t *pc,
const char *keyword);
const char *keyword) _CUPS_PRIVATE;
extern const char *_ppdCacheGetPageSize(_ppd_cache_t *pc, ipp_t *job,
const char *keyword, int *exact);
const char *keyword, int *exact) _CUPS_PRIVATE;
extern pwg_size_t *_ppdCacheGetSize(_ppd_cache_t *pc,
const char *page_size);
const char *page_size) _CUPS_PRIVATE;
extern const char *_ppdCacheGetSource(_ppd_cache_t *pc,
const char *input_slot);
const char *input_slot) _CUPS_PRIVATE;
extern const char *_ppdCacheGetType(_ppd_cache_t *pc,
const char *media_type);
const char *media_type) _CUPS_PRIVATE;
extern int _ppdCacheWriteFile(_ppd_cache_t *pc,
const char *filename, ipp_t *attrs);
extern char *_ppdCreateFromIPP(char *buffer, size_t bufsize, ipp_t *response);
extern void _ppdFreeLanguages(cups_array_t *languages);
extern cups_encoding_t _ppdGetEncoding(const char *name);
extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd);
extern _ppd_globals_t *_ppdGlobals(void);
extern unsigned _ppdHashName(const char *name);
const char *filename, ipp_t *attrs) _CUPS_PRIVATE;
extern char *_ppdCreateFromIPP(char *buffer, size_t bufsize, ipp_t *response) _CUPS_PRIVATE;
extern void _ppdFreeLanguages(cups_array_t *languages) _CUPS_PRIVATE;
extern cups_encoding_t _ppdGetEncoding(const char *name) _CUPS_PRIVATE;
extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd) _CUPS_PRIVATE;
extern _ppd_globals_t *_ppdGlobals(void) _CUPS_PRIVATE;
extern unsigned _ppdHashName(const char *name) _CUPS_PRIVATE;
extern ppd_attr_t *_ppdLocalizedAttr(ppd_file_t *ppd, const char *keyword,
const char *spec, const char *ll_CC);
const char *spec, const char *ll_CC) _CUPS_PRIVATE;
extern char *_ppdNormalizeMakeAndModel(const char *make_and_model,
char *buffer,
size_t bufsize);
size_t bufsize) _CUPS_PRIVATE;
extern ppd_file_t *_ppdOpen(cups_file_t *fp,
_ppd_localization_t localization);
_ppd_localization_t localization) _CUPS_PRIVATE;
extern ppd_file_t *_ppdOpenFile(const char *filename,
_ppd_localization_t localization);
_ppd_localization_t localization) _CUPS_PRIVATE;
extern int _ppdParseOptions(const char *s, int num_options,
cups_option_t **options,
_ppd_parse_t which);
_ppd_parse_t which) _CUPS_PRIVATE;
extern const char *_pwgInputSlotForSource(const char *media_source,
char *name, size_t namesize);
char *name, size_t namesize) _CUPS_PRIVATE;
extern const char *_pwgMediaTypeForType(const char *media_type,
char *name, size_t namesize);
char *name, size_t namesize) _CUPS_PRIVATE;
extern const char *_pwgPageSizeForMedia(pwg_media_t *media,
char *name, size_t namesize);
char *name, size_t namesize) _CUPS_PRIVATE;
/*
+5 -4
Ver Arquivo
@@ -14,13 +14,14 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
#include <fcntl.h>
#include <sys/stat.h>
#if defined(WIN32) || defined(__EMX__)
#if defined(_WIN32) || defined(__EMX__)
# include <io.h>
#else
# include <unistd.h>
#endif /* WIN32 || __EMX__ */
#endif /* _WIN32 || __EMX__ */
/*
@@ -169,7 +170,7 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
return (HTTP_STATUS_NOT_ACCEPTABLE);
}
#ifndef WIN32
#ifndef _WIN32
/*
* See if the PPD file is available locally...
*/
@@ -309,7 +310,7 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
}
}
}
#endif /* !WIN32 */
#endif /* !_WIN32 */
/*
* Try finding a printer URI for this printer...
+41 -7
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* PPD file routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -16,6 +16,7 @@
#include "cups-private.h"
#include "ppd-private.h"
#include "debug-internal.h"
/*
@@ -82,9 +83,9 @@ static ppd_group_t *ppd_get_group(ppd_file_t *ppd, const char *name,
cups_encoding_t encoding);
static ppd_option_t *ppd_get_option(ppd_group_t *group, const char *name);
static _ppd_globals_t *ppd_globals_alloc(void);
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static void ppd_globals_free(_ppd_globals_t *g);
#endif /* HAVE_PTHREAD_H || WIN32 */
#endif /* HAVE_PTHREAD_H || _WIN32 */
#ifdef HAVE_PTHREAD_H
static void ppd_globals_init(void);
#endif /* HAVE_PTHREAD_H */
@@ -321,7 +322,9 @@ ppdErrorString(ppd_status_t status) /* I - PPD status */
_("Bad custom parameter"),
_("Missing option keyword"),
_("Bad value string"),
_("Missing CloseGroup")
_("Missing CloseGroup"),
_("Bad CloseUI/JCLCloseUI"),
_("Missing CloseUI/JCLCloseUI")
};
@@ -1530,8 +1533,29 @@ _ppdOpen(
choice->code = _cupsStrRetain(custom_attr->value);
}
}
else if (!strcmp(keyword, "CloseUI") || !strcmp(keyword, "JCLCloseUI"))
else if (!strcmp(keyword, "CloseUI"))
{
if ((!option || option->section == PPD_ORDER_JCL) && pg->ppd_conform == PPD_CONFORM_STRICT)
{
pg->ppd_status = PPD_BAD_CLOSE_UI;
goto error;
}
option = NULL;
_cupsStrFree(string);
string = NULL;
}
else if (!strcmp(keyword, "JCLCloseUI"))
{
if ((!option || option->section != PPD_ORDER_JCL) && pg->ppd_conform == PPD_CONFORM_STRICT)
{
pg->ppd_status = PPD_BAD_CLOSE_UI;
goto error;
}
option = NULL;
_cupsStrFree(string);
@@ -1994,6 +2018,16 @@ _ppdOpen(
_cupsStrFree(string);
}
/*
* Check for a missing CloseUI/JCLCloseUI...
*/
if (option && pg->ppd_conform == PPD_CONFORM_STRICT)
{
pg->ppd_status = PPD_MISSING_CLOSE_UI;
goto error;
}
/*
* Check for a missing CloseGroup...
*/
@@ -2792,13 +2826,13 @@ ppd_globals_alloc(void)
* 'ppd_globals_free()' - Free global data.
*/
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
static void
ppd_globals_free(_ppd_globals_t *pg) /* I - Pointer to global data */
{
free(pg);
}
#endif /* HAVE_PTHREAD_H || WIN32 */
#endif /* HAVE_PTHREAD_H || _WIN32 */
#ifdef HAVE_PTHREAD_H
+16
Ver Arquivo
@@ -56,6 +56,20 @@ extern "C" {
* Types and structures...
*/
typedef int (*cups_interpret_cb_t)(cups_page_header2_t *header, int preferred_bits);
/**** cupsRasterInterpretPPD callback function
*
* This function is called by
* @link cupsRasterInterpretPPD@ to
* validate (and update, as needed)
* the page header attributes. The
* "preferred_bits" argument provides
* the value of the
* @code cupsPreferredBitsPerColor@
* key from the PostScript page device
* dictionary and is 0 if undefined.
****/
typedef enum ppd_ui_e /**** UI Types @deprecated@ ****/
{
PPD_UI_BOOLEAN, /* True or False option */
@@ -109,6 +123,8 @@ typedef enum ppd_status_e /**** Status Codes @deprecated@ ****/
PPD_MISSING_OPTION_KEYWORD, /* Missing option keyword */
PPD_BAD_VALUE, /* Bad value string */
PPD_MISSING_CLOSE_GROUP, /* Missing CloseGroup */
PPD_BAD_CLOSE_UI, /* Bad CloseUI/JCLCloseUI */
PPD_MISSING_CLOSE_UI, /* Missing CloseUI/JCLCloseUI */
PPD_MAX_STATUS /* @private@ */
} ppd_status_t;

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais