Comparar commits

...

581 Commits

Autor SHA1 Mensagem Data
steve algernon 82e3ee0e32 Update version to 2.3.3 for:
CVE-2020-3898 - cups/ppd.c, ppdc/ppdc-source.cxx
CVE-2019-8842 - cups/ipp.c: ippReadIO

And build issues due to warnings.
2020-04-27 11:04:29 -07:00
Michael R Sweet 1f2a315c2b Update more IPP strings. 2019-12-18 20:19:20 -05:00
Michael R Sweet 9183329049 Update more IPP strings. 2019-12-18 20:01:36 -05:00
Michael R Sweet 2ed9e648a7 Update more IPP strings. 2019-12-18 19:53:45 -05:00
Michael R Sweet 7a672d0bdc Update more IPP strings. 2019-12-18 19:47:31 -05:00
Michael R Sweet d42bc1c4f9 Bump version. 2019-12-18 18:06:01 -05:00
Michael R Sweet 9c2b03c1f7 Update localization files. 2019-12-18 18:05:19 -05:00
Michael R Sweet 40a6b95e55 Add build/test script. 2019-12-18 17:02:42 -05:00
Michael R Sweet ed181c24e4 Bump versions. 2019-12-13 09:44:10 -05:00
Michael R Sweet dbdf8a2a45 Fix some new compiler warnings (Issue #5700) 2019-12-13 09:38:13 -05:00
Michael R Sweet b018978c27 CVE-2019-2228: Fix ippSetValueTag validation of default language. 2019-12-13 09:27:14 -05:00
Michael R Sweet bb640280b6 Changelog. 2019-12-04 13:44:15 -05:00
Michael R Sweet 0f98a48497 Merge pull request #5695 from IslandCow/vendor_finishings
Off by one error in ipp_finishings_vendor
2019-12-04 13:43:28 -05:00
Sean Kau a00d9eaecf Off by one error in ipp_finishings_vendor
When enumvalue is 101 and attrname is "finsishings-supported"
we were getting the memory after ipp_finishings_vendor
in the ipp_job_collation_types array.
2019-12-04 10:35:33 -08:00
Michael R Sweet f937322154 Changelog. 2019-12-04 12:00:14 -05:00
Michael R Sweet 2cfb7357e2 Merge pull request #5694 from gaaf/patch-1
Fix error in jobs template
2019-12-04 11:49:25 -05:00
Michael R Sweet 71023b1700 Update default PAM service (cups instead of other) 2019-12-02 21:27:47 -05:00
Michael R Sweet 5d2ac21a00 Clean up authentication support. 2019-12-02 21:26:04 -05:00
Michael R Sweet 81d8eb3af3 Also authenticate web IF. 2019-12-02 16:47:22 -05:00
Michael R Sweet b4f9e3f7ba Update HTML version of man page. 2019-12-02 16:40:48 -05:00
Michael R Sweet 7a2be9facf Limit DNS-SD advertisements to the loopback interface for "localhost" and
support "off" for subtypes to turn off advertisements (Issue #5666)
2019-12-02 16:39:48 -05:00
Michael R Sweet 5ea07c61ba Add authentication support to ippeveprinter (Issue #5665) 2019-12-02 16:24:39 -05:00
Michael R Sweet e8378539e0 Fix compiler warnings. 2019-12-02 14:29:18 -05:00
Michael R Sweet 9240cd70a2 Use pwgMediaForSize when looking up PPD sizes (Issue #5633) 2019-12-02 14:28:09 -05:00
Michael R Sweet e90a53ab8d Changelog. 2019-12-02 10:37:50 -05:00
Michael R Sweet e6330cabb8 Fix a few issues with Apple Raster support (rdar://55301114) 2019-12-02 10:19:36 -05:00
Alex Hermann eb03b2d232 Fix error in jobs template
Fixes error:

E [28/Nov/2019:16:55:51 +0100] [CGI] Saw EOF, expected \':\'!
E [28/Nov/2019:16:55:51 +0100] [CGI] Saw EOF, expected \'}\'!
E [28/Nov/2019:16:55:51 +0100] [CGI] Saw EOF, expected \'}\'!
E [28/Nov/2019:16:55:51 +0100] [CGI] Saw EOF, expected \'}\'!
2019-11-28 16:59:20 +01:00
Michael R Sweet 1a3915dded Always send roll select command. 2019-11-27 12:23:48 -05:00
Michael R Sweet d6ec252e9b Add support for the second roll in DYMO Twin/DUO label printers. 2019-11-27 12:15:51 -05:00
Michael R Sweet 2bae6fc518 LGTM only supports C++ style comments... 2019-11-19 11:19:24 -05:00
Michael R Sweet 6f7bd716e6 Fix name of LGTM config file. 2019-11-19 10:53:08 -05:00
Michael R Sweet fd8e2bdb2d Don't wait for held jobs to complete. 2019-11-18 15:39:32 -05:00
Michael R Sweet 56ba2f5122 Changelog 2019-11-18 13:21:53 -05:00
Michael R Sweet b1f4c1e664 Refactor the defaults code so that the correct order of precedence is
respected in all cases (Issue #5683)
2019-11-18 13:21:53 -05:00
Michael R Sweet b2b97b71f1 Fix up HOME environment variable support on macOS - only exclude containers. 2019-11-18 13:21:53 -05:00
Michael R Sweet f4a99aeb02 Address multiple minor issues reported by the LGTM security scanner:
- Lots of usage of localtime and gmtime (use _r/_s versions instead -
  Issue #5685)
- Some unnecessary comparisons
- Suppress checks that are not useful (header guards, short global names, and
  the integer overflow checks which don't reflect the actual range of values)
2019-11-18 11:19:16 -05:00
Michael R Sweet f950947148 Remove debug fprintf that was accidentally left in... 2019-11-18 11:12:02 -05:00
Michael R Sweet b31d4ca525 More LGTM changes. 2019-11-18 11:03:28 -05:00
Michael R Sweet 6d391f7705 Don't generate certificates that expire on Feb 29th (Issue #5643) 2019-11-14 15:34:34 -05:00
Michael R Sweet e2eb28cfcf Sandboxed applications were not able to get the default printer (Issue #5676)
- Add "home" global pointing to the user's home directory.
- Use it instead of getenv("HOME") everywhere we needed it.
2019-11-14 15:30:00 -05:00
Michael R Sweet 3ff5a8e393 Fix lpoptions defaults (Issue #5681) 2019-11-14 13:00:12 -05:00
Michael R Sweet bea505c32e Fix example source filename in CUPS PM (Issue #5682) 2019-11-14 10:26:13 -05:00
Michael R Sweet 93df3887e0 Changelog. 2019-11-07 09:06:02 -05:00
Michael R Sweet 986daa034e Merge pull request #5677 from reddevillg/patch-2
Fix /admin/log section
2019-11-07 09:04:17 -05:00
reddevillg 5129a91c54 Update adminutil.c
fix /admin/log section
2019-11-07 20:05:02 +08:00
Michael R Sweet 025b8ce8f6 Update documentation of auth-info-required values (Issue #5674) 2019-10-31 11:33:55 -04:00
Michael R Sweet 45f72738bb Support trim finishing options. 2019-10-24 15:00:15 -04:00
Michael R Sweet 397eefaa69 Another fix for DBUSDIR (Issue #5671) 2019-10-21 11:12:11 -04:00
Michael R Sweet 9e82c53ebc Fix --with-dbusdir (Issue #5671) 2019-10-21 10:55:57 -04:00
Michael R Sweet 7454512be9 Changelog. 2019-10-17 10:15:06 -04:00
Michael R Sweet 3c985bae7f Update finishings support to use standard (or standard-inspired) PPD option
keywords, and include all finishing templates (except "none").
2019-10-17 10:13:34 -04:00
Michael R Sweet ec8beb8952 Add support for DigestOptions directive in client.conf (Issue #5647) 2019-10-15 17:34:21 -04:00
Michael R Sweet 4c793ee9ce Changelog 2019-10-15 17:08:05 -04:00
Michael R Sweet e35d176c54 Merge pull request #5621 from zdohnal/cgigetarray-sigsegv
SIGSEGV in CUPS web ui when adding a printer
2019-10-15 17:06:53 -04:00
Michael R Sweet 2a06655e5c PPD files containing custom option keywords did not work (Issue #5639) 2019-10-15 17:05:55 -04:00
Michael R Sweet 692b157d0c Add paint can label size (Issue #5662) 2019-10-15 16:58:24 -04:00
Michael R Sweet 13e6d13ea4 Normalize lp/lpr help text. 2019-10-15 16:54:45 -04:00
Michael R Sweet fca9a9818d Add missing "-d" help string (Issue #5661) 2019-10-15 16:51:07 -04:00
Michael R Sweet 771e64526d Fix typos (Issue #5657) 2019-10-07 20:01:47 -04:00
Michael R Sweet 5b835597f3 The IPP backend did not detect all cases where a job should be retried using
a raster format (rdar://56021091)

- Look for document-xxx reason keywords and client-error-document-xxx status
  codes after a Send-Document or Print-Job request.
2019-10-07 15:03:54 -04:00
Michael R Sweet 99c3e9f3f2 Change DEBUG message to ERROR for libusb_init (Issue #5658) 2019-10-07 13:14:10 -04:00
Michael R Sweet 2b47f09162 More compiler warnings. 2019-10-02 15:50:21 -04:00
Michael R Sweet 6936a1222d Add missing file. 2019-10-02 15:44:30 -04:00
Michael R Sweet dc407006a7 Resolve new compiler warnings. 2019-10-02 15:37:50 -04:00
Michael R Sweet cfaaa07a19 Add threading unit test program (Issue #5642) 2019-10-02 15:31:00 -04:00
Michael R Sweet eff8c82f6a Fix handling of printer resource files (Issue #5652) 2019-10-02 14:06:02 -04:00
Michael R Sweet 3ba95ec48d Fix typos in comments. 2019-09-05 18:15:51 -04:00
Michael R Sweet f8688d733b Add workaround for systemd's lack of true launch-on-demand support (Issue #5640) 2019-09-05 12:43:58 -04:00
Michael R Sweet 1e01995a1c Fix the default common name used by ippeveprinter... 2019-09-05 12:33:42 -04:00
Michael R Sweet 68dc110f52 Use legacy MD5 implementation with GNU TLS since at least some Linux vendors are
disabling MD5 without allowing applications to detect it.
2019-09-03 10:34:51 -04:00
Michael R Sweet 998a43a0dd Revert GNU TLS FIPS-140 changes. 2019-09-03 10:29:07 -04:00
Michael R Sweet bc5060a1dd Fix spelling of "accordion".
Bump version.
2019-08-27 22:27:09 -04:00
Michael R Sweet ee6be9cd7e Changelog 2019-08-23 11:19:38 -04:00
Michael R Sweet 8fb0d30daa Merge pull request #5638 from nicolasfella/wheel
Add wheel to system groups
2019-08-23 11:18:13 -04:00
Michael R Sweet c669a17e64 Clean up versioning and API documentation. 2019-08-23 11:16:26 -04:00
Michael R Sweet 34934be905 Update base localzation files. 2019-08-23 09:40:06 -04:00
Nicolas Fella 89fabc72df Add wheel to system groups 2019-08-23 14:43:19 +02:00
Michael R Sweet 93d79201b2 Update API documentation. 2019-08-23 08:32:10 -04:00
Michael R Sweet ed174a7cec Changelog 2019-08-23 08:30:53 -04:00
Michael R Sweet 5e0dc7e14c Merge pull request #5637 from polluks/patch-1
Fixed typos
2019-08-23 08:26:05 -04:00
Stefan 1553df019b Fixed typos 2019-08-21 22:41:36 +02:00
Michael R Sweet 873c513326 Fix links.: 2019-08-21 08:24:23 -04:00
Michael R Sweet 69e37fbf52 Update top-level documentation files in preparation for the 2.3.0 release. 2019-08-21 08:22:43 -04:00
Michael R Sweet 05690fddfa Also update HTML version of license. 2019-08-20 16:03:23 -04:00
Michael R Sweet 7b6d49eec9 Add GPL2/LGPL2 exception to the new CUPS license. 2019-08-20 15:45:52 -04:00
Michael R Sweet d46a87a45f Fix trailing whitespace. 2019-08-16 15:48:34 -04:00
Michael R Sweet 60a7373f31 Fix a USB printing issue on macOS (rdar://31433931) 2019-08-16 15:41:00 -04:00
Michael R Sweet 2c030c7a06 Multiple security/disclosure issues:
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
- Fixed IPP buffer overflow (rdar://50035411)
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
- Fixed DoS issues in the scheduler (rdar://51373929)
2019-08-15 14:06:47 -04:00
Michael R Sweet d784ca2f83 Fix typo in ipptoolfile man page. 2019-08-15 13:40:12 -04:00
Michael R Sweet f4b0bfa2db Fix whitespace 2019-08-07 13:02:49 -04:00
Michael R Sweet 5754bcceeb Stop accepting attributes in collections (Issue #5630) 2019-08-07 13:00:50 -04:00
Michael R Sweet f79dad58ab Fix man page typo. 2019-08-05 20:10:04 -04:00
Michael R Sweet 3cf5b72ab7 USB quirk (Issue #5617) 2019-08-01 14:30:07 -04:00
Michael R Sweet c76c53615c Changelog 2019-08-01 14:26:30 -04:00
Michael R Sweet 9ec6124c37 GNU TLS FIPS140 support (Issue #5601, Issue #5622) 2019-08-01 14:24:58 -04:00
Michael R Sweet 8e048e4d39 Fix some PPD parser issues discovered via fuzzing (Issue #5623, Issue #5624) 2019-08-01 14:02:04 -04:00
Michael R Sweet dc00a7c3ad Fix some PPD parser issues discovered via fuzzing (Issue #5623, Issue #5624) 2019-08-01 13:56:29 -04:00
Michael R Sweet db1c94f3a1 Fix memory leak in ppdOpen. 2019-08-01 13:02:23 -04:00
Michael R Sweet 65048b860c Enhance testipp to support reading hex dumps. 2019-08-01 12:00:00 -04:00
Michael R Sweet 43c0e4a9d5 Update GCC options (hopefully will cover more future versions...) 2019-08-01 11:45:45 -04:00
Zdenek Dohnal eda46e3aac SIGSEGV in CUPS web ui when adding a printer 2019-07-29 10:33:06 +02:00
Michael R Sweet 6647894889 Fix potential excess logging from the scheduler when removing job files
(Issue #5597)

(may be Debian-specific, as I was unable to duplicate - the extra check is in
place in case file_time is reset)
2019-07-16 10:51:07 -04:00
Michael R Sweet 614efb7a87 Don't default printer-info, printer-location, printer-geo-location (Issue #5603) 2019-07-16 10:43:01 -04:00
Michael R Sweet c5dcd7ecff Update changelog. 2019-07-16 10:39:39 -04:00
Michael R Sweet 9c13b7d26e Log held job messages as errors so that is it clear why a job was held (Issue #5604) 2019-07-16 10:37:37 -04:00
Michael R Sweet 4e104fb9c8 The web interface did not show that a job was held for authentication (Issue #5604) 2019-07-16 10:34:09 -04:00
Michael R Sweet 242b4b9be6 Update the cupsd.conf man page to better explain what @IF(name) and @LOCAL do
(Issue #5604)
2019-07-16 10:09:12 -04:00
Michael R Sweet 9539c53065 Fix lpadmin with cupsIPPSupplies and cupsSNMPSupplies (Issue #5610) 2019-07-16 09:27:13 -04:00
Michael R Sweet 3c27d2a6dd Always check the group membership list (Issue #5613) 2019-07-16 09:16:22 -04:00
Michael R Sweet e9a4e9d6ea The scheduler would restart continuously when idle and printers were not
shared (rdar://52561199)
2019-07-16 09:07:17 -04:00
Michael R Sweet c0a097c92f Merge pull request #5608 from kenshin33/kenshin33-fr
french translation correction
2019-07-12 08:36:09 -04:00
Raouf Bencheraiet 9a5e6d74b9 french translation correction 2019-07-08 18:03:30 -04:00
Michael R Sweet f93b470e22 Fix an issue with the IPP backend and unsupported "sides" values (rdar://51775322) 2019-06-17 15:01:39 -04:00
Michael R Sweet 90d3999e0d Fix whitespace issues. 2019-06-17 09:49:22 -04:00
Michael R Sweet c9b65dc4d9 Fix NULL pointer dereference in httpGetField2 (Issue #5598) 2019-06-17 09:46:37 -04:00
Michael R Sweet 8ef4f507d7 Eliminate new GCC compiler warnings (Issue #5591) 2019-06-13 16:39:34 -04:00
Michael R Sweet 3001a140d6 Use GZIPPROG instead of GZIP to avoid install issues (Issue #5595) 2019-06-12 08:36:28 -04:00
Michael R Sweet 2614dc6385 Changelog. 2019-06-10 15:13:41 -04:00
Michael R Sweet b7569be6f4 Changelog. 2019-06-10 15:13:08 -04:00
Michael R Sweet e02771e0c6 Merge pull request #5590 from yurashek/master
Swapped branches of HAVE_SSL condition
2019-06-10 15:12:59 -04:00
Michael R Sweet 11c5618507 Merge pull request #5593 from mpsuzuki/remove-unused-func
remove unused to64() from scheduler/auth.c to calm warning for -Wunused-functions
2019-06-10 09:09:16 -04:00
suzuki toshiya ce3f7bf3e9 remove unused to64() 2019-06-07 04:06:34 +00:00
Jiri Sasek 387ef588c9 Swapped branches of HAVE_SSL condition 2019-06-03 18:18:54 +02:00
Michael R Sweet 2e738f0309 Changelog. 2019-05-30 10:22:25 -04:00
Michael R Sweet 8e901a3856 Merge pull request #5588 from dargad/job-typo
Fix parentheses in cupsdCleanJobs.
2019-05-30 10:20:50 -04:00
Dariusz Gadomski 53cac1d08b Fix parentheses in cupsdCleanJobs. 2019-05-30 14:06:27 +02:00
Michael R Sweet 9c554374b5 Bump versions to 2.3.0 (optimism!) 2019-05-24 09:33:45 -04:00
Michael R Sweet 03cc81b703 Put IDR command in its own XA/XZ section. 2019-05-24 09:27:09 -04:00
Michael R Sweet 5098fdde63 Swap ^IDR and ^XZ commands to make sure that page image is deleted on the label
printer. (Why is this even a thing?)
2019-05-24 08:12:26 -04:00
Michael R Sweet 0cf87cf506 Fix EXPECT !name WITH-VALUE ... tests. 2019-05-23 11:59:40 -04:00
Michael R Sweet 4d03c4ca90 Bump version to 2.3rc1. 2019-05-21 12:59:32 -04:00
Michael R Sweet 715dfb366b Prep for v2.3rc1 2019-05-21 12:59:04 -04:00
Michael R Sweet 0d89470f82 Update localization files. 2019-05-17 10:17:40 -04:00
Michael R Sweet ef4d439c3b Normalize ippeveprinter environment with ippserver:
- Add -F option to specify the output format (default is application/postscript
  when PPDs are used)
- Add pwg-xxx attributes and output format to environment.
2019-05-17 10:02:27 -04:00
Michael R Sweet b761dd43be Enforce USB read limits (Issue #5583) 2019-05-17 07:53:30 -04:00
Michael R Sweet 7c11d5aea4 Fix Linux build issues with new LINKCUPS macro (Issue #5261) 2019-05-17 07:43:00 -04:00
Michael R Sweet c674bfbe2b Clean up error messages. 2019-05-16 17:00:21 -04:00
Michael R Sweet 1b032cbf87 Fix clang warning. 2019-05-16 08:13:59 -04:00
Michael R Sweet bed16f192b Fix Windows build errors. 2019-05-15 22:38:07 -04:00
Michael R Sweet 3894a88544 Merge branch 'master' of https://github.com/apple/cups 2019-05-15 22:24:48 -04:00
Michael R Sweet 6ac324a2e1 Update SDK. 2019-05-15 22:24:35 -04:00
Michael R Sweet aa5e4fd677 Update source paths. 2019-05-15 22:23:58 -04:00
Michael R Sweet c701f9b123 More tweaks. 2019-05-15 22:11:26 -04:00
Michael R Sweet b1f826250f Rename ippserver to ippeveprinter in Visual Studio projects. 2019-05-15 21:15:05 -04:00
Michael R Sweet 3e391a8e76 Update build system and cups-config script to not add extra libraries to the
"--libs" output (Issue #5261)
2019-05-15 18:35:58 -04:00
Michael R Sweet cb480624d3 Fix regression in ipptool - hex support needs to be limited to a single line. 2019-05-15 17:37:38 -04:00
Michael R Sweet 9914f0fe30 Use zopfli to further compress source archives, when available. 2019-05-15 17:07:55 -04:00
Michael R Sweet c8a5a28c0a Optimize compression of PWG Raster sample files (Issue #5529) 2019-05-15 16:40:12 -04:00
Michael R Sweet bf7c741159 Changelog. 2019-05-15 16:33:19 -04:00
Michael R Sweet d29b58fc33 Optimize PDFs and default printer icon (Issue #5529) 2019-05-15 16:32:22 -04:00
Michael R Sweet aa15a57207 Optimize PNG files (Issue #5529) 2019-05-15 16:29:00 -04:00
Michael R Sweet e923f65f23 Explain the "forbidden" error better (Issue #5547) 2019-05-15 10:42:54 -04:00
Michael R Sweet d1d3862ca2 Update localization files. 2019-05-15 10:30:43 -04:00
Michael R Sweet 20c9da8184 Block cups-files.conf directives (Issue #5530) 2019-05-15 10:30:24 -04:00
Michael R Sweet 9018ff94f1 Changelog. 2019-05-13 17:12:47 -04:00
Michael R Sweet c8d7d4bf55 Add support for $date-current, $date-start, and ISO-8601 time period values for
relative date/time values.
2019-05-13 17:10:48 -04:00
Michael R Sweet bd51657148 Support <hex> strings in IPP files. 2019-05-13 16:24:19 -04:00
Michael R Sweet e1074f486d Tweak some ippeveprinter web interface content. 2019-05-13 09:04:07 -04:00
Michael R Sweet 657748179f Update Windows DLL exports file. 2019-05-09 07:24:37 -04:00
Michael R Sweet 3f3b535383 Use CUPS_RAND macro instead of rand(). 2019-05-08 21:49:14 -04:00
Michael R Sweet d0f469a7cd Another clang warning... 2019-05-08 21:47:34 -04:00
Michael R Sweet f4f9631897 Fix another clang warning.
Update Xcode project for new location of tools.
2019-05-08 21:45:46 -04:00
Michael R Sweet 3408121d8c Fix clang warnings. 2019-05-08 21:14:54 -04:00
Michael R Sweet bb73b8e008 Update copyrights. 2019-05-08 11:35:21 -04:00
Michael R Sweet 0e17f4c941 Fix CSS on short browsers (Issue #5574) 2019-05-08 11:31:08 -04:00
Michael R Sweet c2bcbdc519 Merge pull request #5577 from OdyX/fix-example-test-files
Test: Fix *topdf filters to find the examples in the correct path
2019-05-08 07:44:25 -07:00
Didier 'OdyX' Raboud 98b1b6bafa Test: Fix reference to onepage-letter-*.pwg away from their old .gz postfix
This was changed in ea75e93d17
2019-05-08 14:32:44 +02:00
Didier 'OdyX' Raboud b3f0b5a94f Test: Fix *topdf filters to find the examples in the correct path 2019-05-08 14:17:27 +02:00
Michael R Sweet 16dbc94b92 Fill out the list of job creation attributes. 2019-05-06 15:16:36 -04:00
Michael R Sweet 0c178dec48 Support C-style character escapes in IPP files. 2019-05-03 14:35:04 -04:00
Michael R Sweet 5da48e4614 Move ippeveprinter commands to CUPS_SERVERBIN/command. 2019-05-03 12:29:58 -04:00
Michael R Sweet 69b84368d3 Don't ignore generated man page files anymore. 2019-05-03 12:25:54 -04:00
Michael R Sweet 661d608a65 Add PWG ippserver attributes to list of printer description and system
description attributes.
2019-05-03 09:26:59 -04:00
Michael R Sweet 0450ddd4f0 Update version in configure script. 2019-05-02 12:58:07 -04:00
Michael R Sweet 07b9937a7d Update for 2.3b8. 2019-05-02 12:57:14 -04:00
Michael R Sweet 14bd3d8990 Fix examples. 2019-05-02 12:53:01 -04:00
Michael R Sweet c05a795e78 Fix cupsenable/disable man pages 2019-05-02 12:46:02 -04:00
Michael R Sweet 315afe86da Fix missing header in ippeveps.c, add .gz to man pages in RPM spec file (Red
Hat convention is to compress installed man pages)
2019-05-02 12:41:50 -04:00
Michael R Sweet 066dd700da Fix packaging of man pages and commands. 2019-05-02 12:21:04 -04:00
Michael R Sweet 8dabd1442f Fix Linux RPM builds. 2019-05-02 12:14:05 -04:00
Michael R Sweet 6fcbda51bf Fix source tarballs. 2019-05-02 11:52:15 -04:00
Michael R Sweet 45b2ced5aa Update RPM building script. 2019-05-02 11:47:39 -04:00
Michael R Sweet f49af670aa Bump the default Timeout to 15 minutes as well (Issue #5570) 2019-05-02 09:01:43 -04:00
Michael R Sweet b2ad86e038 Fix typos in snprintf/vsnprintf emulation code. 2019-05-01 16:01:46 -04:00
Michael R Sweet 5f145615d2 Don't use Windows snprintf/vsnprintf since they don't conform to C99... 2019-05-01 15:47:36 -04:00
Michael R Sweet 6dac1130b5 Update the hold expiration logging - one case is an error, the other is normal. 2019-05-01 14:57:51 -04:00
Michael R Sweet d6395c6f1d Increase the MultipleOperationTimeOut default to 15 minutes, log an error if
the job submission times out (Issue #5570)
2019-05-01 14:39:03 -04:00
Michael R Sweet 87030afb3a Greatly simplify the man page handling. 2019-04-26 23:10:09 -04:00
Michael R Sweet ea75e93d17 Update .gitignore to ignore compressed man pages.
Rename PWG raster sample files to avoid using .gz extension.
2019-04-26 18:50:49 -04:00
Michael R Sweet 3f8c4f3409 Fix install of tools. 2019-04-26 18:48:48 -04:00
Michael R Sweet fad6d66937 Don't ignore .gz files. 2019-04-26 18:28:42 -04:00
Michael R Sweet 10ce4df141 Fix whitespace issues. 2019-04-26 18:28:04 -04:00
Michael R Sweet feb13eeaf6 Update test suite for new location of test files. 2019-04-26 17:40:54 -04:00
Michael R Sweet f1ac9f5889 Move example ipptool files to the examples directory.
Build tools directory for IPP tools.
2019-04-26 11:05:27 -04:00
Michael R Sweet a76950482b Cleanup 2019-04-26 10:03:47 -04:00
Michael R Sweet 7586933c85 Rename "tools" to "scripts", since that's what is contained. 2019-04-26 09:59:24 -04:00
Michael R Sweet c0447c4d98 Fix builds without PPD support. 2019-04-25 09:56:35 -04:00
Michael R Sweet 9d8b53bb0c Fix whitespace errors (again). 2019-04-25 09:43:02 -04:00
Michael R Sweet 42f55cadf6 Update localization strings. 2019-04-24 18:36:23 -04:00
Michael R Sweet dc84a5a4cd Update man pages.
Default manufacturer is now "Example".

Add support for DEBUG:, ERROR:, and INFO: messages from print commands.
Info and error messages get copied to the job-state-message attribute.

Add support for updating printer-alert-description attributes.
2019-04-24 18:35:00 -04:00
Michael R Sweet e513da0cd8 Remove unused common source file. 2019-04-24 14:49:17 -04:00
Michael R Sweet f20ce462b9 Update packaging to include ippeveprinter and friends. 2019-04-24 14:46:30 -04:00
Michael R Sweet 9a5efde597 Update installation directories for Xcode project. 2019-04-24 14:38:57 -04:00
Michael R Sweet 58b64171af Process ATTR: messages.
Unify job logging to use [Job NNN] prefix.

Report job-impressions/-completed from printer commands.

Report millisecond-resolution processing time in log.
2019-04-24 14:36:49 -04:00
Michael R Sweet 75c93cc2b5 Fix color PostScript raster output.
ppdEmitJCL didn't handle NULL username or title strings.
2019-04-24 13:48:40 -04:00
Michael R Sweet 2d6dcec181 Implement printer-input-tray and default source/type for PPD-based printers.
Fix printer-png.h corruption.
2019-04-24 10:45:16 -04:00
Michael R Sweet b13a9a9633 Fix PDF filtering. 2019-04-23 17:31:23 -04:00
Michael R Sweet 7331c1b633 Save more work - JPEG, PDF, PostScript, and raster support for PS command. 2019-04-23 17:15:41 -04:00
Michael R Sweet de4912b2c9 Save work. 2019-04-23 14:11:45 -04:00
Michael R Sweet ab8fab6154 Save work on PPD support. 2019-04-22 18:27:46 -04:00
Michael R Sweet d86153a94f Make sure "num_values" is always initialized since newer versions of GCC will
(incorrectly) error out on this...
2019-04-22 07:48:35 -04:00
Michael R Sweet 400e67c15f Fix clang errors on Linux.
Fix subtype support on Linux/Avahi.
2019-04-20 20:02:16 -04:00
Michael R Sweet 507c4adcc8 More clang warning fixes. 2019-04-20 09:13:32 -04:00
Michael R Sweet 60d8f88456 Clean up Clang analyzer warnings.
Update Xcode project file for ippeveprinter and friends.
2019-04-20 08:41:16 -04:00
Michael R Sweet 51ddec4029 Fix Avahi/Linux build error (Issue #5566) 2019-04-19 16:38:15 -04:00
Michael R Sweet 11da92e6b1 Update man page and localization strings. 2019-04-19 16:35:00 -04:00
Michael R Sweet 820cb58e40 More cleanup of web interfaces, add --no-web-forms option to disable the web
forms.
2019-04-19 16:32:11 -04:00
Michael R Sweet d22e887a13 Bump version, and make it absolutely clear that CUPS 2.3 is not yet production
code.
2019-04-18 07:59:23 -04:00
Michael R Sweet 9a51a8159f Fix a memory reallocation bug in HTTP header value expansion
(rdar://problem/50000749)
2019-04-18 07:52:54 -04:00
Michael R Sweet ef6de4e15d Another typo. 2019-04-17 17:38:30 -04:00
Michael R Sweet a9f5214b4c Fix typo in makefile. 2019-04-17 17:36:13 -04:00
Michael R Sweet 0c5991dba7 Don't regenerate cups.strings during a build. 2019-04-17 15:09:22 -04:00
Michael R Sweet 9c5f08f184 Fix broken indentation. 2019-04-17 15:08:44 -04:00
Michael R Sweet 00be463e2c Support B&W raster as well. 2019-04-16 17:55:21 -04:00
Michael R Sweet 4d2df92677 Clean up IPP Everywhere conformance issues. 2019-04-16 16:55:16 -04:00
Michael R Sweet b32051c91b Cleanup to use copy_hex_string, and fix a bug in that function. 2019-04-16 16:29:28 -04:00
Michael R Sweet b3835dde2f Fix regular expression matching on octetString attributes. 2019-04-16 16:23:47 -04:00
Michael R Sweet 59cd12c6d2 Add UserAgentTokens config directive (Issue #5555)
cups/cups-private.h:
- Add enum and value for UserAgentTokens directive.

cups/usersys.c:
- _cups_finalize_conf(): Copy UserAgentTokens value to globals.
- _cups_init_conf(): Set default UserAgentTokens value and grab prefs.
- _cups_read_conf(): Look for UserAgentTokens value.
- _cups_set_uatokens(): Set UserAgentTokens value.
- cupsSetUserAgent(): Support UserAgentTokens values.
2019-04-15 17:22:25 -04:00
Michael R Sweet 4c00fa533f Add a workaround for old Samsung drivers (Issue #5562) 2019-04-15 16:50:04 -04:00
Michael R Sweet 677e4ca625 For octetString values, compare the length against the -supported value
(Issue #5557)
2019-04-15 16:26:46 -04:00
Michael R Sweet 4d0f1959a3 Update systemd service file for cupsd (Issue #5551) 2019-04-15 16:15:58 -04:00
Michael R Sweet 5483fd294a Correctly encode octetString values for print filters (Issue #5558)
scheduler/job.c:
- get_options(): Handle IPP_TAG_STRING separately and either provide a quoted
  string or a hex string, depending on the value.
- ipp_length(): Handle IPP_TAG_STRING separately.
2019-04-15 16:03:03 -04:00
Michael R Sweet cebb2dcc23 The IPP/2.2 test file tested booleans against value "1" instead of "true", but
ipptool was updated a while back to look for "true".

test/ipp-2.2.test:
- Change WITH-VALUE for booleans from '1' to 'true'

test/ipptool.c:
- Update with_value() to support both "true" and "1" for boolean true values.
2019-04-15 12:11:36 -04:00
Michael R Sweet 87854afe61 Fix changelog. 2019-04-15 09:24:31 -04:00
Michael R Sweet a3390b63a6 Remove Travis CI file since we can't enable it for the CUPS repository. 2019-04-15 09:22:25 -04:00
Michael R Sweet e19d0f3891 Ignore generated ippeveprinter commands. 2019-04-15 09:22:07 -04:00
Michael R Sweet bc69e04b2c Fix compile errors. 2019-03-26 21:28:04 -04:00
Michael R Sweet dd43b7f78d Save work. 2019-03-22 20:49:01 -04:00
Michael R Sweet dd2b61669e Directory output now uses the same naming algorithm as is used for the spool
directory.
2019-03-22 17:44:59 -04:00
Michael R Sweet cc108616c0 Point stdout to the output device or spool directory. 2019-03-22 17:24:18 -04:00
Michael R Sweet 6640ceec8c Fix up some more of the web interface, add colored status indicator, add auto
refresh on the status page.
2019-03-22 17:03:57 -04:00
Michael R Sweet 9141aa0150 Update supply and media pages to be based on attributes instead of member
variables.
2019-03-22 15:09:28 -04:00
Michael R Sweet 154f5392bf Update icon image to use "ippeve-printer" 2019-03-22 14:21:32 -04:00
Michael R Sweet 3e5092db04 Update ippeveprinter to use internal copy of printer.png.
Fix a crash bug in load_legacy_attributes.
2019-03-22 14:18:23 -04:00
Michael R Sweet efb349bcb8 Add man page for and installation of ippeveprinter commands. 2019-03-22 13:21:05 -04:00
Michael R Sweet 6641bd0d3f Stub out the PS and PCL print commands for ippeveprinter.
Add a "corelite" value for --with-components that builds the tools as well as
the PPD-free libcups.

Add a "CUPS_LITE" define in config.h.
2019-03-22 13:01:16 -04:00
Michael R Sweet 098d20d4b9 Make the default get-printer-attributes test request media-col-database. 2019-03-22 13:00:54 -04:00
Michael R Sweet 6d56631f9b Normalize/update program help, error messages. 2019-03-22 12:35:31 -04:00
Michael R Sweet 89c7bc6f48 Update dependencies. 2019-03-21 21:13:18 -04:00
Michael R Sweet a5ed2e3944 Same changes for Print-URI/Send-URI. 2019-03-21 21:12:02 -04:00
Michael R Sweet 9e24f768b9 One more spot needs attention. 2019-03-21 18:28:41 -04:00
Michael R Sweet cdb2e72460 Merge common document processing code. 2019-03-21 18:24:50 -04:00
Michael R Sweet aa2a90cee6 Normalize filename generation and print file creation. 2019-03-21 18:24:50 -04:00
Michael R Sweet 1562b9a19d ippeveprinter building again... 2019-03-21 18:24:49 -04:00
Michael R Sweet 3c2cb8228e Clean up some build issues on certain platforms. 2019-03-21 18:20:40 -04:00
Michael R Sweet f89270998d Save work. 2019-03-21 09:34:44 -04:00
Michael R Sweet 92dad94559 Save work, take ippeveprinter out of the regular build until it is
compiling again...
2019-03-20 21:59:20 -04:00
Michael R Sweet 8a4ed632e8 Save work. 2019-03-20 14:11:51 -04:00
Michael R Sweet 8b4ae65338 Update copyright. 2019-03-20 10:17:51 -04:00
Michael R Sweet d46dbe1ba7 Make ippserver sample code a supported program called "ippeveprinter", which
can serve as a wrapper for "printer applications".
2019-03-20 09:59:24 -04:00
Michael R Sweet 21609267ec Use ALL_DSOFLAGS and ALL_LDFLAGS to avoid issues with some build frameworks. 2019-03-19 16:36:24 -04:00
Michael R Sweet 49b3fb6354 Make --image a no-op, just link libcups. 2019-03-15 12:54:11 -04:00
Michael R Sweet d2df4e48b9 Stop advertising the HTTP methods that are supported (Issue #5540) 2019-03-11 14:01:21 -04:00
Michael R Sweet f88b8468c5 Fix an issue with PreserveJobHistory and time values (Issue #5538) 2019-03-11 13:46:22 -04:00
Michael R Sweet 2c091429d1 Update test suite to test PreserveJobHistory setting using time (30 seconds) 2019-03-11 12:05:03 -04:00
Michael R Sweet d88008a0e6 Fix PPD caching and IPP Everywhere PPDs (Issue #5535) 2019-02-27 15:22:55 -05:00
Michael R Sweet ca2990c7fe Fix another compiler warning. 2019-02-25 15:12:16 -05:00
Michael R Sweet 2a06fe63e6 Use iterator for CRL (Issue #5532) 2019-02-25 15:08:40 -05:00
Michael R Sweet 7d950e9251 Fix compiler warning from newer GCC (Issue #5533) 2019-02-25 11:57:23 -05:00
Michael R Sweet d3454c3ef6 Fix compiler warning from newer GCC (Issue #5533) 2019-02-25 11:39:09 -05:00
Michael R Sweet f05517caab Media size matching now uses a tolerance of 0.5mm (rdar://33822024) 2019-02-21 12:45:33 -05:00
Michael R Sweet 2db15a26b8 Fix typo. 2019-02-21 12:33:31 -05:00
Michael R Sweet 9bdea94b14 Rework idle exit fix after some discussion. 2019-02-21 12:31:10 -05:00
Michael R Sweet b6787b6954 Update localization strings. 2019-02-21 11:13:39 -05:00
Michael R Sweet bb52530560 The lpadmin command would hang with a bad PPD file (rdar://41495016) 2019-02-21 11:13:20 -05:00
Michael R Sweet 47b3bd03e4 The scheduler did not always idle exit as quickly as it could... 2019-02-21 11:03:50 -05:00
Michael R Sweet 45cae1bc04 Don't stop a printer after a job is canceled/aborted (Issue #5517) 2019-02-21 10:43:16 -05:00
Michael R Sweet 76bb0a3b90 Add a USB quirks rule for the DYMO 450 Turbo (Issue #5521) 2019-02-21 09:54:28 -05:00
Michael R Sweet 1df7a46155 Add subject alternate names for self-signed certificates (Issue #5525) 2019-02-19 15:04:36 -05:00
Michael R Sweet 25f2b3ee1a Add "-I" option to usage notes. 2019-02-19 14:15:05 -05:00
Michael R Sweet 7f472a4384 Add ipptool test file for testing Get-Printer-Attributes conformance with the
requested-attributes operation attribute (Issue #5512)
2019-02-19 14:09:53 -05:00
Michael R Sweet baf55a940a Add missing cups_en.po. 2019-02-19 12:38:48 -05:00
Michael R Sweet 5a9647c7ac Merge pull request #5519 from IslandCow/small
Make explicit cast from enum to integer
2019-02-19 11:12:25 -05:00
Michael R Sweet 5ca3a7ff46 Add USB quirks rule for Xerox printers (Issue #5523) 2019-02-19 11:11:35 -05:00
Michael R Sweet cc6495f7a8 Use interactive priority for cupsd now. 2019-02-19 09:41:29 -05:00
Michael R Sweet 73721e3edb Documentation updates. 2019-02-18 10:33:49 -05:00
Sean Kau aa7edf3c17 Make explicit cast from enum to integer 2019-02-18 06:56:47 +00:00
Michael R Sweet 1ce6909d23 Non-Kerberized IPP printing to Windows was broken (Issue #5515) 2019-02-15 17:06:35 -05:00
Michael R Sweet 6e63114c45 Changelog. 2019-02-14 12:55:37 -05:00
Michael R Sweet fa26ab9573 Eliminate use of private macOS security headers/APIs (Issue #5516)
Eliminate use of deprecated cssmErrorString function.

Switch to using SecCertificateCreateWithData.

Clean out unused private header availability checks.
2019-02-14 11:53:23 -05:00
Michael R Sweet ec7e5bddc7 Fix compiler warnings. 2019-02-14 11:10:56 -05:00
Michael R Sweet fa2851d5b5 Update Danish localization (Issue #5504) 2019-02-13 16:33:14 -05:00
Michael R Sweet 0d94b8bf90 Remove log buttons from admin page since most Linux distros use systemd logging
(Issue #5513)
2019-02-13 16:29:55 -05:00
Michael R Sweet e625fa1320 Fix a GNU TLS certificate problem (Issue #5506) 2019-02-05 13:03:22 -05:00
Michael R Sweet d9f301dd14 Fix UTF-8 validation (Issue #5509) 2019-02-05 12:02:49 -05:00
Michael R Sweet 2cb772b87f Update the translation guide to reflect current links, files, etc. (Issue #5497)
Also add some examples of localizing the HTML templates (what to localize and
what to leave alone...)
2019-01-24 14:33:06 -05:00
Michael R Sweet bd880c0c4d Fix online help through web interface... 2019-01-24 14:31:28 -05:00
Michael R Sweet e060cfd23f Fix compile warning. 2019-01-24 14:23:46 -05:00
Michael R Sweet 6648f8c125 Remove remaining references to subscriptions and samba. 2019-01-24 12:46:23 -05:00
Michael R Sweet 340e5f8ffd Show number of translated messages, not number of untranslated ones... 2019-01-24 12:22:44 -05:00
Michael R Sweet 7cf665850c Don't generate synthetic cups_en.po, we have a real one now... 2019-01-24 12:17:19 -05:00
Michael R Sweet 95470a9221 Fix typo. 2019-01-24 12:11:59 -05:00
Michael R Sweet fe0d6115dd Update localization of IPP attribute/value pairs (Issue #5495)
Note: This adds a cups_en.po file containing the real localized strings, with
cups.pot pulling from ipp-strings.c which is generated from the IANA IPP
registry.  Localizer comments are included to help translators do all of those
string...

After the "purge", all of the non-English localization files are well below the
90% goal for translating... :(
2019-01-24 12:06:34 -05:00
Michael R Sweet 7281649214 Add _CUPS_MESSAGE_EMPTY flag to allow loading of empty localizations (needed
for checkpo program)
2019-01-24 12:05:21 -05:00
Michael R Sweet 7cc71486c9 Update usage and localized message about the URL to use for secure access. 2019-01-24 12:04:57 -05:00
Michael R Sweet 0913610bcd Changelog. 2019-01-24 09:39:06 -05:00
Michael R Sweet e65cd5336c Merge pull request #5499 from scootergrisen/patch-4
Remove newline
2019-01-24 09:38:28 -05:00
Michael R Sweet afe1f8fbec Merge pull request #5500 from scootergrisen/patch-5
Remove newline
2019-01-24 09:37:25 -05:00
Michael R Sweet ed7961ff57 Merge pull request #5501 from scootergrisen/patch-6
Add "# German message catalog for CUPS."
2019-01-24 09:36:57 -05:00
scootergrisen aae22a2168 Add "# German message catalog for CUPS." 2019-01-24 06:54:56 +01:00
scootergrisen ba2aac9d2e Remove newline
So it matches the source/template file
2019-01-24 06:49:26 +01:00
scootergrisen 4eb4a2f3be Remove newline 2019-01-24 06:46:53 +01:00
Michael R Sweet 6bf37cc8c0 Make sure config.h gets installed with the private headers, as needed. 2019-01-23 12:58:47 -05:00
Michael R Sweet 083672b18c OK, allow DESTDIR to be used as a default BUILDROOT, much like we do for
DSTROOT.
2019-01-23 12:38:25 -05:00
Michael R Sweet ffbf1e61ff Fix some build issues with the "core" component selection (rdar://47394086)
- Availability macros were incorrect.
- Some driver headers/definitions were installed even when the core library
  does not contain them.
- Fix up the macOS/iOS detection of keychain/API availability - just need to
  use the TARGET_OS_xxx macros instead.
- When installing private headers, install config.h so that the private
  headers actually work.
2019-01-23 12:15:38 -05:00
Michael R Sweet e13e173f26 Remove macOS version check. 2019-01-23 12:14:12 -05:00
Michael R Sweet a7c0c36cf5 Updated the USB quirks rule for Zebra label printers (Issue #5395)
All Zebra printers now use unidir and no-reattach.
2019-01-23 11:14:39 -05:00
Michael R Sweet bcaeb97caa Remove old "printer-purge.tmpl" file from the translation guide and the
Spanish templates (Issue #5491)
2019-01-23 11:04:32 -05:00
Michael R Sweet 09cc278869 Fix metadata header and strip old messages. 2019-01-23 11:02:07 -05:00
Michael R Sweet c780bc5573 Merge pull request #5489 from scootergrisen/master
Add translations for templates/da
2019-01-23 10:56:42 -05:00
Michael R Sweet 7ef11adeca Merge pull request #5492 from scootergrisen/patch-2
Fix a problem with msgid/msgstr in cups_de.po
2019-01-23 10:55:48 -05:00
Michael R Sweet 888f758194 Merge pull request #5493 from scootergrisen/patch-3
Remove some newlines from cups_ru.po
2019-01-23 10:54:36 -05:00
Michael R Sweet 48cc38928a Revert previous change - need explicit AC_PROG_CPP for the header checks. 2019-01-22 17:48:17 -05:00
Michael R Sweet 971a6b5d79 Don't need AC_PROG_CPP. Greatly simplifies things when cross-compiling! 2019-01-22 16:05:36 -05:00
scootergrisen 588a6c8af7 Remove some newlines from cups_ru.po
msgfmt -c cups_ru.po gave some warnings about some ending \n that was in the source strings.
2019-01-22 04:40:21 +01:00
scootergrisen 6f08381068 Remove #, fuzzy from header 2019-01-22 04:28:05 +01:00
scootergrisen 5107832098 Remove " and fix spaces 2019-01-22 04:25:13 +01:00
scootergrisen c68935d876 Fix a problem with msgid/msgstr 2019-01-22 04:18:59 +01:00
scootergrisen 414e798b71 Add translations for templates/da 2019-01-22 02:14:39 +01:00
Michael R Sweet 86c184ff34 Clean out some more _cupsStr cruft that might potentially cause an
unaligned memory access (Issue #5474)

Don't directly use the string pool in the CGI programs or scheduler.
2019-01-21 16:03:08 -05:00
Michael R Sweet e5dfea4c04 Changelog. 2019-01-21 14:20:37 -05:00
Michael R Sweet 5a00cf374d Fix potential unaligned accesses in the string pool (Issue #5474)
This set of changes makes the PPD functions use strdup and free - they were
modifying the contents of the string in places and doing other things that
were not safe for (immutable) strings in the pool.
2019-01-21 14:14:04 -05:00
Michael R Sweet bf4873cbf3 Merge pull request #5486 from scootergrisen/master
Add doc/da/index.html.in
2019-01-21 14:11:15 -05:00
scootergrisen f120cf3a5d Add doc/da/index.html.in 2019-01-21 20:05:41 +01:00
Michael R Sweet 4b5a6914fb Stop parsing the Emulators keywords in PPD files (Issue #5475)
This also eliminates a potential memory leak...
2019-01-21 13:42:27 -05:00
Michael R Sweet 644dca1806 Switch to using "all" and "media-col-database" because some vendors apparently
do not know how to read (Issue #5484)
2019-01-21 12:01:11 -05:00
Michael R Sweet e4b275a3eb Changelog. 2019-01-21 11:56:16 -05:00
Michael R Sweet cc44874447 Merge pull request #5481 from scootergrisen/patch-1
Add [da] translation
2019-01-21 11:55:52 -05:00
Michael R Sweet 0057f146f6 Fix compile error on Linux (Issue #5483) 2019-01-21 11:53:59 -05:00
Michael R Sweet aa09736e02 Add a USB quirk rule for the Lexmark E120n (Issue #5478) 2019-01-21 11:32:25 -05:00
Michael R Sweet 622207eff5 Use the same requested-attributes values for all IPP Everywhere setup
requests (Issue #5484)
2019-01-21 11:27:43 -05:00
Michael R Sweet d728c2935e Clean up installation of private headers.
Clean up generation of api help.
2019-01-21 08:42:04 -05:00
Michael R Sweet 588c22056a Fix iOS libcups builds (rdar://47386169) 2019-01-18 12:11:34 -05:00
scootergrisen 0210d14387 Add [da] translation 2019-01-15 21:08:17 +01:00
Michael R Sweet 690b923151 Changelog. 2019-01-10 17:16:12 -05:00
Michael R Sweet ef3aba66ff Fixed a performance regression with large PPDs (rdar://47040759)
scheduler/printers.c:
- create_media_col(): Drop media-source/media-type support.
- load_ppd(): Stop enumerating all combinations of media size, source, and
  type.
2019-01-10 17:07:29 -05:00
Michael R Sweet d7cd12f009 Allow ippSetXxx from no-value or unknown to the corresponding type. 2019-01-10 11:53:04 -05:00
Michael R Sweet bfc73dc326 Update usage info. 2019-01-09 14:15:03 -05:00
Michael R Sweet c715f67b55 Don't expect debug2 messages when we run the "deeper" test sets. 2019-01-09 14:10:38 -05:00
Michael R Sweet 127c90dae1 Changelog. 2019-01-09 13:24:44 -05:00
Michael R Sweet 96fee30386 Protect against continuing to read from a file at EOF (Issue #5473) 2019-01-09 13:19:11 -05:00
Michael R Sweet f294fe22fd Use codedoc now instead of mxmldoc.
Dump all of the docset stuff - Xcode no longer supports it... :(
2019-01-07 22:07:35 -05:00
Michael R Sweet 1de4cd2b2e Update changelog. 2019-01-07 10:13:44 -05:00
Michael R Sweet c51c178726 Merge pull request #5461 from erkanisik1/master
turkish update
2019-01-07 09:59:30 -05:00
Michael R Sweet 7ca2817eee Merge pull request #5471 from Atalanttore/patch-2
Update cups_de.po
2019-01-07 09:58:47 -05:00
Ettore Atalan 5ab3e072f7 Update cups_de.po
Added some german translations.
2019-01-05 01:15:35 +01:00
Michael R Sweet 9f409435a4 Fix potential crash in cups-driverd (rdar://46625579) 2018-12-14 14:30:12 -05:00
Michael R Sweet b1e7afd596 Bump version. 2018-12-14 10:20:18 -05:00
Michael R Sweet 3642bcbddf Changelog. 2018-12-14 10:04:35 -05:00
Michael R Sweet 59e57148ee Merge pull request #5463 from OdyX/fix-unitialized-service-idle-exit
Fix service_idle_exit build issue with -Werror=maybe-unitialized
2018-12-14 10:03:57 -05:00
Didier Raboud a30818495d Fix service_idle_exit build issue with -Werror=maybe-unitialized 2018-12-14 15:53:32 +01:00
Erkan IŞIK 311bd0d91e turkish update 2018-12-11 22:06:35 +03:00
Michael R Sweet 9dd1bc98cd Move getifaddrs to a separate header. 2018-12-10 14:53:29 -05:00
Michael R Sweet 70bdce1628 Fix ppdmerge backup filename (Issue #5455) 2018-12-10 09:18:43 -05:00
Michael R Sweet 8a763079f5 Bump version, changelog. 2018-12-08 08:14:16 -05:00
Michael R Sweet 065632e209 Fix compile errors - not sure why these didn't show up before... 2018-12-08 08:12:52 -05:00
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
Michael R Sweet 5c2c2ab6a3 Fix cupsJobPassword documentation. 2018-05-14 10:26:55 -07:00
Michael R Sweet 06a5a4d332 Mark cupsGetDevices as deprecated.
Update CUPS Programming Manual.

Update CUPS Admin API documentation.

Update CUPS PPD documentation.
2018-05-14 10:21:51 -07:00
Michael R Sweet 4cadd6202f Mirror validation changes from 2.2 branch. 2018-05-11 12:10:32 -07:00
Michael R Sweet 2de7c5f81c Update changelog, copyright... 2018-05-11 10:25:39 -07:00
Michael R Sweet 8127ebd190 Merge pull request #5312 from hansmi/mailtowait1
mailto: Wait for server opening message
2018-05-11 10:19:47 -07:00
Michael R Sweet e5fee178d9 Always use Negotiate or PeerCred for Kerberized printing. 2018-05-10 16:35:37 -04:00
Michael Hanselmann 077bd665bd mailto: Wait for server opening message
A subset of all mailserver configurations reject SMTP sessions where the
client sends anything before the server sent its opening message. This
is the case with Exim on Ubuntu Artful, for example:

  SMTP protocol synchronization error (input sent without waiting for
  greeting)

Not waiting for the opening message is a violation of the session
initiation described in RFC5321 (section 3.1). Update the mailto
notifier to wait for a non-error status code from the server before
proceeding to start the mail transaction.
2018-05-09 01:26:21 +02:00
Michael R Sweet dfe5f3b95c Changelog. 2018-05-01 08:38:41 -04:00
Michael R Sweet 616f3f56dd Merge pull request #5306 from speachy/master
Fix typo in example (cupsCommand -> cupsCommands)
2018-05-01 08:36:28 -04:00
Solomon Peachy f594a3db6d Fix typo in example (cupsCommand -> cupsCommands) 2018-04-30 19:09:41 -04:00
Michael R Sweet d3ab37abea Use -m everywhere for manual sharing. 2018-04-24 20:44:54 -04:00
Michael R Sweet 619d6d95eb Fix 360dpi typo (Issue #5300) 2018-04-24 20:34:10 -04:00
Michael R Sweet b95156db4c Update ErrorPolicy in cupsd.conf man page (Issue #5301) 2018-04-24 20:28:36 -04:00
Michael R Sweet ff82ce17bf Fix GNU TLS httpCertString changes. 2018-04-24 18:22:41 -04:00
Michael R Sweet af62b316e7 Extend GNU TLS certificate string. 2018-04-24 18:04:52 -04:00
Michael R Sweet 073b3929a1 Add issuer and signature algorithm to certificate string, show it in tlscheck output. 2018-04-24 17:46:58 -04:00
Michael R Sweet 17cc92f131 Add resource and system object/state values. 2018-04-24 16:17:21 -04:00
Michael R Sweet bd4b5b3ee1 Changelog. 2018-04-18 08:51:07 -04:00
Michael R Sweet c77dede2ed Merge pull request #5297 from FedericoYundt/patch-1
Allow cupsd daemon to exit on idle (restart=on-failure instead of always)
2018-04-18 08:48:46 -04:00
FedericoYundt 4e02be68c1 Allow cupsd daemon to exit on idle
When using socket activation cups daemon can safely exit on idle and be automatically started when it's needed. Using Restart=always prevent this behavior and causes cups daemon constantly restarting itself instead of exiting. Users reported[1] that Restart=on-failure was enough to fix issues[2] so Restart=always may be unnecessary and harmful.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861470
[2] https://github.com/apple/cups/issues/5263
2018-04-18 08:40:59 +01:00
Michael R Sweet 0873f681e4 Fix policy limits using All (Issue #5296) 2018-04-17 16:54:24 -04:00
Michael R Sweet c1de912d13 Map , to p in phone numbers. 2018-04-17 14:22:16 -04:00
Michael R Sweet fbcc927ded Add support for pause and wait characters in fax numbers (rdar://39212256) 2018-04-17 12:47:00 -04:00
Michael R Sweet 4feb1fe2e5 - Added a workaround for certain web browsers that do not support multiple
authentication schemes in a single response header (Issue #5289)
2018-04-16 17:16:31 -04:00
Michael R Sweet c944b62ba8 Fix cups_auth_find for schemes without parameters. 2018-04-11 22:03:47 -04:00
Michael R Sweet 44cb0dd233 Fix a parsing bug in the new authentication code. 2018-04-11 13:10:24 -04:00
Michael R Sweet 3581e03de5 Update lpoptions man page (Issue #5286) 2018-04-10 15:43:24 -04:00
Michael R Sweet 56f0cbeb27 Merge pull request #5286 from Kohlrabi/master
Remove mentions of non-implemented -U option from lpoptions manpage (still need to update date)
2018-04-10 15:36:58 -04:00
Michael R Sweet 656c109a1c Fix another CUPS-Create-Local-Printer crash (Issue #5290) 2018-04-09 15:31:56 -04:00
Michael R Sweet 159e027902 Changelog. 2018-04-09 09:52:07 -04:00
Michael R Sweet 7271db11d2 Use cupsGetNamedDest for legacy printing APIs (Issue #5288) 2018-04-09 09:50:50 -04:00
Michael R Sweet d07cb8d5dc The ipptool program no longer checks for duplicate attributes when running in
list or CSV mode (Issue #5278)
2018-04-05 20:12:39 -04:00
Michael R Sweet 15fe2ddc7f Fix ippfind _regtype 2018-04-05 17:25:31 -04:00
Christoph Terasa df59b110ad Remove mentions of non-implemented -U option from lpoptions manpage 2018-04-03 16:30:16 +02:00
677 arquivos alterados com 125948 adições e 65558 exclusões
+3 -1
Ver Arquivo
@@ -1,3 +1,5 @@
.git* export-ignore
.mailmap export-ignore
tools export-ignore
examples/testfile.pcl -text
exampels/testfile.txt -text
scripts export-ignore
+24 -26
Ver Arquivo
@@ -1,13 +1,7 @@
*.a
*.bck
*.cgi
*.dylib
*.gz
*.o
*.so
*.so.*
*.tokens
.buildrev
autom4te.cache
config.h
config.log
@@ -16,7 +10,9 @@ cups-config
Makedefs
backend/dnssd
backend/http
backend/https
backend/ipp
backend/ipps
backend/lpd
backend/mdns
backend/snmp
@@ -29,7 +25,6 @@ berkeley/lpc
berkeley/lpq
berkeley/lpr
berkeley/lprm
cgi-bin/makedocset
cgi-bin/testcgi
cgi-bin/testhi
cgi-bin/testhi.index
@@ -39,6 +34,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
@@ -62,6 +65,7 @@ cups/testppd
cups/testpwg
cups/testraster
cups/testsnmp
cups/testthreads
cups/tlscheck
desktop/cups.desktop
doc/index.html
@@ -76,14 +80,6 @@ filter/rastertopwg
locale/checkpo
locale/po2strings
locale/strings2po
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
man/mantohtml
monitor/bcp
monitor/tbcp
@@ -92,8 +88,6 @@ notifier/mailto
notifier/rss
notifier/testnotify
packaging/cups.list
org.cups.docset*
patches
ppdc/genstrings
ppdc/ppd/
ppdc/ppd2/
@@ -117,6 +111,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
@@ -125,7 +120,6 @@ scheduler/testlpd
scheduler/testmime
scheduler/testspeed
scheduler/testsub
systemv/accept
systemv/cancel
systemv/cupsaccept
systemv/cupsaddsmb
@@ -141,18 +135,22 @@ systemv/lpinfo
systemv/lpmove
systemv/lpoptions
systemv/lpstat
systemv/reject
templates/header.tmpl
templates/*/header.tmpl
test/cups-str-*.html
test/*_log-*
test/ippfind
test/ippfind-static
test/ippserver
test/ippserver-shared
test/ipptool
test/ipptool-static
test/pwg-raster-samples-*
tools/ippevepcl
tools/ippeveprinter
tools/ippeveprinter-static
tools/ippeveps
tools/ippfind
tools/ippfind-static
tools/ipptool
tools/ipptool-static
vcnet/.vs
vcnet/packages
vcnet/Win32
vcnet/x64
xcode/CUPS.xcodeproj/project.xcworkspace/
xcode/CUPS.xcodeproj/xcuserdata/
+4
Ver Arquivo
@@ -0,0 +1,4 @@
queries:
- exclude: cpp/integer-multiplication-cast-to-long
- exclude: cpp/missing-header-guard
- exclude: cpp/short-global-name
+272 -1
Ver Arquivo
@@ -1,6 +1,277 @@
CHANGES - 2.3b4 - 2018-03-23
CHANGES - 2.3.3 - 2020-04-24
============================
Changes in CUPS v2.3.3
----------------------
- CVE-2020-3898: The `ppdOpen` function did not handle invalid UI
constraint. `ppdcSource::get_resolution` function did not handle
invalid resolution strings.
- CVE-2019-8842: The `ippReadIO` function may under-read an extension
field.
- Fixed WARNING_OPTIONS support for GCC 9.x
Changes in CUPS v2.3.2
----------------------
- Localization updates.
Changes in CUPS v2.3.1
----------------------
- Documentation updates (Issue #5661, #5674, #5682)
- CVE-2019-2228: The `ippSetValuetag` function did not validate the default
language value.
- Fixed a crash bug in the web interface (Issue #5621)
- The PPD cache code now looks up page sizes using their dimensions
(Issue #5633)
- PPD files containing "custom" option keywords did not work (Issue #5639)
- Added a workaround for the scheduler's systemd support (Issue #5640)
- On Windows, TLS certificates generated on February 29 would likely fail
(Issue #5643)
- Added a DigestOptions directive for the `client.conf` file to control whether
MD5-based Digest authentication is allowed (Issue #5647)
- Fixed a bug in the handling of printer resource files (Issue #5652)
- The libusb-based USB backend now reports an error when the distribution
permissions are wrong (Issue #5658)
- Added paint can labels to Dymo driver (Issue #5662)
- The `ippeveprinter` program now supports authentication (Issue #5665)
- The `ippeveprinter` program now advertises DNS-SD services on the correct
interfaces, and provides a way to turn them off (Issue #5666)
- The `--with-dbusdir` option was ignored by the configure script (Issue #5671)
- Sandboxed applications were not able to get the default printer (Issue #5676)
- Log file access controls were not preserved by `cupsctl` (Issue #5677)
- Default printers set with `lpoptions` did not work in all cases (Issue #5681,
Issue #5683, Issue #5684)
- Fixed an error in the jobs web interface template (Issue #5694)
- Fixed an off-by-one error in `ippEnumString` (Issue #5695)
- Fixed some new compiler warnings (Issue #5700)
- Fixed a few issues with the Apple Raster support (rdar://55301114)
- The IPP backend did not detect all cases where a job should be retried using
a raster format (rdar://56021091)
- Fixed spelling of "fold-accordion".
- Fixed the default common name for TLS certificates used by `ippeveprinter`.
- Fixed the option names used for IPP Everywhere finishing options.
- Added support for the second roll of the DYMO Twin/DUO label printers.
Changes in CUPS v2.3.0
----------------------
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
- Added a GPL2/LGPL2 exception to the new CUPS license terms.
- Documentation updates (Issue #5604)
- Localization updates (Issue #5637)
- Fixed a bug in the scheduler job cleanup code (Issue #5588)
- Fixed builds when there is no TLS library (Issue #5590)
- Eliminated some new GCC compiler warnings (Issue #5591)
- Removed dead code from the scheduler (Issue #5593)
- "make" failed with GZIP options (Issue #5595)
- Fixed potential excess logging from the scheduler when removing job files
(Issue #5597)
- Fixed a NULL pointer dereference bug in `httpGetSubField2` (Issue #5598)
- Added FIPS-140 workarounds for GNU TLS (Issue #5601, Issue #5622)
- The scheduler no longer provides a default value for the description
(Issue #5603)
- The scheduler now logs jobs held for authentication using the error level so
it is clear what happened (Issue #5604)
- The `lpadmin` command did not always update the PPD file for changes to the
`cupsIPPSupplies` and `cupsSNMPSupplies` keywords (Issue #5610)
- The scheduler now uses both the group's membership list as well as the
various OS-specific membership functions to determine whether a user belongs
to a named group (Issue #5613)
- Added USB quirks rule for HP LaserJet 1015 (Issue #5617)
- Fixed some PPD parser issues (Issue #5623, Issue #5624)
- The IPP parser no longer allows invalid member attributes in collections
(Issue #5630)
- The configure script now treats the "wheel" group as a potential system
group (Issue #5638)
- Fixed a USB printing issue on macOS (rdar://31433931)
- Fixed IPP buffer overflow (rdar://50035411)
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
- Fixed DoS issues in the scheduler (rdar://51373929)
- Fixed an issue with unsupported "sides" values in the IPP backend
(rdar://51775322)
- The scheduler would restart continuously when idle and printers were not
shared (rdar://52561199)
- Fixed an issue with `EXPECT !name WITH-VALUE ...` tests.
- Fixed a command ordering issue in the Zebra ZPL driver.
- Fixed a memory leak in `ppdOpen`.
Changes in CUPS v2.3rc1
-----------------------
- The `cups-config` script no longer adds extra libraries when linking against
shared libraries (Issue #5261)
- The supplied example print documents have been optimized for size
(Issue #5529)
- The `cupsctl` command now prevents setting "cups-files.conf" directives
(Issue #5530)
- The "forbidden" message in the web interface is now explained (Issue #5547)
- The footer in the web interface covered some content on small displays
(Issue #5574)
- The libusb-based USB backend now enforces read limits, improving print speed
in many cases (Issue #5583)
- The `ippeveprinter` command now looks for print commands in the "command"
subdirectory.
- The `ipptool` command now supports `$date-current` and `$date-start` variables
to insert the current and starting date and time values, as well as ISO-8601
relative time values such as "PT30S" for 30 seconds in the future.
Changes in CUPS v2.3b8
----------------------
- Media size matching now uses a tolerance of 0.5mm (rdar://33822024)
- The lpadmin command would hang with a bad PPD file (rdar://41495016)
- Fixed a potential crash bug in cups-driverd (rdar://46625579)
- Fixed a performance regression with large PPDs (rdar://47040759)
- Fixed a memory reallocation bug in HTTP header value expansion
(rdar://problem/50000749)
- Timed out job submission now yields an error (Issue #5570)
- Restored minimal support for the `Emulators` keyword in PPD files to allow
old Samsung printer drivers to continue to work (Issue #5562)
- The scheduler did not encode octetString values like "job-password" correctly
for the print filters (Issue #5558)
- The `cupsCheckDestSupported` function did not check octetString values
correctly (Issue #5557)
- Added support for `UserAgentTokens` directive in "client.conf" (Issue #5555)
- Updated the systemd service file for cupsd (Issue #5551)
- The `ippValidateAttribute` function did not catch all instances of invalid
UTF-8 strings (Issue #5509)
- Fixed an issue with the self-signed certificates generated by GNU TLS
(Issue #5506)
- Fixed a potential memory leak when reading at the end of a file (Issue #5473)
- Fixed potential unaligned accesses in the string pool (Issue #5474)
- Fixed a potential memory leak when loading a PPD file (Issue #5475)
- Added a USB quirks rule for the Lexmark E120n (Issue #5478)
- Updated the USB quirks rule for Zebra label printers (Issue #5395)
- Fixed a compile error on Linux (Issue #5483)
- The lpadmin command, web interface, and scheduler all queried an IPP
Everywhere printer differently, resulting in different PPDs for the same
printer (Issue #5484)
- The web interface no longer provides access to the log files (Issue #5513)
- Non-Kerberized printing to Windows via IPP was broken (Issue #5515)
- Eliminated use of private headers and some deprecated macOS APIs (Issue #5516)
- The scheduler no longer stops a printer if an error occurs when a job is
canceled or aborted (Issue #5517)
- Added a USB quirks rule for the DYMO 450 Turbo (Issue #5521)
- Added a USB quirks rule for Xerox printers (Issue #5523)
- The scheduler's self-signed certificate did not include all of the alternate
names for the server when using GNU TLS (Issue #5525)
- Fixed compiler warnings with newer versions of GCC (Issue #5532, Issue #5533)
- Fixed some PPD caching and IPP Everywhere PPD accounting/password bugs
(Issue #5535)
- Fixed `PreserveJobHistory` bug with time values (Issue #5538)
- The scheduler no longer advertises the HTTP methods it supports (Issue #5540)
- Localization updates (Issue #5461, Issues #5471, Issue #5481, Issue #5486,
Issue #5489, Issue #5491, Issue #5492, Issue #5493, Issue #5494, Issue #5495,
Issue #5497, Issue #5499, Issue #5500, Issue #5501, Issue #5504)
- The scheduler did not always idle exit as quickly as it could.
- Added a new `ippeveprinter` command based on the old ippserver sample code.
Changes in CUPS v2.3b7
----------------------
- Fixed some build failures (Issue #5451, Issue #5463)
- Running ppdmerge with the same input and output filenames did not work as
advertised (Issue #5455)
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-4300: 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)
- The `cupsCreateJob`, `cupsPrintFile2`, and `cupsPrintFiles2` APIs did not use
the supplied HTTP connection (Issue #5288)
- Fixed another crash in the scheduler when adding an IPP Everywhere printer
(Issue #5290)
- Added a workaround for certain web browsers that do not support multiple
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.
Changes in CUPS v2.3b4
----------------------
+6 -5
Ver Arquivo
@@ -2,13 +2,14 @@ Contributing to CUPS
====================
CUPS is developed by Apple Inc. and distributed as open source software under
the Apache License, Version 2.0. Significant contributions to CUPS must be
licensed to Apple using the Apple Contributor Agreement:
the Apache License, Version 2.0 with exceptions to allow linking to GPL2/LGPL2
code. Significant contributions to CUPS must be licensed to Apple using the
Apple Contributor Agreement:
https://www.cups.org/AppleContributorAgreement_2011-03-10.pdf
Contributions should be submitted as attachments to bug reports on the CUPS web
site. Changes to existing source files should be submitted as unified diffs
(both Subversion and Git produce this format by default) while new source files
Contributions should be submitted as attachments to bug reports on the
[CUPS Github project](https://github.com/apple/cups). Changes to existing
source files should be submitted as unified diffs while new source files
should be provided as-is or in an archive. Github pull requests can also be
used to submit changes.
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
CREDITS - 2017-05-01
CREDITS - 2019-08-21
====================
Few projects are completed by one person, and CUPS is no exception. We'd like
+15 -7
Ver Arquivo
@@ -63,7 +63,9 @@ major, minor, and patch release numbers. Major release numbers indicate large
design changes or backwards-incompatible changes to the CUPS API or CUPS
Imaging API. Minor release numbers indicate new features and other smaller
changes which are backwards-compatible with previous CUPS releases. Patch
numbers indicate bug fixes to the previous feature or patch release.
numbers indicate bug fixes to the previous feature or patch release. This
version numbering scheme is consistent with the
[Semantic Versioning](http://semver.org) specification.
> Note:
>
@@ -114,6 +116,10 @@ Contributed source code must follow the guidelines below. While the examples
are for C and C++ source files, source code for other languages should conform
to the same guidelines as allowed by the language.
Source code comments provide the reference portion of the CUPS Programming
Manual, which is generated using the [codedoc](https://www.msweet.org/codedoc)
software.
### Source Files
@@ -270,15 +276,17 @@ Return/output values are indicated using an "O" prefix, input values are
indicated using the "I" prefix, and values that are both input and output use
the "IO" prefix for the corresponding in-line comment.
The Mini-XML documentation generator also understands the following special
text in the function description comment:
The [codedoc](https://www.msweet.org/codedoc) documentation generator also
understands the following special text in the function description comment:
@deprecated@ - Marks the function as deprecated (not recommended
for new development and scheduled for removal)
@deprecated@ - Marks the function as deprecated: not recommended
for new development and scheduled for removal.
@link name@ - Provides a hyperlink to the corresponding function
or type definition.
@since CUPS version@ - Marks the function as new in the specified version
of CUPS.
@private@ - Marks the function as private (same as starting the
function name with an underscore)
@private@ - Marks the function as private so it will not be
included in the documentation.
### Variables
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v2.3b4 - 2018-03-22
INSTALL - CUPS v2.3.3 - 2020-04-24
==================================
This file describes how to compile and install CUPS from source code. For more
+41 -41
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-2019 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.
#
#
@@ -25,7 +26,7 @@ CHMOD = @CHMOD@
CXX = @LIBTOOL_CXX@ @CXX@
DSO = @DSO@
DSOXX = @DSOXX@
GZIP = @GZIP@
GZIPPROG = @GZIPPROG@
INSTALL = @INSTALL@
LD = @LD@
LD_CC = @LD_CC@
@@ -91,14 +92,13 @@ LOCALTARGET = @LOCALTARGET@
#
LIBCUPS = @LIBCUPS@
LIBCUPSCGI = @LIBCUPSCGI@
LIBCUPSIMAGE = @LIBCUPSIMAGE@
LIBCUPSMIME = @LIBCUPSMIME@
LIBCUPSPPDC = @LIBCUPSPPDC@
LIBCUPSOBJS = @LIBCUPSOBJS@
LIBCUPSSTATIC = @LIBCUPSSTATIC@
LIBGSSAPI = @LIBGSSAPI@
LIBHEADERS = @LIBHEADERS@
LIBHEADERSPRIV = @LIBHEADERSPRIV@
LIBMALLOC = @LIBMALLOC@
LIBMXML = @LIBMXML@
LIBPAPER = @LIBPAPER@
LIBUSB = @LIBUSB@
LIBWRAP = @LIBWRAP@
@@ -116,12 +116,27 @@ INSTALLSTATIC = @INSTALLSTATIC@
IPPALIASES = @IPPALIASES@
#
# ippeveprinter commands...
#
IPPEVECOMMANDS = @IPPEVECOMMANDS@
#
# Install XPC backends?
#
INSTALLXPC = @INSTALLXPC@
#
# Code signing...
#
CODE_SIGN = @CODE_SIGN@
CODE_SIGN_IDENTITY = -
#
# Program options...
#
@@ -132,10 +147,15 @@ 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)
ALL_DSOFLAGS = -L../cups @ARCHFLAGS@ @RELROFLAGS@ $(DSOFLAGS) $(OPTIM)
ALL_LDFLAGS = -L../cups @LDARCHFLAGS@ @RELROFLAGS@ $(LDFLAGS) \
@PIEFLAGS@ $(OPTIM)
ARCHFLAGS = @ARCHFLAGS@
ARFLAGS = @ARFLAGS@
BACKLIBS = @BACKLIBS@
@@ -147,21 +167,18 @@ CXXLIBS = @CXXLIBS@
DBUS_NOTIFIER = @DBUS_NOTIFIER@
DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@
DNSSD_BACKEND = @DNSSD_BACKEND@
DSOFLAGS = -L../cups @DSOFLAGS@
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
DSOFLAGS = @DSOFLAGS@
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)
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
LDFLAGS = @LDFLAGS@
LINKCUPS = @LINKCUPS@
LINKCUPSSTATIC = ../cups/$(LIBCUPSSTATIC) $(LIBS)
LIBS = $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ) $(COMMONLIBS)
ONDEMANDFLAGS = @ONDEMANDFLAGS@
ONDEMANDLIBS = @ONDEMANDLIBS@
OPTIM = @OPTIM@
OPTIONS =
OPTIONS = @WARNING_OPTIONS@
PAMLIBS = @PAMLIBS@
SERVERLIBS = @SERVERLIBS@
SSLFLAGS = @SSLFLAGS@
@@ -203,9 +220,8 @@ srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
BUILDROOT = $(DSTROOT)
BUILDROOT = $(DSTROOT)$(DESTDIR)
AMANDIR = $(BUILDROOT)@AMANDIR@
BINDIR = $(BUILDROOT)@bindir@
BUNDLEDIR = @CUPS_BUNDLEDIR@
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
@@ -218,23 +234,17 @@ LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
MANDIR = $(BUILDROOT)@mandir@
MENUDIR = @MENUDIR@
PMANDIR = $(BUILDROOT)@PMANDIR@
PRIVATEINCLUDE = $(BUILDROOT)@PRIVATEINCLUDE@
RCLEVELS = @RCLEVELS@
RCSTART = @RCSTART@
RCSTOP = @RCSTOP@
REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
RESOURCEDIR = @CUPS_RESOURCEDIR@
SBINDIR = $(BUILDROOT)@sbindir@
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
MAN1EXT = @MAN1EXT@
MAN5EXT = @MAN5EXT@
MAN7EXT = @MAN7EXT@
MAN8EXT = @MAN8EXT@
MAN8DIR = @MAN8DIR@
PAMDIR = @PAMDIR@
PAMFILE = @PAMFILE@
@@ -254,7 +264,7 @@ USBQUIRKS = @USBQUIRKS@
#
.SILENT:
.SUFFIXES: .1 .1.gz .1m .1m.gz .3 .3.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .gz
.SUFFIXES: .a .c .cxx .h .o
.c.o:
echo Compiling $<...
@@ -263,13 +273,3 @@ USBQUIRKS = @USBQUIRKS@
.cxx.o:
echo Compiling $<...
$(CXX) $(ARCHFLAGS) $(OPTIM) $(ALL_CXXFLAGS) -c -o $@ $<
.man.1 .man.1m .man.3 .man.5 .man.7 .man.8:
echo Linking $<...
$(RM) $@
$(LN) $< $@
.man.1.gz .man.1m.gz .man.3.gz .man.5.gz .man.7.gz .man.8.gz .man.gz:
echo -n Compressing $<...
$(RM) $@
gzip -v9 <$< >$@
+15 -54
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-2019 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,14 @@ include Makedefs
# Directories to make...
#
DIRS = cups test $(BUILDDIRS)
DIRS = cups $(BUILDDIRS)
#
# Test suite options - normally blank, override with make command...
#
TESTOPTIONS =
#
@@ -94,16 +102,14 @@ distclean: clean
$(RM) Makedefs config.h config.log config.status
$(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
$(RM) cups-config
$(RM) data/testprint
$(RM) desktop/cups.desktop
$(RM) doc/index.html
$(RM) 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
$(RM) packaging/cups.list
$(RM) 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
$(RM) templates/header.tmpl
-$(RM) doc/*/index.html
-$(RM) templates/*/header.tmpl
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
-$(RM) -r autom4te*.cache cups/charmaps cups/locale
#
@@ -117,25 +123,6 @@ depend:
done
#
# Run the Clang static code analysis tool on the sources, available here:
#
# http://clang-analyzer.llvm.org
#
# At least checker-231 is required.
#
# Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
# output instead of HTML...)
#
.PHONY: clang clang-changes
clang:
$(RM) -r clang
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
clang-changes:
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
#
# Run the STACK tool on the sources, available here:
#
@@ -245,7 +232,7 @@ uninstall:
test: all unittests
echo Running CUPS test suite...
cd test; ./run-stp-tests.sh
cd test; ./run-stp-tests.sh $(TESTOPTIONS)
check: all unittests
@@ -258,7 +245,7 @@ debugcheck: all unittests
#
# Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
# Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
#
apihelp:
@@ -268,32 +255,6 @@ apihelp:
done
#
# Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
#
docset: apihelp
echo Generating docset directory tree...
$(RM) -r org.cups.docset
mkdir -p org.cups.docset/Contents/Resources/Documentation/help
mkdir -p org.cups.docset/Contents/Resources/Documentation/images
cd man; $(MAKE) $(MFLAGS) html
cd doc; $(MAKE) $(MFLAGS) docset
cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
cgi-bin/makedocset org.cups.docset \
`svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
doc/help/api-*.tokens
$(RM) doc/help/api-*.tokens
echo Indexing docset...
/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset
echo Generating docset archive and feed...
$(RM) org.cups.docset.atom
/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
--atom org.cups.docset.atom \
--download-url http://www.cups.org/org.cups.docset.xar \
org.cups.docset
#
# Lines of code computation...
#
+18 -1
Ver Arquivo
@@ -1,6 +1,6 @@
CUPS
Copyright © 2007-2018 by Apple Inc.
Copyright © 2007-2019 by Apple Inc.
Copyright © 1997-2007 by Easy Software Products.
CUPS and the CUPS logo are trademarks of Apple Inc.
@@ -32,3 +32,20 @@ the following restrictions:
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
-- CUPS Exceptions to the Apache 2.0 License --
As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into an Object form of such source code, you
may redistribute such embedded portions in such Object form without complying
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
In addition, if you combine or link compiled forms of this Software with
software that is licensed under the GPLv2 ("Combined Software") and if a
court of competent jurisdiction determines that the patent provision (Section
3), the indemnity provision (Section 9) or other Section of the License
conflicts with the conditions of the GPLv2, you may retroactively and
prospectively choose to deem waived or otherwise exclude such Section(s) of
the License, but only in their entirety and only with respect to the Combined
Software.
+39 -30
Ver Arquivo
@@ -1,13 +1,9 @@
README - CUPS v2.3b4 - 2018-03-22
README - CUPS v2.3.3 - 2020-04-24
=================================
Looking for compile instructions? Read the file `INSTALL.md` instead...
INTRODUCTION
------------
CUPS is a standards-based, open source printing system developed by Apple Inc.
for macOS® and other UNIX®-like operating systems. CUPS uses the Internet
Printing Protocol ("IPP") and provides System V and Berkeley command-line
@@ -29,8 +25,21 @@ CUPS is licensed under the Apache License Version 2.0. See the file
READING THE DOCUMENTATION
-------------------------
Initial documentation to get you started is provided in the root directory of
the CUPS sources:
- `CHANGES.md`: A list of changes in the current major release of CUPS.
- `CONTRIBUTING.md`: Guidelines for contributing to the CUPS project.
- `CREDITS.md`: A list of past contributors to the CUPS project.
- `DEVELOPING.md`: Guidelines for developing code for the CUPS project.
- `INSTALL.md`: Instructions for building and installing CUPS.
- `LICENSE`: The CUPS license agreement (Apache 2.0).
- `NOTICE`: Copyright notices and exceptions to the CUPS license agreement.
- `README.md`: This file.
Once you have installed the software you can access the documentation (and a
bunch of other stuff) online at <http://localhost:631/>.
bunch of other stuff) online at <http://localhost:631/> and using the `man`
command, for example `man cups`.
If you're having trouble getting that far, the documentation is located under
the `doc/help` and `man` directories.
@@ -56,11 +65,11 @@ in your browser to access the printer administration tools:
*Do not* use the hostname for your machine - it will not work with the default
CUPS configuration. To enable administration access on other addresses, check
the `Allow Remote Administration` box and click on the `Change Settings button.
the `Allow Remote Administration` box and click on the `Change Settings` button.
You will be asked for the administration password (root or any other user in the
sys/system/root/admin/lpadmin group on your system) when performing any
administrative function.
"sys", "system", "root", "admin", or "lpadmin" group on your system) when
performing any administrative function.
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
@@ -70,28 +79,28 @@ CUPS currently uses PPD (PostScript Printer Description) files that describe
printer capabilities and driver programs needed for each printer. The
`everywhere` PPD is used for nearly all modern networks printers sold since
about 2009. For example, the following command creates a print queue for a
printer at address 11.22.33.44:
printer at address "11.22.33.44":
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
CUPS also includes several sample PPD files you can use for "legacy" printers:
Driver PPD Name
----------------------------- ------------------------------
Dymo Label Printers drv:///sample.drv/dymo.ppd
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
Generic PostScript Printer drv:///sample.drv/generic.ppd
HP DeskJet Series drv:///sample.drv/deskjet.ppd
HP LaserJet Series drv:///sample.drv/laserjet.ppd
OKIDATA 9-Pin Series drv:///sample.drv/okidata9.ppd
OKIDATA 24-Pin Series drv:///sample.drv/okidat24.ppd
Zebra CPCL Label Printer drv:///sample.drv/zebracpl.ppd
Zebra EPL1 Label Printer drv:///sample.drv/zebraep1.ppd
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
Driver | PPD Name
----------------------------- | ------------------------------
Dymo Label Printers | drv:///sample.drv/dymo.ppd
Intellitech Intellibar | drv:///sample.drv/intelbar.ppd
EPSON 9-pin Series | drv:///sample.drv/epson9.ppd
EPSON 24-pin Series | drv:///sample.drv/epson24.ppd
Generic PCL Laser Printer | drv:///sample.drv/generpcl.ppd
Generic PostScript Printer | drv:///sample.drv/generic.ppd
HP DeskJet Series | drv:///sample.drv/deskjet.ppd
HP LaserJet Series | drv:///sample.drv/laserjet.ppd
OKIDATA 9-Pin Series | drv:///sample.drv/okidata9.ppd
OKIDATA 24-Pin Series | drv:///sample.drv/okidat24.ppd
Zebra CPCL Label Printer | drv:///sample.drv/zebracpl.ppd
Zebra EPL1 Label Printer | drv:///sample.drv/zebraep1.ppd
Zebra EPL2 Label Printer | drv:///sample.drv/zebraep2.ppd
Zebra ZPL Label Printer | drv:///sample.drv/zebra.ppd
You can run the `lpinfo -m` command to list all of the available drivers:
@@ -148,12 +157,12 @@ This will prevent the filters from misinterpreting your print file.
LEGAL STUFF
-----------
Copyright © 2007-2018 by Apple Inc.
Copyright © 2007-2019 by Apple Inc.
Copyright © 1997-2007 by Easy Software Products.
CUPS is provided under the terms of the Apache License, Version 2.0. A copy of
this license can be found in the file `LICENSE`. Additional legal information
is provided in the file `NOTICE`.
CUPS is provided under the terms of the Apache License, Version 2.0 with
exceptions for GPL2/LGPL2 software. A copy of this license can be found in the
file `LICENSE`. Additional legal information is provided in the file `NOTICE`.
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+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
+28 -20
Ver Arquivo
@@ -1,7 +1,7 @@
#
# Backend makefile for CUPS.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 2007-2019 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.
@@ -201,8 +201,8 @@ uninstall:
test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o test1284 test1284.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -211,8 +211,8 @@ test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o testbackend testbackend.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -221,9 +221,9 @@ testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
$(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -243,7 +243,8 @@ libbackend.a: $(LIBOBJS)
dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
$(LD_CC) $(ALL_LDFLAGS) -o dnssd dnssd.o libbackend.a $(DNSSDLIBS) $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
if test `uname` = Darwin; then \
$(RM) mdns; \
$(LN) dnssd mdns; \
@@ -256,9 +257,12 @@ 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
$(LD_CC) $(ALL_LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
$(RM) http https ipps
for file in $(IPPALIASES); do \
$(LN) ipp $$file; \
done
#
@@ -267,7 +271,8 @@ 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)
$(LD_CC) $(ALL_LDFLAGS) -o lpd lpd.o libbackend.a $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -276,7 +281,8 @@ 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)
$(LD_CC) $(ALL_LDFLAGS) -o snmp snmp.o libbackend.a $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -285,13 +291,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)
$(LD_CC) $(ALL_LDFLAGS) -o socket socket.o libbackend.a $(LINKCUPS)
$(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)
$(LD_CC) $(ALL_LDFLAGS) -o socket-static socket.o libbackend.a \
$(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -300,8 +307,9 @@ socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
$(BACKLIBS) $(LIBS)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
$(BACKLIBS) $(COMMONLIBS) $(LINKCUPS)
$(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';
+175 -137
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* IPP backend for CUPS.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 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
@@ -23,12 +23,8 @@
# define kPMPrintUIToolAgent "com.apple.printuitool.agent"
# define kPMStartJob 100
# define kPMWaitForJob 101
# ifdef HAVE_XPC_PRIVATE_H
# include <xpc/private.h>
# else
extern void xpc_connection_set_target_uid(xpc_connection_t connection,
uid_t uid);
# endif /* HAVE_XPC_PRIVATE_H */
#endif /* HAVE_GSSAPI && HAVE_XPC */
@@ -237,7 +233,6 @@ main(int argc, /* I - Number of command-line args */
int waitjob, /* Wait for job complete? */
waitjob_tries = 0, /* Number of times we've waited */
waitprinter; /* Wait for printer ready? */
time_t waittime; /* Wait time for held jobs */
_cups_monitor_t monitor; /* Monitoring data */
ipp_attribute_t *job_id_attr; /* job-id attribute */
int job_id; /* job-id value */
@@ -421,9 +416,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 +505,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 +699,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 +906,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 +921,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 +935,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 +960,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 +984,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 +996,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 +1010,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 +1130,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 +1173,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 +1181,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 +1189,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 +1197,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 +1206,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 +1240,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 +1258,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 +1384,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 +1412,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,10 +1445,12 @@ 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");
fprintf(stderr, "DEBUG: retryable=%d\n", monitor.retryable);
if (create_job)
{
monitor.job_name = argv[3];
@@ -1485,6 +1489,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 (!sides || !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 +1555,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 +1583,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 +1609,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 +1628,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 +1653,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 +1661,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 +1680,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 +1732,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 +1788,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 +1817,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 +1841,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,28 +1861,36 @@ 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)));
response = cupsGetResponse(http, resource);
ippDelete(request);
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
ippErrorString(cupsLastError()), cupsLastErrorString());
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n", ippErrorString(cupsLastError()), cupsLastErrorString());
debug_attributes(response);
ippDelete(response);
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING && !job_canceled)
{
ipp_attribute_t *reasons = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD);
/* job-state-reasons values */
ipp_status = cupsLastError();
_cupsLangPrintFilter(stderr, "ERROR",
_("Unable to add document to print job."));
if (ippContainsString(reasons, "document-format-error"))
ipp_status = IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR;
else if (ippContainsString(reasons, "document-unprintable"))
ipp_status = IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE;
ippDelete(response);
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to add document to print job."));
break;
}
else
{
ippDelete(response);
password_tries = 0;
if (num_files == 0 || fd < 0)
@@ -1866,12 +1902,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_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
argc == 6 &&
document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
{
@@ -1885,9 +1921,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 +1939,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 +1976,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 +1990,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;
}
@@ -1972,7 +2008,7 @@ main(int argc, /* I - Number of command-line args */
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
for (delay = _cupsNextDelay(0, &prev_delay), waittime = time(NULL) + 30; !job_canceled;)
for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;)
{
/*
* Check for side-channel requests...
@@ -1986,14 +2022,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 +2053,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 +2067,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 +2075,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 +2109,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);
@@ -2087,19 +2123,18 @@ main(int argc, /* I - Number of command-line args */
job_sheets->values[0].integer);
/*
* Stop polling if the job is finished or pending-held for 30 seconds...
* Stop polling if the job is finished or pending-held...
*/
if (job_state->values[0].integer > IPP_JSTATE_STOPPED ||
(job_state->values[0].integer == IPP_JSTATE_HELD && time(NULL) > waittime))
if (job_state->values[0].integer > IPP_JSTATE_STOPPED || job_state->values[0].integer == IPP_JSTATE_HELD)
{
ippDelete(response);
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 +2144,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 +2169,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 +2179,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 +2226,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 +2240,26 @@ 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 (job_canceled)
return (CUPS_BACKEND_OK);
else 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 +2270,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 +2294,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 +2328,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 +2336,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 +2462,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 +2481,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 +2498,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 +2525,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 +2542,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)
@@ -2548,12 +2584,11 @@ monitor_printer(
}
}
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
ippEnumString("job-state", monitor->job_state));
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n", ippEnumString("job-state", (int)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");
@@ -2630,12 +2665,11 @@ monitor_printer(
ippDelete(response);
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
ippEnumString("job-state", monitor->job_state));
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n", ippEnumString("job-state", (int)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 +2691,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 +2774,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);
@@ -2780,7 +2814,7 @@ new_request(
char phone[1024], /* Phone number string */
*ptr, /* Pointer into string */
tel_uri[1024]; /* tel: URI */
static const char * const allowed = "0123456789#*-+.()";
static const char * const allowed = "0123456789#*-+.()pw";
/* Allowed characters */
destination = ippNew();
@@ -2793,7 +2827,9 @@ new_request(
_httpDecodeURI(phone, keyword, sizeof(phone));
for (ptr = phone; *ptr;)
{
if (!strchr(allowed, *ptr))
if (*ptr == ',')
*ptr = 'p';
else if (!strchr(allowed, *ptr))
_cups_strcpy(ptr, ptr + 1);
else
ptr ++;
@@ -3579,6 +3615,8 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
}
}
cupsArrayDelete(new_reasons);
_cupsMutexUnlock(&report_mutex);
/*
+18 -19
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Line Printer Daemon backend for CUPS.
*
* Copyright © 2007-2016 by Apple Inc.
* Copyright © 2007-2019 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
@@ -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>
@@ -71,13 +71,12 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
*/
static int cups_rresvport(int *port, int family);
static int lpd_command(int lpd_fd, char *format, ...);
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
const char *printer, int print_fd, int snmp_fd,
int mode, const char *user, const char *title,
int copies, int banner, int format, int order,
int reserve, int manual_copies, int timeout,
int contimeout, const char *orighost);
static int lpd_command(int lpd_fd, char *format, ...)
# ifdef __GNUC__
__attribute__ ((__format__ (__printf__, 2, 3)))
# endif /* __GNUC__ */
;
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist, const char *printer, int print_fd, int snmp_fd, int mode, const char *user, const char *title, int copies, int banner, int format, int order, int reserve, int manual_copies, int timeout, int contimeout, const char *orighost) _CUPS_NONNULL((1,2,3,7,8,17));
static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length);
static void sigterm_handler(int sig);
@@ -618,11 +617,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 +729,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 +916,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 +927,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."));
@@ -1047,7 +1046,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
* Send the control file...
*/
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
(int)getpid() % 1000, localhost))
{
close(fd);
@@ -1097,7 +1096,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
* Send the print file...
*/
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03.3d%.15s\n",
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03d%.15s\n",
CUPS_LLCAST filestats.st_size, (int)getpid() % 1000,
localhost))
{
@@ -1180,7 +1179,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
* Send control file...
*/
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
(int)getpid() % 1000, localhost))
{
close(fd);
+23 -2
Ver Arquivo
@@ -140,8 +140,8 @@
# Samsung ML-2160 Series (https://bugzilla.redhat.com/show_bug.cgi?id=873123)
0x04e8 0x330f unidir
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028)
0x0a5f unidir
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028) (Issue #5395)
0x0a5f unidir no-reattach
# Canon CP-10
0x04a9 0x304a blacklist
@@ -242,6 +242,9 @@
# All Intermec devices (Issue #4553)
0x067e no-reattach
# HP LaserJet 1015 (Issue #5617)
0x03f0 0x0e17 delay-close
# HP LaserJet 1150 (Issue #4549)
0x03f0 0x0f17 delay-close
@@ -281,3 +284,21 @@
# 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
# Lexmark E120n (Issue #5478)
0x043d 0x00cc no-reattach
# All Xerox printers (Issue #5523)
0x0924 no-reattach
# Dymo 450 Turbo (Issue #5521)
0x0922 0x0021 unidir
+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);
+12 -12
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);
@@ -1280,6 +1280,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
(*printerIntf)->GetInterfaceNumber(printerIntf, &intfNumber);
(*printerIntf)->GetLocationID(printerIntf, &intfLocation);
if (intfProtocol == kUSBPrintingProtocolIPP)
return keepLooking;
if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
{
if (serial != NULL && CFStringCompare(serial, g.serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
@@ -1287,12 +1290,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
g.interfaceProtocol = intfProtocol;
g.location = intfLocation;
g.alternateSetting = intfAltSetting;
if (intfProtocol != kUSBPrintingProtocolIPP)
{
g.printer_obj = obj;
IOObjectRetain(obj);
}
keepLooking = (intfProtocol == kUSBPrintingProtocolIPP);
g.printer_obj = obj;
IOObjectRetain(obj);
keepLooking = false;
}
}
else
@@ -1300,14 +1300,14 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
if (g.printer_obj != 0)
IOObjectRelease(g.printer_obj);
if (g.location == 0 || g.location == intfLocation)
keepLooking = false;
g.location = intfLocation;
g.alternateSetting = intfAltSetting;
g.interfaceProtocol = intfProtocol;
g.printer_obj = obj;
IOObjectRetain(obj);
if (g.location == 0 || g.location == intfLocation)
keepLooking = false;
}
if (!keepLooking)
@@ -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);
}
+6 -7
Ver Arquivo
@@ -1,9 +1,10 @@
/*
* LIBUSB interface code for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 2007-2019 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.
*/
/*
@@ -825,8 +826,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
err = libusb_init(NULL);
if (err)
{
fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
"libusb error %i\n", (int)err);
fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)err, libusb_strerror((int)err));
return (NULL);
}
@@ -878,7 +878,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
protocol = 0;
for (altset = 0, altptr = ifaceptr->altsetting;
altset < ifaceptr->num_altsetting;
altset < ifaceptr->num_altsetting; // lgtm [cpp/comparison-with-wider-type]
altset ++, altptr ++)
{
/*
@@ -1742,8 +1742,7 @@ static void *read_thread(void *reference)
* Make sure this loop executes no more than once every 250 miliseconds...
*/
if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
(g.wait_eof || !g.read_thread_stop))
if ((g.wait_eof || !g.read_thread_stop))
{
gettimeofday(&now, NULL);
if (timercmp(&now, &end, <))
+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
+9 -5
Ver Arquivo
@@ -1,7 +1,7 @@
#
# Berkeley commands makefile for CUPS.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 2007-2019 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.
@@ -120,7 +120,8 @@ uninstall:
lpc: lpc.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
$(LD_CC) $(ALL_LDFLAGS) -o lpc lpc.o $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -129,7 +130,8 @@ lpc: lpc.o ../cups/$(LIBCUPS)
lpq: lpq.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
$(LD_CC) $(ALL_LDFLAGS) -o lpq lpq.o $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -138,7 +140,8 @@ lpq: lpq.o ../cups/$(LIBCUPS)
lpr: lpr.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
$(LD_CC) $(ALL_LDFLAGS) -o lpr lpr.o $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -147,7 +150,8 @@ lpr: lpr.o ../cups/$(LIBCUPS)
lprm: lprm.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
$(LD_CC) $(ALL_LDFLAGS) -o lprm lprm.o $(LINKCUPS)
$(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-2019 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, _("-P destination Specify the destination"));
_cupsLangPuts(stdout, _("-q Specify the job should be held for printing"));
_cupsLangPuts(stdout, _("-r Remove the file(s) after submission"));
_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
+30 -114
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-2019 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) $(ALL_LDFLAGS) -o $@ admin.o libcupscgi.a $(LINKCUPS)
$(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) $(ALL_LDFLAGS) -o $@ classes.o libcupscgi.a $(LINKCUPS)
$(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) $(ALL_LDFLAGS) -o $@ help.o libcupscgi.a $(LINKCUPS)
$(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) $(ALL_LDFLAGS) -o $@ jobs.o libcupscgi.a $(LINKCUPS)
$(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) $(ALL_LDFLAGS) -o $@ printers.o libcupscgi.a $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -292,9 +208,9 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
$(LIBZ) $(LIBGSSAPI)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testcgi.o libcupscgi.a \
$(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Testing CGI API...
./testcgi
@@ -305,9 +221,9 @@ testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
$(LIBZ) $(LIBGSSAPI)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testhi.o libcupscgi.a \
$(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Testing help index API...
./testhi
@@ -318,8 +234,8 @@ testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
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)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testtemplate.o libcupscgi.a $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
+29 -203
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-2019 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.
*/
/*
@@ -40,7 +41,6 @@ static void do_am_printer(http_t *http, int modify);
static void do_config_server(http_t *http);
static void do_delete_class(http_t *http);
static void do_delete_printer(http_t *http);
static void do_export(http_t *http);
static void do_list_printers(http_t *http);
static void do_menu(http_t *http);
static void do_set_allowed_users(http_t *http);
@@ -163,8 +163,6 @@ main(void)
do_set_options(http, 0);
else if (!strcmp(op, "config-server"))
do_config_server(http);
else if (!strcmp(op, "export-samba"))
do_export(http);
else
{
/*
@@ -561,7 +559,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
attr = ippAddStrings(request, IPP_TAG_PRINTER, IPP_TAG_URI, "member-uris",
num_printers, NULL, NULL);
for (i = 0; i < num_printers; i ++)
attr->values[i].string.text = _cupsStrAlloc(cgiGetArray("MEMBER_URIS", i));
ippSetString(request, &attr, i, cgiGetArray("MEMBER_URIS", i));
}
/*
@@ -928,6 +926,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 +1073,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();
}
@@ -1936,141 +1935,6 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
}
/*
* 'do_export()' - Export printers to Samba.
*/
static void
do_export(http_t *http) /* I - HTTP connection */
{
int i, j; /* Looping vars */
ipp_t *request, /* IPP request */
*response; /* IPP response */
const char *username, /* Samba username */
*password, /* Samba password */
*export_all; /* Export all printers? */
int export_count, /* Number of printers to export */
printer_count; /* Number of available printers */
const char *name, /* What name to pull */
*dest; /* Current destination */
char ppd[1024]; /* PPD file */
/*
* Get form data...
*/
username = cgiGetVariable("USERNAME");
password = cgiGetVariable("PASSWORD");
export_all = cgiGetVariable("EXPORT_ALL");
export_count = cgiGetSize("EXPORT_NAME");
/*
* Get list of available printers...
*/
cgiSetSize("PRINTER_NAME", 0);
cgiSetSize("PRINTER_EXPORT", 0);
request = ippNewRequest(CUPS_GET_PRINTERS);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
"printer-type", 0);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
"printer-type-mask", CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "printer-name");
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
ippDelete(response);
if (!export_all)
{
printer_count = cgiGetSize("PRINTER_NAME");
for (i = 0; i < printer_count; i ++)
{
dest = cgiGetArray("PRINTER_NAME", i);
for (j = 0; j < export_count; j ++)
if (!_cups_strcasecmp(dest, cgiGetArray("EXPORT_NAME", j)))
break;
cgiSetArray("PRINTER_EXPORT", i, j < export_count ? "Y" : "");
}
}
}
/*
* Export or get the printers to export...
*/
if (username && *username && password && *password &&
(export_all || export_count > 0))
{
/*
* Do export...
*/
fputs("DEBUG: Export printers...\n", stderr);
if (export_all)
{
name = "PRINTER_NAME";
export_count = cgiGetSize("PRINTER_NAME");
}
else
name = "EXPORT_NAME";
for (i = 0; i < export_count; i ++)
{
dest = cgiGetArray(name, i);
if (!cupsAdminCreateWindowsPPD(http, dest, ppd, sizeof(ppd)))
break;
j = cupsAdminExportSamba(dest, ppd, "localhost", username, password,
stderr);
unlink(ppd);
if (!j)
break;
}
if (i < export_count)
cgiSetVariable("ERROR", cupsLastErrorString());
else
{
cgiStartHTML(cgiText(_("Export Printers to Samba")));
cgiCopyTemplateLang("samba-exported.tmpl");
cgiEndHTML();
return;
}
}
else if (username && !*username)
cgiSetVariable("ERROR",
cgiText(_("A Samba username is required to export "
"printer drivers")));
else if (username && (!password || !*password))
cgiSetVariable("ERROR",
cgiText(_("A Samba password is required to export "
"printer drivers")));
/*
* Show form...
*/
cgiStartHTML(cgiText(_("Export Printers to Samba")));
cgiCopyTemplateLang("samba-export.tmpl");
cgiEndHTML();
}
/*
* 'do_list_printers()' - List available printers.
*/
@@ -2121,7 +1985,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
attr;
attr = ippFindNextAttribute(response, "device-uri", IPP_TAG_URI))
{
cupsArrayAdd(printer_devices, _cupsStrAlloc(attr->values[0].string.text));
cupsArrayAdd(printer_devices, strdup(attr->values[0].string.text));
}
/*
@@ -2259,7 +2123,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
for (printer_device = (char *)cupsArrayFirst(printer_devices);
printer_device;
printer_device = (char *)cupsArrayNext(printer_devices))
_cupsStrFree(printer_device);
free(printer_device);
cupsArrayDelete(printer_devices);
}
@@ -2285,10 +2149,6 @@ do_menu(http_t *http) /* I - HTTP connection */
int num_settings; /* Number of server settings */
cups_option_t *settings; /* Server settings */
const char *val; /* Setting value */
char filename[1024]; /* Temporary filename */
const char *datadir; /* Location of data files */
ipp_t *request, /* IPP request */
*response; /* IPP response */
/*
@@ -2382,55 +2242,6 @@ do_menu(http_t *http) /* I - HTTP connection */
cupsFreeOptions(num_settings, settings);
/*
* See if Samba and the Windows drivers are installed...
*/
if ((datadir = getenv("CUPS_DATADIR")) == NULL)
datadir = CUPS_DATADIR;
snprintf(filename, sizeof(filename), "%s/drivers/pscript5.dll", datadir);
if (!access(filename, R_OK))
{
/*
* Found Windows 2000 driver file, see if we have smbclient and
* rpcclient...
*/
if (cupsFileFind("smbclient", getenv("PATH"), 1, filename,
sizeof(filename)) &&
cupsFileFind("rpcclient", getenv("PATH"), 1, filename,
sizeof(filename)))
cgiSetVariable("HAVE_SAMBA", "Y");
else
{
if (!cupsFileFind("smbclient", getenv("PATH"), 1, filename,
sizeof(filename)))
fputs("ERROR: smbclient not found!\n", stderr);
if (!cupsFileFind("rpcclient", getenv("PATH"), 1, filename,
sizeof(filename)))
fputs("ERROR: rpcclient not found!\n", stderr);
}
}
else
perror(filename);
/*
* Subscriptions...
*/
request = ippNewRequest(IPP_GET_SUBSCRIPTIONS);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, "ipp://localhost/");
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
ippDelete(response);
}
/*
* Finally, show the main menu template...
*/
@@ -2656,7 +2467,7 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
* Add the name...
*/
attr->values[i].string.text = _cupsStrAlloc(ptr);
ippSetString(request, &attr, i, ptr);
/*
* Advance to the next name...
@@ -3118,6 +2929,9 @@ do_set_options(http_t *http, /* I - HTTP connection */
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_POINTS :
if (!_cups_strncasecmp(option->defchoice, "Custom.", 7))
{
@@ -3465,8 +3279,8 @@ do_set_options(http_t *http, /* I - HTTP connection */
attr = ippAddStrings(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
"job-sheets-default", 2, NULL, NULL);
attr->values[0].string.text = _cupsStrAlloc(cgiGetVariable("job_sheets_start"));
attr->values[1].string.text = _cupsStrAlloc(cgiGetVariable("job_sheets_end"));
ippSetString(request, &attr, 0, cgiGetVariable("job_sheets_start"));
ippSetString(request, &attr, 1, cgiGetVariable("job_sheets_end"));
if ((var = cgiGetVariable("printer_error_policy")) != NULL)
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
@@ -3717,6 +3531,9 @@ get_option_value(
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
@@ -3795,6 +3612,9 @@ get_option_value(
switch (cparam->type)
{
case PPD_CUSTOM_UNKNOWN :
break;
case PPD_CUSTOM_CURVE :
case PPD_CUSTOM_INVCURVE :
case PPD_CUSTOM_REAL :
@@ -3928,6 +3748,11 @@ get_printer_ppd(const char *uri, /* I - Printer URI */
host[256], /* Hostname */
resource[256]; /* Resource path */
int port; /* Port number */
static const char * const pattrs[] = /* Printer attributes we need */
{
"all",
"media-col-database"
};
/*
@@ -3968,6 +3793,7 @@ get_printer_ppd(const char *uri, /* I - Printer URI */
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
response = cupsDoRequest(http, request, resource);
if (!_ppdCreateFromIPP(buffer, bufsize, response))
+8 -7
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* CGI support library definitions for CUPS.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright © 2007-2019 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_CGI_H_
@@ -15,12 +16,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>
@@ -66,14 +67,14 @@ extern void cgiEndMultipart(void);
extern char *cgiFormEncode(char *dst, const char *src,
size_t dstsize);
extern void cgiFreeSearch(void *search);
extern const char *cgiGetArray(const char *name, int element);
extern char *cgiGetArray(const char *name, int element);
extern void cgiGetAttributes(ipp_t *request, const char *tmpl);
extern const char *cgiGetCookie(const char *name);
extern const cgi_file_t *cgiGetFile(void);
extern cups_array_t *cgiGetIPPObjects(ipp_t *response, void *search);
extern int cgiGetSize(const char *name);
extern char *cgiGetTemplateDir(void);
extern const char *cgiGetVariable(const char *name);
extern char *cgiGetVariable(const char *name);
extern int cgiInitialize(void);
extern int cgiIsPOST(void);
extern void cgiMoveJobs(http_t *http, const char *dest, int job_id);
+8 -50
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Online help index routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2019 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.
*/
/*
@@ -134,11 +135,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 +151,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 +181,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 +228,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.
*/
@@ -352,6 +341,8 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
while (isspace(*ptr & 255))
ptr ++;
}
else
section[0] = '\0';
if (*ptr != '\"')
break;
@@ -441,8 +432,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 +511,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 +632,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 +683,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 +716,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 +745,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 +854,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,17 +1185,13 @@ 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);
n->filename = strdup(filename);
n->anchor = anchor ? strdup(anchor) : NULL;
n->section = *section ? strdup(section) : NULL;
n->section = (section && *section) ? strdup(section) : NULL;
n->text = strdup(text);
n->mtime = mtime;
n->offset = offset;
@@ -1242,10 +1212,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 +1237,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 +1260,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);
}
+51 -62
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* CGI form variable and array functions for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
* Copyright © 2007-2019 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.
*/
/*
@@ -29,10 +30,10 @@
typedef struct /**** Form variable structure ****/
{
const char *name; /* Name of variable */
char *name; /* Name of variable */
int nvalues, /* Number of values */
avalues; /* Number of values allocated */
const char **values; /* Value(s) of variable */
char **values; /* Value(s) of variable */
} _cgi_var_t;
@@ -113,7 +114,12 @@ cgiCheckVariables(const char *names) /* I - Variables to look for */
return (0);
if (*val == '\0')
{
free((void *)val);
return (0); /* Can't be blank, either! */
}
free((void *)val);
}
return (1);
@@ -135,10 +141,10 @@ cgiClearVariables(void)
for (v = form_vars, i = form_count; i > 0; v ++, i --)
{
_cupsStrFree(v->name);
free(v->name);
for (j = 0; j < v->nvalues; j ++)
if (v->values[j])
_cupsStrFree(v->values[j]);
free(v->values[j]);
}
form_count = 0;
@@ -151,7 +157,7 @@ cgiClearVariables(void)
* 'cgiGetArray()' - Get an element from a form array.
*/
const char * /* O - Element value or NULL */
char * /* O - Element value or NULL */
cgiGetArray(const char *name, /* I - Name of array variable */
int element) /* I - Element number (0 to N) */
{
@@ -164,7 +170,10 @@ cgiGetArray(const char *name, /* I - Name of array variable */
if (element < 0 || element >= var->nvalues)
return (NULL);
return (_cupsStrRetain(var->values[element]));
if (var->values[element] == NULL)
return (NULL);
return (strdup(var->values[element]));
}
@@ -214,7 +223,7 @@ cgiGetSize(const char *name) /* I - Name of variable */
* array of values, returns the last element.
*/
const char * /* O - Value of variable */
char * /* O - Value of variable */
cgiGetVariable(const char *name) /* I - Name of variable */
{
const _cgi_var_t *var; /* Returned variable */
@@ -222,15 +231,7 @@ 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]));
return ((var == NULL) ? NULL : strdup(var->values[var->nvalues - 1]));
}
@@ -320,11 +321,18 @@ cgiInitialize(void)
else
fputs("DEBUG: " CUPS_SID " form variable is not present.\n", stderr);
free((void *)cups_sid_form);
cgiClearVariables();
return (0);
}
else
{
free((void *)cups_sid_form);
return (1);
}
}
else
return (0);
@@ -378,10 +386,9 @@ cgiSetArray(const char *name, /* I - Name of variable */
{
if (element >= var->avalues)
{
const char **temp; /* Temporary pointer */
char **temp; /* Temporary pointer */
temp = (const char **)realloc((void *)(var->values),
sizeof(char *) * (size_t)(element + 16));
temp = (char **)realloc((void *)(var->values), sizeof(char *) * (size_t)(element + 16));
if (!temp)
return;
@@ -397,9 +404,9 @@ cgiSetArray(const char *name, /* I - Name of variable */
var->nvalues = element + 1;
}
else if (var->values[element])
_cupsStrFree((char *)var->values[element]);
free((char *)var->values[element]);
var->values[element] = _cupsStrAlloc(value);
var->values[element] = strdup(value);
}
}
@@ -456,10 +463,9 @@ cgiSetSize(const char *name, /* I - Name of variable */
if (size >= var->avalues)
{
const char **temp; /* Temporary pointer */
char **temp; /* Temporary pointer */
temp = (const char **)realloc((void *)(var->values),
sizeof(char *) * (size_t)(size + 16));
temp = (char **)realloc((void *)(var->values), sizeof(char *) * (size_t)(size + 16));
if (!temp)
return;
@@ -476,7 +482,7 @@ cgiSetSize(const char *name, /* I - Name of variable */
{
for (i = size; i < var->nvalues; i ++)
if (var->values[i])
_cupsStrFree((void *)(var->values[i]));
free((void *)(var->values[i]));
}
var->nvalues = size;
@@ -511,9 +517,9 @@ cgiSetVariable(const char *name, /* I - Name of variable */
{
for (i = 0; i < var->nvalues; i ++)
if (var->values[i])
_cupsStrFree((char *)var->values[i]);
free((char *)var->values[i]);
var->values[0] = _cupsStrAlloc(value);
var->values[0] = strdup(value);
var->nvalues = 1;
}
}
@@ -534,9 +540,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 */
@@ -559,10 +562,10 @@ cgi_add_variable(const char *name, /* I - Variable name */
if ((var->values = calloc((size_t)element + 1, sizeof(char *))) == NULL)
return;
var->name = _cupsStrAlloc(name);
var->name = strdup(name);
var->nvalues = element + 1;
var->avalues = element + 1;
var->values[element] = _cupsStrAlloc(value);
var->values[element] = strdup(value);
form_count ++;
}
@@ -594,7 +597,7 @@ cgi_find_variable(const char *name) /* I - Name of variable */
if (form_count < 1 || name == NULL)
return (NULL);
key.name = name;
key.name = (char *)name;
return ((_cgi_var_t *)bsearch(&key, form_vars, (size_t)form_count, sizeof(_cgi_var_t),
(int (*)(const void *, const void *))cgi_compare_variables));
@@ -715,8 +718,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 +757,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...
*/
@@ -885,12 +884,13 @@ cgi_initialize_multipart(
if (line[0])
cgiSetArray(name, atoi(ptr) - 1, line);
}
else if (cgiGetVariable(name))
else if ((ptr = cgiGetVariable(name)) != NULL)
{
/*
* Add another element in the array...
*/
free(ptr);
cgiSetArray(name, cgiGetSize(name), line);
}
else
@@ -970,8 +970,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...
*/
@@ -985,7 +983,7 @@ cgi_initialize_post(void)
*/
length = (size_t)strtol(content_length, NULL, 10);
data = malloc(length + 1);
data = malloc(length + 1); // lgtm [cpp/uncontrolled-allocation-size]
if (data == NULL)
return (0);
@@ -1047,7 +1045,8 @@ cgi_initialize_string(const char *data) /* I - Form data string */
char *s, /* Pointer to current form string */
ch, /* Temporary character */
name[255], /* Name of form variable */
value[65536]; /* Variable value */
value[65536], /* Variable value */
*temp; /* Temporary pointer */
/*
@@ -1149,8 +1148,11 @@ cgi_initialize_string(const char *data) /* I - Form data string */
if (value[0])
cgiSetArray(name, atoi(s) - 1, value);
}
else if (cgiGetVariable(name) != NULL)
else if ((temp = cgiGetVariable(name)) != NULL)
{
free(temp);
cgiSetArray(name, cgiGetSize(name), value);
}
else
cgiSetVariable(name, value);
}
@@ -1203,6 +1205,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 +1215,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 +1238,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 */
}
+62 -38
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-2019 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...
@@ -38,7 +39,11 @@ AC_PROG_CXX(clang++ c++ g++)
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
AC_PATH_PROG(GZIP,gzip)
AC_PATH_PROG(GZIPPROG,gzip)
AC_MSG_CHECKING(for install-sh script)
INSTALL="`pwd`/install-sh"
AC_SUBST(INSTALL)
AC_MSG_RESULT(using $INSTALL)
AC_PATH_PROG(LD,ld)
AC_PATH_PROG(LN,ln)
AC_PATH_PROG(MKDIR,mkdir)
@@ -47,6 +52,7 @@ AC_PATH_PROG(RM,rm)
AC_PATH_PROG(RMDIR,rmdir)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(XDGOPEN,xdg-open)
if test "x$XDGOPEN" = x; then
CUPS_HTMLVIEW="htmlview"
else
@@ -54,11 +60,6 @@ else
fi
AC_SUBST(CUPS_HTMLVIEW)
AC_MSG_CHECKING(for install-sh script)
INSTALL="`pwd`/install-sh"
AC_SUBST(INSTALL)
AC_MSG_RESULT(using $INSTALL)
if test "x$AR" = x; then
AC_MSG_ERROR([Unable to find required library archive command.])
fi
@@ -139,16 +140,6 @@ AC_CHECK_HEADER(iconv.h,
SAVELIBS="$SAVELIBS $LIBS")
LIBS="$SAVELIBS")
dnl Checks for Mini-XML (www.minixml.org)...
LIBMXML=""
AC_CHECK_HEADER(mxml.h,
SAVELIBS="$LIBS"
AC_SEARCH_LIBS(mmxlNewElement,mxml,
AC_DEFINE(HAVE_MXML_H)
LIBMXML="-lmxml")
LIBS="$SAVELIBS")
AC_SUBST(LIBMXML)
dnl Checks for statfs and its many headers...
AC_CHECK_HEADER(sys/mount.h,AC_DEFINE(HAVE_SYS_MOUNT_H))
AC_CHECK_HEADER(sys/statfs.h,AC_DEFINE(HAVE_SYS_STATFS_H))
@@ -262,14 +253,14 @@ dnl ZLIB
INSTALL_GZIP=""
LIBZ=""
AC_CHECK_HEADER(zlib.h,
AC_CHECK_LIB(z, gzgets,
AC_CHECK_LIB(z, gzgets,[
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz"
LIBS="$LIBS -lz"
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_INFLATECOPY))
if test "x$GZIP" != z; then
if test "x$GZIPPROG" != x; then
INSTALL_GZIP="-z"
fi))
fi]))
AC_SUBST(INSTALL_GZIP)
AC_SUBST(LIBZ)
@@ -302,14 +293,14 @@ fi
LIBS="$SAVELIBS"
dnl Check for DBUS support
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
DBUSDIR="$withval")
DBUSDIR=""
DBUS_NOTIFIER=""
DBUS_NOTIFIERLIBS=""
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
DBUSDIR="$withval")
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
@@ -326,7 +317,7 @@ if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdar
AC_CHECK_FUNC(dbus_threads_init,
AC_DEFINE(HAVE_DBUS_THREADS_INIT))
LIBS="$SAVELIBS"
if test -d /etc/dbus-1; then
if test -d /etc/dbus-1 -a "x$DBUSDIR" = x; then
DBUSDIR="/etc/dbus-1"
fi
else
@@ -348,20 +339,21 @@ case $host_os_name in
darwin*)
BACKLIBS="$BACKLIBS -framework IOKit"
SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices"
LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS"
LIBS="-framework CoreFoundation -framework Security $LIBS"
dnl Check for framework headers...
AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h,AC_DEFINE(HAVE_APPLICATIONSERVICES_H))
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
dnl Check for dynamic store function...
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName)
SAVELIBS="$LIBS"
LIBS="-framework SystemConfiguration $LIBS"
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName,[
AC_DEFINE(HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME)],[
LIBS="$SAVELIBS"])
dnl Check for the new membership functions in MacOSX 10.4...
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
AC_CHECK_FUNCS(mbr_uid_to_uuid)
dnl Need <dlfcn.h> header...
@@ -395,7 +387,6 @@ case $host_os_name in
else
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
fi])
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
dnl Check for sandbox/Seatbelt support
if test $host_os_version -ge 100; then
@@ -416,8 +407,6 @@ case $host_os_name in
AC_CHECK_HEADER(xpc/xpc.h,
AC_DEFINE(HAVE_XPC)
INSTALLXPC="install-xpc")
AC_CHECK_HEADER(xpc/private.h,
AC_DEFINE(HAVE_XPC_PRIVATE_H))
;;
esac
@@ -432,16 +421,47 @@ 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"
IPPEVECOMMANDS="ippevepcl ippeveps"
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
LIBHEADERS="\$(COREHEADERS) \$(DRIVERHEADERS)"
LIBHEADERSPRIV="\$(COREHEADERSPRIV) \$(DRIVERHEADERSPRIV)"
case "$COMPONENTS" in
all)
BUILDDIRS="filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
BUILDDIRS="tools filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
;;
core)
BUILDDIRS="data locale"
BUILDDIRS="tools examples locale"
;;
corelite)
AC_DEFINE(CUPS_LITE)
BUILDDIRS="tools examples locale"
cupsimagebase=""
LIBCUPSOBJS="\$(COREOBJS)"
LIBHEADERS="\$(COREHEADERS)"
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
;;
libcups)
BUILDDIRS="locale"
cupsimagebase=""
;;
libcupslite)
AC_DEFINE(CUPS_LITE)
BUILDDIRS="locale"
cupsimagebase=""
LIBCUPSOBJS="\$(COREOBJS)"
LIBHEADERS="\$(COREHEADERS)"
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
;;
*)
@@ -450,3 +470,7 @@ case "$COMPONENTS" in
esac
AC_SUBST(BUILDDIRS)
AC_SUBST(IPPEVECOMMANDS)
AC_SUBST(LIBCUPSOBJS)
AC_SUBST(LIBHEADERS)
AC_SUBST(LIBHEADERSPRIV)
+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
+23 -7
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",
@@ -229,7 +245,7 @@ AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups
AC_MSG_CHECKING(for default system groups)
if test -f /etc/group; then
CUPS_SYSTEM_GROUPS=""
GROUP_LIST="lpadmin sys system root"
GROUP_LIST="lpadmin sys system root wheel"
for group in $GROUP_LIST; do
if test "`grep \^${group}: /etc/group`" != ""; then
if test "x$CUPS_SYSTEM_GROUPS" = x; then
+6 -6
Ver Arquivo
@@ -1,9 +1,10 @@
dnl
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright © 2007-2019 by Apple Inc.
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
AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
@@ -28,7 +29,7 @@ if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$host_os_name != xdarwin
DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
DNSSD_BACKEND="dnssd"
IPPFIND_BIN="ippfind"
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
IPPFIND_MAN="ippfind.1"
AC_DEFINE(HAVE_AVAHI)
else
AC_MSG_RESULT(no)
@@ -41,10 +42,9 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
darwin*)
# Darwin and macOS...
AC_DEFINE(HAVE_DNSSD)
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
DNSSD_BACKEND="dnssd"
IPPFIND_BIN="ippfind"
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
IPPFIND_MAN="ippfind.1"
;;
*)
# All others...
@@ -62,7 +62,7 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
DNSSDLIBS="-ldns_sd"
DNSSD_BACKEND="dnssd",
IPPFIND_BIN="ippfind"
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
IPPFIND_MAN="ippfind.1"
AC_MSG_RESULT(no))
LIBS="$SAVELIBS"
;;
+4 -47
Ver Arquivo
@@ -1,10 +1,11 @@
dnl
dnl Manpage stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright © 2007-2019 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 Fix "mandir" variable...
@@ -19,54 +20,10 @@ if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
darwin* | linux* | gnu* | *bsd*)
# Darwin, macOS, Linux, GNU HURD, and *BSD
mandir="/usr/share/man"
AMANDIR="/usr/share/man"
PMANDIR="/usr/share/man"
;;
*)
# All others
mandir="/usr/man"
AMANDIR="/usr/man"
PMANDIR="/usr/man"
;;
esac
else
AMANDIR="$mandir"
PMANDIR="$mandir"
fi
AC_SUBST(AMANDIR)
AC_SUBST(PMANDIR)
dnl Setup manpage extensions...
case "$host_os_name" in
sunos*)
# Solaris
MAN1EXT=1
MAN5EXT=5
MAN7EXT=7
MAN8EXT=1m
MAN8DIR=1m
;;
linux* | gnu* | darwin*)
# Linux, GNU Hurd, and macOS
MAN1EXT=1.gz
MAN5EXT=5.gz
MAN7EXT=7.gz
MAN8EXT=8.gz
MAN8DIR=8
;;
*)
# All others
MAN1EXT=1
MAN5EXT=5
MAN7EXT=7
MAN8EXT=8
MAN8DIR=8
;;
esac
AC_SUBST(MAN1EXT)
AC_SUBST(MAN5EXT)
AC_SUBST(MAN7EXT)
AC_SUBST(MAN8EXT)
AC_SUBST(MAN8DIR)
+6 -7
Ver Arquivo
@@ -1,10 +1,11 @@
dnl
dnl Operating system stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright © 2007-2019 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
@@ -18,10 +19,6 @@ if test "x$host_os_version" = x; then
host_os_version="0"
fi
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
dnl Determine whether we are cross-compiling...
if test "$build" = "$host"; then
# No, build local targets
@@ -31,3 +28,5 @@ else
LOCALTARGET=""
fi
AC_SUBST(LOCALTARGET)
AC_PATH_PROGS(CODE_SIGN, codesign true)
+27 -53
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,42 +74,24 @@ 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"
LINKCUPS="../cups/lib$cupsbase.a \$(LIBS)"
EXTLINKCUPS="-lcups \$LIBS"
else
LINKCUPS="-l${cupsbase}"
LINKCUPSIMAGE="-lcupsimage"
LINKCUPS="-L../cups -l${cupsbase}"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
fi
AC_SUBST(EXTLINKCUPS)
AC_SUBST(EXTLINKCUPSIMAGE)
AC_SUBST(LINKCUPS)
AC_SUBST(LINKCUPSIMAGE)
dnl Update libraries for DSOs...
EXPORT_LDFLAGS=""
if test "$DSO" != ":"; then
# When using DSOs the image libraries are linked to libcupsimage.so
# rather than to the executables. This makes things smaller if you
# are using any static libraries, and it also allows us to distribute
# a single DSO rather than a bunch...
DSOLIBS="\$(LIBZ)"
IMGLIBS=""
# Tell the run-time linkers where to find a DSO. Some platforms
# need this option, even when the library is installed in a
# standard location...
@@ -142,11 +121,6 @@ if test "$DSO" != ":"; then
fi
;;
esac
else
DSOLIBS=""
IMGLIBS="\$(LIBZ)"
fi
AC_SUBST(DSOLIBS)
AC_SUBST(IMGLIBS)
AC_SUBST(EXPORT_LDFLAGS)
+2 -20
Ver Arquivo
@@ -1,7 +1,7 @@
dnl
dnl TLS stuff for CUPS.
dnl
dnl Copyright 2007-2017 by Apple Inc.
dnl Copyright 2007-2019 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.
@@ -27,30 +27,12 @@ if test x$enable_ssl != xno; then
CUPS_SERVERKEYCHAIN="/Library/Keychains/System.keychain"
dnl Check for the various security headers...
AC_CHECK_HEADER(Security/SecureTransportPriv.h,
AC_DEFINE(HAVE_SECURETRANSPORTPRIV_H))
AC_CHECK_HEADER(Security/SecCertificate.h,
AC_DEFINE(HAVE_SECCERTIFICATE_H))
AC_CHECK_HEADER(Security/SecItem.h,
AC_DEFINE(HAVE_SECITEM_H))
AC_CHECK_HEADER(Security/SecItemPriv.h,
AC_DEFINE(HAVE_SECITEMPRIV_H),,
[#include <Security/SecItem.h>])
AC_CHECK_HEADER(Security/SecPolicy.h,
AC_DEFINE(HAVE_SECPOLICY_H))
AC_CHECK_HEADER(Security/SecPolicyPriv.h,
AC_DEFINE(HAVE_SECPOLICYPRIV_H))
AC_CHECK_HEADER(Security/SecBasePriv.h,
AC_DEFINE(HAVE_SECBASEPRIV_H))
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
AC_DEFINE(HAVE_CSSMERRORSTRING)
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
if test $host_os_version -ge 150; then
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
fi
AC_DEFINE(HAVE_SECPOLICY_H))])
fi
fi
+5 -40
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Configuration file for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2019 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.
*/
#ifndef _CUPS_CONFIG_H_
@@ -16,6 +17,7 @@
#define CUPS_SVERSION ""
#define CUPS_MINIMAL ""
#define CUPS_LITE 0
/*
@@ -318,21 +320,9 @@
*/
#undef HAVE_AUTHORIZATION_H
#undef HAVE_SECBASEPRIV_H
#undef HAVE_SECCERTIFICATE_H
#undef HAVE_SECIDENTITYSEARCHPRIV_H
#undef HAVE_SECITEM_H
#undef HAVE_SECITEMPRIV_H
#undef HAVE_SECPOLICY_H
#undef HAVE_SECPOLICYPRIV_H
#undef HAVE_SECURETRANSPORTPRIV_H
/*
* Do we have the cssmErrorString function?
*/
#undef HAVE_CSSMERRORSTRING
/*
@@ -342,20 +332,6 @@
#undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE
/*
* Do we have the SecKeychainOpen function?
*/
#undef HAVE_SECKEYCHAINOPEN
/*
* Do we have (a working) SSLSetEnabledCiphers function?
*/
#undef HAVE_SSLSETENABLEDCIPHERS
/*
* Do we have libpaper?
*/
@@ -498,12 +474,10 @@
/*
* Do we have CoreFoundation public and private headers?
* Do we have CoreFoundation public headers?
*/
#undef HAVE_COREFOUNDATION_H
#undef HAVE_CFPRIV_H
#undef HAVE_CFBUNDLEPRIV_H
/*
@@ -532,7 +506,6 @@
*/
#undef HAVE_MEMBERSHIP_H
#undef HAVE_MEMBERSHIPPRIV_H
#undef HAVE_MBR_UID_TO_UUID
@@ -685,14 +658,6 @@
*/
#undef HAVE_XPC
#undef HAVE_XPC_PRIVATE_H
/*
* Do we have Mini-XML?
*/
#undef HAVE_MXML_H
/*
externo
+367 -576
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+2 -10
Ver Arquivo
@@ -1,7 +1,7 @@
dnl
dnl Configuration script for CUPS.
dnl
dnl Copyright © 2007-2018 by Apple Inc.
dnl Copyright © 2007-2019 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
@@ -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.3.3], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
@@ -66,14 +66,6 @@ AC_OUTPUT(Makedefs
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
+7 -16
Ver Arquivo
@@ -2,7 +2,7 @@
#
# CUPS configuration utility.
#
# Copyright © 2007-2018 by Apple Inc.
# Copyright © 2007-2019 by Apple Inc.
# Copyright © 2001-2006 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -18,7 +18,6 @@ exec_prefix=@exec_prefix@
bindir=@bindir@
includedir=@includedir@
libdir=@libdir@
imagelibdir=@libdir@
datarootdir=@datadir@
datadir=@datadir@
sysconfdir=@sysconfdir@
@@ -27,19 +26,18 @@ cups_serverbin=@CUPS_SERVERBIN@
cups_serverroot=@CUPS_SERVERROOT@
INSTALLSTATIC=@INSTALLSTATIC@
# flags for C++ compiler:
# flags for compiler and linker...
CFLAGS=""
LDFLAGS="@EXPORT_LDFLAGS@"
LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
LIBS="@LIBGSSAPI@ @DNSSDLIBS@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
# Check for local invocation...
selfdir=`dirname $0`
if test -f "$selfdir/cups/cups.h"; then
CFLAGS="-I$selfdir"
LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
LDFLAGS="-L$selfdir/cups $LDFLAGS"
libdir="$selfdir/cups"
imagelibdir="$selfdir/filter"
else
if test $includedir != /usr/include; then
CFLAGS="$CFLAGS -I$includedir"
@@ -73,7 +71,6 @@ fi
# Parse command line options
static=no
image=no
while test $# -gt 0; do
case $1 in
@@ -93,22 +90,16 @@ while test $# -gt 0; do
usage 0
;;
--image)
image=yes
# Do nothing
;;
--ldflags)
echo $LDFLAGS
;;
--libs)
if test $static = no; then
libs="@EXTLINKCUPS@ $LIBS";
if test $image = yes; then
libs="@EXTLINKCUPSIMAGE@ $libs"
fi
libs="@EXTLINKCUPS@";
else
libs="$libdir/libcups.a $LIBS";
if test $image = yes; then
libs="$libdir/libcupsimage.a $libs"
fi
fi
echo $libs
;;
@@ -120,7 +111,7 @@ while test $# -gt 0; do
;;
--static)
if test -z "$INSTALLSTATIC"; then
echo "WARNING: Static libraries not installed!" >&2
echo "WARNING: Static libraries not installed." >&2
else
static=yes
fi
+361 -277
Ver Arquivo
@@ -1,327 +1,411 @@
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
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
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 \
debug-internal.h debug-private.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
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
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
../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
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
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
debug-internal.h debug-private.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
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-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
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
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
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 tls-darwin.h
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
adminutil.o: adminutil.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 adminutil.h
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h pwg.h sidechannel.h
backend.o: backend.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 \
backend.h ppd.h cups.h raster.h
getdevices.o: getdevices.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 adminutil.h cups.h
getifaddrs.o: getifaddrs.c getifaddrs-internal.h ../config.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 \
../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-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
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-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
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
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
testthreads.o: testthreads.c ../cups/cups.h file.h versioning.h ipp.h \
http.h array.h language.h pwg.h ../cups/thread-private.h ../config.h \
../cups/versioning.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
+156 -138
Ver Arquivo
@@ -1,8 +1,8 @@
#
# Library Makefile for CUPS.
#
# Copyright 2007-2018 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright © 2007-2019 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.
@@ -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 \
@@ -95,6 +106,7 @@ TESTOBJS = \
testpwg.o \
testraster.o \
testsnmp.o \
testthreads.o \
tlscheck.o
OBJS = \
$(LIBOBJS) \
@@ -106,24 +118,29 @@ OBJS = \
# Header files to install...
#
HEADERS = \
adminutil.h \
COREHEADERS = \
array.h \
backend.h \
cups.h \
dir.h \
file.h \
http.h \
ipp.h \
language.h \
ppd.h \
pwg.h \
raster.h \
sidechannel.h \
transcode.h \
versioning.h
HEADERSPRIV = \
DRIVERHEADERS = \
adminutil.h \
backend.h \
ppd.h \
sidechannel.h
HEADERS = \
$(LIBHEADERS)
COREHEADERSPRIV = \
array-private.h \
cups-private.h \
debug-private.h \
@@ -131,14 +148,18 @@ HEADERSPRIV = \
http-private.h \
ipp-private.h \
language-private.h \
md5-private.h \
ppd-private.h \
pwg-private.h \
raster-private.h \
snmp-private.h \
string-private.h \
thread-private.h
DRIVERHEADERSPRIV = \
ppd-private.h \
snmp-private.h
HEADERSPRIV = \
$(LIBHEADERSPRIV)
#
# Targets in this directory...
@@ -171,6 +192,7 @@ UNITTARGETS = \
testpwg \
testraster \
testsnmp \
testthreads \
tlscheck
TARGETS = \
@@ -268,7 +290,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 +302,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 +339,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 +353,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 +367,7 @@ uninstall:
libcups.so.2: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
@@ -347,21 +376,15 @@ 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 $@ \
$(DSO) $(ARCHFLAGS) $(ALL_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) $(LIBS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
$(RM) libcups.dylib
$(LN) $@ libcups.dylib
@@ -371,9 +394,8 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
libcups.la: $(LIBOBJS)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
-rpath $(LIBDIR) -version-info 2:14 $(LIBGSSAPI) $(SSLLIBS) \
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
-rpath $(LIBDIR) -version-info 2:14 $(LIBS)
#
@@ -397,9 +419,10 @@ libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
echo "VERSION 2.14" >>libcups2.def
echo "EXPORTS" >>libcups2.def
(nm $(LIBOBJS) $(IMAGEOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy; \
echo __cups_snprintf; echo __cups_vsnprintf; echo __cups_gettimeofday) | \
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 +433,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) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS) $(LINKCUPS)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
@@ -422,11 +444,12 @@ libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2
libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.3.0 \
-compatibility_version 2.0.0 \
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
$(IMAGEOBJS) $(LINKCUPS)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
$(RM) libcupsimage.dylib
$(LN) $@ libcupsimage.dylib
@@ -437,9 +460,8 @@ 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
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) \
$(LINKCUPS) -rpath $(LIBDIR) -version-info 2:3
#
@@ -454,12 +476,13 @@ 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) $(ALL_LDFLAGS) -o $@ rasterbench.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -468,8 +491,8 @@ rasterbench: rasterbench.o libcupsimage.a
testadmin: testadmin.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testadmin.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -478,8 +501,8 @@ testadmin: testadmin.o $(LIBCUPSSTATIC)
testarray: testarray.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testarray.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running array API tests...
./testarray
@@ -490,19 +513,18 @@ testarray: testarray.o $(LIBCUPSSTATIC)
testcache: testcache.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testcache.o $(LINKCUPSSTATIC)
$(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) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testclient.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -511,8 +533,8 @@ testclient: testclient.o $(LIBCUPSSTATIC) libcupsimage.a
testconflicts: testconflicts.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testconflicts.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -521,8 +543,8 @@ testconflicts: testconflicts.o $(LIBCUPSSTATIC)
testcreds: testcreds.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testcreds.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -531,8 +553,8 @@ testcreds: testcreds.o $(LIBCUPSSTATIC)
testcups: testcups.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testcups.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -541,8 +563,8 @@ testcups: testcups.o $(LIBCUPSSTATIC)
testdest: testdest.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testdest.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -551,8 +573,8 @@ testdest: testdest.o $(LIBCUPSSTATIC)
testfile: testfile.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testfile.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running file API tests...
./testfile
@@ -563,8 +585,8 @@ testfile: testfile.o $(LIBCUPSSTATIC)
testgetdests: testgetdests.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testgetdests.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testgetdests.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -573,8 +595,8 @@ testgetdests: testgetdests.o $(LIBCUPSSTATIC)
testhttp: testhttp.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testhttp.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running HTTP API tests...
./testhttp
@@ -585,8 +607,8 @@ testhttp: testhttp.o $(LIBCUPSSTATIC)
testipp: testipp.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testipp.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running IPP API tests...
./testipp
@@ -597,8 +619,8 @@ testipp: testipp.o $(LIBCUPSSTATIC)
testi18n: testi18n.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testi18n.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running internationalization API tests...
./testi18n
@@ -609,15 +631,10 @@ testi18n: testi18n.o $(LIBCUPSSTATIC)
testlang: testlang.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testlang.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Creating locale directory structure...
$(RM) -r locale
$(MKDIR) locale/en
echo 'msgid "No"' > locale/en/cups_en.po
echo 'msgstr "No"' >> locale/en/cups_en.po
echo 'msgid "Yes"' >> locale/en/cups_en.po
echo 'msgstr "Yes"' >> locale/en/cups_en.po
for po in ../locale/cups_*.po; do \
lang=`basename $$po .po | sed -e '1,$$s/^cups_//'`; \
$(MKDIR) locale/$$lang; \
@@ -633,8 +650,8 @@ testlang: testlang.o $(LIBCUPSSTATIC)
testoptions: testoptions.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testoptions.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running option API tests...
./testoptions
@@ -645,8 +662,8 @@ testoptions: testoptions.o $(LIBCUPSSTATIC)
testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testppd.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running PPD API tests...
./testppd
@@ -657,21 +674,20 @@ testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testpwg.o $(LINKCUPSSTATIC)
$(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 \
$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
$(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testraster.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
echo Running raster API tests...
./testraster
@@ -682,8 +698,18 @@ testraster: testraster.o $(LIBCUPSSTATIC) libcupsimage.a
testsnmp: testsnmp.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ALL_LDFLAGS) -o $@ testsnmp.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
# testthreads (dependency on static CUPS library is intentional)
#
testthreads: testthreads.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ALL_LDFLAGS) -o $@ testthreads.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -692,8 +718,8 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
tlscheck: tlscheck.o $(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ tlscheck.o $(LINKCUPSSTATIC)
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
#
@@ -703,42 +729,34 @@ tlscheck: tlscheck.o $(LIBCUPSSTATIC)
apihelp:
echo Generating CUPS API help files...
$(RM) cupspm.xml
mxmldoc --section "Programming" --body cupspm.md \
codedoc --section "Programming" --body cupspm.md \
cupspm.xml \
auth.c cups.h dest*.c encode.c http.h http*.c ipp.h ipp*.c \
options.c tls-darwin.c usersys.c util.c \
--coverimage cupspm.png \
--epub ../doc/help/cupspm.epub
mxmldoc --section "Programming" --body cupspm.md \
codedoc --section "Programming" --body cupspm.md \
cupspm.xml > ../doc/help/cupspm.html
$(RM) cupspm.xml
mxmldoc --section "Programming" --title "Administration APIs" \
codedoc --section "Programming" --title "Administration APIs" \
--css ../doc/cups-printable.css \
--header api-admin.header --intro api-admin.shtml \
api-admin.xml \
--header api-admin.header --body api-admin.shtml \
adminutil.c adminutil.h getdevices.c >../doc/help/api-admin.html
$(RM) api-admin.xml
mxmldoc --section "Programming" --title "PPD API (DEPRECATED)" \
codedoc --section "Programming" --title "PPD API (DEPRECATED)" \
--css ../doc/cups-printable.css \
--header api-ppd.header --intro api-ppd.shtml \
api-ppd.xml ppd.h ppd-*.c >../doc/help/api-ppd.html
$(RM) api-ppd.xml
mxmldoc --section "Programming" --title "Raster API" \
--header api-ppd.header --body api-ppd.shtml \
ppd.h ppd-*.c raster-interstub.c >../doc/help/api-ppd.html
codedoc --section "Programming" --title "Raster API" \
--css ../doc/cups-printable.css \
--header api-raster.header --intro api-raster.shtml \
api-raster.xml \
../cups/raster.h interpret.c raster.c \
--header api-raster.header --body api-raster.shtml \
../cups/raster.h raster-stubs.c \
>../doc/help/api-raster.html
mxmldoc --tokens help/api-raster.html api-raster.xml >../doc/help/api-raster.tokens
$(RM) api-raster.xml
mxmldoc --section "Programming" \
codedoc --section "Programming" \
--title "Filter and Backend Programming" \
--css ../doc/cups-printable.css \
--header api-filter.header --intro api-filter.shtml \
api-filter.xml \
--header api-filter.header --body api-filter.shtml \
backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
>../doc/help/api-filter.html
$(RM) api-filter.xml
#
+25 -955
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+1 -1
Ver Arquivo
@@ -77,7 +77,7 @@ extern ipp_status_t cupsGetDevices(http_t *http, int timeout,
const char *include_schemes,
const char *exclude_schemes,
cups_device_cb_t callback,
void *user_data) _CUPS_API_1_4;
void *user_data) _CUPS_DEPRECATED;
# ifdef __cplusplus
+1 -1
Ver Arquivo
@@ -11,7 +11,7 @@
<p>The administrative APIs provide convenience functions to perform certain administrative functions with the CUPS scheduler.</p>
<blockquote><b>Note:<b>
<blockquote><b>Note:</b>
<p>Administrative functions normally require administrative privileges to execute and must not be used in ordinary user applications!</p>
</blockquote>
+4 -1
Ver Arquivo
@@ -868,4 +868,7 @@ void *my_data;
</ol>
<blockquote><b>Note:</b> The sandbox profile used in CUPS 2.0 still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</blockquote>
<blockquote><b>Note:</b>
<p>The sandbox profile used in CUPS still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</p>
</blockquote>
+6 -3
Ver Arquivo
@@ -1,7 +1,7 @@
<!--
PPD API header for CUPS.
Copyright © 2008-2012 by Apple Inc.
Copyright © 2008-2019 by Apple Inc.
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
@@ -9,7 +9,10 @@
<h1 class='title'>PPD API (DEPRECATED)</h1>
<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><b>Note:</b>
<p>The PPD API was deprecated in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS Programming Manual</a> documentation. These functions will be removed in a future release of CUPS.</p>
</blockquote>
<div class='summary'><table summary='General Information'>
<thead>
@@ -26,7 +29,7 @@
<tr>
<th>See Also</th>
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
Programming: <a href='cupspm.html' target='_top'>CUPS Programming Manual</a><br>
Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
</tr>
</tbody>
+9 -2
Ver Arquivo
@@ -1,7 +1,7 @@
<!--
PPD API introduction for CUPS.
Copyright © 2007-2012 by Apple Inc.
Copyright © 2007-2019 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,10 @@
<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><b>Note:</b>
<p>The PPD API was deprecated in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS Programming Manual</a> documentation. These functions will be removed in a future release of CUPS.</p>
</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
@@ -28,6 +31,7 @@ values as case-insensitive strings, so option "InputSlot" and choice "Upper"
are equivalent to "inputslot" and "upper", respectively.</p>
</blockquote>
<h3><a name="LOADING">Loading a PPD File</a></h3>
<p>The <a href="#ppdOpenFile"><code>ppdOpenFile</code></a> function "opens" a
@@ -115,6 +119,7 @@ int num_options = cupsParseOptions(argv[5], 0, &amp;options);
cupsFreeOptions(num_options, options);
</pre>
<h3><a name="CONSTRAINTS">Constraints</a></h3>
<p>PPD files support specification of conflict conditions, called
@@ -125,6 +130,7 @@ the options and choices that conflict with each other. The
how many of the selected options are incompatible. Since constraints are
normally specified in pairs, the returned value is typically an even number.</p>
<h3><a name="PAGE_SIZES">Page Sizes</a></h3>
<p>Page sizes are special options which have physical dimensions and margins
@@ -179,6 +185,7 @@ in points. Custom page size names can also be specified in inches
<a href="#ppdPageSize"><code>ppdPageSize</code></a> function will return
<code>NULL</code>.</p>
<h3><a name="ATTRIBUTES">Attributes</a></h3>
<p>Every PPD file is composed of one or more attributes. Most of these
+4 -5
Ver Arquivo
@@ -1,7 +1,7 @@
<!--
Raster API documentation for CUPS.
Copyright © 2008-2010 by Apple Inc.
Copyright © 2008-2019 by Apple Inc.
Licensed under Apache License v2.0. See the file "LICENSE" for more
information.
@@ -19,13 +19,12 @@
<tbody>
<tr>
<th>Library</th>
<td>-lcupsimage</td>
<td>-lcups</td>
</tr>
<tr>
<th>See Also</th>
<td>Programming: <a href='api-overview.html'>Introduction to CUPS Programming</a><br>
Programming: <a href='api-cups.html'>CUPS API</a><br>
Programming: <a href='api-cups.html'>PPD API</a><br>
<td>Programming: <a href='cupspm.html'>CUPS Programming Manual</a><br>
Programming: <a href='api-ppd.html'>PPD API</a><br>
References: <a href='spec-ppd.html'>CUPS PPD Specification</a></td>
</tr>
</tbody>
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
<!--
Raster API introduction for CUPS.
Copyright © 2007-2013 by Apple Inc.
Copyright © 2007-2019 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
@@ -147,7 +147,7 @@ the memory used to read the raster file:</p>
<ul class="code">
<li><a href="#cupsRasterInterpretPPD" title="Interpret PPD commands to create a page header.">cupsRasterInterpretPPD</a></li>
<li><a href="#cupsRasterInitPWGHeader" title="Interpret IPP attributes to create a page header.">cupsRasterInitPWGHeader</a></li>
<li><a href="#cupsRasterWriteHeader" title="Write a raster page header from a version 1 page header structure.">cupsRasterWriteHeader</a> <span class="info">Deprecated in CUPS 1.2/macOS 10.5</span></li>
<li><a href="#cupsRasterWriteHeader2" title="Write a raster page header from a version 2 page header structure.">cupsRasterWriteHeader2</a></li>
<li><a href="#cupsRasterWritePixels" title="Write raster pixels.">cupsRasterWritePixels</a></li>
+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"
+77 -159
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Authentication functions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2019 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* This file contains Kerberos support code, copyright 2006 by
@@ -15,21 +15,17 @@
*/
#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>
# ifdef HAVE_SECBASEPRIV_H
# include <Security/SecBasePriv.h>
# else
extern const char *cssmErrorString(int error);
# endif /* HAVE_SECBASEPRIV_H */
#endif /* HAVE_AUTHORIZATION_H */
#if defined(SO_PEERCRED) && defined(AF_LOCAL)
@@ -46,6 +42,9 @@ static const char *cups_auth_param(const char *scheme, const char *name, char *v
static const char *cups_auth_scheme(const char *www_authenticate, char *scheme, size_t schemesize);
#ifdef HAVE_GSSAPI
# define CUPS_GSS_OK 0 /* Successfully set credentials */
# define CUPS_GSS_NONE -1 /* No credentials */
# define CUPS_GSS_FAIL -2 /* Failed credentials/authentication */
# ifdef HAVE_GSS_ACQUIRE_CRED_EX_F
# ifdef HAVE_GSS_GSSAPI_SPI_H
# include <GSS/gssapi_spi.h>
@@ -113,9 +112,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 */
@@ -174,6 +171,8 @@ cupsDoAuthentication(
* Check the scheme name...
*/
DEBUG_printf(("2cupsDoAuthentication: Trying scheme \"%s\"...", scheme));
#ifdef HAVE_GSSAPI
if (!_cups_strcasecmp(scheme, "Negotiate"))
{
@@ -181,18 +180,36 @@ cupsDoAuthentication(
* Kerberos authentication...
*/
if (_cupsSetNegotiateAuthString(http, method, resource))
int gss_status; /* Auth status */
if ((gss_status = _cupsSetNegotiateAuthString(http, method, resource)) == CUPS_GSS_FAIL)
{
DEBUG_puts("1cupsDoAuthentication: Negotiate failed.");
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
return (-1);
}
break;
else if (gss_status == CUPS_GSS_NONE)
{
DEBUG_puts("2cupsDoAuthentication: No credentials for Negotiate.");
continue;
}
else
{
DEBUG_puts("2cupsDoAuthentication: Using Negotiate.");
break;
}
}
else
#endif /* HAVE_GSSAPI */
if (_cups_strcasecmp(scheme, "Basic") && _cups_strcasecmp(scheme, "Digest"))
continue; /* Not supported (yet) */
{
/*
* Other schemes not yet supported...
*/
DEBUG_printf(("2cupsDoAuthentication: Scheme \"%s\" not yet supported.", scheme));
continue;
}
/*
* See if we should retry the current username:password...
@@ -212,7 +229,7 @@ cupsDoAuthentication(
if (!cg->lang_default)
cg->lang_default = cupsLangDefault();
if (cups_auth_param(scheme, "username", default_username, sizeof(default_username)))
if (cups_auth_param(schemedata, "username", default_username, sizeof(default_username)))
cupsSetUser(default_username);
snprintf(prompt, sizeof(prompt), _cupsLangString(cg->lang_default, _("Password for %s on %s? ")), cupsUser(), http->hostname[0] == '/' ? "localhost" : http->hostname);
@@ -222,6 +239,7 @@ cupsDoAuthentication(
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
{
DEBUG_puts("1cupsDoAuthentication: User canceled password request.");
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
return (-1);
}
@@ -251,8 +269,10 @@ cupsDoAuthentication(
char encode[256]; /* Base64 buffer */
DEBUG_puts("2cupsDoAuthentication: Using Basic.");
httpEncode64_2(encode, sizeof(encode), http->userpass, (int)strlen(http->userpass));
httpSetAuthString(http, "Basic", encode);
break;
}
else if (!_cups_strcasecmp(scheme, "Digest"))
{
@@ -260,136 +280,30 @@ 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)))
if (_httpSetDigestAuthString(http, nonce, method, resource))
{
/*
* 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);
DEBUG_puts("2cupsDoAuthentication: Using Digest.");
break;
}
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 (http->authstring)
{
DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\"", http->authstring));
DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\".", http->authstring));
return (0);
}
else
{
DEBUG_printf(("1cupsDoAuthentication: Unknown auth type: \"%s\"", www_auth));
DEBUG_puts("1cupsDoAuthentication: No supported schemes.");
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
return (-1);
@@ -402,7 +316,7 @@ cupsDoAuthentication(
* '_cupsSetNegotiateAuthString()' - Set the Kerberos authentication string.
*/
int /* O - 0 on success, -1 on error */
int /* O - 0 on success, negative on error */
_cupsSetNegotiateAuthString(
http_t *http, /* I - Connection to server */
const char *method, /* I - Request method ("GET", "POST", "PUT") */
@@ -427,10 +341,16 @@ _cupsSetNegotiateAuthString(
{
DEBUG_puts("1_cupsSetNegotiateAuthString: Weak-linked GSSAPI/Kerberos "
"framework is not present");
return (-1);
return (CUPS_GSS_NONE);
}
# endif /* __APPLE__ */
if (!strcmp(http->hostname, "localhost") || http->hostname[0] == '/' || isdigit(http->hostname[0] & 255) || !strchr(http->hostname, '.'))
{
DEBUG_printf(("1_cupsSetNegotiateAuthString: Kerberos not available for host \"%s\".", http->hostname));
return (CUPS_GSS_NONE);
}
if (http->gssname == GSS_C_NO_NAME)
{
http->gssname = cups_gss_getname(http, _cupsGSSServiceName());
@@ -475,7 +395,7 @@ _cupsSetNegotiateAuthString(
cupsUser(), http->gsshost);
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
return (-1);
return (CUPS_GSS_FAIL);
/*
* Try to acquire credentials...
@@ -529,18 +449,20 @@ _cupsSetNegotiateAuthString(
}
# endif /* HAVE_GSS_ACQUIRED_CRED_EX_F */
if (GSS_ERROR(major_status))
if (major_status == GSS_S_NO_CRED)
{
cups_gss_printf(major_status, minor_status,
"_cupsSetNegotiateAuthString: Unable to initialize "
"security context");
return (-1);
cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: No credentials");
return (CUPS_GSS_NONE);
}
else if (GSS_ERROR(major_status))
{
cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: Unable to initialize security context");
return (CUPS_GSS_FAIL);
}
# ifdef DEBUG
else if (major_status == GSS_S_CONTINUE_NEEDED)
cups_gss_printf(major_status, minor_status,
"_cupsSetNegotiateAuthString: Continuation needed!");
cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: Continuation needed");
# endif /* DEBUG */
if (output_token.length > 0 && output_token.length <= 65536)
@@ -551,7 +473,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);
@@ -574,10 +496,10 @@ _cupsSetNegotiateAuthString(
"large - %d bytes!", (int)output_token.length));
gss_release_buffer(&minor_status, &output_token);
return (-1);
return (CUPS_GSS_FAIL);
}
return (0);
return (CUPS_GSS_OK);
}
#endif /* HAVE_GSSAPI */
@@ -614,7 +536,7 @@ cups_auth_find(const char *www_authenticate, /* I - Pointer into WWW-Authenticat
* See if this is "Scheme" followed by whitespace or the end of the string.
*/
if (!strncmp(www_authenticate, scheme, schemelen) && (isspace(www_authenticate[schemelen] & 255) || !www_authenticate[schemelen]))
if (!strncmp(www_authenticate, scheme, schemelen) && (isspace(www_authenticate[schemelen] & 255) || www_authenticate[schemelen] == ',' || !www_authenticate[schemelen]))
{
/*
* Yes, this is the start of the scheme-specific information...
@@ -795,7 +717,7 @@ cups_auth_scheme(const char *www_authenticate, /* I - Pointer into WWW-Authentic
* Parse the scheme name or param="value" string...
*/
for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && !isspace(*www_authenticate & 255); www_authenticate ++)
for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && *www_authenticate != ',' && !isspace(*www_authenticate & 255); www_authenticate ++)
{
if (*www_authenticate == '=')
param = 1;
@@ -1005,9 +927,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);
@@ -1060,8 +982,8 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &http->auth_ref);
if (status != errAuthorizationSuccess)
{
DEBUG_printf(("8cups_local_auth: AuthorizationCreate() returned %d (%s)",
(int)status, cssmErrorString(status)));
DEBUG_printf(("8cups_local_auth: AuthorizationCreate() returned %d",
(int)status));
return (-1);
}
@@ -1102,8 +1024,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
else if (status == errAuthorizationCanceled)
return (-1);
DEBUG_printf(("9cups_local_auth: AuthorizationCopyRights() returned %d (%s)",
(int)status, cssmErrorString(status)));
DEBUG_printf(("9cups_local_auth: AuthorizationCopyRights() returned %d", (int)status));
/*
* Fall through to try certificates...
@@ -1115,10 +1036,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 +1085,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 +1097,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 +1129,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
}
return (1);
#endif /* WIN32 || __EMX__ */
#endif /* _WIN32 || __EMX__ */
}
+7 -6
Ver Arquivo
@@ -12,13 +12,14 @@
*/
#include "cups.h"
#include "sidechannel.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 +72,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 +134,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)
{
+56 -27
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Private definitions for CUPS.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 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,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,30 @@ 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 enum _cups_digestoptions_e /**** Digest Options values */
{
_CUPS_DIGESTOPTIONS_NONE, /* No Digest authentication options */
_CUPS_DIGESTOPTIONS_DENYMD5 /* Do not use MD5 hashes for digest */
} _cups_digestoptions_t;
typedef enum _cups_uatokens_e /**** UserAgentTokens values */
{
_CUPS_UATOKENS_NONE, /* Do not send User-Agent */
_CUPS_UATOKENS_PRODUCT_ONLY, /* CUPS IPP */
_CUPS_UATOKENS_MAJOR, /* CUPS/major IPP/2 */
_CUPS_UATOKENS_MINOR, /* CUPS/major.minor IPP/2.1 */
_CUPS_UATOKENS_MINIMAL, /* CUPS/major.minor.patch IPP/2.1 */
_CUPS_UATOKENS_OS, /* CUPS/major.minor.patch (osname osversion) IPP/2.1 */
_CUPS_UATOKENS_FULL /* CUPS/major.minor.patch (osname osversion; architecture) IPP/2.1 */
} _cups_uatokens_t;
typedef struct _cups_globals_s /**** CUPS global state data ****/
{
/* Multiple places... */
@@ -59,6 +82,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
*cups_serverroot,
/* CUPS_SERVERROOT environment var */
*cups_statedir, /* CUPS_STATEDIR environment var */
*home, /* HOME environment var */
*localedir; /* LOCALDIR environment var */
/* adminutil.c */
@@ -122,6 +146,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 */
@@ -137,6 +164,8 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
char tempfile[1024]; /* cupsTempFd/File buffer */
/* usersys.c */
_cups_digestoptions_t digestoptions; /* DigestOptions setting */
_cups_uatokens_t uatokens; /* UserAgentTokens setting */
http_encryption_t encryption; /* Encryption setting */
char user[65], /* User name */
user_agent[256],/* User-Agent string */
@@ -219,38 +248,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;
/*
+36 -39
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* API definitions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright © 2007-2019 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.
*/
#ifndef _CUPS_CUPS_H_
@@ -15,12 +16,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"
@@ -41,10 +42,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 2.0300
# define CUPS_VERSION 2.0303
# define CUPS_VERSION_MAJOR 2
# define CUPS_VERSION_MINOR 3
# define CUPS_VERSION_PATCH 0
# define CUPS_VERSION_PATCH 3
# define CUPS_BC_FD 3
/* Back-channel file descriptor for
@@ -328,55 +329,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 +385,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)
@@ -410,10 +411,6 @@ extern int cupsSetDests2(http_t *http, int num_dests,
cups_dest_t *dests) _CUPS_API_1_1_21;
/**** New in CUPS 1.2/macOS 10.5 ****/
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
double timeout) _CUPS_API_1_2;
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
double timeout) _CUPS_API_1_2;
extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
cups_option_t *options,
ipp_tag_t group_tag) _CUPS_API_1_2;
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 15 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 13 KiB

+23 -12
Ver Arquivo
@@ -1,8 +1,8 @@
---
title: CUPS Programming Manual
author: Michael R Sweet
copyright: Copyright © 2007-2018 by Apple Inc. All Rights Reserved.
version: 2.3.0
copyright: Copyright © 2007-2019 by Apple Inc. All Rights Reserved.
version: 2.3.3
...
> Please [file issues on Github](https://github.com/apple/cups/issues) to
@@ -25,7 +25,7 @@ the CUPS scheduler.
## Guidelines
When writing software that uses the "cups" library:
When writing software (other than printer drivers) that uses the "cups" library:
- Do not use undocumented or deprecated APIs,
- Do not rely on pre-configured printers,
@@ -42,16 +42,23 @@ Similarly, printer and job management applications can use standard query
operations to obtain the status information in a common, generic form and use
standard management operations to control the state of those printers and jobs.
> **Note:**
>
> CUPS printer drivers necessarily depend on specific file formats and certain
> implementation details of the CUPS software. Please consult the Postscript
> and raster printer driver developer documentation on
> [CUPS.org](https://www.cups.org/documentation.html) for more information.
## Terms Used in This Document
A *Destination* is a printer or print queue that accepts print jobs. A
*Print Job* is one or more documents that are processed by a destination
using options supplied when creating the job. A *Document* is a file (JPEG
image, PDF file, etc.) suitable for printing. An *Option* controls some aspect
of printing, such as the media used. *Media* is the sheets or roll that is
printed on. An *Attribute* is an option encoded for an Internet Printing
Protocol (IPP) request.
*Print Job* is a collection of one or more documents that are processed by a
destination using options supplied when creating the job. A *Document* is a
file (JPEG image, PDF file, etc.) suitable for printing. An *Option* controls
some aspect of printing, such as the media used. *Media* is the sheets or roll
that is printed on. An *Attribute* is an option encoded for an Internet
Printing Protocol (IPP) request.
## Compiling Programs That Use the CUPS API
@@ -101,7 +108,7 @@ to the file. Build and run (CMD+R) to see the list of destinations.
### Compiling with GCC
From the command-line, create a file called `sample.c` using your favorite
From the command-line, create a file called `simple.c` using your favorite
editor, copy the example to this file, and save. Then run the following command
to compile it with GCC and run it:
@@ -195,7 +202,9 @@ can have any of the following constant (bit) values set:
The callback function returns 0 to stop enumeration or 1 to continue.
> Note that the callback function will likely be called multiple times for the
> **Note:**
>
> The callback function will likely be called multiple times for the
> same destination, so it is up to the caller to suppress any duplicate
> destinations.
@@ -817,7 +826,9 @@ which printer is being queried:
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, printer_uri);
> Note: If we wanted to query the scheduler instead of the device, we would look
> **Note:**
>
> If we wanted to query the scheduler instead of the device, we would look
> up the "printer-uri-supported" option instead of the "device-uri" value.
The `ippAddString` function adds the "printer-uri" attribute the the IPP
BIN
Ver Arquivo
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 166 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 144 KiB

+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"
/*
+20 -8
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Destination option/media support for CUPS.
*
* Copyright © 2012-2018 by Apple Inc.
* Copyright © 2012-2019 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
@@ -12,6 +12,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
/*
@@ -27,7 +28,7 @@
static void cups_add_dconstres(cups_array_t *a, ipp_t *collection);
static int cups_collection_contains(ipp_t *test, ipp_t *match);
static size_t cups_collection_string(ipp_attribute_t *attr, char *buffer, size_t bufsize);
static size_t cups_collection_string(ipp_attribute_t *attr, char *buffer, size_t bufsize) _CUPS_NONNULL((1,2));
static int cups_compare_dconstres(_cups_dconstres_t *a,
_cups_dconstres_t *b);
static int cups_compare_media_db(_cups_media_db_t *a,
@@ -58,7 +59,7 @@ static void cups_update_ready(http_t *http, cups_dinfo_t *dinfo);
/*
* 'cupsAddDestMediaOptions()' - Add the option corresponding to the specified media size.
*
* @since CUPS 2.3@
* @since CUPS 2.3/macOS 10.14@
*/
int /* O - New number of options */
@@ -178,6 +179,7 @@ cupsCheckDestSupported(
ipp_res_t units_value; /* Resolution units */
ipp_attribute_t *attr; /* Attribute */
_ipp_value_t *attrval; /* Current attribute value */
_ipp_option_t *map; /* Option mapping information */
/*
@@ -269,9 +271,14 @@ cupsCheckDestSupported(
* Check literal values...
*/
map = _ippFindOption(option);
switch (attr->value_tag)
{
case IPP_TAG_INTEGER :
if (map && map->value_tag == IPP_TAG_STRING)
return (strlen(value) <= (size_t)attr->values[0].integer);
case IPP_TAG_ENUM :
int_value = atoi(value);
@@ -284,7 +291,10 @@ cupsCheckDestSupported(
return (attr->values[0].boolean);
case IPP_TAG_RANGE :
int_value = atoi(value);
if (map && map->value_tag == IPP_TAG_STRING)
int_value = (int)strlen(value);
else
int_value = atoi(value);
for (i = 0; i < attr->num_values; i ++)
if (int_value >= attr->values[i].range.lower &&
@@ -1617,7 +1627,7 @@ cups_collection_string(
else
snprintf(temp, sizeof(temp), "%04u-%02u-%02uT%02u:%02u:%02u%c%02u%02u", year, date[2], date[3], date[4], date[5], date[6], date[8], date[9], date[10]);
if (buffer && bufptr < bufend)
if (bufptr < bufend)
strlcpy(bufptr, temp, (size_t)(bufend - bufptr + 1));
bufptr += strlen(temp);
@@ -1637,7 +1647,7 @@ cups_collection_string(
else
snprintf(temp, sizeof(temp), "%dx%d%s", xres, yres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
if (buffer && bufptr < bufend)
if (bufptr < bufend)
strlcpy(bufptr, temp, (size_t)(bufend - bufptr + 1));
bufptr += strlen(temp);
@@ -1653,7 +1663,7 @@ cups_collection_string(
snprintf(temp, sizeof(temp), "%d-%d", lower, upper);
if (buffer && bufptr < bufend)
if (bufptr < bufend)
strlcpy(bufptr, temp, (size_t)(bufend - bufptr + 1));
bufptr += strlen(temp);
@@ -2512,8 +2522,10 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
strlcpy(size->media, best->key, sizeof(size->media));
else if (best->size_name)
strlcpy(size->media, best->size_name, sizeof(size->media));
else
else if (pwg && pwg->pwg)
strlcpy(size->media, pwg->pwg, sizeof(size->media));
else
strlcpy(size->media, "unknown", sizeof(size->media));
size->width = best->width;
size->length = best->length;
+51 -50
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* User-defined destination (and option) support for CUPS.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -13,6 +13,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <sys/stat.h>
#ifdef HAVE_NOTIFY_H
@@ -43,10 +44,10 @@
*/
#ifdef __APPLE__
# if !TARGET_OS_IOS
# if HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME
# include <SystemConfiguration/SystemConfiguration.h>
# define _CUPS_LOCATION_DEFAULTS 1
# endif /* !TARGET_OS_IOS */
# endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
# define kCUPSPrintingPrefs CFSTR("org.cups.PrintingPrefs")
# define kDefaultPaperIDKey CFSTR("DefaultPaperID")
# define kLastUsedPrintersKey CFSTR("LastUsedPrinters")
@@ -1747,7 +1748,6 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
cups_dest_t *dest; /* Destination */
char filename[1024], /* Path to lpoptions */
defname[256]; /* Default printer name */
const char *home = getenv("HOME"); /* Home directory */
int set_as_default = 0; /* Set returned destination as default */
ipp_op_t op = IPP_OP_GET_PRINTER_ATTRIBUTES;
/* IPP operation to get server ops */
@@ -1779,13 +1779,13 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
else
instance = NULL;
}
else if (home)
else if (cg->home)
{
/*
* No default in the environment, try the user's lpoptions files...
*/
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
dest_name = cups_get_default(filename, defname, sizeof(defname), &instance);
@@ -1891,9 +1891,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
if (home)
if (cg->home)
{
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
}
@@ -2031,9 +2031,6 @@ 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
const char *home; /* HOME environment variable */
#endif /* WIN32 */
char filename[1024]; /* lpoptions file */
int num_temps; /* Number of temporary destinations */
cups_dest_t *temps = NULL, /* Temporary destinations */
@@ -2067,27 +2064,18 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
#ifndef WIN32
if (getuid())
if (cg->home)
{
/*
* Point to user defaults...
* Create ~/.cups subdirectory...
*/
if ((home = getenv("HOME")) != NULL)
{
/*
* Create ~/.cups subdirectory...
*/
snprintf(filename, sizeof(filename), "%s/.cups", cg->home);
if (access(filename, 0))
mkdir(filename, 0700);
snprintf(filename, sizeof(filename), "%s/.cups", home);
if (access(filename, 0))
mkdir(filename, 0700);
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
}
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
}
#endif /* !WIN32 */
/*
* Try to open the file...
@@ -2099,7 +2087,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 +2095,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:
@@ -2268,7 +2256,7 @@ _cupsUserDefault(char *name, /* I - Name buffer */
* system preferences...
*/
if ((locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
if (!getenv("CUPS_NO_APPLE_DEFAULT") && (locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
{
CFStringGetCString(locprinter, name, (CFIndex)namesize, kCFStringEncodingUTF8);
CFRelease(locprinter);
@@ -3391,10 +3379,9 @@ cups_enum_dests(
int i, j, /* Looping vars */
num_dests; /* Number of destinations */
cups_dest_t *dests = NULL, /* Destinations */
*dest, /* Current destination */
*user_dest; /* User destination */
*dest; /* Current destination */
cups_option_t *option; /* Current option */
char *user_default; /* User default printer */
const char *user_default; /* Default printer from environment */
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
int count, /* Number of queries started */
completed, /* Number of completed queries */
@@ -3425,7 +3412,6 @@ cups_enum_dests(
#else
_cups_getdata_t data; /* Data for callback */
#endif /* HAVE_DNSSD || HAVE_AVAHI */
const char *home; /* HOME environment variable */
char filename[1024]; /* Local lpoptions file */
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
@@ -3450,13 +3436,35 @@ cups_enum_dests(
memset(&data, 0, sizeof(data));
if ((user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name))) == NULL)
{
const char *defprinter = cupsGetDefault2(http);
/* Server default, if any */
user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name));
if (defprinter)
strlcpy(data.def_name, defprinter, sizeof(data.def_name));
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
if (cg->home)
{
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
}
if (!user_default && (dest = cupsGetDest(NULL, NULL, data.num_dests, data.dests)) != NULL)
{
/*
* Use an lpoptions default printer...
*/
if (dest->instance)
snprintf(data.def_name, sizeof(data.def_name), "%s/%s", dest->name, dest->instance);
else
strlcpy(data.def_name, dest->name, sizeof(data.def_name));
}
else
{
const char *default_printer; /* Server default printer */
if ((default_printer = cupsGetDefault2(http)) != NULL)
strlcpy(data.def_name, default_printer, sizeof(data.def_name));
}
if (data.def_name[0])
@@ -3471,16 +3479,6 @@ cups_enum_dests(
DEBUG_printf(("1cups_enum_dests: def_name=\"%s\", def_instance=\"%s\"", data.def_name, data.def_instance));
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
if ((home = getenv("HOME")) != NULL)
{
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
}
/*
* Get ready to enumerate...
*/
@@ -3518,8 +3516,9 @@ cups_enum_dests(
i > 0 && (!cancel || !*cancel);
i --, dest ++)
{
cups_dest_t *user_dest; /* Destination from lpoptions */
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
const char *device_uri; /* Device URI */
const char *device_uri; /* Device URI */
#endif /* HAVE_DNSSD || HAVE_AVAHI */
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
@@ -3788,6 +3787,8 @@ cups_enum_dests(
if ((device->type & mask) == type)
{
cups_dest_t *user_dest; /* Destination from lpoptions */
dest = &device->dest;
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
+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 */
+37 -4
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Option encoding routines for CUPS.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -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 },
@@ -490,7 +523,7 @@ _cupsEncodeOption(
quote = *sep;
}
else if (*sep == ',' && count > 1)
else if (*sep == ',')
break;
else if (*sep == '\\' && sep[1])
{
@@ -640,7 +673,7 @@ _cupsEncodeOption(
/*
* 'cupsEncodeOption()' - Encode a single option into an IPP attribute.
*
* @since CUPS 2.3@
* @since CUPS 2.3/macOS 10.14@
*/
ipp_attribute_t * /* O - New attribute or @code NULL@ on error */
-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
}
+86 -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-2019 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);
@@ -640,6 +675,12 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
return (-1);
}
if (fp->eof)
{
DEBUG_puts("5cupsFileGetChar: End-of-file!");
return (-1);
}
/*
* If the input buffer is empty, try to read more data...
*/
@@ -986,11 +1027,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 +1119,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 +1290,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.
*
@@ -1600,6 +1653,12 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
if (bytes == 0)
return (0);
if (fp->eof)
{
DEBUG_puts("5cupsFileRead: End-of-file!");
return (-1);
}
/*
* Loop until all bytes are read...
*/
@@ -2013,11 +2072,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 +2606,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 +2636,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 +2675,7 @@ cups_open(const char *filename, /* I - Filename */
errno = EPERM;
return (-1);
}
#endif /* !WIN32 */
#endif /* !_WIN32 */
return (fd);
}
@@ -2642,7 +2701,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 +2711,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 +2758,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 +2768,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
+5 -1
Ver Arquivo
@@ -11,6 +11,7 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include "adminutil.h"
@@ -23,7 +24,10 @@
* parameters provide comma-delimited lists of backends to include or omit from
* the request respectively.
*
* @since CUPS 1.4/macOS 10.6@
* This function is deprecated with the IPP printer discovery functionality
* being provided by the @link cupsEnumDests@ and @cupsGetDests@ functions.
*
* @deprecated@
*/
ipp_status_t /* O - Request status - @code IPP_OK@ on success. */
+113
Ver Arquivo
@@ -0,0 +1,113 @@
/*
* getifaddrs definitions for CUPS.
*
* 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.
*/
#ifndef _CUPS_GETIFADDRS_INTERNAL_H_
# define _CUPS_GETIFADDRS_INTERNAL_H_
/*
* Include necessary headers...
*/
# include "config.h"
# ifdef _WIN32
# define _WINSOCK_DEPRECATED_NO_WARNINGS 1
# include <io.h>
# include <winsock2.h>
# define CUPS_SOCAST (const char *)
# else
# include <unistd.h>
# include <fcntl.h>
# include <sys/socket.h>
# define CUPS_SOCAST
# endif /* _WIN32 */
# if defined(__APPLE__) && !defined(_SOCKLEN_T)
/*
* macOS 10.2.x does not define socklen_t, and in fact uses an int instead of
* unsigned type for length values...
*/
typedef int socklen_t;
# endif /* __APPLE__ && !_SOCKLEN_T */
# ifndef _WIN32
# include <net/if.h>
# include <resolv.h>
# ifdef HAVE_GETIFADDRS
# include <ifaddrs.h>
# else
# include <sys/ioctl.h>
# ifdef HAVE_SYS_SOCKIO_H
# include <sys/sockio.h>
# endif /* HAVE_SYS_SOCKIO_H */
# endif /* HAVE_GETIFADDRS */
# endif /* !_WIN32 */
/*
* C++ magic...
*/
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
/*
* Some OS's don't have getifaddrs() and freeifaddrs()...
*/
# if !defined(_WIN32) && !defined(HAVE_GETIFADDRS)
# ifdef ifa_dstaddr
# undef ifa_dstaddr
# endif /* ifa_dstaddr */
# ifndef ifr_netmask
# define ifr_netmask ifr_addr
# endif /* !ifr_netmask */
struct ifaddrs /**** Interface Structure ****/
{
struct ifaddrs *ifa_next; /* Next interface in list */
char *ifa_name; /* Name of interface */
unsigned int ifa_flags; /* Flags (up, point-to-point, etc.) */
struct sockaddr *ifa_addr, /* Network address */
*ifa_netmask; /* Address mask */
union
{
struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
} ifa_ifu;
void *ifa_data; /* Interface statistics */
};
# ifndef ifa_broadaddr
# define ifa_broadaddr ifa_ifu.ifu_broadaddr
# endif /* !ifa_broadaddr */
# ifndef ifa_dstaddr
# define ifa_dstaddr ifa_ifu.ifu_dstaddr
# endif /* !ifa_dstaddr */
extern int _cups_getifaddrs(struct ifaddrs **addrs) _CUPS_PRIVATE;
# define getifaddrs _cups_getifaddrs
extern void _cups_freeifaddrs(struct ifaddrs *addrs) _CUPS_PRIVATE;
# define freeifaddrs _cups_freeifaddrs
# endif /* !_WIN32 && !HAVE_GETIFADDRS */
/*
* C++ magic...
*/
# ifdef __cplusplus
}
# endif /* __cplusplus */
#endif /* !_CUPS_GETIFADDRS_INTERNAL_H_ */
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Network interface functions for CUPS.
*
* Copyright © 2007-2010 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
@@ -12,7 +12,7 @@
* Include necessary headers.
*/
#include "http-private.h"
#include "getifaddrs-internal.h"
#ifndef HAVE_GETIFADDRS
+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;
+45 -22
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Global variable access routines for CUPS.
*
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2019 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,6 +13,9 @@
*/
#include "cups-private.h"
#ifndef _WIN32
# include <pwd.h>
#endif /* !_WIN32 */
/*
@@ -28,23 +32,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 +63,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 +118,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 +168,7 @@ DllMain(HINSTANCE hinst, /* I - DLL module handle */
return (TRUE);
}
#endif /* WIN32 */
#endif /* _WIN32 */
/*
@@ -176,13 +180,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 +217,7 @@ cups_globals_alloc(void)
* Then set directories as appropriate...
*/
#ifdef WIN32
#ifdef _WIN32
if (!installdir[0])
{
/*
@@ -222,8 +226,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 +235,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;)
@@ -270,6 +273,8 @@ cups_globals_alloc(void)
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
cg->localedir = localedir;
cg->home = getenv("HOME");
#else
# ifdef HAVE_GETEUID
if ((geteuid() != getuid() && getuid()) || getegid() != getgid())
@@ -308,8 +313,23 @@ cups_globals_alloc(void)
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
cg->localedir = CUPS_LOCALEDIR;
cg->home = getenv("HOME");
# ifdef __APPLE__ /* Sandboxing now exposes the container as the home directory */
if (cg->home && strstr(cg->home, "/Library/Containers/"))
cg->home = NULL;
# endif /* !__APPLE__ */
}
#endif /* WIN32 */
if (!cg->home)
{
struct passwd *pw; /* User info */
if ((pw = getpwuid(getuid())) != NULL)
cg->home = _cupsStrAlloc(pw->pw_dir);
}
#endif /* _WIN32 */
return (cg);
}
@@ -319,7 +339,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 +372,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
+24 -4
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* Hashing function for CUPS.
*
* Copyright © 2015-2018 by Apple Inc.
* Copyright © 2015-2019 by Apple Inc.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
@@ -16,8 +16,9 @@
# include <CommonCrypto/CommonDigest.h>
#elif defined(HAVE_GNUTLS)
# include <gnutls/crypto.h>
# include "md5-internal.h"
#else
# include "md5-private.h"
# include "md5-internal.h"
#endif /* __APPLE__ */
@@ -185,8 +186,24 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
unsigned char temp[64]; /* Temporary hash buffer */
size_t tempsize = 0; /* Truncate to this size? */
if (!strcmp(algorithm, "md5"))
alg = GNUTLS_DIG_MD5;
{
/*
* Some versions of GNU TLS disable MD5 without warning...
*/
_cups_md5_state_t state; /* MD5 state info */
if (hashsize < 16)
goto too_small;
_cupsMD5Init(&state);
_cupsMD5Append(&state, data, datalen);
_cupsMD5Finish(&state, hash);
return (16);
}
else if (!strcmp(algorithm, "sha"))
alg = GNUTLS_DIG_SHA1;
else if (!strcmp(algorithm, "sha2-224"))
@@ -230,7 +247,7 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
gnutls_hash_fast(alg, data, datalen, hash);
return (gnutls_hash_get_len(alg));
return ((ssize_t)gnutls_hash_get_len(alg));
}
#else
@@ -242,6 +259,9 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
{
_cups_md5_state_t state; /* MD5 state info */
if (hashsize < 16)
goto too_small;
_cupsMD5Init(&state);
_cupsMD5Append(&state, data, datalen);
_cupsMD5Finish(&state, hash);
+11 -7
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* HTTP address routines for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2007-2019 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.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/
/*
@@ -12,13 +13,16 @@
*/
#include "cups-private.h"
#include "debug-internal.h"
#include <sys/stat.h>
#ifdef HAVE_RESOLV_H
# include <resolv.h>
#endif /* HAVE_RESOLV_H */
#ifdef __APPLE__
# include <CoreFoundation/CoreFoundation.h>
# include <SystemConfiguration/SystemConfiguration.h>
# ifdef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME
# include <SystemConfiguration/SystemConfiguration.h>
# endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
#endif /* __APPLE__ */
@@ -63,11 +67,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 +256,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;
+34 -132
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 */
/*
@@ -204,21 +154,6 @@ typedef gnutls_certificate_credentials_t *http_tls_credentials_t;
* for its IO and protocol management...
*/
# if !defined(HAVE_SECBASEPRIV_H) && defined(HAVE_CSSMERRORSTRING) /* Declare prototype for function in that header... */
extern const char *cssmErrorString(int error);
# endif /* !HAVE_SECBASEPRIV_H && HAVE_CSSMERRORSTRING */
# if !defined(HAVE_SECIDENTITYSEARCHPRIV_H) && defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */
extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy,
CFStringRef idString, CSSM_KEYUSE keyUsage,
CFTypeRef keychainOrArray,
Boolean returnOnlyValidIdentities,
SecIdentitySearchRef* searchRef);
# endif /* !HAVE_SECIDENTITYSEARCHPRIV_H && HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY */
# if !defined(HAVE_SECPOLICYPRIV_H) && defined(HAVE_SECPOLICYSETVALUE) /* Declare prototype for function in that header... */
extern OSStatus SecPolicySetValue(SecPolicyRef policyRef,
const CSSM_DATA *value);
# endif /* !HAVE_SECPOLICYPRIV_H && HAVE_SECPOLICYSETVALUE */
typedef SSLContextRef http_tls_t;
typedef CFArrayRef http_tls_credentials_t;
@@ -349,10 +284,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 */
@@ -372,76 +316,34 @@ extern const char *_cups_hstrerror(int error);
# endif /* !HAVE_HSTRERROR */
/*
* Some OS's don't have getifaddrs() and freeifaddrs()...
*/
# if !defined(WIN32) && !defined(HAVE_GETIFADDRS)
# ifdef ifa_dstaddr
# undef ifa_dstaddr
# endif /* ifa_dstaddr */
# ifndef ifr_netmask
# define ifr_netmask ifr_addr
# endif /* !ifr_netmask */
struct ifaddrs /**** Interface Structure ****/
{
struct ifaddrs *ifa_next; /* Next interface in list */
char *ifa_name; /* Name of interface */
unsigned int ifa_flags; /* Flags (up, point-to-point, etc.) */
struct sockaddr *ifa_addr, /* Network address */
*ifa_netmask; /* Address mask */
union
{
struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
} ifa_ifu;
void *ifa_data; /* Interface statistics */
};
# ifndef ifa_broadaddr
# define ifa_broadaddr ifa_ifu.ifu_broadaddr
# endif /* !ifa_broadaddr */
# ifndef ifa_dstaddr
# define ifa_dstaddr ifa_ifu.ifu_dstaddr
# endif /* !ifa_dstaddr */
extern int _cups_getifaddrs(struct ifaddrs **addrs);
# define getifaddrs _cups_getifaddrs
extern void _cups_freeifaddrs(struct ifaddrs *addrs);
# define freeifaddrs _cups_freeifaddrs
# 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;
/*
+166 -16
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* HTTP support routines for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 2007-2019 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>
@@ -797,14 +799,12 @@ httpGetDateString2(time_t t, /* I - Time in seconds */
char *s, /* I - String buffer */
int slen) /* I - Size of string buffer */
{
struct tm *tdate; /* UNIX date/time data */
struct tm tdate; /* UNIX date/time data */
tdate = gmtime(&t);
if (tdate)
snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate->tm_wday], tdate->tm_mday, http_months[tdate->tm_mon], tdate->tm_year + 1900, tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
else
s[0] = '\0';
gmtime_r(&t, &tdate);
snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate.tm_wday], tdate.tm_mday, http_months[tdate.tm_mon], tdate.tm_year + 1900, tdate.tm_hour, tdate.tm_min, tdate.tm_sec);
return (s);
}
@@ -1026,7 +1026,7 @@ httpSeparateURI(
*ptr = '\0';
if (*uri != ':')
if (*uri != ':' || *scheme == '.' || !*scheme)
{
*scheme = '\0';
return (HTTP_URI_STATUS_BAD_SCHEME);
@@ -1296,6 +1296,159 @@ 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 */
_cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
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
*/
if (cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5)
{
DEBUG_puts("3_httpSetDigestAuthString: MD5 Digest is disabled.");
return (0);
}
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 +1769,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 +1897,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,
+156 -102
Ver Arquivo
@@ -1,8 +1,8 @@
/*
* HTTP routines for CUPS.
*
* Copyright 2007-2018 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* This file contains Kerberos support code, copyright 2006 by
* Jelmer Vernooij.
@@ -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);
}
@@ -1340,8 +1345,11 @@ httpGetSubField2(http_t *http, /* I - HTTP connection */
DEBUG_printf(("2httpGetSubField2(http=%p, field=%d, name=\"%s\", value=%p, valuelen=%d)", (void *)http, field, name, (void *)value, valuelen));
if (value)
*value = '\0';
if (!http || !name || !value || valuelen < 2 ||
field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX || !http->fields[field])
return (NULL);
end = value + valuelen - 1;
@@ -1484,9 +1492,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 +1504,7 @@ httpInitialize(void)
return;
}
#ifdef WIN32
#ifdef _WIN32
WSAStartup(MAKEWORD(2,2), &winsockdata);
#elif !defined(SO_NOSIGPIPE)
@@ -1518,7 +1526,7 @@ httpInitialize(void)
# else
signal(SIGPIPE, SIG_IGN);
# endif /* !SO_NOSIGPIPE */
#endif /* WIN32 */
#endif /* _WIN32 */
# ifdef HAVE_SSL
_httpTLSInitialize();
@@ -1674,7 +1682,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 +1731,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 = 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 +1751,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 +1761,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 +1780,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 +1814,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 +1824,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
bytes = 0;
else
http->error = errno;
#endif /* WIN32 */
#endif /* _WIN32 */
}
else if (bytes == 0)
{
@@ -1852,7 +1860,7 @@ httpPrintf(http_t *http, /* I - HTTP connection */
...) /* I - Additional args as needed */
{
ssize_t bytes; /* Number of bytes to write */
char buf[16384]; /* Buffer for formatted string */
char buf[65536]; /* Buffer for formatted string */
va_list ap; /* Variable argument pointer */
@@ -1864,7 +1872,12 @@ httpPrintf(http_t *http, /* I - HTTP connection */
DEBUG_printf(("3httpPrintf: (" CUPS_LLFMT " bytes) %s", CUPS_LLCAST bytes, buf));
if (http->data_encoding == HTTP_ENCODING_FIELDS)
if (bytes > (ssize_t)(sizeof(buf) - 1))
{
http->error = ENOMEM;
return (-1);
}
else if (http->data_encoding == HTTP_ENCODING_FIELDS)
return ((int)httpWrite2(http, buf, (size_t)bytes));
else
{
@@ -1946,31 +1959,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 +1991,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 +2010,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 +2026,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 +2105,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 +2390,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 +2707,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 +2887,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 +3045,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 +3086,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 +3182,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 +3209,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;
@@ -3634,7 +3652,15 @@ http_add_field(http_t *http, /* I - HTTP connection */
char *combined; /* New value string */
if ((combined = realloc(http->fields[field], total + 1)) != NULL)
if (http->fields[field] == http->_fields[field])
{
if ((combined = malloc(total + 1)) != NULL)
{
http->fields[field] = combined;
snprintf(combined, total + 1, "%s, %s", http->_fields[field], value);
}
}
else if ((combined = realloc(http->fields[field], total + 1)) != NULL)
{
http->fields[field] = combined;
strlcat(combined, ", ", total + 1);
@@ -3681,13 +3707,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 +3725,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 +3744,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 +3820,6 @@ http_content_coding_start(
return;
}
memset(&(http->stream), 0, sizeof(http->stream));
switch (coding)
{
case _HTTP_CODING_DEFLATE :
@@ -3809,18 +3840,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 +3880,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 +3969,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 +4106,7 @@ http_read(http_t *http, /* I - HTTP connection */
if (bytes < 0)
{
#ifdef WIN32
#ifdef _WIN32
if (WSAGetLastError() != WSAEINTR)
{
http->error = WSAGetLastError();
@@ -4088,7 +4142,7 @@ http_read(http_t *http, /* I - HTTP connection */
http->error = errno;
return (-1);
}
#endif /* WIN32 */
#endif /* _WIN32 */
}
}
while (bytes < 0);
@@ -4102,7 +4156,7 @@ http_read(http_t *http, /* I - HTTP connection */
if (bytes < 0)
{
#ifdef WIN32
#ifdef _WIN32
if (WSAGetLastError() == WSAEINTR)
bytes = 0;
else
@@ -4112,7 +4166,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 +4528,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 +4543,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 +4711,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 +4726,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 +4749,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 +4783,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;
+166 -17
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* IPP data file parsing functions.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -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 == '\"'))
@@ -290,7 +303,12 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
* Start of quoted text or regular expression...
*/
quote = ch;
if (ch == '<')
quote = '>';
else
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 +318,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 +356,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 +365,24 @@ _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)));
}
else if (ch == 'a')
ch = '\a';
else if (ch == 'b')
ch = '\b';
else if (ch == 'f')
ch = '\f';
else if (ch == 'n')
ch = '\n';
else if (ch == 'r')
ch = '\r';
else if (ch == 't')
ch = '\t';
else if (ch == 'v')
ch = '\v';
}
if (tokptr < tokend)
@@ -376,7 +413,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);
}
@@ -425,14 +462,14 @@ parse_collection(
if (!_ippFileReadToken(f, syntax, sizeof(syntax)))
{
report_error(f, v, user_data, "Missing ATTR syntax on line %d of \"%s\".", f->linenum, f->filename);
report_error(f, v, user_data, "Missing MEMBER syntax on line %d of \"%s\".", f->linenum, f->filename);
ippDelete(col);
col = NULL;
break;
}
else if ((value_tag = ippTagValue(syntax)) < IPP_TAG_UNSUPPORTED_VALUE)
{
report_error(f, v, user_data, "Bad ATTR syntax \"%s\" on line %d of \"%s\".", syntax, f->linenum, f->filename);
report_error(f, v, user_data, "Bad MEMBER syntax \"%s\" on line %d of \"%s\".", syntax, f->linenum, f->filename);
ippDelete(col);
col = NULL;
break;
@@ -440,7 +477,7 @@ parse_collection(
if (!_ippFileReadToken(f, name, sizeof(name)) || !name[0])
{
report_error(f, v, user_data, "Missing ATTR name on line %d of \"%s\".", f->linenum, f->filename);
report_error(f, v, user_data, "Missing MEMBER name on line %d of \"%s\".", f->linenum, f->filename);
ippDelete(col);
col = NULL;
break;
@@ -515,8 +552,11 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element) /* I - Element number */
{
char value[1024], /* Value string */
temp[1024]; /* Temporary string */
char value[2049], /* Value string */
*valueptr, /* Pointer into value string */
temp[2049], /* Temporary string */
*tempptr; /* Pointer into temporary string */
size_t valuelen; /* Length of value */
if (!_ippFileReadToken(f, temp, sizeof(temp)))
@@ -549,8 +589,80 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
utc_offset = 0; /* Timezone offset from UTC */
ipp_uchar_t date[11]; /* dateTime value */
if (sscanf(value, "%d-%d-%dT%d:%d:%d%d", &year, &month, &day, &hour, &minute, &second, &utc_offset) < 6)
if (*value == 'P')
{
/*
* Time period...
*/
time_t curtime; /* Current time in seconds */
int period = 0, /* Current period value */
saw_T = 0; /* Saw time separator */
curtime = time(NULL);
for (valueptr = value + 1; *valueptr; valueptr ++)
{
if (isdigit(*valueptr & 255))
{
period = (int)strtol(valueptr, &valueptr, 10);
if (!valueptr || period < 0)
{
report_error(f, v, user_data, "Bad dateTime value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
return (0);
}
}
if (*valueptr == 'Y')
{
curtime += 365 * 86400 * period;
period = 0;
}
else if (*valueptr == 'M')
{
if (saw_T)
curtime += 60 * period;
else
curtime += 30 * 86400 * period;
period = 0;
}
else if (*valueptr == 'D')
{
curtime += 86400 * period;
period = 0;
}
else if (*valueptr == 'H')
{
curtime += 3600 * period;
period = 0;
}
else if (*valueptr == 'S')
{
curtime += period;
period = 0;
}
else if (*valueptr == 'T')
{
saw_T = 1;
period = 0;
}
else
{
report_error(f, v, user_data, "Bad dateTime value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
return (0);
}
}
return (ippSetDate(ipp, attr, element, ippTimeToDate(curtime)));
}
else if (sscanf(value, "%d-%d-%dT%d:%d:%d%d", &year, &month, &day, &hour, &minute, &second, &utc_offset) < 6)
{
/*
* Date/time value did not parse...
*/
report_error(f, v, user_data, "Bad dateTime value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
return (0);
}
@@ -624,7 +736,44 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
break;
case IPP_TAG_STRING :
return (ippSetOctetString(ipp, attr, element, value, (int)strlen(value)));
valuelen = strlen(value);
if (value[0] == '<' && value[strlen(value) - 1] == '>')
{
if (valuelen & 1)
{
report_error(f, v, user_data, "Bad octetString value on line %d of \"%s\".", f->linenum, f->filename);
return (0);
}
valueptr = value + 1;
tempptr = temp;
while (*valueptr && *valueptr != '>')
{
if (!isxdigit(valueptr[0] & 255) || !isxdigit(valueptr[1] & 255))
{
report_error(f, v, user_data, "Bad octetString value on line %d of \"%s\".", f->linenum, f->filename);
return (0);
}
if (valueptr[0] >= '0' && valueptr[0] <= '9')
*tempptr = (char)((valueptr[0] - '0') << 4);
else
*tempptr = (char)((tolower(valueptr[0]) - 'a' + 10) << 4);
if (valueptr[1] >= '0' && valueptr[1] <= '9')
*tempptr |= (valueptr[1] - '0');
else
*tempptr |= (tolower(valueptr[1]) - 'a' + 10);
tempptr ++;
}
return (ippSetOctetString(ipp, attr, element, temp, (int)(tempptr - temp)));
}
else
return (ippSetOctetString(ipp, attr, element, value, (int)valuelen));
break;
case IPP_TAG_TEXTLANG :
@@ -647,7 +796,7 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
if (strcmp(value, "{"))
{
report_error(f, v, user_data, "Bad ATTR collection value on line %d of \"%s\".", f->linenum, f->filename);
report_error(f, v, user_data, "Bad collection value on line %d of \"%s\".", f->linenum, f->filename);
return (0);
}
@@ -662,7 +811,7 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
break;
default :
report_error(f, v, user_data, "Unsupported ATTR value on line %d of \"%s\".", f->linenum, f->filename);
report_error(f, v, user_data, "Unsupported value on line %d of \"%s\".", f->linenum, f->filename);
return (0);
}
+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;
/*
+372 -226
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-accordion", /* 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[] =
{
@@ -569,7 +571,7 @@ static const char * const ipp_document_states[] =
"0x40000057",
"0x40000058",
"0x40000059",
"cups-fold-accordian",
"cups-fold-accordion",
"cups-fold-double-gate",
"cups-fold-gate",
"cups-fold-half",
@@ -616,7 +618,21 @@ static const char * const ipp_document_states[] =
{ /* printer-state enums */
"idle",
"processing",
"stopped",
"stopped"
},
* const ipp_resource_states[] =
{ /* resource-state enums */
"pending",
"available",
"installed",
"canceled",
"aborted"
},
* const ipp_system_states[] =
{ /* system-state enums */
"idle",
"processing",
"stopped"
};
@@ -874,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 */
@@ -909,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",
@@ -977,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",
@@ -1168,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",
@@ -1227,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",
@@ -1238,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",
@@ -1246,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",
@@ -1260,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",
@@ -1297,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",
@@ -1472,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 */
@@ -1587,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",
@@ -1666,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",
@@ -1693,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",
@@ -1713,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",
@@ -1737,6 +1779,12 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
"requesting-user-name-allowed", /* CUPS extension */
"requesting-user-name-denied", /* CUPS extension */
"requesting-user-uri-supported",
"smi2699-auth-print-group", /* PWG ippserver extension */
"smi2699-auth-proxy-group", /* PWG ippserver extension */
"smi2699-device-command", /* PWG ippserver extension */
"smi2699-device-format", /* PWG ippserver extension */
"smi2699-device-name", /* PWG ippserver extension */
"smi2699-device-uri", /* PWG ippserver extension */
"subordinate-printers-supported",
"subscription-privacy-attributes", /* IPP Privacy Attributes */
"subscription-privacy-scope", /* IPP Privacy Attributes */
@@ -1749,17 +1797,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 */
@@ -1781,21 +1866,78 @@ 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",
"smi2699-auth-group-supported", /* PWG ippserver extension */
"smi2699-device-command-supported", /* PWG ippserver extension */
"smi2699-device-format-format", /* PWG ippserver extension */
"smi2699-device-uri-schemes-supported",
/* PWG ippserver extension */
"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");
@@ -1826,12 +1968,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;
@@ -1839,67 +1978,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);
}
@@ -1923,59 +2087,31 @@ ippEnumString(const char *attrname, /* I - Attribute name */
* Check for standard enum values...
*/
if (!strcmp(attrname, "document-state") &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_document_states) /
sizeof(ipp_document_states[0]))))
if (!strcmp(attrname, "document-state") && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_document_states) / sizeof(ipp_document_states[0]))))
return (ipp_document_states[enumvalue - 3]);
else if (!strcmp(attrname, "finishings") ||
!strcmp(attrname, "finishings-actual") ||
!strcmp(attrname, "finishings-default") ||
!strcmp(attrname, "finishings-ready") ||
!strcmp(attrname, "finishings-supported") ||
!strcmp(attrname, "job-finishings") ||
!strcmp(attrname, "job-finishings-default") ||
!strcmp(attrname, "job-finishings-supported"))
else if (!strcmp(attrname, "finishings") || !strcmp(attrname, "finishings-actual") || !strcmp(attrname, "finishings-default") || !strcmp(attrname, "finishings-ready") || !strcmp(attrname, "finishings-supported") || !strcmp(attrname, "job-finishings") || !strcmp(attrname, "job-finishings-default") || !strcmp(attrname, "job-finishings-supported"))
{
if (enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_finishings) /
sizeof(ipp_finishings[0]))))
if (enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
return (ipp_finishings[enumvalue - 3]);
else if (enumvalue >= 0x40000000 &&
enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) /
sizeof(ipp_finishings_vendor[0]))))
else if (enumvalue >= 0x40000000 && enumvalue < (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0]))))
return (ipp_finishings_vendor[enumvalue - 0x40000000]);
}
else if ((!strcmp(attrname, "job-collation-type") ||
!strcmp(attrname, "job-collation-type-actual")) &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) /
sizeof(ipp_job_collation_types[0]))))
else if ((!strcmp(attrname, "job-collation-type") || !strcmp(attrname, "job-collation-type-actual")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) / sizeof(ipp_job_collation_types[0]))))
return (ipp_job_collation_types[enumvalue - 3]);
else if (!strcmp(attrname, "job-state") &&
enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
else if (!strcmp(attrname, "job-state") && enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
return (ipp_job_states[enumvalue - IPP_JSTATE_PENDING]);
else if (!strcmp(attrname, "operations-supported"))
return (ippOpString((ipp_op_t)enumvalue));
else if ((!strcmp(attrname, "orientation-requested") ||
!strcmp(attrname, "orientation-requested-actual") ||
!strcmp(attrname, "orientation-requested-default") ||
!strcmp(attrname, "orientation-requested-supported")) &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) /
sizeof(ipp_orientation_requesteds[0]))))
else if ((!strcmp(attrname, "orientation-requested") || !strcmp(attrname, "orientation-requested-actual") || !strcmp(attrname, "orientation-requested-default") || !strcmp(attrname, "orientation-requested-supported")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) / sizeof(ipp_orientation_requesteds[0]))))
return (ipp_orientation_requesteds[enumvalue - 3]);
else if ((!strcmp(attrname, "print-quality") ||
!strcmp(attrname, "print-quality-actual") ||
!strcmp(attrname, "print-quality-default") ||
!strcmp(attrname, "print-quality-supported")) &&
enumvalue >= 3 &&
enumvalue < (3 + (int)(sizeof(ipp_print_qualities) /
sizeof(ipp_print_qualities[0]))))
else if ((!strcmp(attrname, "print-quality") || !strcmp(attrname, "print-quality-actual") || !strcmp(attrname, "print-quality-default") || !strcmp(attrname, "print-quality-supported")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_print_qualities) / sizeof(ipp_print_qualities[0]))))
return (ipp_print_qualities[enumvalue - 3]);
else if (!strcmp(attrname, "printer-state") &&
enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
else if (!strcmp(attrname, "printer-state") && enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
return (ipp_printer_states[enumvalue - IPP_PSTATE_IDLE]);
else if (!strcmp(attrname, "resource-state") && enumvalue >= IPP_RSTATE_PENDING && enumvalue <= IPP_RSTATE_ABORTED)
return (ipp_resource_states[enumvalue - IPP_RSTATE_PENDING]);
else if (!strcmp(attrname, "system-state") && enumvalue >= IPP_SSTATE_IDLE && enumvalue <= IPP_SSTATE_STOPPED)
return (ipp_system_states[enumvalue - IPP_SSTATE_IDLE]);
/*
* Not a standard enum value, just return the decimal equivalent...
@@ -2067,6 +2203,16 @@ ippEnumValue(const char *attrname, /* I - Attribute name */
num_strings = (int)(sizeof(ipp_printer_states) / sizeof(ipp_printer_states[0]));
strings = ipp_printer_states;
}
else if (!strcmp(attrname, "resource-state"))
{
num_strings = (int)(sizeof(ipp_resource_states) / sizeof(ipp_resource_states[0]));
strings = ipp_resource_states;
}
else if (!strcmp(attrname, "system-state"))
{
num_strings = (int)(sizeof(ipp_system_states) / sizeof(ipp_system_states[0]));
strings = ipp_system_states;
}
else
return (-1);
+5 -2
Ver Arquivo
@@ -1,7 +1,7 @@
/*
* IPP data file parsing functions.
*
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -15,6 +15,7 @@
#include <cups/cups.h>
#include "ipp-private.h"
#include "string-private.h"
#include "debug-internal.h"
/*
@@ -133,7 +134,9 @@ const char * /* O - Value or @code NULL@ if not set */
_ippVarsGet(_ipp_vars_t *v, /* I - IPP variables */
const char *name) /* I - Variable name */
{
if (!strcmp(name, "uri"))
if (!v)
return (NULL);
else if (!strcmp(name, "uri"))
return (v->uri);
else if (!strcmp(name, "uriuser") || !strcmp(name, "username"))
return (v->username[0] ? v->username : NULL);
+156 -226
Ver Arquivo
@@ -1,10 +1,11 @@
/*
* Internet Printing Protocol functions for CUPS.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2019 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,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 */
/*
@@ -27,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);
@@ -1477,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 */
@@ -1495,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);
@@ -1510,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);
@@ -1652,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 ++;
@@ -1686,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;
@@ -3049,7 +2956,7 @@ ippReadIO(void *src, /* I - Data source */
* Read 32-bit "extension" tag...
*/
if ((*cb)(src, buffer, 4) < 1)
if ((*cb)(src, buffer, 4) < 4)
{
DEBUG_puts("1ippReadIO: Callback returned EOF/error");
_cupsBufferRelease((char *)buffer);
@@ -3083,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)
{
/*
@@ -3126,8 +3040,13 @@ ippReadIO(void *src, /* I - Data source */
DEBUG_printf(("2ippReadIO: name length=%d", n));
if (n == 0 && tag != IPP_TAG_MEMBERNAME &&
tag != IPP_TAG_END_COLLECTION)
if (n && parent)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid named IPP attribute in collection."), 1);
DEBUG_puts("1ippReadIO: bad attribute name in collection.");
return (IPP_STATE_ERROR);
}
else if (n == 0 && tag != IPP_TAG_MEMBERNAME && tag != IPP_TAG_END_COLLECTION)
{
/*
* More values for current attribute...
@@ -3380,7 +3299,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 :
@@ -3400,6 +3322,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 :
@@ -3654,6 +3577,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)
{
@@ -3830,8 +3754,7 @@ ippSetDate(ipp_t *ipp, /* I - IPP message */
* Range check input...
*/
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_DATE ||
element < 0 || element > (*attr)->num_values || !datevalue)
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_DATE && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || !datevalue)
return (0);
/*
@@ -3914,9 +3837,7 @@ ippSetInteger(ipp_t *ipp, /* I - IPP message */
* Range check input...
*/
if (!ipp || !attr || !*attr ||
((*attr)->value_tag != IPP_TAG_INTEGER && (*attr)->value_tag != IPP_TAG_ENUM) ||
element < 0 || element > (*attr)->num_values)
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_INTEGER && (*attr)->value_tag != IPP_TAG_ENUM && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values)
return (0);
/*
@@ -3924,7 +3845,12 @@ ippSetInteger(ipp_t *ipp, /* I - IPP message */
*/
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
{
if ((*attr)->value_tag != IPP_TAG_ENUM)
(*attr)->value_tag = IPP_TAG_INTEGER;
value->integer = intvalue;
}
return (value != NULL);
}
@@ -4001,9 +3927,7 @@ ippSetOctetString(
* Range check input...
*/
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_STRING ||
element < 0 || element > (*attr)->num_values ||
datalen < 0 || datalen > IPP_MAX_LENGTH)
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_STRING && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || datalen < 0 || datalen > IPP_MAX_LENGTH)
return (0);
/*
@@ -4027,6 +3951,8 @@ ippSetOctetString(
* Copy the data...
*/
(*attr)->value_tag = IPP_TAG_STRING;
if (value->unknown.data)
{
/*
@@ -4118,8 +4044,7 @@ ippSetRange(ipp_t *ipp, /* I - IPP message */
* Range check input...
*/
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_RANGE ||
element < 0 || element > (*attr)->num_values || lowervalue > uppervalue)
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_RANGE && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || lowervalue > uppervalue)
return (0);
/*
@@ -4128,6 +4053,7 @@ ippSetRange(ipp_t *ipp, /* I - IPP message */
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
{
(*attr)->value_tag = IPP_TAG_RANGE;
value->range.lower = lowervalue;
value->range.upper = uppervalue;
}
@@ -4200,9 +4126,7 @@ ippSetResolution(
* Range check input...
*/
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_RESOLUTION ||
element < 0 || element > (*attr)->num_values || xresvalue <= 0 || yresvalue <= 0 ||
unitsvalue < IPP_RES_PER_INCH || unitsvalue > IPP_RES_PER_CM)
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_RESOLUTION && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || xresvalue <= 0 || yresvalue <= 0 || unitsvalue < IPP_RES_PER_INCH || unitsvalue > IPP_RES_PER_CM)
return (0);
/*
@@ -4211,6 +4135,7 @@ ippSetResolution(
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
{
(*attr)->value_tag = IPP_TAG_RESOLUTION;
value->resolution.units = unitsvalue;
value->resolution.xres = xresvalue;
value->resolution.yres = yresvalue;
@@ -4312,10 +4237,7 @@ ippSetString(ipp_t *ipp, /* I - IPP message */
else
value_tag = IPP_TAG_ZERO;
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)
if (!ipp || !attr || !*attr || (value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG && value_tag != IPP_TAG_NAMELANG && value_tag != IPP_TAG_NOVALUE && value_tag != IPP_TAG_UNKNOWN) || value_tag > IPP_TAG_MIMETYPE || element < 0 || element > (*attr)->num_values || !strvalue)
return (0);
/*
@@ -4324,6 +4246,9 @@ ippSetString(ipp_t *ipp, /* I - IPP message */
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
{
if (value_tag == IPP_TAG_NOVALUE || value_tag == IPP_TAG_UNKNOWN)
(*attr)->value_tag = IPP_TAG_KEYWORD;
if (element > 0)
value->string.language = (*attr)->values[0].string.language;
@@ -4424,10 +4349,7 @@ ippSetStringfv(ipp_t *ipp, /* I - IPP message */
else
value_tag = IPP_TAG_ZERO;
if (!ipp || !attr || !*attr ||
(value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG &&
value_tag != IPP_TAG_NAMELANG) || value_tag > IPP_TAG_MIMETYPE ||
!format)
if (!ipp || !attr || !*attr || (value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG && value_tag != IPP_TAG_NAMELANG && value_tag != IPP_TAG_NOVALUE && value_tag != IPP_TAG_UNKNOWN) || value_tag > IPP_TAG_MIMETYPE || !format)
return (0);
/*
@@ -4479,6 +4401,8 @@ ippSetStringfv(ipp_t *ipp, /* I - IPP message */
max_bytes = IPP_MAX_CHARSET;
break;
case IPP_TAG_NOVALUE :
case IPP_TAG_UNKNOWN :
case IPP_TAG_KEYWORD :
max_bytes = IPP_MAX_KEYWORD;
break;
@@ -4626,9 +4550,7 @@ ippSetValueTag(
break;
case IPP_TAG_NAME :
if (temp_tag != IPP_TAG_KEYWORD && temp_tag != IPP_TAG_URI &&
temp_tag != IPP_TAG_URISCHEME && temp_tag != IPP_TAG_LANGUAGE &&
temp_tag != IPP_TAG_MIMETYPE)
if (temp_tag != IPP_TAG_KEYWORD)
return (0);
(*attr)->value_tag = (ipp_tag_t)(IPP_TAG_NAME | ((*attr)->value_tag & IPP_TAG_CUPS_CONST));
@@ -4636,17 +4558,14 @@ ippSetValueTag(
case IPP_TAG_NAMELANG :
case IPP_TAG_TEXTLANG :
if (value_tag == IPP_TAG_NAMELANG &&
(temp_tag != IPP_TAG_NAME && temp_tag != IPP_TAG_KEYWORD &&
temp_tag != IPP_TAG_URI && temp_tag != IPP_TAG_URISCHEME &&
temp_tag != IPP_TAG_LANGUAGE && temp_tag != IPP_TAG_MIMETYPE))
if (value_tag == IPP_TAG_NAMELANG && (temp_tag != IPP_TAG_NAME && temp_tag != IPP_TAG_KEYWORD))
return (0);
if (value_tag == IPP_TAG_TEXTLANG && temp_tag != IPP_TAG_TEXT)
return (0);
if (ipp->attrs && ipp->attrs->next && ipp->attrs->next->name &&
!strcmp(ipp->attrs->next->name, "attributes-natural-language"))
!strcmp(ipp->attrs->next->name, "attributes-natural-language") && (ipp->attrs->next->value_tag & IPP_TAG_CUPS_MASK) == IPP_TAG_LANGUAGE)
{
/*
* Use the language code from the IPP message...
@@ -4740,7 +4659,7 @@ ippSetVersion(ipp_t *ipp, /* I - IPP message */
const ipp_uchar_t * /* O - RFC-2579 date/time data */
ippTimeToDate(time_t t) /* I - Time in seconds */
{
struct tm *unixdate; /* UNIX unixdate/time info */
struct tm unixdate; /* UNIX unixdate/time info */
ipp_uchar_t *date = _cupsGlobals()->ipp_date;
/* RFC-2579 date/time data */
@@ -4762,16 +4681,16 @@ ippTimeToDate(time_t t) /* I - Time in seconds */
* 10 UTC minutes (0 to 59)
*/
unixdate = gmtime(&t);
unixdate->tm_year += 1900;
gmtime_r(&t, &unixdate);
unixdate.tm_year += 1900;
date[0] = (ipp_uchar_t)(unixdate->tm_year >> 8);
date[1] = (ipp_uchar_t)(unixdate->tm_year);
date[2] = (ipp_uchar_t)(unixdate->tm_mon + 1);
date[3] = (ipp_uchar_t)unixdate->tm_mday;
date[4] = (ipp_uchar_t)unixdate->tm_hour;
date[5] = (ipp_uchar_t)unixdate->tm_min;
date[6] = (ipp_uchar_t)unixdate->tm_sec;
date[0] = (ipp_uchar_t)(unixdate.tm_year >> 8);
date[1] = (ipp_uchar_t)(unixdate.tm_year);
date[2] = (ipp_uchar_t)(unixdate.tm_mon + 1);
date[3] = (ipp_uchar_t)unixdate.tm_mday;
date[4] = (ipp_uchar_t)unixdate.tm_hour;
date[5] = (ipp_uchar_t)unixdate.tm_min;
date[6] = (ipp_uchar_t)unixdate.tm_sec;
date[7] = 0;
date[8] = '+';
date[9] = 0;
@@ -4990,40 +4909,44 @@ ippValidateAttribute(
{
if ((*ptr & 0xe0) == 0xc0)
{
ptr ++;
if ((*ptr & 0xc0) != 0x80)
if ((ptr[1] & 0xc0) != 0x80)
break;
ptr ++;
}
else if ((*ptr & 0xf0) == 0xe0)
{
ptr ++;
if ((*ptr & 0xc0) != 0x80)
break;
ptr ++;
if ((*ptr & 0xc0) != 0x80)
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80)
break;
ptr += 2;
}
else if ((*ptr & 0xf8) == 0xf0)
{
ptr ++;
if ((*ptr & 0xc0) != 0x80)
break;
ptr ++;
if ((*ptr & 0xc0) != 0x80)
break;
ptr ++;
if ((*ptr & 0xc0) != 0x80)
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80 || (ptr[3] & 0xc0) != 0x80)
break;
ptr += 3;
}
else if (*ptr & 0x80)
break;
else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f)
break;
}
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))
{
@@ -5041,40 +4964,44 @@ ippValidateAttribute(
{
if ((*ptr & 0xe0) == 0xc0)
{
ptr ++;
if ((*ptr & 0xc0) != 0x80)
if ((ptr[1] & 0xc0) != 0x80)
break;
ptr ++;
}
else if ((*ptr & 0xf0) == 0xe0)
{
ptr ++;
if ((*ptr & 0xc0) != 0x80)
break;
ptr ++;
if ((*ptr & 0xc0) != 0x80)
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80)
break;
ptr += 2;
}
else if ((*ptr & 0xf8) == 0xf0)
{
ptr ++;
if ((*ptr & 0xc0) != 0x80)
break;
ptr ++;
if ((*ptr & 0xc0) != 0x80)
break;
ptr ++;
if ((*ptr & 0xc0) != 0x80)
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80 || (ptr[3] & 0xc0) != 0x80)
break;
ptr += 3;
}
else if (*ptr & 0x80)
break;
else if (*ptr < ' ' || *ptr == 0x7f)
break;
}
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))
{
@@ -6361,6 +6288,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 :
@@ -6702,14 +6630,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;
@@ -6737,11 +6665,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 */
}
@@ -6840,7 +6768,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)
@@ -6909,9 +6839,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 */
}

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