Comparar commits
358 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 82e3ee0e32 | |||
| 1f2a315c2b | |||
| 9183329049 | |||
| 2ed9e648a7 | |||
| 7a672d0bdc | |||
| d42bc1c4f9 | |||
| 9c2b03c1f7 | |||
| 40a6b95e55 | |||
| ed181c24e4 | |||
| dbdf8a2a45 | |||
| b018978c27 | |||
| bb640280b6 | |||
| 0f98a48497 | |||
| a00d9eaecf | |||
| f937322154 | |||
| 2cfb7357e2 | |||
| 71023b1700 | |||
| 5d2ac21a00 | |||
| 81d8eb3af3 | |||
| b4f9e3f7ba | |||
| 7a2be9facf | |||
| 5ea07c61ba | |||
| e8378539e0 | |||
| 9240cd70a2 | |||
| e90a53ab8d | |||
| e6330cabb8 | |||
| eb03b2d232 | |||
| 1a3915dded | |||
| d6ec252e9b | |||
| 2bae6fc518 | |||
| 6f7bd716e6 | |||
| fd8e2bdb2d | |||
| 56ba2f5122 | |||
| b1f4c1e664 | |||
| b2b97b71f1 | |||
| f4a99aeb02 | |||
| f950947148 | |||
| b31d4ca525 | |||
| 6d391f7705 | |||
| e2eb28cfcf | |||
| 3ff5a8e393 | |||
| bea505c32e | |||
| 93df3887e0 | |||
| 986daa034e | |||
| 5129a91c54 | |||
| 025b8ce8f6 | |||
| 45f72738bb | |||
| 397eefaa69 | |||
| 9e82c53ebc | |||
| 7454512be9 | |||
| 3c985bae7f | |||
| ec8beb8952 | |||
| 4c793ee9ce | |||
| e35d176c54 | |||
| 2a06655e5c | |||
| 692b157d0c | |||
| 13e6d13ea4 | |||
| fca9a9818d | |||
| 771e64526d | |||
| 5b835597f3 | |||
| 99c3e9f3f2 | |||
| 2b47f09162 | |||
| 6936a1222d | |||
| dc407006a7 | |||
| cfaaa07a19 | |||
| eff8c82f6a | |||
| 3ba95ec48d | |||
| f8688d733b | |||
| 1e01995a1c | |||
| 68dc110f52 | |||
| 998a43a0dd | |||
| bc5060a1dd | |||
| ee6be9cd7e | |||
| 8fb0d30daa | |||
| c669a17e64 | |||
| 34934be905 | |||
| 89fabc72df | |||
| 93d79201b2 | |||
| ed174a7cec | |||
| 5e0dc7e14c | |||
| 1553df019b | |||
| 873c513326 | |||
| 69e37fbf52 | |||
| 05690fddfa | |||
| 7b6d49eec9 | |||
| d46a87a45f | |||
| 60a7373f31 | |||
| 2c030c7a06 | |||
| d784ca2f83 | |||
| f4b0bfa2db | |||
| 5754bcceeb | |||
| f79dad58ab | |||
| 3cf5b72ab7 | |||
| c76c53615c | |||
| 9ec6124c37 | |||
| 8e048e4d39 | |||
| dc00a7c3ad | |||
| db1c94f3a1 | |||
| 65048b860c | |||
| 43c0e4a9d5 | |||
| eda46e3aac | |||
| 6647894889 | |||
| 614efb7a87 | |||
| c5dcd7ecff | |||
| 9c13b7d26e | |||
| 4e104fb9c8 | |||
| 242b4b9be6 | |||
| 9539c53065 | |||
| 3c27d2a6dd | |||
| e9a4e9d6ea | |||
| c0a097c92f | |||
| 9a5e6d74b9 | |||
| f93b470e22 | |||
| 90d3999e0d | |||
| c9b65dc4d9 | |||
| 8ef4f507d7 | |||
| 3001a140d6 | |||
| 2614dc6385 | |||
| b7569be6f4 | |||
| e02771e0c6 | |||
| 11c5618507 | |||
| ce3f7bf3e9 | |||
| 387ef588c9 | |||
| 2e738f0309 | |||
| 8e901a3856 | |||
| 53cac1d08b | |||
| 9c554374b5 | |||
| 03cc81b703 | |||
| 5098fdde63 | |||
| 0cf87cf506 | |||
| 4d03c4ca90 | |||
| 715dfb366b | |||
| 0d89470f82 | |||
| ef4d439c3b | |||
| b761dd43be | |||
| 7c11d5aea4 | |||
| c674bfbe2b | |||
| 1b032cbf87 | |||
| bed16f192b | |||
| 3894a88544 | |||
| 6ac324a2e1 | |||
| aa5e4fd677 | |||
| c701f9b123 | |||
| b1f826250f | |||
| 3e391a8e76 | |||
| cb480624d3 | |||
| 9914f0fe30 | |||
| c8a5a28c0a | |||
| bf7c741159 | |||
| d29b58fc33 | |||
| aa15a57207 | |||
| e923f65f23 | |||
| d1d3862ca2 | |||
| 20c9da8184 | |||
| 9018ff94f1 | |||
| c8d7d4bf55 | |||
| bd51657148 | |||
| e1074f486d | |||
| 657748179f | |||
| 3f3b535383 | |||
| d0f469a7cd | |||
| f4f9631897 | |||
| 3408121d8c | |||
| bb73b8e008 | |||
| 0e17f4c941 | |||
| c2bcbdc519 | |||
| 98b1b6bafa | |||
| b3f0b5a94f | |||
| 16dbc94b92 | |||
| 0c178dec48 | |||
| 5da48e4614 | |||
| 69b84368d3 | |||
| 661d608a65 | |||
| 0450ddd4f0 | |||
| 07b9937a7d | |||
| 14bd3d8990 | |||
| c05a795e78 | |||
| 315afe86da | |||
| 066dd700da | |||
| 8dabd1442f | |||
| 6fcbda51bf | |||
| 45b2ced5aa | |||
| f49af670aa | |||
| b2ad86e038 | |||
| 5f145615d2 | |||
| 6dac1130b5 | |||
| d6395c6f1d | |||
| 87030afb3a | |||
| ea75e93d17 | |||
| 3f8c4f3409 | |||
| fad6d66937 | |||
| 10ce4df141 | |||
| feb13eeaf6 | |||
| f1ac9f5889 | |||
| a76950482b | |||
| 7586933c85 | |||
| c0447c4d98 | |||
| 9d8b53bb0c | |||
| 42f55cadf6 | |||
| dc84a5a4cd | |||
| e513da0cd8 | |||
| f20ce462b9 | |||
| 9a5efde597 | |||
| 58b64171af | |||
| 75c93cc2b5 | |||
| 2d6dcec181 | |||
| b13a9a9633 | |||
| 7331c1b633 | |||
| de4912b2c9 | |||
| ab8fab6154 | |||
| d86153a94f | |||
| 400e67c15f | |||
| 507c4adcc8 | |||
| 60d8f88456 | |||
| 51ddec4029 | |||
| 11da92e6b1 | |||
| 820cb58e40 | |||
| d22e887a13 | |||
| 9a51a8159f | |||
| ef6de4e15d | |||
| a9f5214b4c | |||
| 0c5991dba7 | |||
| 9c5f08f184 | |||
| 00be463e2c | |||
| 4d2df92677 | |||
| b32051c91b | |||
| b3835dde2f | |||
| 59cd12c6d2 | |||
| 4c00fa533f | |||
| 677e4ca625 | |||
| 4d0f1959a3 | |||
| 5483fd294a | |||
| cebb2dcc23 | |||
| 87854afe61 | |||
| a3390b63a6 | |||
| e19d0f3891 | |||
| bc69e04b2c | |||
| dd43b7f78d | |||
| dd2b61669e | |||
| cc108616c0 | |||
| 6640ceec8c | |||
| 9141aa0150 | |||
| 154f5392bf | |||
| 3e5092db04 | |||
| efb349bcb8 | |||
| 6641bd0d3f | |||
| 098d20d4b9 | |||
| 6d56631f9b | |||
| 89c7bc6f48 | |||
| a5ed2e3944 | |||
| 9e24f768b9 | |||
| cdb2e72460 | |||
| aa2a90cee6 | |||
| 1562b9a19d | |||
| 3c2cb8228e | |||
| f89270998d | |||
| 92dad94559 | |||
| 8a4ed632e8 | |||
| 8b4ae65338 | |||
| d46dbe1ba7 | |||
| 21609267ec | |||
| 49b3fb6354 | |||
| d2df4e48b9 | |||
| f88b8468c5 | |||
| 2c091429d1 | |||
| d88008a0e6 | |||
| ca2990c7fe | |||
| 2a06fe63e6 | |||
| 7d950e9251 | |||
| d3454c3ef6 | |||
| f05517caab | |||
| 2db15a26b8 | |||
| 9bdea94b14 | |||
| b6787b6954 | |||
| bb52530560 | |||
| 47b3bd03e4 | |||
| 45cae1bc04 | |||
| 76bb0a3b90 | |||
| 1df7a46155 | |||
| 25f2b3ee1a | |||
| 7f472a4384 | |||
| baf55a940a | |||
| 5a9647c7ac | |||
| 5ca3a7ff46 | |||
| cc6495f7a8 | |||
| 73721e3edb | |||
| aa7edf3c17 | |||
| 1ce6909d23 | |||
| 6e63114c45 | |||
| fa26ab9573 | |||
| ec7e5bddc7 | |||
| fa2851d5b5 | |||
| 0d94b8bf90 | |||
| e625fa1320 | |||
| d9f301dd14 | |||
| 2cb772b87f | |||
| bd880c0c4d | |||
| e060cfd23f | |||
| 6648f8c125 | |||
| 340e5f8ffd | |||
| 7cf665850c | |||
| 95470a9221 | |||
| fe0d6115dd | |||
| 7281649214 | |||
| 7cc71486c9 | |||
| 0913610bcd | |||
| e65cd5336c | |||
| afe1f8fbec | |||
| ed7961ff57 | |||
| aae22a2168 | |||
| ba2aac9d2e | |||
| 4eb4a2f3be | |||
| 6bf37cc8c0 | |||
| 083672b18c | |||
| ffbf1e61ff | |||
| e13e173f26 | |||
| a7c0c36cf5 | |||
| bcaeb97caa | |||
| 09cc278869 | |||
| c780bc5573 | |||
| 7ef11adeca | |||
| 888f758194 | |||
| 48cc38928a | |||
| 971a6b5d79 | |||
| 588a6c8af7 | |||
| 6f08381068 | |||
| 5107832098 | |||
| c68935d876 | |||
| 414e798b71 | |||
| 86c184ff34 | |||
| e5dfea4c04 | |||
| 5a00cf374d | |||
| bf4873cbf3 | |||
| f120cf3a5d | |||
| 4b5a6914fb | |||
| 644dca1806 | |||
| e4b275a3eb | |||
| cc44874447 | |||
| 0057f146f6 | |||
| aa09736e02 | |||
| 622207eff5 | |||
| d728c2935e | |||
| 588c22056a | |||
| 0210d14387 | |||
| 690b923151 | |||
| ef3aba66ff | |||
| d7cd12f009 | |||
| bfc73dc326 | |||
| c715f67b55 | |||
| 127c90dae1 | |||
| 96fee30386 | |||
| f294fe22fd | |||
| 1de4cd2b2e | |||
| c51c178726 | |||
| 7ca2817eee | |||
| 5ab3e072f7 | |||
| 9f409435a4 | |||
| 311bd0d91e |
@@ -1,3 +1,5 @@
|
||||
.git* export-ignore
|
||||
.mailmap export-ignore
|
||||
tools export-ignore
|
||||
examples/testfile.pcl -text
|
||||
exampels/testfile.txt -text
|
||||
scripts export-ignore
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
*.a
|
||||
*.bck
|
||||
*.cgi
|
||||
*.gz
|
||||
*.o
|
||||
*.tokens
|
||||
.buildrev
|
||||
autom4te.cache
|
||||
config.h
|
||||
config.log
|
||||
@@ -28,7 +25,6 @@ berkeley/lpc
|
||||
berkeley/lpq
|
||||
berkeley/lpr
|
||||
berkeley/lprm
|
||||
cgi-bin/makedocset
|
||||
cgi-bin/testcgi
|
||||
cgi-bin/testhi
|
||||
cgi-bin/testhi.index
|
||||
@@ -69,6 +65,7 @@ cups/testppd
|
||||
cups/testpwg
|
||||
cups/testraster
|
||||
cups/testsnmp
|
||||
cups/testthreads
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
@@ -83,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
|
||||
@@ -99,8 +88,6 @@ notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
org.cups.docset*
|
||||
patches
|
||||
ppdc/genstrings
|
||||
ppdc/ppd/
|
||||
ppdc/ppd2/
|
||||
@@ -133,7 +120,6 @@ scheduler/testlpd
|
||||
scheduler/testmime
|
||||
scheduler/testspeed
|
||||
scheduler/testsub
|
||||
systemv/accept
|
||||
systemv/cancel
|
||||
systemv/cupsaccept
|
||||
systemv/cupsaddsmb
|
||||
@@ -149,18 +135,18 @@ 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
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
queries:
|
||||
- exclude: cpp/integer-multiplication-cast-to-long
|
||||
- exclude: cpp/missing-header-guard
|
||||
- exclude: cpp/short-global-name
|
||||
@@ -1,25 +0,0 @@
|
||||
#
|
||||
# Travis CI configuration file for CUPS.
|
||||
#
|
||||
# Copyright © 2018 by Apple Inc.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
language: c
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# Linux-specific build stuff
|
||||
- dist: trusty
|
||||
sudo: required
|
||||
before_install:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install -y libavahi-client-dev libgnutls28-dev libkrb5-dev libnss-mdns libpam-dev libsystemd-dev libusb-1.0-0-dev zlib1g-dev
|
||||
|
||||
# macOS-specific build stuff
|
||||
- os: osx
|
||||
osx_image: xcode10
|
||||
|
||||
script: ./configure && make check
|
||||
@@ -1,6 +1,178 @@
|
||||
CHANGES - 2.3b6 - 2018-12-14
|
||||
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
|
||||
----------------------
|
||||
|
||||
@@ -15,7 +187,7 @@ Changes in CUPS v2.3b6
|
||||
- Localization update (Issue #5339, Issue #5348, Issue #5362, Issue #5408,
|
||||
Issue #5410)
|
||||
- Documentation updates (Issue #5369, Issue #5402, Issue #5403, Issue #5404)
|
||||
- CVE-2018-4700: Linux session cookies used a predictable random number seed.
|
||||
- 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)
|
||||
|
||||
@@ -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,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
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
INSTALL - CUPS v2.3b7 - 2018-12-14
|
||||
INSTALL - CUPS v2.3.3 - 2020-04-24
|
||||
==================================
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Common makefile 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
|
||||
@@ -26,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@
|
||||
@@ -96,8 +96,9 @@ LIBCUPSIMAGE = @LIBCUPSIMAGE@
|
||||
LIBCUPSOBJS = @LIBCUPSOBJS@
|
||||
LIBCUPSSTATIC = @LIBCUPSSTATIC@
|
||||
LIBGSSAPI = @LIBGSSAPI@
|
||||
LIBHEADERS = @LIBHEADERS@
|
||||
LIBHEADERSPRIV = @LIBHEADERSPRIV@
|
||||
LIBMALLOC = @LIBMALLOC@
|
||||
LIBMXML = @LIBMXML@
|
||||
LIBPAPER = @LIBPAPER@
|
||||
LIBUSB = @LIBUSB@
|
||||
LIBWRAP = @LIBWRAP@
|
||||
@@ -115,6 +116,14 @@ INSTALLSTATIC = @INSTALLSTATIC@
|
||||
|
||||
IPPALIASES = @IPPALIASES@
|
||||
|
||||
|
||||
#
|
||||
# ippeveprinter commands...
|
||||
#
|
||||
|
||||
IPPEVECOMMANDS = @IPPEVECOMMANDS@
|
||||
|
||||
|
||||
#
|
||||
# Install XPC backends?
|
||||
#
|
||||
@@ -144,6 +153,9 @@ ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) \
|
||||
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@
|
||||
@@ -155,17 +167,14 @@ CXXLIBS = @CXXLIBS@
|
||||
DBUS_NOTIFIER = @DBUS_NOTIFIER@
|
||||
DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@
|
||||
DNSSD_BACKEND = @DNSSD_BACKEND@
|
||||
DSOFLAGS = -L../cups @ARCHFLAGS@ @LDFLAGS@ @RELROFLAGS@ \
|
||||
@DSOFLAGS@ $(OPTIM)
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
DSOFLAGS = @DSOFLAGS@
|
||||
DNSSDLIBS = @DNSSDLIBS@
|
||||
IPPFIND_BIN = @IPPFIND_BIN@
|
||||
IPPFIND_MAN = @IPPFIND_MAN@
|
||||
LDFLAGS = -L../cups @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@
|
||||
@@ -211,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@
|
||||
@@ -226,7 +234,6 @@ LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
|
||||
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
|
||||
MANDIR = $(BUILDROOT)@mandir@
|
||||
MENUDIR = @MENUDIR@
|
||||
PMANDIR = $(BUILDROOT)@PMANDIR@
|
||||
PRIVATEINCLUDE = $(BUILDROOT)@PRIVATEINCLUDE@
|
||||
RCLEVELS = @RCLEVELS@
|
||||
RCSTART = @RCSTART@
|
||||
@@ -238,12 +245,6 @@ 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@
|
||||
|
||||
@@ -263,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 $<...
|
||||
@@ -272,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 <$< >$@
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Top-level Makefile 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
|
||||
@@ -18,6 +18,13 @@ include Makedefs
|
||||
DIRS = cups $(BUILDDIRS)
|
||||
|
||||
|
||||
#
|
||||
# Test suite options - normally blank, override with make command...
|
||||
#
|
||||
|
||||
TESTOPTIONS =
|
||||
|
||||
|
||||
#
|
||||
# Make all targets...
|
||||
#
|
||||
@@ -95,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
|
||||
|
||||
|
||||
#
|
||||
@@ -118,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:
|
||||
#
|
||||
@@ -246,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
|
||||
@@ -259,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:
|
||||
@@ -269,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...
|
||||
#
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
README - CUPS v2.3b7 - 2018-12-14
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Backend makefile 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 information.
|
||||
@@ -201,8 +201,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -212,8 +211,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -223,9 +221,8 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -246,7 +243,7 @@ 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; \
|
||||
@@ -260,7 +257,7 @@ 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)
|
||||
$(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 \
|
||||
@@ -274,7 +271,7 @@ ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o lpd lpd.o libbackend.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -284,7 +281,7 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o snmp snmp.o libbackend.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -294,14 +291,13 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -311,8 +307,8 @@ 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
|
||||
|
||||
|
||||
@@ -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 */
|
||||
@@ -1454,6 +1449,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
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];
|
||||
@@ -1508,7 +1505,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
const char *sides = cupsGetOption("sides", num_options, options);
|
||||
|
||||
if (!strncmp(sides, "two-sided-", 10))
|
||||
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);
|
||||
@@ -1871,21 +1868,29 @@ main(int argc, /* I - Number of command-line args */
|
||||
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_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)
|
||||
@@ -1902,7 +1907,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
copies_remaining --;
|
||||
}
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || 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"))
|
||||
{
|
||||
@@ -2003,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...
|
||||
@@ -2118,11 +2123,10 @@ 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;
|
||||
@@ -2236,8 +2240,9 @@ 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_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_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 ||
|
||||
@@ -2579,8 +2584,7 @@ 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_JSTATE_CANCELED ||
|
||||
@@ -2661,8 +2665,7 @@ 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_JSTATE_CANCELED ||
|
||||
|
||||
@@ -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
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -291,5 +294,11 @@
|
||||
# Star TSP743 (Issue #5443)
|
||||
0x0519 0x0001 delay-close
|
||||
|
||||
# Zebra ZD420 (Issue #5395)
|
||||
0x0a5f 0x0120 unidir no-reattach
|
||||
# Lexmark E120n (Issue #5478)
|
||||
0x043d 0x00cc no-reattach
|
||||
|
||||
# All Xerox printers (Issue #5523)
|
||||
0x0924 no-reattach
|
||||
|
||||
# Dymo 450 Turbo (Issue #5521)
|
||||
0x0922 0x0021 unidir
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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, <))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Berkeley commands makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2018 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,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ 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)" $@
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "lpr" command 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
|
||||
@@ -445,9 +445,9 @@ usage(void)
|
||||
" 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, _("-P destination Specify the destination"));
|
||||
_cupsLangPuts(stdout, _("-T title Specify the job title"));
|
||||
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# CGI makefile for CUPS.
|
||||
#
|
||||
# Copyright © 2007-2018 by Apple Inc.
|
||||
# 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
|
||||
@@ -158,7 +158,7 @@ libcupscgi.a: $(LIBOBJS)
|
||||
|
||||
admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ admin.o libcupscgi.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ admin.o libcupscgi.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
|
||||
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ classes.o libcupscgi.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ classes.o libcupscgi.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
|
||||
help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ help.o libcupscgi.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ help.o libcupscgi.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
|
||||
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ jobs.o libcupscgi.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ jobs.o libcupscgi.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
|
||||
printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ printers.o libcupscgi.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ printers.o libcupscgi.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -208,9 +208,8 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
|
||||
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
|
||||
@@ -222,9 +221,8 @@ 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
|
||||
@@ -236,8 +234,7 @@ 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)" $@
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Administration CGI 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
|
||||
@@ -41,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);
|
||||
@@ -164,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
|
||||
{
|
||||
/*
|
||||
@@ -562,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));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1938,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.
|
||||
*/
|
||||
@@ -2123,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));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2261,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);
|
||||
}
|
||||
@@ -2287,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -2384,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...
|
||||
*/
|
||||
@@ -2658,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...
|
||||
@@ -3120,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))
|
||||
{
|
||||
@@ -3467,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,
|
||||
@@ -3719,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 :
|
||||
@@ -3797,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 :
|
||||
@@ -3930,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"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@@ -3970,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))
|
||||
|
||||
@@ -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_
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -340,6 +341,8 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
}
|
||||
else
|
||||
section[0] = '\0';
|
||||
|
||||
if (*ptr != '\"')
|
||||
break;
|
||||
@@ -1188,7 +1191,7 @@ help_new_node(const char *filename, /* I - Filename */
|
||||
|
||||
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;
|
||||
|
||||
@@ -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,7 +231,7 @@ cgiGetVariable(const char *name) /* I - Name of variable */
|
||||
|
||||
var = cgi_find_variable(name);
|
||||
|
||||
return ((var == NULL) ? NULL : _cupsStrRetain(var->values[var->nvalues - 1]));
|
||||
return ((var == NULL) ? NULL : strdup(var->values[var->nvalues - 1]));
|
||||
}
|
||||
|
||||
|
||||
@@ -312,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);
|
||||
@@ -370,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;
|
||||
|
||||
@@ -389,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,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;
|
||||
|
||||
@@ -468,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;
|
||||
@@ -503,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;
|
||||
}
|
||||
}
|
||||
@@ -548,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 ++;
|
||||
}
|
||||
@@ -583,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));
|
||||
@@ -870,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
|
||||
@@ -968,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);
|
||||
@@ -1030,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1132,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);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Common configuration stuff 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
|
||||
@@ -39,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)
|
||||
@@ -48,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
|
||||
@@ -55,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
|
||||
@@ -140,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))
|
||||
@@ -263,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)
|
||||
|
||||
@@ -303,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
|
||||
@@ -327,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
|
||||
@@ -349,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...
|
||||
@@ -396,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
|
||||
@@ -417,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
|
||||
|
||||
@@ -439,14 +427,27 @@ AC_ARG_WITH(components, [ --with-components set components to build:
|
||||
COMPONENTS="$withval")
|
||||
|
||||
cupsimagebase="cupsimage"
|
||||
IPPEVECOMMANDS="ippevepcl ippeveps"
|
||||
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS) \$(DRIVERHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV) \$(DRIVERHEADERSPRIV)"
|
||||
|
||||
case "$COMPONENTS" in
|
||||
all)
|
||||
BUILDDIRS="test 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="test locale"
|
||||
BUILDDIRS="tools examples locale"
|
||||
;;
|
||||
|
||||
corelite)
|
||||
AC_DEFINE(CUPS_LITE)
|
||||
BUILDDIRS="tools examples locale"
|
||||
cupsimagebase=""
|
||||
LIBCUPSOBJS="\$(COREOBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
|
||||
;;
|
||||
|
||||
libcups)
|
||||
@@ -455,9 +456,12 @@ case "$COMPONENTS" in
|
||||
;;
|
||||
|
||||
libcupslite)
|
||||
AC_DEFINE(CUPS_LITE)
|
||||
BUILDDIRS="locale"
|
||||
cupsimagebase=""
|
||||
LIBCUPSOBJS="\$(COREOBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -466,4 +470,7 @@ case "$COMPONENTS" in
|
||||
esac
|
||||
|
||||
AC_SUBST(BUILDDIRS)
|
||||
AC_SUBST(IPPEVECOMMANDS)
|
||||
AC_SUBST(LIBCUPSOBJS)
|
||||
AC_SUBST(LIBHEADERS)
|
||||
AC_SUBST(LIBHEADERSPRIV)
|
||||
|
||||
@@ -245,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
|
||||
|
||||
@@ -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"
|
||||
;;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
dnl
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2018 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
|
||||
dnl information.
|
||||
@@ -19,12 +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
|
||||
|
||||
echo host_os_version=$host_os_version
|
||||
|
||||
dnl Determine whether we are cross-compiling...
|
||||
if test "$build" = "$host"; then
|
||||
# No, build local targets
|
||||
|
||||
@@ -78,45 +78,20 @@ AC_SUBST(LIBCUPSIMAGE)
|
||||
AC_SUBST(LIBCUPSSTATIC)
|
||||
|
||||
if test x$enable_shared = xno; then
|
||||
LINKCUPS="../cups/lib$cupsbase.a"
|
||||
EXTLINKCUPS="-lcups"
|
||||
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LINKCUPSIMAGE="../cups/lib$cupsimagebase.a"
|
||||
EXTLINKCUPSIMAGE="-l$cupsimagebase"
|
||||
else
|
||||
LINKCUPSIMAGE=""
|
||||
EXTLINKCUPSIMAGE=""
|
||||
fi
|
||||
LINKCUPS="../cups/lib$cupsbase.a \$(LIBS)"
|
||||
EXTLINKCUPS="-lcups \$LIBS"
|
||||
else
|
||||
LINKCUPS="-l${cupsbase}"
|
||||
LINKCUPS="-L../cups -l${cupsbase}"
|
||||
EXTLINKCUPS="-lcups"
|
||||
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LINKCUPSIMAGE="-l$cupsimagebase"
|
||||
EXTLINKCUPSIMAGE="-l$cupsimagebase"
|
||||
else
|
||||
LINKCUPSIMAGE=""
|
||||
EXTLINKCUPSIMAGE=""
|
||||
fi
|
||||
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...
|
||||
@@ -146,11 +121,6 @@ if test "$DSO" != ":"; then
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
DSOLIBS=""
|
||||
IMGLIBS="\$(LIBZ)"
|
||||
fi
|
||||
|
||||
AC_SUBST(DSOLIBS)
|
||||
AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for CUPS 2.3b7.
|
||||
# Generated by GNU Autoconf 2.69 for CUPS 2.3.3.
|
||||
#
|
||||
# Report bugs to <https://github.com/apple/cups/issues>.
|
||||
#
|
||||
@@ -580,8 +580,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='CUPS'
|
||||
PACKAGE_TARNAME='cups'
|
||||
PACKAGE_VERSION='2.3b7'
|
||||
PACKAGE_STRING='CUPS 2.3b7'
|
||||
PACKAGE_VERSION='2.3.3'
|
||||
PACKAGE_STRING='CUPS 2.3.3'
|
||||
PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
|
||||
PACKAGE_URL='https://www.cups.org/'
|
||||
|
||||
@@ -702,11 +702,7 @@ LIBTOOL
|
||||
LD_CXX
|
||||
LD_CC
|
||||
EXPORT_LDFLAGS
|
||||
IMGLIBS
|
||||
DSOLIBS
|
||||
LINKCUPSIMAGE
|
||||
LINKCUPS
|
||||
EXTLINKCUPSIMAGE
|
||||
EXTLINKCUPS
|
||||
LIBCUPSSTATIC
|
||||
LIBCUPSIMAGE
|
||||
@@ -715,13 +711,6 @@ LIBCUPS
|
||||
DSOFLAGS
|
||||
DSOXX
|
||||
DSO
|
||||
MAN8DIR
|
||||
MAN8EXT
|
||||
MAN7EXT
|
||||
MAN5EXT
|
||||
MAN1EXT
|
||||
PMANDIR
|
||||
AMANDIR
|
||||
CUPS_STATEDIR
|
||||
CUPS_SERVERROOT
|
||||
INSTALL_SYSV
|
||||
@@ -737,7 +726,10 @@ CUPS_DATADIR
|
||||
CUPS_CACHEDIR
|
||||
PRIVATEINCLUDE
|
||||
privateinclude
|
||||
LIBHEADERSPRIV
|
||||
LIBHEADERS
|
||||
LIBCUPSOBJS
|
||||
IPPEVECOMMANDS
|
||||
BUILDDIRS
|
||||
INSTALLXPC
|
||||
CUPS_SYSTEM_AUTHKEY
|
||||
@@ -753,14 +745,12 @@ INSTALL_GZIP
|
||||
LIBWRAP
|
||||
USBQUIRKS
|
||||
LIBUSB
|
||||
LIBMXML
|
||||
EGREP
|
||||
GREP
|
||||
LIBPAPER
|
||||
LIBMALLOC
|
||||
PKGCONFIG
|
||||
INSTALLSTATIC
|
||||
INSTALL
|
||||
CUPS_HTMLVIEW
|
||||
XDGOPEN
|
||||
SED
|
||||
@@ -770,7 +760,8 @@ MV
|
||||
MKDIR
|
||||
LN
|
||||
LD
|
||||
GZIP
|
||||
INSTALL
|
||||
GZIPPROG
|
||||
CHMOD
|
||||
AR
|
||||
RANLIB
|
||||
@@ -1476,7 +1467,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures CUPS 2.3b7 to adapt to many kinds of systems.
|
||||
\`configure' configures CUPS 2.3.3 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1541,7 +1532,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of CUPS 2.3b7:";;
|
||||
short | recursive ) echo "Configuration of CUPS 2.3.3:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1722,7 +1713,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
CUPS configure 2.3b7
|
||||
CUPS configure 2.3.3
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2186,7 +2177,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by CUPS $as_me 2.3b7, which was
|
||||
It was created by CUPS $as_me 2.3.3, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2644,12 +2635,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
|
||||
as_fn_error $? "Sorry, this version of CUPS requires macOS 10.8 or higher." "$LINENO" 5
|
||||
fi
|
||||
|
||||
echo host_os_version=$host_os_version
|
||||
|
||||
if test "$build" = "$host"; then
|
||||
# No, build local targets
|
||||
LOCALTARGET="local"
|
||||
@@ -2709,7 +2694,7 @@ done
|
||||
ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
CUPS_VERSION="2.3b7"
|
||||
CUPS_VERSION="2.3.3"
|
||||
CUPS_REVISION=""
|
||||
CUPS_BUILD="cups-$CUPS_VERSION"
|
||||
|
||||
@@ -3946,12 +3931,12 @@ fi
|
||||
set dummy gzip; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_GZIP+:} false; then :
|
||||
if ${ac_cv_path_GZIPPROG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $GZIP in
|
||||
case $GZIPPROG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path.
|
||||
ac_cv_path_GZIPPROG="$GZIPPROG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
@@ -3961,7 +3946,7 @@ do
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext"
|
||||
ac_cv_path_GZIPPROG="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
@@ -3972,16 +3957,22 @@ IFS=$as_save_IFS
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
GZIP=$ac_cv_path_GZIP
|
||||
if test -n "$GZIP"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIP" >&5
|
||||
$as_echo "$GZIP" >&6; }
|
||||
GZIPPROG=$ac_cv_path_GZIPPROG
|
||||
if test -n "$GZIPPROG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GZIPPROG" >&5
|
||||
$as_echo "$GZIPPROG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install-sh script" >&5
|
||||
$as_echo_n "checking for install-sh script... " >&6; }
|
||||
INSTALL="`pwd`/install-sh"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $INSTALL" >&5
|
||||
$as_echo "using $INSTALL" >&6; }
|
||||
# Extract the first word of "ld", so it can be a program name with args.
|
||||
set dummy ld; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
@@ -4302,6 +4293,7 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test "x$XDGOPEN" = x; then
|
||||
CUPS_HTMLVIEW="htmlview"
|
||||
else
|
||||
@@ -4309,13 +4301,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for install-sh script" >&5
|
||||
$as_echo_n "checking for install-sh script... " >&6; }
|
||||
INSTALL="`pwd`/install-sh"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $INSTALL" >&5
|
||||
$as_echo "using $INSTALL" >&6; }
|
||||
|
||||
if test "x$AR" = x; then
|
||||
as_fn_error $? "Unable to find required library archive command." "$LINENO" 5
|
||||
fi
|
||||
@@ -5262,74 +5247,6 @@ fi
|
||||
|
||||
|
||||
|
||||
LIBMXML=""
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "mxml.h" "ac_cv_header_mxml_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_mxml_h" = xyes; then :
|
||||
SAVELIBS="$LIBS"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mmxlNewElement" >&5
|
||||
$as_echo_n "checking for library containing mmxlNewElement... " >&6; }
|
||||
if ${ac_cv_search_mmxlNewElement+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char mmxlNewElement ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return mmxlNewElement ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
for ac_lib in '' mxml; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
ac_res=-l$ac_lib
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
fi
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_search_mmxlNewElement=$ac_res
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext
|
||||
if ${ac_cv_search_mmxlNewElement+:} false; then :
|
||||
break
|
||||
fi
|
||||
done
|
||||
if ${ac_cv_search_mmxlNewElement+:} false; then :
|
||||
|
||||
else
|
||||
ac_cv_search_mmxlNewElement=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mmxlNewElement" >&5
|
||||
$as_echo "$ac_cv_search_mmxlNewElement" >&6; }
|
||||
ac_res=$ac_cv_search_mmxlNewElement
|
||||
if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
$as_echo "#define HAVE_MXML_H 1" >>confdefs.h
|
||||
|
||||
LIBMXML="-lmxml"
|
||||
fi
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_mount_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SYS_MOUNT_H 1" >>confdefs.h
|
||||
@@ -5716,7 +5633,8 @@ fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzgets" >&5
|
||||
$as_echo "$ac_cv_lib_z_gzgets" >&6; }
|
||||
if test "x$ac_cv_lib_z_gzgets" = xyes; then :
|
||||
$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
|
||||
|
||||
$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
|
||||
|
||||
LIBZ="-lz"
|
||||
LIBS="$LIBS -lz"
|
||||
@@ -5761,7 +5679,7 @@ if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
|
||||
|
||||
fi
|
||||
|
||||
if test "x$GZIP" != z; then
|
||||
if test "x$GZIPPROG" != x; then
|
||||
INSTALL_GZIP="-z"
|
||||
fi
|
||||
fi
|
||||
@@ -5857,6 +5775,10 @@ fi
|
||||
fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
# Check whether --enable-dbus was given.
|
||||
if test "${enable_dbus+set}" = set; then :
|
||||
enableval=$enable_dbus;
|
||||
@@ -5869,10 +5791,6 @@ if test "${with_dbusdir+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5
|
||||
$as_echo_n "checking for DBUS... " >&6; }
|
||||
@@ -5900,7 +5818,7 @@ if test "x$ac_cv_func_dbus_threads_init" = xyes; then :
|
||||
fi
|
||||
|
||||
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
|
||||
@@ -5922,7 +5840,7 @@ 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"
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "ApplicationServices/ApplicationServices.h" "ac_cv_header_ApplicationServices_ApplicationServices_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_ApplicationServices_ApplicationServices_h" = xyes; then :
|
||||
@@ -5938,22 +5856,10 @@ if test "x$ac_cv_header_CoreFoundation_CoreFoundation_h" = xyes; then :
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "CoreFoundation/CFPriv.h" "ac_cv_header_CoreFoundation_CFPriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_CoreFoundation_CFPriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_CFPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "CoreFoundation/CFBundlePriv.h" "ac_cv_header_CoreFoundation_CFBundlePriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_CoreFoundation_CFBundlePriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_CFBUNDLEPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
for ac_func in SCDynamicStoreCopyComputerName
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="-framework SystemConfiguration $LIBS"
|
||||
for ac_func in SCDynamicStoreCopyComputerName
|
||||
do :
|
||||
ac_fn_c_check_func "$LINENO" "SCDynamicStoreCopyComputerName" "ac_cv_func_SCDynamicStoreCopyComputerName"
|
||||
if test "x$ac_cv_func_SCDynamicStoreCopyComputerName" = xyes; then :
|
||||
@@ -5961,6 +5867,11 @@ if test "x$ac_cv_func_SCDynamicStoreCopyComputerName" = xyes; then :
|
||||
#define HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME 1
|
||||
_ACEOF
|
||||
|
||||
$as_echo "#define HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME 1" >>confdefs.h
|
||||
|
||||
else
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -5972,13 +5883,6 @@ if test "x$ac_cv_header_membership_h" = xyes; then :
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "membershipPriv.h" "ac_cv_header_membershipPriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_membershipPriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_MEMBERSHIPPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
for ac_func in mbr_uid_to_uuid
|
||||
do :
|
||||
ac_fn_c_check_func "$LINENO" "mbr_uid_to_uuid" "ac_cv_func_mbr_uid_to_uuid"
|
||||
@@ -6057,13 +5961,6 @@ if test "x$ac_cv_header_Security_Authorization_h" = xyes; then :
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecBasePriv.h" "ac_cv_header_Security_SecBasePriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_Security_SecBasePriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECBASEPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $host_os_version -ge 100; then
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "sandbox.h" "ac_cv_header_sandbox_h" "$ac_includes_default"
|
||||
@@ -6096,13 +5993,6 @@ if test "x$ac_cv_header_xpc_xpc_h" = xyes; then :
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "xpc/private.h" "ac_cv_header_xpc_private_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_xpc_private_h" = xyes; then :
|
||||
$as_echo "#define HAVE_XPC_PRIVATE_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -6128,14 +6018,28 @@ fi
|
||||
|
||||
|
||||
cupsimagebase="cupsimage"
|
||||
IPPEVECOMMANDS="ippevepcl ippeveps"
|
||||
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS) \$(DRIVERHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV) \$(DRIVERHEADERSPRIV)"
|
||||
|
||||
case "$COMPONENTS" in
|
||||
all)
|
||||
BUILDDIRS="test 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="test locale"
|
||||
BUILDDIRS="tools examples locale"
|
||||
;;
|
||||
|
||||
corelite)
|
||||
$as_echo "#define CUPS_LITE 1" >>confdefs.h
|
||||
|
||||
BUILDDIRS="tools examples locale"
|
||||
cupsimagebase=""
|
||||
LIBCUPSOBJS="\$(COREOBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
|
||||
;;
|
||||
|
||||
libcups)
|
||||
@@ -6144,9 +6048,13 @@ case "$COMPONENTS" in
|
||||
;;
|
||||
|
||||
libcupslite)
|
||||
$as_echo "#define CUPS_LITE 1" >>confdefs.h
|
||||
|
||||
BUILDDIRS="locale"
|
||||
cupsimagebase=""
|
||||
LIBCUPSOBJS="\$(COREOBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -6160,6 +6068,9 @@ esac
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if test "$prefix" = "NONE"; then
|
||||
prefix="/"
|
||||
fi
|
||||
@@ -6565,59 +6476,16 @@ 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
|
||||
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PICFLAG=1
|
||||
DSOFLAGS="${DSOFLAGS:=}"
|
||||
|
||||
@@ -6692,44 +6560,19 @@ fi
|
||||
|
||||
|
||||
if test x$enable_shared = xno; then
|
||||
LINKCUPS="../cups/lib$cupsbase.a"
|
||||
EXTLINKCUPS="-lcups"
|
||||
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LINKCUPSIMAGE="../cups/lib$cupsimagebase.a"
|
||||
EXTLINKCUPSIMAGE="-l$cupsimagebase"
|
||||
else
|
||||
LINKCUPSIMAGE=""
|
||||
EXTLINKCUPSIMAGE=""
|
||||
fi
|
||||
LINKCUPS="../cups/lib$cupsbase.a \$(LIBS)"
|
||||
EXTLINKCUPS="-lcups \$LIBS"
|
||||
else
|
||||
LINKCUPS="-l${cupsbase}"
|
||||
LINKCUPS="-L../cups -l${cupsbase}"
|
||||
EXTLINKCUPS="-lcups"
|
||||
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LINKCUPSIMAGE="-l$cupsimagebase"
|
||||
EXTLINKCUPSIMAGE="-l$cupsimagebase"
|
||||
else
|
||||
LINKCUPSIMAGE=""
|
||||
EXTLINKCUPSIMAGE=""
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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...
|
||||
@@ -6759,16 +6602,11 @@ if test "$DSO" != ":"; then
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
DSOLIBS=""
|
||||
IMGLIBS="\$(LIBZ)"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Check whether --enable-libtool_unsupported was given.
|
||||
if test "${enable_libtool_unsupported+set}" = set; then :
|
||||
enableval=$enable_libtool_unsupported; if test x$enable_libtool_unsupported != xno; then
|
||||
@@ -7073,8 +6911,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
# 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"
|
||||
7.* | 8.* | 9.*)
|
||||
WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-format-overflow -Wno-tautological-compare"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -8319,14 +8157,7 @@ if test "x$ac_cv_header_Security_SecureTransport_h" = xyes; then :
|
||||
|
||||
CUPS_SERVERKEYCHAIN="/Library/Keychains/System.keychain"
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecureTransportPriv.h" "ac_cv_header_Security_SecureTransportPriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_Security_SecureTransportPriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECURETRANSPORTPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecCertificate.h" "ac_cv_header_Security_SecCertificate_h" "$ac_includes_default"
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecCertificate.h" "ac_cv_header_Security_SecCertificate_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_Security_SecCertificate_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECCERTIFICATE_H 1" >>confdefs.h
|
||||
|
||||
@@ -8340,14 +8171,6 @@ if test "x$ac_cv_header_Security_SecItem_h" = xyes; then :
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_compile "$LINENO" "Security/SecItemPriv.h" "ac_cv_header_Security_SecItemPriv_h" "#include <Security/SecItem.h>
|
||||
"
|
||||
if test "x$ac_cv_header_Security_SecItemPriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECITEMPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecPolicy.h" "ac_cv_header_Security_SecPolicy_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_Security_SecPolicy_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECPOLICY_H 1" >>confdefs.h
|
||||
@@ -8355,40 +8178,9 @@ if test "x$ac_cv_header_Security_SecPolicy_h" = xyes; then :
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecPolicyPriv.h" "ac_cv_header_Security_SecPolicyPriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_Security_SecPolicyPriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECPOLICYPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecBasePriv.h" "ac_cv_header_Security_SecBasePriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_Security_SecBasePriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECBASEPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "Security/SecIdentitySearchPriv.h" "ac_cv_header_Security_SecIdentitySearchPriv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_Security_SecIdentitySearchPriv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SECIDENTITYSEARCHPRIV_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
$as_echo "#define HAVE_CSSMERRORSTRING 1" >>confdefs.h
|
||||
|
||||
$as_echo "#define HAVE_SECKEYCHAINOPEN 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $host_os_version -ge 150; then
|
||||
$as_echo "#define HAVE_SSLSETENABLEDCIPHERS 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -9128,7 +8920,7 @@ $as_echo "yes" >&6; }
|
||||
DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
IPPFIND_MAN="ippfind.1"
|
||||
$as_echo "#define HAVE_AVAHI 1" >>confdefs.h
|
||||
|
||||
else
|
||||
@@ -9146,10 +8938,9 @@ if test "x$ac_cv_header_dns_sd_h" = xyes; then :
|
||||
# Darwin and macOS...
|
||||
$as_echo "#define HAVE_DNSSD 1" >>confdefs.h
|
||||
|
||||
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
IPPFIND_MAN="ippfind.1"
|
||||
;;
|
||||
*)
|
||||
# All others...
|
||||
@@ -9181,7 +8972,7 @@ $as_echo "yes" >&6; }
|
||||
DNSSD_BACKEND="dnssd"
|
||||
else
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
IPPFIND_MAN="ippfind.1"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
@@ -9802,7 +9593,7 @@ else
|
||||
$as_echo_n "checking for default system groups... " >&6; }
|
||||
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
|
||||
@@ -10086,7 +9877,7 @@ fi
|
||||
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files Makedefs conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf cups-config desktop/cups.desktop doc/index.html man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
|
||||
ac_config_files="$ac_config_files Makedefs conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf cups-config desktop/cups.desktop doc/index.html scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
@@ -10594,7 +10385,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by CUPS $as_me 2.3b7, which was
|
||||
This file was extended by CUPS $as_me 2.3.3, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -10657,7 +10448,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
CUPS config.status 2.3b7
|
||||
CUPS config.status 2.3.3
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
@@ -10789,13 +10580,6 @@ do
|
||||
"cups-config") CONFIG_FILES="$CONFIG_FILES cups-config" ;;
|
||||
"desktop/cups.desktop") CONFIG_FILES="$CONFIG_FILES desktop/cups.desktop" ;;
|
||||
"doc/index.html") CONFIG_FILES="$CONFIG_FILES doc/index.html" ;;
|
||||
"man/client.conf.man") CONFIG_FILES="$CONFIG_FILES man/client.conf.man" ;;
|
||||
"man/cups-files.conf.man") CONFIG_FILES="$CONFIG_FILES man/cups-files.conf.man" ;;
|
||||
"man/cups-lpd.man") CONFIG_FILES="$CONFIG_FILES man/cups-lpd.man" ;;
|
||||
"man/cups-snmp.man") CONFIG_FILES="$CONFIG_FILES man/cups-snmp.man" ;;
|
||||
"man/cupsd.conf.man") CONFIG_FILES="$CONFIG_FILES man/cupsd.conf.man" ;;
|
||||
"man/cupsd.man") CONFIG_FILES="$CONFIG_FILES man/cupsd.man" ;;
|
||||
"man/lpoptions.man") CONFIG_FILES="$CONFIG_FILES man/lpoptions.man" ;;
|
||||
"scheduler/cups-lpd.xinetd") CONFIG_FILES="$CONFIG_FILES scheduler/cups-lpd.xinetd" ;;
|
||||
"scheduler/cups.sh") CONFIG_FILES="$CONFIG_FILES scheduler/cups.sh" ;;
|
||||
"scheduler/cups.xml") CONFIG_FILES="$CONFIG_FILES scheduler/cups.xml" ;;
|
||||
|
||||
@@ -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.3b7], [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,13 +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/cupsd.conf.man
|
||||
man/cupsd.man
|
||||
man/lpoptions.man
|
||||
scheduler/cups-lpd.xinetd
|
||||
scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -188,7 +188,7 @@ tls.o: tls.c cups-private.h string-private.h ../config.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
|
||||
debug-internal.h debug-private.h tls-darwin.c tls-darwin.h
|
||||
transcode.o: transcode.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 \
|
||||
@@ -214,7 +214,7 @@ adminutil.o: adminutil.c cups-private.h string-private.h ../config.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
|
||||
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 \
|
||||
@@ -401,6 +401,9 @@ testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.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 \
|
||||
../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 \
|
||||
|
||||
@@ -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.
|
||||
@@ -106,6 +106,7 @@ TESTOBJS = \
|
||||
testpwg.o \
|
||||
testraster.o \
|
||||
testsnmp.o \
|
||||
testthreads.o \
|
||||
tlscheck.o
|
||||
OBJS = \
|
||||
$(LIBOBJS) \
|
||||
@@ -117,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 \
|
||||
@@ -142,13 +148,18 @@ HEADERSPRIV = \
|
||||
http-private.h \
|
||||
ipp-private.h \
|
||||
language-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...
|
||||
@@ -181,6 +192,7 @@ UNITTARGETS = \
|
||||
testpwg \
|
||||
testraster \
|
||||
testsnmp \
|
||||
testthreads \
|
||||
tlscheck
|
||||
|
||||
TARGETS = \
|
||||
@@ -355,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`
|
||||
|
||||
@@ -367,12 +378,11 @@ libcups.so.2: $(LIBOBJS)
|
||||
|
||||
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 \
|
||||
$(LIBOBJS) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LIBOBJS) $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) libcups.dylib
|
||||
$(LN) $@ libcups.dylib
|
||||
@@ -384,9 +394,8 @@ libcups.2.dylib: $(LIBOBJS)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
#
|
||||
@@ -410,7 +419,8 @@ 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|SNMP' \
|
||||
-e 'Block$$' | \
|
||||
@@ -423,7 +433,7 @@ libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
|
||||
|
||||
libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) $(LINKCUPS)
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS) $(LINKCUPS)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
@@ -434,11 +444,11 @@ 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) $(LINKCUPS)
|
||||
$(IMAGEOBJS) $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) libcupsimage.dylib
|
||||
$(LN) $@ libcupsimage.dylib
|
||||
@@ -450,7 +460,7 @@ libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
|
||||
|
||||
libcupsimage.la: $(IMAGEOBJS) libcups.la
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) \
|
||||
$(LINKCUPS) -rpath $(LIBDIR) -version-info 2:3
|
||||
|
||||
|
||||
@@ -471,8 +481,7 @@ libcupsimage.a: $(IMAGEOBJS)
|
||||
|
||||
rasterbench: rasterbench.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rasterbench.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ rasterbench.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -482,8 +491,7 @@ rasterbench: rasterbench.o $(LIBCUPSSTATIC)
|
||||
|
||||
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)" $@
|
||||
|
||||
|
||||
@@ -493,8 +501,7 @@ 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
|
||||
@@ -506,8 +513,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -517,8 +523,7 @@ testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
|
||||
testclient: testclient.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testclient.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testclient.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
@@ -528,8 +533,7 @@ testclient: testclient.o $(LIBCUPSSTATIC)
|
||||
|
||||
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)" $@
|
||||
|
||||
|
||||
@@ -539,8 +543,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -550,8 +553,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -561,8 +563,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -572,8 +573,7 @@ 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
|
||||
@@ -585,8 +585,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -596,8 +595,7 @@ 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
|
||||
@@ -609,8 +607,7 @@ 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
|
||||
@@ -622,8 +619,7 @@ 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
|
||||
@@ -635,16 +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; \
|
||||
@@ -660,8 +650,7 @@ 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
|
||||
@@ -673,8 +662,7 @@ 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
|
||||
@@ -686,8 +674,7 @@ 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
|
||||
@@ -699,9 +686,7 @@ testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
|
||||
|
||||
testraster: testraster.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o \
|
||||
$(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
|
||||
@@ -713,8 +698,17 @@ testraster: testraster.o $(LIBCUPSSTATIC)
|
||||
|
||||
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)" $@
|
||||
|
||||
|
||||
@@ -724,8 +718,7 @@ 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)" $@
|
||||
|
||||
|
||||
@@ -736,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
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@@ -47,6 +47,10 @@ cupsAdminCreateWindowsPPD(
|
||||
char *buffer, /* I - Filename buffer */
|
||||
int bufsize) /* I - Size of filename buffer */
|
||||
{
|
||||
(void)http;
|
||||
(void)dest;
|
||||
(void)bufsize;
|
||||
|
||||
if (buffer)
|
||||
*buffer = '\0';
|
||||
|
||||
@@ -69,6 +73,13 @@ cupsAdminExportSamba(
|
||||
const char *samba_password, /* I - Samba password */
|
||||
FILE *logfile) /* I - Log file, if any */
|
||||
{
|
||||
(void)dest;
|
||||
(void)ppd;
|
||||
(void)samba_server;
|
||||
(void)samba_user;
|
||||
(void)samba_password;
|
||||
(void)logfile;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -727,13 +738,9 @@ cupsAdminSetServerSettings(
|
||||
{
|
||||
if (!wrote_browsing)
|
||||
{
|
||||
int new_share_printers = (share_printers > 0 ||
|
||||
(share_printers == -1 &&
|
||||
old_share_printers > 0));
|
||||
|
||||
wrote_browsing = 1;
|
||||
|
||||
if (new_share_printers)
|
||||
if (share_printers)
|
||||
{
|
||||
const char *localp = cupsGetOption("BrowseLocalProtocols",
|
||||
num_settings, settings);
|
||||
@@ -978,7 +985,7 @@ cupsAdminSetServerSettings(
|
||||
|
||||
in_cancel_job = 0;
|
||||
}
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location) &&
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location || in_log_location) &&
|
||||
(remote_admin >= 0 || remote_any >= 0)) ||
|
||||
(in_root_location && share_printers >= 0)) &&
|
||||
(!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") ||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
PPD API introduction for CUPS.
|
||||
|
||||
Copyright © 2007-2018 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="cupspm.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, &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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Authentication functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2018 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
|
||||
@@ -26,11 +26,6 @@
|
||||
|
||||
#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)
|
||||
@@ -47,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>
|
||||
@@ -173,6 +171,8 @@ cupsDoAuthentication(
|
||||
* Check the scheme name...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("2cupsDoAuthentication: Trying scheme \"%s\"...", scheme));
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (!_cups_strcasecmp(scheme, "Negotiate"))
|
||||
{
|
||||
@@ -180,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...
|
||||
@@ -221,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);
|
||||
}
|
||||
@@ -250,6 +269,7 @@ 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;
|
||||
@@ -268,19 +288,22 @@ cupsDoAuthentication(
|
||||
cups_auth_param(schemedata, "realm", http->realm, sizeof(http->realm));
|
||||
|
||||
if (_httpSetDigestAuthString(http, nonce, method, resource))
|
||||
{
|
||||
DEBUG_puts("2cupsDoAuthentication: Using Digest.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -293,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") */
|
||||
@@ -318,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());
|
||||
@@ -366,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...
|
||||
@@ -420,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)
|
||||
@@ -465,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 */
|
||||
|
||||
@@ -951,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);
|
||||
}
|
||||
|
||||
@@ -993,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...
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include "sidechannel.h"
|
||||
#include <errno.h>
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
|
||||
@@ -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
|
||||
@@ -57,6 +57,23 @@ typedef struct _cups_raster_error_s /**** Error buffer structure ****/
|
||||
*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... */
|
||||
@@ -65,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 */
|
||||
@@ -146,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 */
|
||||
|
||||
@@ -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_
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
|
Antes Largura: | Altura: | Tamanho: 15 KiB Depois Largura: | Altura: | Tamanho: 13 KiB |
@@ -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
|
||||
|
||||
|
Antes Largura: | Altura: | Tamanho: 166 KiB Depois Largura: | Altura: | Tamanho: 144 KiB |
@@ -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.
|
||||
@@ -28,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,
|
||||
@@ -59,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 */
|
||||
@@ -179,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -270,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);
|
||||
|
||||
@@ -285,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 &&
|
||||
@@ -1618,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);
|
||||
@@ -1638,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);
|
||||
@@ -1654,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);
|
||||
@@ -2513,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;
|
||||
|
||||
@@ -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
|
||||
@@ -44,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")
|
||||
@@ -1748,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 */
|
||||
@@ -1780,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);
|
||||
|
||||
@@ -1892,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);
|
||||
}
|
||||
@@ -2032,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 */
|
||||
@@ -2068,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...
|
||||
@@ -2269,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);
|
||||
@@ -3392,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 */
|
||||
@@ -3426,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 */
|
||||
|
||||
@@ -3451,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])
|
||||
@@ -3472,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...
|
||||
*/
|
||||
@@ -3519,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)
|
||||
@@ -3789,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)
|
||||
|
||||
@@ -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
|
||||
@@ -523,7 +523,7 @@ _cupsEncodeOption(
|
||||
|
||||
quote = *sep;
|
||||
}
|
||||
else if (*sep == ',' && count > 1)
|
||||
else if (*sep == ',')
|
||||
break;
|
||||
else if (*sep == '\\' && sep[1])
|
||||
{
|
||||
@@ -673,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 */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* different line endings, gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* 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
|
||||
@@ -675,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...
|
||||
*/
|
||||
@@ -1647,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...
|
||||
*/
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -269,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())
|
||||
@@ -307,6 +313,21 @@ 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__ */
|
||||
}
|
||||
|
||||
if (!cg->home)
|
||||
{
|
||||
struct passwd *pw; /* User info */
|
||||
|
||||
if ((pw = getpwuid(getuid())) != NULL)
|
||||
cg->home = _cupsStrAlloc(pw->pw_dir);
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
@@ -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,6 +16,7 @@
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
#elif defined(HAVE_GNUTLS)
|
||||
# include <gnutls/crypto.h>
|
||||
# include "md5-internal.h"
|
||||
#else
|
||||
# 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);
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -19,7 +20,9 @@
|
||||
#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__ */
|
||||
|
||||
|
||||
|
||||
@@ -154,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;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* HTTP support routines 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
|
||||
@@ -799,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);
|
||||
}
|
||||
@@ -1321,6 +1319,7 @@ _httpSetDigestAuthString(
|
||||
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));
|
||||
@@ -1363,6 +1362,12 @@ _httpSetDigestAuthString(
|
||||
* 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"))
|
||||
|
||||
@@ -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.
|
||||
@@ -1345,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;
|
||||
@@ -1730,7 +1733,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (http->used > 0 && ((z_stream *)http->stream)->avail_in < HTTP_MAX_BUFFER)
|
||||
{
|
||||
size_t buflen = buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
|
||||
size_t buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
|
||||
/* Number of bytes to copy */
|
||||
|
||||
if (((z_stream *)http->stream)->avail_in > 0 &&
|
||||
@@ -1857,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 */
|
||||
|
||||
|
||||
@@ -1869,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
|
||||
{
|
||||
@@ -3644,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);
|
||||
|
||||
@@ -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
|
||||
@@ -303,7 +303,10 @@ _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)));
|
||||
}
|
||||
@@ -366,6 +369,20 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
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)
|
||||
@@ -445,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;
|
||||
@@ -460,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;
|
||||
@@ -535,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)))
|
||||
@@ -569,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);
|
||||
}
|
||||
@@ -644,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 :
|
||||
@@ -667,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);
|
||||
}
|
||||
|
||||
@@ -682,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@ static const char * const ipp_document_states[] =
|
||||
"punch-multiple-top", /* IPP Finishings 2.1/Canon */
|
||||
"punch-multiple-right",/* IPP Finishings 2.1/Canon */
|
||||
"punch-multiple-bottom",/* IPP Finishings 2.1/Canon */
|
||||
"fold-accordian", /* IPP Finishings 2.0 */
|
||||
"fold-accordion", /* IPP Finishings 2.0 */
|
||||
"fold-double-gate", /* IPP Finishings 2.0 */
|
||||
"fold-gate", /* IPP Finishings 2.0 */
|
||||
"fold-half", /* IPP Finishings 2.0 */
|
||||
@@ -571,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",
|
||||
@@ -1779,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 */
|
||||
@@ -1874,6 +1880,11 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"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",
|
||||
@@ -2082,7 +2093,7 @@ ippEnumString(const char *attrname, /* I - Attribute name */
|
||||
{
|
||||
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]))))
|
||||
|
||||
@@ -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
|
||||
@@ -134,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);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Internet Printing Protocol functions 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
|
||||
@@ -2956,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);
|
||||
@@ -3040,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...
|
||||
@@ -3749,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);
|
||||
|
||||
/*
|
||||
@@ -3833,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);
|
||||
|
||||
/*
|
||||
@@ -3843,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);
|
||||
}
|
||||
@@ -3920,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);
|
||||
|
||||
/*
|
||||
@@ -3946,6 +3951,8 @@ ippSetOctetString(
|
||||
* Copy the data...
|
||||
*/
|
||||
|
||||
(*attr)->value_tag = IPP_TAG_STRING;
|
||||
|
||||
if (value->unknown.data)
|
||||
{
|
||||
/*
|
||||
@@ -4037,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);
|
||||
|
||||
/*
|
||||
@@ -4047,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;
|
||||
}
|
||||
@@ -4119,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);
|
||||
|
||||
/*
|
||||
@@ -4130,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;
|
||||
@@ -4231,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 ||
|
||||
element < 0 || element > (*attr)->num_values || !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);
|
||||
|
||||
/*
|
||||
@@ -4243,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;
|
||||
|
||||
@@ -4343,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);
|
||||
|
||||
/*
|
||||
@@ -4398,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;
|
||||
@@ -4545,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));
|
||||
@@ -4555,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...
|
||||
@@ -4659,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 */
|
||||
|
||||
@@ -4681,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;
|
||||
@@ -4909,30 +4909,24 @@ 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;
|
||||
@@ -4970,30 +4964,24 @@ 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;
|
||||
|
||||
@@ -145,11 +145,11 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
|
||||
IPP_FINISHINGS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge */
|
||||
IPP_FINISHINGS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side */
|
||||
IPP_FINISHINGS_PUNCH_QUAD_BOTTOM, /* Punch 4 holes bottom edge */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT, /* Pucnh multiple holes left side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_TOP, /* Pucnh multiple holes top edge */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT, /* Pucnh multiple holes right side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM, /* Pucnh multiple holes bottom edge */
|
||||
IPP_FINISHINGS_FOLD_ACCORDIAN = 90, /* Accordian-fold the paper vertically into four sections */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT, /* Punch multiple holes left side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_TOP, /* Punch multiple holes top edge */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT, /* Punch multiple holes right side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM, /* Punch multiple holes bottom edge */
|
||||
IPP_FINISHINGS_FOLD_ACCORDION = 90, /* Accordion-fold the paper vertically into four sections */
|
||||
IPP_FINISHINGS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */
|
||||
IPP_FINISHINGS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline */
|
||||
IPP_FINISHINGS_FOLD_HALF, /* Fold the paper in half vertically */
|
||||
@@ -184,8 +184,8 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
|
||||
IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM,/* Punch 4 holes bottom edge @exclude all@ */
|
||||
|
||||
IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN = 0x4000005A,
|
||||
/* Accordian-fold the paper vertically into four sections @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_ACCORDION = 0x4000005A,
|
||||
/* Accordion-fold the paper vertically into four sections @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_HALF, /* Fold the paper in half vertically @exclude all@ */
|
||||
@@ -198,8 +198,10 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
|
||||
IPP_FINISHINGS_CUPS_FOLD_Z /* Fold the paper vertically into three sections, forming a Z @exclude all@ */
|
||||
} ipp_finishings_t;
|
||||
# ifndef _CUPS_NO_DEPRECATED
|
||||
# define IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN IPP_FINISHINGS_CUPS_FOLD_ACCORDION
|
||||
# define IPP_FINISHINGS_FOLD_ACCORDIAN IPP_FINISHINGS_FOLD_ACCORDION
|
||||
# define IPP_FINISHINGS_JOB_OFFSET IPP_FINISHINGS_JOG_OFFSET
|
||||
/* Long-time misspelling... */
|
||||
/* Long-time misspellings... */
|
||||
typedef enum ipp_finishings_e ipp_finish_t;
|
||||
# endif /* !_CUPS_NO_DEPRECATED */
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ extern "C" {
|
||||
# define _CUPS_MESSAGE_PO 0 /* Message file is in GNU .po format */
|
||||
# define _CUPS_MESSAGE_UNQUOTE 1 /* Unescape \foo in strings? */
|
||||
# define _CUPS_MESSAGE_STRINGS 2 /* Message file is in Apple .strings format */
|
||||
# define _CUPS_MESSAGE_EMPTY 4 /* Allow empty localized strings */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1017,7 +1017,7 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
|
||||
|
||||
if (m)
|
||||
{
|
||||
if (m->str && m->str[0])
|
||||
if (m->str && (m->str[0] || (flags & _CUPS_MESSAGE_EMPTY)))
|
||||
{
|
||||
cupsArrayAdd(a, m);
|
||||
}
|
||||
@@ -1114,7 +1114,7 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */
|
||||
|
||||
if (m)
|
||||
{
|
||||
if (m->str && m->str[0])
|
||||
if (m->str && (m->str[0] || (flags & _CUPS_MESSAGE_EMPTY)))
|
||||
{
|
||||
cupsArrayAdd(a, m);
|
||||
}
|
||||
|
||||
@@ -69,13 +69,16 @@ _cupsThreadCreate
|
||||
_cupsThreadDetach
|
||||
_cupsThreadWait
|
||||
_cupsUserDefault
|
||||
_cups_gettimeofday
|
||||
_cups_safe_vsnprintf
|
||||
_cups_snprintf
|
||||
_cups_strcasecmp
|
||||
_cups_strcpy
|
||||
_cups_strcpy
|
||||
_cups_strlcat
|
||||
_cups_strlcpy
|
||||
_cups_strncasecmp
|
||||
_cups_vsnprintf
|
||||
_httpAddrSetPort
|
||||
_httpCreateCredentials
|
||||
_httpDecodeURI
|
||||
@@ -278,16 +281,28 @@ cupsPrintFiles2
|
||||
cupsPutFd
|
||||
cupsPutFile
|
||||
cupsRasterClose
|
||||
cupsRasterClose
|
||||
cupsRasterErrorString
|
||||
cupsRasterErrorString
|
||||
cupsRasterInitPWGHeader
|
||||
cupsRasterInitPWGHeader
|
||||
cupsRasterInterpretPPD
|
||||
cupsRasterInterpretPPD
|
||||
cupsRasterOpen
|
||||
cupsRasterOpen
|
||||
cupsRasterOpenIO
|
||||
cupsRasterOpenIO
|
||||
cupsRasterReadHeader
|
||||
cupsRasterReadHeader
|
||||
cupsRasterReadHeader2
|
||||
cupsRasterReadHeader2
|
||||
cupsRasterReadPixels
|
||||
cupsRasterReadPixels
|
||||
cupsRasterWriteHeader
|
||||
cupsRasterWriteHeader
|
||||
cupsRasterWriteHeader2
|
||||
cupsRasterWriteHeader2
|
||||
cupsRasterWritePixels
|
||||
cupsRasterWritePixels
|
||||
cupsReadResponseData
|
||||
cupsRemoveDest
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "md5-internal.h"
|
||||
#include "string-private.h"
|
||||
|
||||
#if !defined(__APPLE__) && !defined(HAVE_GNUTLS)
|
||||
#if !defined(__APPLE__)
|
||||
# define T1 0xd76aa478
|
||||
# define T2 0xe8c7b756
|
||||
# define T3 0x242070db
|
||||
@@ -338,4 +338,4 @@ _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16])
|
||||
for (i = 0; i < 16; ++i)
|
||||
digest[i] = (unsigned char)(pms->abcd[i >> 2] >> ((i & 3) << 3));
|
||||
}
|
||||
#endif /* !__APPLE__ && !HAVE_GNUTLS */
|
||||
#endif /* !__APPLE__ */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* PPD cache implementation for CUPS.
|
||||
*
|
||||
* Copyright © 2010-2018 by Apple Inc.
|
||||
* Copyright © 2010-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@@ -533,24 +533,20 @@ _ppdCacheCreateWithFile(
|
||||
else if (!_cups_strcasecmp(line, "Filter"))
|
||||
{
|
||||
if (!pc->filters)
|
||||
pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0,
|
||||
(cups_acopy_func_t)_cupsStrAlloc,
|
||||
(cups_afree_func_t)_cupsStrFree);
|
||||
pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
cupsArrayAdd(pc->filters, value);
|
||||
}
|
||||
else if (!_cups_strcasecmp(line, "PreFilter"))
|
||||
{
|
||||
if (!pc->prefilters)
|
||||
pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0,
|
||||
(cups_acopy_func_t)_cupsStrAlloc,
|
||||
(cups_afree_func_t)_cupsStrFree);
|
||||
pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
cupsArrayAdd(pc->prefilters, value);
|
||||
}
|
||||
else if (!_cups_strcasecmp(line, "Product"))
|
||||
{
|
||||
pc->product = _cupsStrAlloc(value);
|
||||
pc->product = strdup(value);
|
||||
}
|
||||
else if (!_cups_strcasecmp(line, "SingleFile"))
|
||||
{
|
||||
@@ -650,8 +646,8 @@ _ppdCacheCreateWithFile(
|
||||
}
|
||||
|
||||
map = pc->bins + pc->num_bins;
|
||||
map->pwg = _cupsStrAlloc(pwg_keyword);
|
||||
map->ppd = _cupsStrAlloc(ppd_keyword);
|
||||
map->pwg = strdup(pwg_keyword);
|
||||
map->ppd = strdup(ppd_keyword);
|
||||
|
||||
pc->num_bins ++;
|
||||
}
|
||||
@@ -705,8 +701,8 @@ _ppdCacheCreateWithFile(
|
||||
goto create_error;
|
||||
}
|
||||
|
||||
size->map.pwg = _cupsStrAlloc(pwg_keyword);
|
||||
size->map.ppd = _cupsStrAlloc(ppd_keyword);
|
||||
size->map.pwg = strdup(pwg_keyword);
|
||||
size->map.ppd = strdup(ppd_keyword);
|
||||
|
||||
pc->num_sizes ++;
|
||||
}
|
||||
@@ -734,15 +730,15 @@ _ppdCacheCreateWithFile(
|
||||
|
||||
pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
|
||||
pc->custom_max_width, pc->custom_max_length, NULL);
|
||||
pc->custom_max_keyword = _cupsStrAlloc(pwg_keyword);
|
||||
pc->custom_max_keyword = strdup(pwg_keyword);
|
||||
|
||||
pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "min",
|
||||
pc->custom_min_width, pc->custom_min_length, NULL);
|
||||
pc->custom_min_keyword = _cupsStrAlloc(pwg_keyword);
|
||||
pc->custom_min_keyword = strdup(pwg_keyword);
|
||||
}
|
||||
else if (!_cups_strcasecmp(line, "SourceOption"))
|
||||
{
|
||||
pc->source_option = _cupsStrAlloc(value);
|
||||
pc->source_option = strdup(value);
|
||||
}
|
||||
else if (!_cups_strcasecmp(line, "NumSources"))
|
||||
{
|
||||
@@ -789,8 +785,8 @@ _ppdCacheCreateWithFile(
|
||||
}
|
||||
|
||||
map = pc->sources + pc->num_sources;
|
||||
map->pwg = _cupsStrAlloc(pwg_keyword);
|
||||
map->ppd = _cupsStrAlloc(ppd_keyword);
|
||||
map->pwg = strdup(pwg_keyword);
|
||||
map->ppd = strdup(ppd_keyword);
|
||||
|
||||
pc->num_sources ++;
|
||||
}
|
||||
@@ -838,8 +834,8 @@ _ppdCacheCreateWithFile(
|
||||
}
|
||||
|
||||
map = pc->types + pc->num_types;
|
||||
map->pwg = _cupsStrAlloc(pwg_keyword);
|
||||
map->ppd = _cupsStrAlloc(ppd_keyword);
|
||||
map->pwg = strdup(pwg_keyword);
|
||||
map->ppd = strdup(ppd_keyword);
|
||||
|
||||
pc->num_types ++;
|
||||
}
|
||||
@@ -869,13 +865,13 @@ _ppdCacheCreateWithFile(
|
||||
pc->presets[print_color_mode] + print_quality);
|
||||
}
|
||||
else if (!_cups_strcasecmp(line, "SidesOption"))
|
||||
pc->sides_option = _cupsStrAlloc(value);
|
||||
pc->sides_option = strdup(value);
|
||||
else if (!_cups_strcasecmp(line, "Sides1Sided"))
|
||||
pc->sides_1sided = _cupsStrAlloc(value);
|
||||
pc->sides_1sided = strdup(value);
|
||||
else if (!_cups_strcasecmp(line, "Sides2SidedLong"))
|
||||
pc->sides_2sided_long = _cupsStrAlloc(value);
|
||||
pc->sides_2sided_long = strdup(value);
|
||||
else if (!_cups_strcasecmp(line, "Sides2SidedShort"))
|
||||
pc->sides_2sided_short = _cupsStrAlloc(value);
|
||||
pc->sides_2sided_short = strdup(value);
|
||||
else if (!_cups_strcasecmp(line, "Finishings"))
|
||||
{
|
||||
if (!pc->finishings)
|
||||
@@ -896,20 +892,20 @@ _ppdCacheCreateWithFile(
|
||||
else if (!_cups_strcasecmp(line, "FinishingTemplate"))
|
||||
{
|
||||
if (!pc->templates)
|
||||
pc->templates = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)_cupsStrAlloc, (cups_afree_func_t)_cupsStrFree);
|
||||
pc->templates = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
cupsArrayAdd(pc->templates, value);
|
||||
}
|
||||
else if (!_cups_strcasecmp(line, "MaxCopies"))
|
||||
pc->max_copies = atoi(value);
|
||||
else if (!_cups_strcasecmp(line, "ChargeInfoURI"))
|
||||
pc->charge_info_uri = _cupsStrAlloc(value);
|
||||
pc->charge_info_uri = strdup(value);
|
||||
else if (!_cups_strcasecmp(line, "JobAccountId"))
|
||||
pc->account_id = !_cups_strcasecmp(value, "true");
|
||||
else if (!_cups_strcasecmp(line, "JobAccountingUserId"))
|
||||
pc->accounting_user_id = !_cups_strcasecmp(value, "true");
|
||||
else if (!_cups_strcasecmp(line, "JobPassword"))
|
||||
pc->password = _cupsStrAlloc(value);
|
||||
pc->password = strdup(value);
|
||||
else if (!_cups_strcasecmp(line, "Mandatory"))
|
||||
{
|
||||
if (pc->mandatory)
|
||||
@@ -920,9 +916,7 @@ _ppdCacheCreateWithFile(
|
||||
else if (!_cups_strcasecmp(line, "SupportFile"))
|
||||
{
|
||||
if (!pc->support_files)
|
||||
pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0,
|
||||
(cups_acopy_func_t)_cupsStrAlloc,
|
||||
(cups_afree_func_t)_cupsStrFree);
|
||||
pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
cupsArrayAdd(pc->support_files, value);
|
||||
}
|
||||
@@ -1081,7 +1075,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
* Convert the PPD size name to the corresponding PWG keyword name.
|
||||
*/
|
||||
|
||||
if ((pwg_media = pwgMediaForPPD(ppd_size->name)) != NULL)
|
||||
if ((pwg_media = pwgMediaForSize(PWG_FROM_POINTS(ppd_size->width), PWG_FROM_POINTS(ppd_size->length))) != NULL)
|
||||
{
|
||||
/*
|
||||
* Standard name, do we have conflicts?
|
||||
@@ -1166,8 +1160,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
*/
|
||||
|
||||
new_size = old_size;
|
||||
_cupsStrFree(old_size->map.ppd);
|
||||
_cupsStrFree(old_size->map.pwg);
|
||||
free(old_size->map.ppd);
|
||||
free(old_size->map.pwg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1188,8 +1182,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
* Save this size...
|
||||
*/
|
||||
|
||||
new_size->map.ppd = _cupsStrAlloc(ppd_size->name);
|
||||
new_size->map.pwg = _cupsStrAlloc(pwg_name);
|
||||
new_size->map.ppd = strdup(ppd_size->name);
|
||||
new_size->map.pwg = strdup(pwg_name);
|
||||
new_size->width = new_width;
|
||||
new_size->length = new_length;
|
||||
new_size->left = new_left;
|
||||
@@ -1209,14 +1203,14 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "max",
|
||||
PWG_FROM_POINTS(ppd->custom_max[0]),
|
||||
PWG_FROM_POINTS(ppd->custom_max[1]), NULL);
|
||||
pc->custom_max_keyword = _cupsStrAlloc(pwg_keyword);
|
||||
pc->custom_max_keyword = strdup(pwg_keyword);
|
||||
pc->custom_max_width = PWG_FROM_POINTS(ppd->custom_max[0]);
|
||||
pc->custom_max_length = PWG_FROM_POINTS(ppd->custom_max[1]);
|
||||
|
||||
pwgFormatSizeName(pwg_keyword, sizeof(pwg_keyword), "custom", "min",
|
||||
PWG_FROM_POINTS(ppd->custom_min[0]),
|
||||
PWG_FROM_POINTS(ppd->custom_min[1]), NULL);
|
||||
pc->custom_min_keyword = _cupsStrAlloc(pwg_keyword);
|
||||
pc->custom_min_keyword = strdup(pwg_keyword);
|
||||
pc->custom_min_width = PWG_FROM_POINTS(ppd->custom_min[0]);
|
||||
pc->custom_min_length = PWG_FROM_POINTS(ppd->custom_min[1]);
|
||||
|
||||
@@ -1235,7 +1229,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
|
||||
if (input_slot)
|
||||
{
|
||||
pc->source_option = _cupsStrAlloc(input_slot->keyword);
|
||||
pc->source_option = strdup(input_slot->keyword);
|
||||
|
||||
if ((pc->sources = calloc((size_t)input_slot->num_choices, sizeof(pwg_map_t))) == NULL)
|
||||
{
|
||||
@@ -1287,8 +1281,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
"_");
|
||||
}
|
||||
|
||||
map->pwg = _cupsStrAlloc(pwg_name);
|
||||
map->ppd = _cupsStrAlloc(choice->choice);
|
||||
map->pwg = strdup(pwg_name);
|
||||
map->ppd = strdup(choice->choice);
|
||||
|
||||
/*
|
||||
* Add localized text for PWG keyword to message catalog...
|
||||
@@ -1358,8 +1352,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
"_");
|
||||
}
|
||||
|
||||
map->pwg = _cupsStrAlloc(pwg_name);
|
||||
map->ppd = _cupsStrAlloc(choice->choice);
|
||||
map->pwg = strdup(pwg_name);
|
||||
map->ppd = strdup(choice->choice);
|
||||
|
||||
/*
|
||||
* Add localized text for PWG keyword to message catalog...
|
||||
@@ -1392,14 +1386,14 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
{
|
||||
pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword), "_");
|
||||
|
||||
map->pwg = _cupsStrAlloc(pwg_keyword);
|
||||
map->ppd = _cupsStrAlloc(choice->choice);
|
||||
map->pwg = strdup(pwg_keyword);
|
||||
map->ppd = strdup(choice->choice);
|
||||
|
||||
/*
|
||||
* Add localized text for PWG keyword to message catalog...
|
||||
*/
|
||||
|
||||
snprintf(msg_id, sizeof(msg_id), "output-bin.%s", pwg_name);
|
||||
snprintf(msg_id, sizeof(msg_id), "output-bin.%s", pwg_keyword);
|
||||
pwg_add_message(pc->strings, msg_id, choice->text);
|
||||
}
|
||||
}
|
||||
@@ -1626,7 +1620,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
|
||||
if (duplex)
|
||||
{
|
||||
pc->sides_option = _cupsStrAlloc(duplex->keyword);
|
||||
pc->sides_option = strdup(duplex->keyword);
|
||||
|
||||
for (i = duplex->num_choices, choice = duplex->choices;
|
||||
i > 0;
|
||||
@@ -1634,16 +1628,16 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
{
|
||||
if ((!_cups_strcasecmp(choice->choice, "None") ||
|
||||
!_cups_strcasecmp(choice->choice, "False")) && !pc->sides_1sided)
|
||||
pc->sides_1sided = _cupsStrAlloc(choice->choice);
|
||||
pc->sides_1sided = strdup(choice->choice);
|
||||
else if ((!_cups_strcasecmp(choice->choice, "DuplexNoTumble") ||
|
||||
!_cups_strcasecmp(choice->choice, "LongEdge") ||
|
||||
!_cups_strcasecmp(choice->choice, "Top")) && !pc->sides_2sided_long)
|
||||
pc->sides_2sided_long = _cupsStrAlloc(choice->choice);
|
||||
pc->sides_2sided_long = strdup(choice->choice);
|
||||
else if ((!_cups_strcasecmp(choice->choice, "DuplexTumble") ||
|
||||
!_cups_strcasecmp(choice->choice, "ShortEdge") ||
|
||||
!_cups_strcasecmp(choice->choice, "Bottom")) &&
|
||||
!pc->sides_2sided_short)
|
||||
pc->sides_2sided_short = _cupsStrAlloc(choice->choice);
|
||||
pc->sides_2sided_short = strdup(choice->choice);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1651,9 +1645,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
* Copy filters and pre-filters...
|
||||
*/
|
||||
|
||||
pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0,
|
||||
(cups_acopy_func_t)_cupsStrAlloc,
|
||||
(cups_afree_func_t)_cupsStrFree);
|
||||
pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
cupsArrayAdd(pc->filters,
|
||||
"application/vnd.cups-raw application/octet-stream 0 -");
|
||||
@@ -1710,9 +1702,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsPreFilter", NULL)) != NULL)
|
||||
{
|
||||
pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0,
|
||||
(cups_acopy_func_t)_cupsStrAlloc,
|
||||
(cups_afree_func_t)_cupsStrFree);
|
||||
pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
do
|
||||
{
|
||||
@@ -1729,7 +1719,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
*/
|
||||
|
||||
if (ppd->product)
|
||||
pc->product = _cupsStrAlloc(ppd->product);
|
||||
pc->product = strdup(ppd->product);
|
||||
|
||||
/*
|
||||
* Copy finishings mapping data...
|
||||
@@ -1869,7 +1859,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
|
||||
if ((ppd_option = ppdFindOption(ppd, "cupsFinishingTemplate")) != NULL)
|
||||
{
|
||||
pc->templates = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)_cupsStrAlloc, (cups_afree_func_t)_cupsStrFree);
|
||||
pc->templates = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
for (choice = ppd_option->choices, i = ppd_option->num_choices; i > 0; choice ++, i --)
|
||||
{
|
||||
@@ -1901,7 +1891,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
*/
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsChargeInfoURI", NULL)) != NULL)
|
||||
pc->charge_info_uri = _cupsStrAlloc(ppd_attr->value);
|
||||
pc->charge_info_uri = strdup(ppd_attr->value);
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsJobAccountId", NULL)) != NULL)
|
||||
pc->account_id = !_cups_strcasecmp(ppd_attr->value, "true");
|
||||
@@ -1910,7 +1900,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
pc->accounting_user_id = !_cups_strcasecmp(ppd_attr->value, "true");
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsJobPassword", NULL)) != NULL)
|
||||
pc->password = _cupsStrAlloc(ppd_attr->value);
|
||||
pc->password = strdup(ppd_attr->value);
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsMandatory", NULL)) != NULL)
|
||||
pc->mandatory = _cupsArrayNewStrings(ppd_attr->value, ' ');
|
||||
@@ -1919,9 +1909,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
* Support files...
|
||||
*/
|
||||
|
||||
pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0,
|
||||
(cups_acopy_func_t)_cupsStrAlloc,
|
||||
(cups_afree_func_t)_cupsStrFree);
|
||||
pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
|
||||
for (ppd_attr = ppdFindAttr(ppd, "cupsICCProfile", NULL);
|
||||
ppd_attr;
|
||||
@@ -1977,8 +1965,8 @@ _ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
|
||||
{
|
||||
for (i = pc->num_bins, map = pc->bins; i > 0; i --, map ++)
|
||||
{
|
||||
_cupsStrFree(map->pwg);
|
||||
_cupsStrFree(map->ppd);
|
||||
free(map->pwg);
|
||||
free(map->ppd);
|
||||
}
|
||||
|
||||
free(pc->bins);
|
||||
@@ -1988,22 +1976,21 @@ _ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
|
||||
{
|
||||
for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++)
|
||||
{
|
||||
_cupsStrFree(size->map.pwg);
|
||||
_cupsStrFree(size->map.ppd);
|
||||
free(size->map.pwg);
|
||||
free(size->map.ppd);
|
||||
}
|
||||
|
||||
free(pc->sizes);
|
||||
}
|
||||
|
||||
if (pc->source_option)
|
||||
_cupsStrFree(pc->source_option);
|
||||
free(pc->source_option);
|
||||
|
||||
if (pc->sources)
|
||||
{
|
||||
for (i = pc->num_sources, map = pc->sources; i > 0; i --, map ++)
|
||||
{
|
||||
_cupsStrFree(map->pwg);
|
||||
_cupsStrFree(map->ppd);
|
||||
free(map->pwg);
|
||||
free(map->ppd);
|
||||
}
|
||||
|
||||
free(pc->sources);
|
||||
@@ -2013,26 +2000,23 @@ _ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
|
||||
{
|
||||
for (i = pc->num_types, map = pc->types; i > 0; i --, map ++)
|
||||
{
|
||||
_cupsStrFree(map->pwg);
|
||||
_cupsStrFree(map->ppd);
|
||||
free(map->pwg);
|
||||
free(map->ppd);
|
||||
}
|
||||
|
||||
free(pc->types);
|
||||
}
|
||||
|
||||
if (pc->custom_max_keyword)
|
||||
_cupsStrFree(pc->custom_max_keyword);
|
||||
free(pc->custom_max_keyword);
|
||||
free(pc->custom_min_keyword);
|
||||
|
||||
if (pc->custom_min_keyword)
|
||||
_cupsStrFree(pc->custom_min_keyword);
|
||||
|
||||
_cupsStrFree(pc->product);
|
||||
free(pc->product);
|
||||
cupsArrayDelete(pc->filters);
|
||||
cupsArrayDelete(pc->prefilters);
|
||||
cupsArrayDelete(pc->finishings);
|
||||
|
||||
_cupsStrFree(pc->charge_info_uri);
|
||||
_cupsStrFree(pc->password);
|
||||
free(pc->charge_info_uri);
|
||||
free(pc->password);
|
||||
|
||||
cupsArrayDelete(pc->mandatory);
|
||||
|
||||
@@ -2189,7 +2173,7 @@ _ppdCacheGetFinishingValues(
|
||||
f;
|
||||
f = (_pwg_finishings_t *)cupsArrayNext(pc->finishings))
|
||||
{
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues: Checking %d (%s)", f->value, ippEnumString("finishings", f->value)));
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues: Checking %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
|
||||
|
||||
for (i = f->num_options, option = f->options; i > 0; i --, option ++)
|
||||
{
|
||||
@@ -2204,9 +2188,9 @@ _ppdCacheGetFinishingValues(
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues: Adding %d (%s)", f->value, ippEnumString("finishings", f->value)));
|
||||
DEBUG_printf(("_ppdCacheGetFinishingValues: Adding %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
|
||||
|
||||
values[num_values ++] = f->value;
|
||||
values[num_values ++] = (int)f->value;
|
||||
|
||||
if (num_values >= max_values)
|
||||
break;
|
||||
@@ -2973,12 +2957,12 @@ _ppdCacheWriteFile(
|
||||
if (pc->charge_info_uri)
|
||||
cupsFilePutConf(fp, "ChargeInfoURI", pc->charge_info_uri);
|
||||
|
||||
cupsFilePrintf(fp, "AccountId %s\n", pc->account_id ? "true" : "false");
|
||||
cupsFilePrintf(fp, "AccountingUserId %s\n",
|
||||
cupsFilePrintf(fp, "JobAccountId %s\n", pc->account_id ? "true" : "false");
|
||||
cupsFilePrintf(fp, "JobAccountingUserId %s\n",
|
||||
pc->accounting_user_id ? "true" : "false");
|
||||
|
||||
if (pc->password)
|
||||
cupsFilePutConf(fp, "Password", pc->password);
|
||||
cupsFilePutConf(fp, "JobPassword", pc->password);
|
||||
|
||||
for (value = (char *)cupsArrayFirst(pc->mandatory);
|
||||
value;
|
||||
@@ -3172,6 +3156,16 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
httpClose(http);
|
||||
}
|
||||
|
||||
/*
|
||||
* Accounting...
|
||||
*/
|
||||
|
||||
if (ippGetBoolean(ippFindAttribute(response, "job-account-id-supported", IPP_TAG_BOOLEAN), 0))
|
||||
cupsFilePuts(fp, "*cupsJobAccountId: True\n");
|
||||
|
||||
if (ippGetBoolean(ippFindAttribute(response, "job-accounting-user-id-supported", IPP_TAG_BOOLEAN), 0))
|
||||
cupsFilePuts(fp, "*cupsJobAccountingUserId: True\n");
|
||||
|
||||
/*
|
||||
* Password/PIN printing...
|
||||
*/
|
||||
@@ -3204,7 +3198,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
|
||||
pattern[maxlen] = '\0';
|
||||
|
||||
cupsFilePrintf(fp, "*cupsPassword: \"%s\"\n", pattern);
|
||||
cupsFilePrintf(fp, "*cupsJobPassword: \"%s\"\n", pattern);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3989,7 +3983,25 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((attr = ippFindAttribute(response, "finishings-supported", IPP_TAG_ENUM)) != NULL)
|
||||
{
|
||||
int value; /* Enum value */
|
||||
const char *ppd_keyword; /* PPD keyword for enum */
|
||||
cups_array_t *names; /* Names we've added */
|
||||
static const char * const base_keywords[] =
|
||||
{ /* Base STD 92 keywords */
|
||||
NULL, /* none */
|
||||
"SingleAuto", /* staple */
|
||||
"SingleAuto", /* punch */
|
||||
NULL, /* cover */
|
||||
"BindAuto", /* bind */
|
||||
"SaddleStitch", /* saddle-stitch */
|
||||
"EdgeStitchAuto", /* edge-stitch */
|
||||
"Auto", /* fold */
|
||||
NULL, /* trim */
|
||||
NULL, /* bale */
|
||||
NULL, /* booklet-maker */
|
||||
NULL, /* jog-offset */
|
||||
NULL, /* coat */
|
||||
NULL /* laminate */
|
||||
};
|
||||
|
||||
count = ippGetCount(attr);
|
||||
names = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
@@ -4010,6 +4022,33 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const staple_keywords[] =
|
||||
{ /* StapleLocation keywords */
|
||||
"SinglePortrait",
|
||||
"SingleRevLandscape",
|
||||
"SingleLandscape",
|
||||
"SingleRevPortrait",
|
||||
"EdgeStitchPortrait",
|
||||
"EdgeStitchLandscape",
|
||||
"EdgeStitchRevPortrait",
|
||||
"EdgeStitchRevLandscape",
|
||||
"DualPortrait",
|
||||
"DualLandscape",
|
||||
"DualRevPortrait",
|
||||
"DualRevLandscape",
|
||||
"TriplePortrait",
|
||||
"TripleLandscape",
|
||||
"TripleRevPortrait",
|
||||
"TripleRevLandscape"
|
||||
};
|
||||
static const char * const bind_keywords[] =
|
||||
{ /* StapleLocation binding keywords */
|
||||
"BindPortrait",
|
||||
"BindLandscape",
|
||||
"BindRevPortrait",
|
||||
"BindRevLandscape"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*StapleLocation");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *StapleLocation: PickOne\n");
|
||||
@@ -4037,9 +4076,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", keyword);
|
||||
cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, keyword);
|
||||
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
|
||||
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
|
||||
else if (value >= IPP_FINISHINGS_STAPLE_TOP_LEFT && value <= IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM)
|
||||
ppd_keyword = staple_keywords[value - IPP_FINISHINGS_STAPLE_TOP_LEFT];
|
||||
else if (value >= IPP_FINISHINGS_BIND_LEFT && value <= IPP_FINISHINGS_BIND_BOTTOM)
|
||||
ppd_keyword = bind_keywords[value - IPP_FINISHINGS_BIND_LEFT];
|
||||
else
|
||||
ppd_keyword = NULL;
|
||||
|
||||
if (!ppd_keyword)
|
||||
continue;
|
||||
|
||||
cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *StapleLocation\n");
|
||||
@@ -4054,12 +4105,28 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (!strncmp(keyword, "fold-", 5))
|
||||
if (!strncmp(keyword, "cups-fold-", 10) || !strcmp(keyword, "fold") || !strncmp(keyword, "fold-", 5))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const fold_keywords[] =
|
||||
{ /* FoldType keywords */
|
||||
"Accordion",
|
||||
"DoubleGate",
|
||||
"Gate",
|
||||
"Half",
|
||||
"HalfZ",
|
||||
"LeftGate",
|
||||
"Letter",
|
||||
"Parallel",
|
||||
"XFold",
|
||||
"RightGate",
|
||||
"ZFold",
|
||||
"EngineeringZ"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*FoldType");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *FoldType: PickOne\n");
|
||||
@@ -4074,7 +4141,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (strncmp(keyword, "fold-", 5))
|
||||
if (!strncmp(keyword, "cups-fold-", 10))
|
||||
keyword += 5;
|
||||
else if (strcmp(keyword, "fold") && strncmp(keyword, "fold-", 5))
|
||||
continue;
|
||||
|
||||
if (cupsArrayFind(names, (char *)keyword))
|
||||
@@ -4087,9 +4156,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
cupsFilePrintf(fp, "*FoldType %s: \"\"\n", keyword);
|
||||
cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, keyword);
|
||||
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
|
||||
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
|
||||
else if (value >= IPP_FINISHINGS_FOLD_ACCORDION && value <= IPP_FINISHINGS_FOLD_ENGINEERING_Z)
|
||||
ppd_keyword = fold_keywords[value - IPP_FINISHINGS_FOLD_ACCORDION];
|
||||
else if (value >= IPP_FINISHINGS_CUPS_FOLD_ACCORDION && value <= IPP_FINISHINGS_CUPS_FOLD_Z)
|
||||
ppd_keyword = fold_keywords[value - IPP_FINISHINGS_CUPS_FOLD_ACCORDION];
|
||||
else
|
||||
ppd_keyword = NULL;
|
||||
|
||||
if (!ppd_keyword)
|
||||
continue;
|
||||
|
||||
cupsFilePrintf(fp, "*FoldType %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *FoldType\n");
|
||||
@@ -4104,12 +4185,36 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (!strncmp(keyword, "punch-", 6))
|
||||
if (!strncmp(keyword, "cups-punch-", 11) || !strncmp(keyword, "punch-", 6))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const punch_keywords[] =
|
||||
{ /* PunchMedia keywords */
|
||||
"SinglePortrait",
|
||||
"SingleRevLandscape",
|
||||
"SingleLandscape",
|
||||
"SingleRevPortrait",
|
||||
"DualPortrait",
|
||||
"DualLandscape",
|
||||
"DualRevPortrait",
|
||||
"DualRevLandscape",
|
||||
"TriplePortrait",
|
||||
"TripleLandscape",
|
||||
"TripleRevPortrait",
|
||||
"TripleRevLandscape",
|
||||
"QuadPortrait",
|
||||
"QuadLandscape",
|
||||
"QuadRevPortrait",
|
||||
"QuadRevLandscape",
|
||||
"MultiplePortrait",
|
||||
"MultipleLandscape",
|
||||
"MultipleRevPortrait",
|
||||
"MultipleRevLandscape"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*PunchMedia");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *PunchMedia: PickOne\n");
|
||||
@@ -4124,7 +4229,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (strncmp(keyword, "punch-", 6))
|
||||
if (!strncmp(keyword, "cups-punch-", 11))
|
||||
keyword += 5;
|
||||
else if (strncmp(keyword, "punch-", 6))
|
||||
continue;
|
||||
|
||||
if (cupsArrayFind(names, (char *)keyword))
|
||||
@@ -4137,9 +4244,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", keyword);
|
||||
cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, keyword);
|
||||
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
|
||||
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
|
||||
else if (value >= IPP_FINISHINGS_PUNCH_TOP_LEFT && value <= IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM)
|
||||
ppd_keyword = punch_keywords[value - IPP_FINISHINGS_PUNCH_TOP_LEFT];
|
||||
else if (value >= IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT && value <= IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM)
|
||||
ppd_keyword = punch_keywords[value - IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT];
|
||||
else
|
||||
ppd_keyword = NULL;
|
||||
|
||||
if (!ppd_keyword)
|
||||
continue;
|
||||
|
||||
cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *PunchMedia\n");
|
||||
@@ -4163,6 +4282,69 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
cupsFilePuts(fp, "*CloseUI: *Booklet\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* CutMedia
|
||||
*/
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (!strcmp(keyword, "trim") || !strncmp(keyword, "trim-", 5))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const trim_keywords[] =
|
||||
{ /* CutMedia keywords */
|
||||
"EndOfPage",
|
||||
"EndOfDoc",
|
||||
"EndOfSet",
|
||||
"EndOfJob"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*CutMedia");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *CutMedia: PickOne\n");
|
||||
cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *CutMedia\n");
|
||||
cupsFilePrintf(fp, "*%s.Translation CutMedia/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Cut")));
|
||||
cupsFilePuts(fp, "*DefaultCutMedia: None\n");
|
||||
cupsFilePuts(fp, "*CutMedia None: \"\"\n");
|
||||
cupsFilePrintf(fp, "*%s.CutMedia None/%s: \"\"\n", lang->language, _cupsLangString(lang, _("None")));
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (strcmp(keyword, "trim") && strncmp(keyword, "trim-", 5))
|
||||
continue;
|
||||
|
||||
if (cupsArrayFind(names, (char *)keyword))
|
||||
continue; /* Already did this finishing template */
|
||||
|
||||
cupsArrayAdd(names, (char *)keyword);
|
||||
|
||||
snprintf(msgid, sizeof(msgid), "finishings.%d", value);
|
||||
if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
if (value == IPP_FINISHINGS_TRIM)
|
||||
ppd_keyword = "Auto";
|
||||
else
|
||||
ppd_keyword = trim_keywords[value - IPP_FINISHINGS_TRIM_AFTER_PAGES];
|
||||
|
||||
cupsFilePrintf(fp, "*CutMedia %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.CutMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*CutMedia %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *CutMedia\n");
|
||||
}
|
||||
|
||||
cupsArrayDelete(names);
|
||||
}
|
||||
|
||||
@@ -4190,7 +4372,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if (!keyword || cupsArrayFind(templates, (void *)keyword))
|
||||
continue;
|
||||
|
||||
if (strncmp(keyword, "fold-", 5) && (strstr(keyword, "-bottom") || strstr(keyword, "-left") || strstr(keyword, "-right") || strstr(keyword, "-top")))
|
||||
if (!strcmp(keyword, "none"))
|
||||
continue;
|
||||
|
||||
cupsArrayAdd(templates, (void *)keyword);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* PPD code emission routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 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
|
||||
@@ -441,6 +441,9 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* Clean up the job title...
|
||||
*/
|
||||
|
||||
if (!title)
|
||||
title = "Unknown";
|
||||
|
||||
if ((ptr = strrchr(title, '/')) != NULL)
|
||||
{
|
||||
/*
|
||||
@@ -490,6 +493,9 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
|
||||
* issues with some printer's PJL implementations...
|
||||
*/
|
||||
|
||||
if (!user)
|
||||
user = "anonymous";
|
||||
|
||||
snprintf(displaymsg, sizeof(displaymsg), "%d %s %s", job_id, user, temp);
|
||||
|
||||
/*
|
||||
@@ -658,6 +664,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@@ -704,6 +713,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@@ -799,6 +811,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@@ -832,7 +847,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
*bufptr++ = *cptr++;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (choices[i]->code)
|
||||
{
|
||||
/*
|
||||
* Otherwise just copy the option code directly...
|
||||
@@ -1001,6 +1016,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@@ -1065,7 +1083,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
DEBUG_printf(("2ppdEmitString: Offset in string is %d...",
|
||||
(int)(bufptr - buffer)));
|
||||
}
|
||||
else
|
||||
else if (choices[i]->code)
|
||||
{
|
||||
strlcpy(bufptr, choices[i]->code, (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(bufptr);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Option marking routines 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.
|
||||
@@ -851,6 +851,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@@ -886,9 +889,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
case PPD_CUSTOM_PASSWORD :
|
||||
case PPD_CUSTOM_STRING :
|
||||
if (cparam->current.custom_string)
|
||||
_cupsStrFree(cparam->current.custom_string);
|
||||
free(cparam->current.custom_string);
|
||||
|
||||
cparam->current.custom_string = _cupsStrAlloc(choice + 7);
|
||||
cparam->current.custom_string = strdup(choice + 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -928,6 +931,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@@ -963,9 +969,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
case PPD_CUSTOM_PASSWORD :
|
||||
case PPD_CUSTOM_STRING :
|
||||
if (cparam->current.custom_string)
|
||||
_cupsStrFree(cparam->current.custom_string);
|
||||
free(cparam->current.custom_string);
|
||||
|
||||
cparam->current.custom_string = _cupsStrRetain(val->value);
|
||||
cparam->current.custom_string = strdup(val->value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Private PPD 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
|
||||
@@ -156,6 +156,7 @@ struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
|
||||
*/
|
||||
|
||||
extern int _cupsConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options) _CUPS_PRIVATE;
|
||||
extern int _cupsRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code) _CUPS_NONNULL(3) _CUPS_PRIVATE;
|
||||
extern int _cupsRasterInterpretPPD(cups_page_header2_t *h, ppd_file_t *ppd, int num_options, cups_option_t *options, cups_interpret_cb_t func) _CUPS_PRIVATE;
|
||||
|
||||
extern _ppd_cache_t *_ppdCacheCreateWithFile(const char *filename,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* PPD file 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.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@@ -23,8 +23,6 @@
|
||||
* Definitions...
|
||||
*/
|
||||
|
||||
#define ppd_free(p) if (p) free(p) /* Safe free macro */
|
||||
|
||||
#define PPD_KEYWORD 1 /* Line contained a keyword */
|
||||
#define PPD_OPTION 2 /* Line contained an option name */
|
||||
#define PPD_TEXT 4 /* Line contained human-readable text */
|
||||
@@ -106,7 +104,6 @@ void
|
||||
ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ppd_emul_t *emul; /* Current emulation */
|
||||
ppd_group_t *group; /* Current group */
|
||||
char **font; /* Current font */
|
||||
ppd_attr_t **attr; /* Current attribute */
|
||||
@@ -125,28 +122,12 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
* Free all strings at the top level...
|
||||
*/
|
||||
|
||||
_cupsStrFree(ppd->lang_encoding);
|
||||
_cupsStrFree(ppd->nickname);
|
||||
if (ppd->patches)
|
||||
free(ppd->patches);
|
||||
_cupsStrFree(ppd->jcl_begin);
|
||||
_cupsStrFree(ppd->jcl_end);
|
||||
_cupsStrFree(ppd->jcl_ps);
|
||||
|
||||
/*
|
||||
* Free any emulations...
|
||||
*/
|
||||
|
||||
if (ppd->num_emulations > 0)
|
||||
{
|
||||
for (i = ppd->num_emulations, emul = ppd->emulations; i > 0; i --, emul ++)
|
||||
{
|
||||
_cupsStrFree(emul->start);
|
||||
_cupsStrFree(emul->stop);
|
||||
}
|
||||
|
||||
ppd_free(ppd->emulations);
|
||||
}
|
||||
free(ppd->lang_encoding);
|
||||
free(ppd->nickname);
|
||||
free(ppd->patches);
|
||||
free(ppd->jcl_begin);
|
||||
free(ppd->jcl_end);
|
||||
free(ppd->jcl_ps);
|
||||
|
||||
/*
|
||||
* Free any UI groups, subgroups, and options...
|
||||
@@ -157,7 +138,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
|
||||
ppd_free_group(group);
|
||||
|
||||
ppd_free(ppd->groups);
|
||||
free(ppd->groups);
|
||||
}
|
||||
|
||||
cupsArrayDelete(ppd->options);
|
||||
@@ -168,14 +149,14 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
*/
|
||||
|
||||
if (ppd->num_sizes > 0)
|
||||
ppd_free(ppd->sizes);
|
||||
free(ppd->sizes);
|
||||
|
||||
/*
|
||||
* Free any constraints...
|
||||
*/
|
||||
|
||||
if (ppd->num_consts > 0)
|
||||
ppd_free(ppd->consts);
|
||||
free(ppd->consts);
|
||||
|
||||
/*
|
||||
* Free any filters...
|
||||
@@ -190,9 +171,9 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
if (ppd->num_fonts > 0)
|
||||
{
|
||||
for (i = ppd->num_fonts, font = ppd->fonts; i > 0; i --, font ++)
|
||||
_cupsStrFree(*font);
|
||||
free(*font);
|
||||
|
||||
ppd_free(ppd->fonts);
|
||||
free(ppd->fonts);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -200,7 +181,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
*/
|
||||
|
||||
if (ppd->num_profiles > 0)
|
||||
ppd_free(ppd->profiles);
|
||||
free(ppd->profiles);
|
||||
|
||||
/*
|
||||
* Free any attributes...
|
||||
@@ -210,11 +191,11 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
{
|
||||
for (i = ppd->num_attrs, attr = ppd->attrs; i > 0; i --, attr ++)
|
||||
{
|
||||
_cupsStrFree((*attr)->value);
|
||||
ppd_free(*attr);
|
||||
free((*attr)->value);
|
||||
free(*attr);
|
||||
}
|
||||
|
||||
ppd_free(ppd->attrs);
|
||||
free(ppd->attrs);
|
||||
}
|
||||
|
||||
cupsArrayDelete(ppd->sorted_attrs);
|
||||
@@ -236,7 +217,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
case PPD_CUSTOM_PASSCODE :
|
||||
case PPD_CUSTOM_PASSWORD :
|
||||
case PPD_CUSTOM_STRING :
|
||||
_cupsStrFree(cparam->current.custom_string);
|
||||
free(cparam->current.custom_string);
|
||||
break;
|
||||
|
||||
default :
|
||||
@@ -284,7 +265,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
* Free the whole record...
|
||||
*/
|
||||
|
||||
ppd_free(ppd);
|
||||
free(ppd);
|
||||
}
|
||||
|
||||
|
||||
@@ -432,7 +413,6 @@ _ppdOpen(
|
||||
_ppd_localization_t localization) /* I - Localization to load */
|
||||
{
|
||||
int i, j, k; /* Looping vars */
|
||||
int count; /* Temporary count */
|
||||
_ppd_line_t line; /* Line buffer */
|
||||
ppd_file_t *ppd; /* PPD file record */
|
||||
ppd_group_t *group, /* Current group */
|
||||
@@ -450,7 +430,6 @@ _ppdOpen(
|
||||
/* Human-readable text from file */
|
||||
*string, /* Code/text from file */
|
||||
*sptr, /* Pointer into string */
|
||||
*nameptr, /* Pointer into name */
|
||||
*temp, /* Temporary string pointer */
|
||||
**tempfonts; /* Temporary fonts pointer */
|
||||
float order; /* Order dependency number */
|
||||
@@ -624,16 +603,14 @@ _ppdOpen(
|
||||
if (pg->ppd_status == PPD_OK)
|
||||
pg->ppd_status = PPD_MISSING_PPDADOBE4;
|
||||
|
||||
_cupsStrFree(string);
|
||||
ppd_free(line.buffer);
|
||||
free(string);
|
||||
free(line.buffer);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
DEBUG_printf(("2_ppdOpen: keyword=%s, string=%p", keyword, string));
|
||||
|
||||
_cupsStrFree(string);
|
||||
|
||||
/*
|
||||
* Allocate memory for the PPD file record...
|
||||
*/
|
||||
@@ -642,18 +619,20 @@ _ppdOpen(
|
||||
{
|
||||
pg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
_cupsStrFree(string);
|
||||
ppd_free(line.buffer);
|
||||
free(string);
|
||||
free(line.buffer);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
free(string);
|
||||
string = NULL;
|
||||
|
||||
ppd->language_level = 2;
|
||||
ppd->color_device = 0;
|
||||
ppd->colorspace = PPD_CS_N;
|
||||
ppd->landscape = -90;
|
||||
ppd->coptions = cupsArrayNew((cups_array_func_t)ppd_compare_coptions,
|
||||
NULL);
|
||||
ppd->coptions = cupsArrayNew((cups_array_func_t)ppd_compare_coptions, NULL);
|
||||
|
||||
/*
|
||||
* Read lines from the PPD file and add them to the file record...
|
||||
@@ -726,6 +705,8 @@ _ppdOpen(
|
||||
strncmp(ll, keyword, ll_len)))
|
||||
{
|
||||
DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
|
||||
free(string);
|
||||
string = NULL;
|
||||
continue;
|
||||
}
|
||||
else if (localization == _PPD_LOCALIZATION_ICC_PROFILES)
|
||||
@@ -745,6 +726,8 @@ _ppdOpen(
|
||||
if (i >= (int)(sizeof(color_keywords) / sizeof(color_keywords[0])))
|
||||
{
|
||||
DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
|
||||
free(string);
|
||||
string = NULL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -840,7 +823,7 @@ _ppdOpen(
|
||||
* Say all PPD files are UTF-8, since we convert to UTF-8...
|
||||
*/
|
||||
|
||||
ppd->lang_encoding = _cupsStrAlloc("UTF-8");
|
||||
ppd->lang_encoding = strdup("UTF-8");
|
||||
encoding = _ppdGetEncoding(string);
|
||||
}
|
||||
else if (!strcmp(keyword, "LanguageVersion"))
|
||||
@@ -861,10 +844,10 @@ _ppdOpen(
|
||||
|
||||
|
||||
cupsCharsetToUTF8(utf8, string, sizeof(utf8), encoding);
|
||||
ppd->nickname = _cupsStrAlloc((char *)utf8);
|
||||
ppd->nickname = strdup((char *)utf8);
|
||||
}
|
||||
else
|
||||
ppd->nickname = _cupsStrAlloc(string);
|
||||
ppd->nickname = strdup(string);
|
||||
}
|
||||
else if (!strcmp(keyword, "Product"))
|
||||
ppd->product = string;
|
||||
@@ -874,17 +857,17 @@ _ppdOpen(
|
||||
ppd->ttrasterizer = string;
|
||||
else if (!strcmp(keyword, "JCLBegin"))
|
||||
{
|
||||
ppd->jcl_begin = _cupsStrAlloc(string);
|
||||
ppd->jcl_begin = strdup(string);
|
||||
ppd_decode(ppd->jcl_begin); /* Decode quoted string */
|
||||
}
|
||||
else if (!strcmp(keyword, "JCLEnd"))
|
||||
{
|
||||
ppd->jcl_end = _cupsStrAlloc(string);
|
||||
ppd->jcl_end = strdup(string);
|
||||
ppd_decode(ppd->jcl_end); /* Decode quoted string */
|
||||
}
|
||||
else if (!strcmp(keyword, "JCLToPSInterpreter"))
|
||||
{
|
||||
ppd->jcl_ps = _cupsStrAlloc(string);
|
||||
ppd->jcl_ps = strdup(string);
|
||||
ppd_decode(ppd->jcl_ps); /* Decode quoted string */
|
||||
}
|
||||
else if (!strcmp(keyword, "AccurateScreensSupport"))
|
||||
@@ -952,10 +935,10 @@ _ppdOpen(
|
||||
ppd->num_filters ++;
|
||||
|
||||
/*
|
||||
* Retain a copy of the filter string...
|
||||
* Make a copy of the filter string...
|
||||
*/
|
||||
|
||||
*filter = _cupsStrRetain(string);
|
||||
*filter = strdup(string);
|
||||
}
|
||||
else if (!strcmp(keyword, "Throughput"))
|
||||
ppd->throughput = atoi(string);
|
||||
@@ -978,7 +961,7 @@ _ppdOpen(
|
||||
}
|
||||
|
||||
ppd->fonts = tempfonts;
|
||||
ppd->fonts[ppd->num_fonts] = _cupsStrAlloc(name);
|
||||
ppd->fonts[ppd->num_fonts] = strdup(name);
|
||||
ppd->num_fonts ++;
|
||||
}
|
||||
else if (!strncmp(keyword, "ParamCustom", 11))
|
||||
@@ -1009,6 +992,13 @@ _ppdOpen(
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (cparam->type != PPD_CUSTOM_UNKNOWN)
|
||||
{
|
||||
pg->ppd_status = PPD_BAD_CUSTOM_PARAM;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the parameter data...
|
||||
*/
|
||||
@@ -1143,7 +1133,7 @@ _ppdOpen(
|
||||
strlcpy(choice->text, text[0] ? text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
|
||||
choice->code = _cupsStrAlloc(string);
|
||||
choice->code = strdup(string);
|
||||
|
||||
if (custom_option->section == PPD_ORDER_JCL)
|
||||
ppd_decode(choice->code);
|
||||
@@ -1192,59 +1182,23 @@ _ppdOpen(
|
||||
else if (!strcmp(string, "Plus90"))
|
||||
ppd->landscape = 90;
|
||||
}
|
||||
else if (!strcmp(keyword, "Emulators") && string)
|
||||
else if (!strcmp(keyword, "Emulators") && string && ppd->num_emulations == 0)
|
||||
{
|
||||
for (count = 1, sptr = string; sptr != NULL;)
|
||||
if ((sptr = strchr(sptr, ' ')) != NULL)
|
||||
{
|
||||
count ++;
|
||||
while (*sptr == ' ')
|
||||
sptr ++;
|
||||
}
|
||||
/*
|
||||
* Issue #5562: Samsung printer drivers incorrectly use Emulators keyword
|
||||
* to configure themselves
|
||||
*
|
||||
* The Emulators keyword was loaded but never used by anything in CUPS,
|
||||
* and has no valid purpose in CUPS. The old code was removed due to a
|
||||
* memory leak (Issue #5475), so the following (new) code supports a single
|
||||
* name for the Emulators keyword, allowing these drivers to work until we
|
||||
* remove PPD and driver support entirely in a future version of CUPS.
|
||||
*/
|
||||
|
||||
ppd->num_emulations = count;
|
||||
if ((ppd->emulations = calloc((size_t)count, sizeof(ppd_emul_t))) == NULL)
|
||||
{
|
||||
pg->ppd_status = PPD_ALLOC_ERROR;
|
||||
ppd->num_emulations = 1;
|
||||
ppd->emulations = calloc(1, sizeof(ppd_emul_t));
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
for (i = 0, sptr = string; i < count; i ++)
|
||||
{
|
||||
for (nameptr = ppd->emulations[i].name;
|
||||
*sptr != '\0' && *sptr != ' ';
|
||||
sptr ++)
|
||||
if (nameptr < (ppd->emulations[i].name + sizeof(ppd->emulations[i].name) - 1))
|
||||
*nameptr++ = *sptr;
|
||||
|
||||
*nameptr = '\0';
|
||||
|
||||
while (*sptr == ' ')
|
||||
sptr ++;
|
||||
}
|
||||
}
|
||||
else if (!strncmp(keyword, "StartEmulator_", 14))
|
||||
{
|
||||
ppd_decode(string);
|
||||
|
||||
for (i = 0; i < ppd->num_emulations; i ++)
|
||||
if (!strcmp(keyword + 14, ppd->emulations[i].name))
|
||||
{
|
||||
ppd->emulations[i].start = string;
|
||||
string = NULL;
|
||||
}
|
||||
}
|
||||
else if (!strncmp(keyword, "StopEmulator_", 13))
|
||||
{
|
||||
ppd_decode(string);
|
||||
|
||||
for (i = 0; i < ppd->num_emulations; i ++)
|
||||
if (!strcmp(keyword + 13, ppd->emulations[i].name))
|
||||
{
|
||||
ppd->emulations[i].stop = string;
|
||||
string = NULL;
|
||||
}
|
||||
strlcpy(ppd->emulations[0].name, string, sizeof(ppd->emulations[0].name));
|
||||
}
|
||||
else if (!strcmp(keyword, "JobPatchFile"))
|
||||
{
|
||||
@@ -1399,7 +1353,7 @@ _ppdOpen(
|
||||
|
||||
option->section = PPD_ORDER_ANY;
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
|
||||
/*
|
||||
@@ -1427,7 +1381,7 @@ _ppdOpen(
|
||||
strlcpy(choice->text,
|
||||
custom_attr->text[0] ? custom_attr->text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
choice->code = _cupsStrRetain(custom_attr->value);
|
||||
choice->code = strdup(custom_attr->value);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(keyword, "JCLOpenUI"))
|
||||
@@ -1506,7 +1460,7 @@ _ppdOpen(
|
||||
option->section = PPD_ORDER_JCL;
|
||||
group = NULL;
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
|
||||
/*
|
||||
@@ -1530,7 +1484,7 @@ _ppdOpen(
|
||||
strlcpy(choice->text,
|
||||
custom_attr->text[0] ? custom_attr->text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
choice->code = _cupsStrRetain(custom_attr->value);
|
||||
choice->code = strdup(custom_attr->value);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(keyword, "CloseUI"))
|
||||
@@ -1544,7 +1498,7 @@ _ppdOpen(
|
||||
|
||||
option = NULL;
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (!strcmp(keyword, "JCLCloseUI"))
|
||||
@@ -1558,7 +1512,7 @@ _ppdOpen(
|
||||
|
||||
option = NULL;
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (!strcmp(keyword, "OpenGroup"))
|
||||
@@ -1605,14 +1559,14 @@ _ppdOpen(
|
||||
if (group == NULL)
|
||||
goto error;
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (!strcmp(keyword, "CloseGroup"))
|
||||
{
|
||||
group = NULL;
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (!strcmp(keyword, "OrderDependency"))
|
||||
@@ -1670,7 +1624,7 @@ _ppdOpen(
|
||||
option->order = order;
|
||||
}
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (!strncmp(keyword, "Default", 7))
|
||||
@@ -1765,8 +1719,7 @@ _ppdOpen(
|
||||
constraint->choice1, constraint->option2,
|
||||
constraint->choice2))
|
||||
{
|
||||
case 0 : /* Error */
|
||||
case 1 : /* Error */
|
||||
default : /* Error */
|
||||
pg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
|
||||
goto error;
|
||||
|
||||
@@ -1913,11 +1866,18 @@ _ppdOpen(
|
||||
* Don't add this one as an attribute...
|
||||
*/
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (!strcmp(keyword, "PaperDimension"))
|
||||
{
|
||||
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
||||
{
|
||||
char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
||||
snprintf(cname, sizeof(cname), "_%s", name);
|
||||
strlcpy(name, cname, sizeof(name));
|
||||
}
|
||||
|
||||
if ((size = ppdPageSize(ppd, name)) == NULL)
|
||||
size = ppd_add_size(ppd, name);
|
||||
|
||||
@@ -1935,11 +1895,18 @@ _ppdOpen(
|
||||
size->width = (float)_cupsStrScand(string, &sptr, loc);
|
||||
size->length = (float)_cupsStrScand(sptr, NULL, loc);
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (!strcmp(keyword, "ImageableArea"))
|
||||
{
|
||||
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
||||
{
|
||||
char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
||||
snprintf(cname, sizeof(cname), "_%s", name);
|
||||
strlcpy(name, cname, sizeof(name));
|
||||
}
|
||||
|
||||
if ((size = ppdPageSize(ppd, name)) == NULL)
|
||||
size = ppd_add_size(ppd, name);
|
||||
|
||||
@@ -1959,7 +1926,7 @@ _ppdOpen(
|
||||
size->right = (float)_cupsStrScand(sptr, &sptr, loc);
|
||||
size->top = (float)_cupsStrScand(sptr, NULL, loc);
|
||||
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
string = NULL;
|
||||
}
|
||||
else if (option != NULL &&
|
||||
@@ -1969,6 +1936,13 @@ _ppdOpen(
|
||||
{
|
||||
DEBUG_printf(("2_ppdOpen: group=%p, subgroup=%p", group, subgroup));
|
||||
|
||||
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
||||
{
|
||||
char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
||||
snprintf(cname, sizeof(cname), "_%s", name);
|
||||
strlcpy(name, cname, sizeof(name));
|
||||
}
|
||||
|
||||
if (!strcmp(keyword, "PageSize"))
|
||||
{
|
||||
/*
|
||||
@@ -2015,7 +1989,7 @@ _ppdOpen(
|
||||
(mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING))
|
||||
ppd_add_attr(ppd, keyword, name, text, string);
|
||||
else
|
||||
_cupsStrFree(string);
|
||||
free(string);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2038,7 +2012,7 @@ _ppdOpen(
|
||||
goto error;
|
||||
}
|
||||
|
||||
ppd_free(line.buffer);
|
||||
free(line.buffer);
|
||||
|
||||
/*
|
||||
* Reset language preferences...
|
||||
@@ -2120,8 +2094,8 @@ _ppdOpen(
|
||||
|
||||
error:
|
||||
|
||||
_cupsStrFree(string);
|
||||
ppd_free(line.buffer);
|
||||
free(string);
|
||||
free(line.buffer);
|
||||
|
||||
ppdClose(ppd);
|
||||
|
||||
@@ -2559,9 +2533,9 @@ ppd_free_filters(ppd_file_t *ppd) /* I - PPD file */
|
||||
if (ppd->num_filters > 0)
|
||||
{
|
||||
for (i = ppd->num_filters, filter = ppd->filters; i > 0; i --, filter ++)
|
||||
_cupsStrFree(*filter);
|
||||
free(*filter);
|
||||
|
||||
ppd_free(ppd->filters);
|
||||
free(ppd->filters);
|
||||
|
||||
ppd->num_filters = 0;
|
||||
ppd->filters = NULL;
|
||||
@@ -2588,7 +2562,7 @@ ppd_free_group(ppd_group_t *group) /* I - Group to free */
|
||||
i --, option ++)
|
||||
ppd_free_option(option);
|
||||
|
||||
ppd_free(group->options);
|
||||
free(group->options);
|
||||
}
|
||||
|
||||
if (group->num_subgroups > 0)
|
||||
@@ -2598,7 +2572,7 @@ ppd_free_group(ppd_group_t *group) /* I - Group to free */
|
||||
i --, subgroup ++)
|
||||
ppd_free_group(subgroup);
|
||||
|
||||
ppd_free(group->subgroups);
|
||||
free(group->subgroups);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2620,10 +2594,10 @@ ppd_free_option(ppd_option_t *option) /* I - Option to free */
|
||||
i > 0;
|
||||
i --, choice ++)
|
||||
{
|
||||
_cupsStrFree(choice->code);
|
||||
free(choice->code);
|
||||
}
|
||||
|
||||
ppd_free(option->choices);
|
||||
free(option->choices);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2693,6 +2667,7 @@ ppd_get_cparam(ppd_coption_t *opt, /* I - PPD file */
|
||||
if ((cparam = calloc(1, sizeof(ppd_cparam_t))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
cparam->type = PPD_CUSTOM_UNKNOWN;
|
||||
strlcpy(cparam->name, param, sizeof(cparam->name));
|
||||
strlcpy(cparam->text, text[0] ? text : param, sizeof(cparam->text));
|
||||
|
||||
@@ -3360,7 +3335,7 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
|
||||
lineptr ++;
|
||||
}
|
||||
|
||||
*string = _cupsStrAlloc(lineptr);
|
||||
*string = strdup(lineptr);
|
||||
|
||||
mask |= PPD_STRING;
|
||||
}
|
||||
@@ -3482,7 +3457,7 @@ ppd_update_filters(ppd_file_t *ppd, /* I - PPD file */
|
||||
filter += ppd->num_filters;
|
||||
ppd->num_filters ++;
|
||||
|
||||
*filter = _cupsStrAlloc(buffer);
|
||||
*filter = strdup(buffer);
|
||||
}
|
||||
while ((attr = ppdFindNextAttr(ppd, "cupsFilter2", NULL)) != NULL);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* THESE APIS ARE DEPRECATED. THIS HEADER AND THESE FUNCTIONS WILL BE REMOVED
|
||||
* IN A FUTURE RELEASE OF 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
|
||||
@@ -226,6 +226,7 @@ typedef struct ppd_profile_s /**** sRGB Color Profiles @deprecated@ ****/
|
||||
/**** New in CUPS 1.2/macOS 10.5 ****/
|
||||
typedef enum ppd_cptype_e /**** Custom Parameter Type @deprecated@ ****/
|
||||
{
|
||||
PPD_CUSTOM_UNKNOWN = -1, /* Unknown type (error) */
|
||||
PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */
|
||||
PPD_CUSTOM_INT, /* Integer number value */
|
||||
PPD_CUSTOM_INVCURVE, /* Curve value for f(x) = x^(1/value) */
|
||||
@@ -295,8 +296,8 @@ typedef struct ppd_file_s /**** PPD File @deprecated@ ****/
|
||||
int throughput; /* Pages per minute */
|
||||
ppd_cs_t colorspace; /* Default colorspace */
|
||||
char *patches; /* Patch commands to be sent to printer */
|
||||
int num_emulations; /* Number of emulations supported */
|
||||
ppd_emul_t *emulations; /* Emulations and the code to invoke them */
|
||||
int num_emulations; /* Number of emulations supported (no longer supported) @private@ */
|
||||
ppd_emul_t *emulations; /* Emulations and the code to invoke them (no longer supported) @private@ */
|
||||
char *jcl_begin; /* Start JCL commands */
|
||||
char *jcl_ps; /* Enter PostScript interpreter */
|
||||
char *jcl_end; /* End JCL commands */
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* PWG media name API implementation for CUPS.
|
||||
*
|
||||
* Copyright 2009-2017 by Apple Inc.
|
||||
* Copyright 2009-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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -21,6 +22,7 @@
|
||||
|
||||
#define _PWG_MEDIA_IN(p,l,a,x,y) {p, l, a, (int)(x * 2540), (int)(y * 2540)}
|
||||
#define _PWG_MEDIA_MM(p,l,a,x,y) {p, l, a, (int)(x * 100), (int)(y * 100)}
|
||||
#define _PWG_EPSILON 50 /* Matching tolerance */
|
||||
|
||||
|
||||
/*
|
||||
@@ -911,10 +913,11 @@ pwgMediaForSize(int width, /* I - Width in hundredths of millimeters */
|
||||
{
|
||||
/*
|
||||
* Adobe uses a size matching algorithm with an epsilon of 5 points, which
|
||||
* is just about 176/2540ths...
|
||||
* is just about 176/2540ths... But a lot of international media sizes are
|
||||
* very close so use 0.5mm (50/2540ths) as the maximum delta.
|
||||
*/
|
||||
|
||||
return (_pwgMediaNearSize(width, length, 176));
|
||||
return (_pwgMediaNearSize(width, length, _PWG_EPSILON));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Private image library definitions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1993-2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@@ -87,7 +87,6 @@ extern void _cupsRasterClearError(void) _CUPS_PRIVATE;
|
||||
extern const char *_cupsRasterColorSpaceString(cups_cspace_t cspace) _CUPS_PRIVATE;
|
||||
extern void _cupsRasterDelete(cups_raster_t *r) _CUPS_PRIVATE;
|
||||
extern const char *_cupsRasterErrorString(void) _CUPS_PRIVATE;
|
||||
extern int _cupsRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code) _CUPS_NONNULL(3) _CUPS_PRIVATE;
|
||||
extern int _cupsRasterInitPWGHeader(cups_page_header2_t *h, pwg_media_t *media, const char *type, int xdpi, int ydpi, const char *sides, const char *sheet_back) _CUPS_PRIVATE;
|
||||
extern cups_raster_t *_cupsRasterNew(cups_raster_iocb_t iocb, void *ctx, cups_mode_t mode) _CUPS_PRIVATE;
|
||||
extern unsigned _cupsRasterReadHeader(cups_raster_t *r) _CUPS_PRIVATE;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Raster file routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* This file is part of the CUPS Imaging library.
|
||||
@@ -32,6 +32,24 @@ typedef void (*_cups_copyfunc_t)(void *dst, const void *src, size_t bytes);
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static const char * const apple_media_types[] =
|
||||
{ /* media-type values for Apple Raster */
|
||||
"auto",
|
||||
"stationery",
|
||||
"transparency",
|
||||
"envelope",
|
||||
"cardstock",
|
||||
"labels",
|
||||
"stationery-letterhead",
|
||||
"disc",
|
||||
"photographic-matte",
|
||||
"photographic-satin",
|
||||
"photographic-semi-gloss",
|
||||
"photographic-glossy",
|
||||
"photographic-high-gloss",
|
||||
"other"
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char * const cups_modes[] =
|
||||
{ /* Open modes */
|
||||
@@ -638,7 +656,7 @@ _cupsRasterReadHeader(
|
||||
{
|
||||
CUPS_CSPACE_SW,
|
||||
CUPS_CSPACE_SRGB,
|
||||
CUPS_CSPACE_RGBW,
|
||||
CUPS_CSPACE_CIELab,
|
||||
CUPS_CSPACE_ADOBERGB,
|
||||
CUPS_CSPACE_W,
|
||||
CUPS_CSPACE_RGB,
|
||||
@@ -648,7 +666,7 @@ _cupsRasterReadHeader(
|
||||
{
|
||||
1,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
1,
|
||||
3,
|
||||
@@ -681,8 +699,21 @@ _cupsRasterReadHeader(
|
||||
r->header.cupsPageSize[1] = (float)(r->header.cupsHeight * 72.0 / r->header.HWResolution[1]);
|
||||
}
|
||||
|
||||
r->header.cupsInteger[0] = r->apple_page_count;
|
||||
r->header.cupsInteger[7] = 0xffffff;
|
||||
r->header.cupsInteger[CUPS_RASTER_PWG_TotalPageCount] = r->apple_page_count;
|
||||
r->header.cupsInteger[CUPS_RASTER_PWG_AlternatePrimary] = 0xffffff;
|
||||
r->header.cupsInteger[CUPS_RASTER_PWG_PrintQuality] = appleheader[3];
|
||||
|
||||
if (appleheader[2] >= 2)
|
||||
r->header.Duplex = 1;
|
||||
if (appleheader[2] == 2)
|
||||
r->header.Tumble = 1;
|
||||
|
||||
r->header.MediaPosition = appleheader[5];
|
||||
|
||||
if (appleheader[4] < (int)(sizeof(apple_media_types) / sizeof(apple_media_types[0])))
|
||||
strlcpy(r->header.MediaType, apple_media_types[appleheader[4]], sizeof(r->header.MediaType));
|
||||
else
|
||||
strlcpy(r->header.MediaType, "other", sizeof(r->header.MediaType));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1072,8 +1103,9 @@ _cupsRasterWriteHeader(
|
||||
* zeroed.
|
||||
*/
|
||||
|
||||
unsigned char appleheader[32]; /* Raw page header */
|
||||
unsigned height = r->header.cupsHeight * r->rowheight;
|
||||
int i; /* Looping var */
|
||||
unsigned char appleheader[32];/* Raw page header */
|
||||
unsigned height = r->header.cupsHeight * r->rowheight;
|
||||
/* Computed page height */
|
||||
|
||||
if (r->apple_page_count == 0xffffffffU)
|
||||
@@ -1101,11 +1133,14 @@ _cupsRasterWriteHeader(
|
||||
|
||||
appleheader[0] = (unsigned char)r->header.cupsBitsPerPixel;
|
||||
appleheader[1] = r->header.cupsColorSpace == CUPS_CSPACE_SRGB ? 1 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_RGBW ? 2 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_CIELab ? 2 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_ADOBERGB ? 3 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_W ? 4 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_RGB ? 5 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_CMYK ? 6 : 0;
|
||||
appleheader[2] = r->header.Duplex ? (r->header.Tumble ? 2 : 3) : 1;
|
||||
appleheader[3] = (unsigned char)(r->header.cupsInteger[CUPS_RASTER_PWG_PrintQuality]);
|
||||
appleheader[5] = (unsigned char)(r->header.MediaPosition);
|
||||
appleheader[12] = (unsigned char)(r->header.cupsWidth >> 24);
|
||||
appleheader[13] = (unsigned char)(r->header.cupsWidth >> 16);
|
||||
appleheader[14] = (unsigned char)(r->header.cupsWidth >> 8);
|
||||
@@ -1119,6 +1154,15 @@ _cupsRasterWriteHeader(
|
||||
appleheader[22] = (unsigned char)(r->header.HWResolution[0] >> 8);
|
||||
appleheader[23] = (unsigned char)(r->header.HWResolution[0]);
|
||||
|
||||
for (i = 0; i < (int)(sizeof(apple_media_types) / sizeof(apple_media_types[0])); i ++)
|
||||
{
|
||||
if (!strcmp(r->header.MediaType, apple_media_types[i]))
|
||||
{
|
||||
appleheader[4] = (unsigned char)i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (cups_raster_io(r, appleheader, sizeof(appleheader)) == sizeof(appleheader));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Side-channel API code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -589,8 +590,8 @@ cupsSideChannelWrite(
|
||||
if ((buffer = _cupsBufferGet((size_t)datalen + 4)) == NULL)
|
||||
return (-1);
|
||||
|
||||
buffer[0] = command;
|
||||
buffer[1] = status;
|
||||
buffer[0] = (char)command;
|
||||
buffer[1] = (char)status;
|
||||
buffer[2] = (char)(datalen >> 8);
|
||||
buffer[3] = (char)(datalen & 255);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Side-channel API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
*/
|
||||
@@ -15,6 +15,13 @@
|
||||
*/
|
||||
|
||||
# include "versioning.h"
|
||||
# include <sys/types.h>
|
||||
# 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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -107,6 +114,13 @@ typedef void (*cups_sc_walk_func_t)(const char *oid, const char *data,
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
/**** 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;
|
||||
|
||||
/**** New in CUPS 1.3/macOS 10.5 ****/
|
||||
extern cups_sc_status_t cupsSideChannelDoRequest(cups_sc_command_t command,
|
||||
char *data, int *datalen,
|
||||
double timeout) _CUPS_API_1_3;
|
||||
@@ -119,7 +133,7 @@ extern int cupsSideChannelWrite(cups_sc_command_t command,
|
||||
const char *data, int datalen,
|
||||
double timeout) _CUPS_API_1_3;
|
||||
|
||||
/**** New in CUPS 1.4 ****/
|
||||
/**** New in CUPS 1.4/macOS 10.6 ****/
|
||||
extern cups_sc_status_t cupsSideChannelSNMPGet(const char *oid, char *data,
|
||||
int *datalen, double timeout)
|
||||
_CUPS_API_1_4;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* SNMP functions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2014 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@@ -1167,7 +1167,7 @@ asn1_encode_snmp(unsigned char *buffer, /* I - Buffer */
|
||||
memcpy(bufptr, packet->community, commlen);
|
||||
bufptr += commlen;
|
||||
|
||||
*bufptr++ = packet->request_type; /* Get-Request-PDU/Get-Next-Request-PDU */
|
||||
*bufptr++ = (unsigned char)packet->request_type; /* Get-Request-PDU/Get-Next-Request-PDU */
|
||||
asn1_set_length(&bufptr, reqlen);
|
||||
|
||||
asn1_set_integer(&bufptr, (int)packet->request_id);
|
||||
@@ -1233,6 +1233,9 @@ asn1_get_integer(
|
||||
int value; /* Integer value */
|
||||
|
||||
|
||||
if (*buffer >= bufend)
|
||||
return (0);
|
||||
|
||||
if (length > sizeof(int))
|
||||
{
|
||||
(*buffer) += length;
|
||||
@@ -1259,6 +1262,9 @@ asn1_get_length(unsigned char **buffer, /* IO - Pointer in buffer */
|
||||
unsigned length; /* Length */
|
||||
|
||||
|
||||
if (*buffer >= bufend)
|
||||
return (0);
|
||||
|
||||
length = **buffer;
|
||||
(*buffer) ++;
|
||||
|
||||
@@ -1301,6 +1307,9 @@ asn1_get_oid(
|
||||
int number; /* OID number */
|
||||
|
||||
|
||||
if (*buffer >= bufend)
|
||||
return (0);
|
||||
|
||||
valend = *buffer + length;
|
||||
oidptr = oid;
|
||||
oidend = oid + oidsize - 1;
|
||||
@@ -1349,9 +1358,12 @@ asn1_get_packed(
|
||||
int value; /* Value */
|
||||
|
||||
|
||||
if (*buffer >= bufend)
|
||||
return (0);
|
||||
|
||||
value = 0;
|
||||
|
||||
while ((**buffer & 128) && *buffer < bufend)
|
||||
while (*buffer < bufend && (**buffer & 128))
|
||||
{
|
||||
value = (value << 7) | (**buffer & 127);
|
||||
(*buffer) ++;
|
||||
@@ -1379,6 +1391,9 @@ asn1_get_string(
|
||||
char *string, /* I - String buffer */
|
||||
size_t strsize) /* I - String buffer size */
|
||||
{
|
||||
if (*buffer >= bufend)
|
||||
return (NULL);
|
||||
|
||||
if (length > (unsigned)(bufend - *buffer))
|
||||
length = (unsigned)(bufend - *buffer);
|
||||
|
||||
@@ -1421,6 +1436,9 @@ asn1_get_type(unsigned char **buffer, /* IO - Pointer in buffer */
|
||||
int type; /* Type */
|
||||
|
||||
|
||||
if (*buffer >= bufend)
|
||||
return (0);
|
||||
|
||||
type = **buffer;
|
||||
(*buffer) ++;
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* snprintf functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -171,7 +172,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
break;
|
||||
|
||||
sprintf(temp, tformat, va_arg(ap, double));
|
||||
templen = strlen(temp):
|
||||
templen = strlen(temp);
|
||||
|
||||
bytes += (int)templen;
|
||||
|
||||
@@ -202,7 +203,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
break;
|
||||
|
||||
sprintf(temp, tformat, va_arg(ap, int));
|
||||
templen = strlen(temp):
|
||||
templen = strlen(temp);
|
||||
|
||||
bytes += (int)templen;
|
||||
|
||||
@@ -226,7 +227,7 @@ _cups_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
break;
|
||||
|
||||
sprintf(temp, tformat, va_arg(ap, void *));
|
||||
templen = strlen(temp):
|
||||
templen = strlen(temp);
|
||||
|
||||
bytes += (int)templen;
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* String functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -145,7 +146,7 @@ _cupsStrDate(char *buf, /* I - Buffer */
|
||||
size_t bufsize, /* I - Size of buffer */
|
||||
time_t timeval) /* I - Time value */
|
||||
{
|
||||
struct tm *dateval; /* Local date/time */
|
||||
struct tm date; /* Local date/time */
|
||||
char temp[1024]; /* Temporary buffer */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
|
||||
|
||||
@@ -153,15 +154,15 @@ _cupsStrDate(char *buf, /* I - Buffer */
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
dateval = localtime(&timeval);
|
||||
localtime_r(&timeval, &date);
|
||||
|
||||
if (cg->lang_default->encoding != CUPS_UTF8)
|
||||
{
|
||||
strftime(temp, sizeof(temp), "%c", dateval);
|
||||
strftime(temp, sizeof(temp), "%c", &date);
|
||||
cupsCharsetToUTF8((cups_utf8_t *)buf, temp, (int)bufsize, cg->lang_default->encoding);
|
||||
}
|
||||
else
|
||||
strftime(buf, bufsize, "%c", dateval);
|
||||
strftime(buf, bufsize, "%c", &date);
|
||||
|
||||
return (buf);
|
||||
}
|
||||
@@ -311,15 +312,6 @@ _cupsStrFree(const char *s) /* I - String to free */
|
||||
|
||||
key = (_cups_sp_item_t *)(s - offsetof(_cups_sp_item_t, str));
|
||||
|
||||
#ifdef DEBUG_GUARDS
|
||||
if (key->guard != _CUPS_STR_GUARD)
|
||||
{
|
||||
DEBUG_printf(("5_cupsStrFree: Freeing string %p(%s), guard=%08x, "
|
||||
"ref_count=%d", key, key->str, key->guard, key->ref_count));
|
||||
abort();
|
||||
}
|
||||
#endif /* DEBUG_GUARDS */
|
||||
|
||||
if ((item = (_cups_sp_item_t *)cupsArrayFind(stringpool, key)) != NULL &&
|
||||
item == key)
|
||||
{
|
||||
@@ -327,6 +319,14 @@ _cupsStrFree(const char *s) /* I - String to free */
|
||||
* Found it, dereference...
|
||||
*/
|
||||
|
||||
#ifdef DEBUG_GUARDS
|
||||
if (key->guard != _CUPS_STR_GUARD)
|
||||
{
|
||||
DEBUG_printf(("5_cupsStrFree: Freeing string %p(%s), guard=%08x, ref_count=%d", key, key->str, key->guard, key->ref_count));
|
||||
abort();
|
||||
}
|
||||
#endif /* DEBUG_GUARDS */
|
||||
|
||||
item->ref_count --;
|
||||
|
||||
if (!item->ref_count)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Simulated client test program for CUPS.
|
||||
*
|
||||
* Copyright © 2017-2018 by Apple Inc.
|
||||
* Copyright © 2017-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@@ -688,7 +688,7 @@ monitor_printer(
|
||||
|
||||
if (printer_state != data->printer_state || strcmp(printer_state_reasons, data->printer_state_reasons))
|
||||
{
|
||||
printf("PRINTER: %s (%s)\n", ippEnumString("printer-state", printer_state), printer_state_reasons);
|
||||
printf("PRINTER: %s (%s)\n", ippEnumString("printer-state", (int)printer_state), printer_state_reasons);
|
||||
|
||||
data->printer_state = printer_state;
|
||||
strlcpy(data->printer_state_reasons, printer_state_reasons, sizeof(data->printer_state_reasons));
|
||||
@@ -718,7 +718,7 @@ monitor_printer(
|
||||
|
||||
if (job_state != data->job_state || strcmp(job_state_reasons, data->job_state_reasons))
|
||||
{
|
||||
printf("JOB %d: %s (%s)\n", data->job_id, ippEnumString("job-state", job_state), job_state_reasons);
|
||||
printf("JOB %d: %s (%s)\n", data->job_id, ippEnumString("job-state", (int)job_state), job_state_reasons);
|
||||
|
||||
data->job_state = job_state;
|
||||
strlcpy(data->job_state_reasons, job_state_reasons, sizeof(data->job_state_reasons));
|
||||
@@ -1049,6 +1049,7 @@ usage(void)
|
||||
{
|
||||
puts("Usage: ./testclient printer-uri [options]");
|
||||
puts("Options:");
|
||||
puts(" -c num-clients Simulate multiple clients");
|
||||
puts(" -d document-format Generate the specified format");
|
||||
puts(" -f print-file Print the named file");
|
||||
puts(" -g Force grayscale printing");
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* IPP test program for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -44,7 +45,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
@@ -74,7 +75,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
|
||||
0x00, 0x00, /* No value */
|
||||
@@ -83,11 +84,11 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@@ -96,7 +97,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x54, 0x56,
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@@ -105,7 +106,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x6d, 0x24,
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
@@ -126,12 +127,12 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'p', 'l', 'a', 'i', 'n',
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
@@ -139,11 +140,11 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@@ -152,7 +153,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x52, 0x08,
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@@ -161,7 +162,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x74, 0x04,
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
@@ -182,7 +183,72 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x06, /* Value length + value */
|
||||
'g', 'l', 'o', 's', 's', 'y',
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_END /* end tag */
|
||||
};
|
||||
static ipp_uchar_t bad_collection[] = /* Collection buffer (bad encoding) */
|
||||
{
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
IPP_TAG_CHARSET,
|
||||
0x00, 0x12, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'c','h','a','r','s','e','t',
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'u','t','f','-','8',
|
||||
|
||||
IPP_TAG_LANGUAGE,
|
||||
0x00, 0x1b, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'n','a','t','u','r','a','l','-','l','a','n',
|
||||
'g','u','a','g','e',
|
||||
0x00, 0x02, /* Value length + value */
|
||||
'e','n',
|
||||
|
||||
IPP_TAG_URI,
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'p','r','i','n','t','e','r','-','u','r','i',
|
||||
0x00, 0x1c, /* Value length + value */
|
||||
'i','p','p',':','/','/','l','o','c','a','l',
|
||||
'h','o','s','t','/','p','r','i','n','t','e',
|
||||
'r','s','/','f','o','o',
|
||||
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x0a, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x54, 0x56,
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x6d, 0x24,
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
@@ -194,7 +260,7 @@ static ipp_uchar_t mixed[] = /* Mixed value buffer */
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
@@ -223,6 +289,7 @@ static ipp_uchar_t mixed[] = /* Mixed value buffer */
|
||||
void hex_dump(const char *title, ipp_uchar_t *buffer, size_t bytes);
|
||||
void print_attributes(ipp_t *ipp, int indent);
|
||||
ssize_t read_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t read_hex(cups_file_t *fp, ipp_uchar_t *buffer, size_t bytes);
|
||||
int token_cb(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *token);
|
||||
ssize_t write_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
|
||||
@@ -584,12 +651,33 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
/*
|
||||
* Read the bad collection data and confirm we get an error...
|
||||
*/
|
||||
|
||||
fputs("Read Bad Collection from Memory: ", stdout);
|
||||
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
data.wused = sizeof(bad_collection);
|
||||
data.wsize = sizeof(bad_collection);
|
||||
data.wbuffer = bad_collection;
|
||||
|
||||
while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL, request)) != IPP_STATE_DATA)
|
||||
if (state == IPP_STATE_ERROR)
|
||||
break;
|
||||
|
||||
if (state != IPP_STATE_ERROR)
|
||||
puts("FAIL (read successful)");
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
/*
|
||||
* Read the mixed data and confirm we converted everything to rangeOfInteger
|
||||
* values...
|
||||
*/
|
||||
|
||||
printf("Read Mixed integer/rangeOfInteger from Memory: ");
|
||||
fputs("Read Mixed integer/rangeOfInteger from Memory: ", stdout);
|
||||
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
@@ -719,6 +807,33 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
request = _ippFileParse(&v, argv[i], NULL);
|
||||
_ippVarsDeinit(&v);
|
||||
}
|
||||
else if (strlen(argv[i]) > 4 && !strcmp(argv[i] + strlen(argv[i]) - 4, ".hex"))
|
||||
{
|
||||
/*
|
||||
* Read a hex-encoded IPP message...
|
||||
*/
|
||||
|
||||
if ((fp = cupsFileOpen(argv[i], "r")) == NULL)
|
||||
{
|
||||
printf("Unable to open \"%s\" - %s\n", argv[i], strerror(errno));
|
||||
status = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
request = ippNew();
|
||||
while ((state = ippReadIO(fp, (ipp_iocb_t)read_hex, 1, NULL, request)) == IPP_STATE_ATTRIBUTE);
|
||||
|
||||
if (state != IPP_STATE_DATA)
|
||||
{
|
||||
printf("Error reading IPP message from \"%s\": %s\n", argv[i], cupsLastErrorString());
|
||||
status = 1;
|
||||
|
||||
ippDelete(request);
|
||||
request = NULL;
|
||||
}
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -886,6 +1001,48 @@ read_cb(_ippdata_t *data, /* I - Data */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'read_hex()' - Read a hex dump of an IPP request.
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes read */
|
||||
read_hex(cups_file_t *fp, /* I - File to read from */
|
||||
ipp_uchar_t *buffer, /* I - Buffer to read */
|
||||
size_t bytes) /* I - Number of bytes to read */
|
||||
{
|
||||
size_t total = 0; /* Total bytes read */
|
||||
static char hex[256] = ""; /* Line from file */
|
||||
static char *hexptr = NULL; /* Pointer in line */
|
||||
|
||||
|
||||
while (total < bytes)
|
||||
{
|
||||
if (!hexptr || (isspace(hexptr[0] & 255) && isspace(hexptr[1] & 255)))
|
||||
{
|
||||
if (!cupsFileGets(fp, hex, sizeof(hex)))
|
||||
break;
|
||||
|
||||
hexptr = hex;
|
||||
while (isxdigit(*hexptr & 255))
|
||||
hexptr ++;
|
||||
while (isspace(*hexptr & 255))
|
||||
hexptr ++;
|
||||
|
||||
if (!isxdigit(*hexptr & 255))
|
||||
{
|
||||
hexptr = NULL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
*buffer++ = (ipp_uchar_t)strtol(hexptr, &hexptr, 16);
|
||||
total ++;
|
||||
}
|
||||
|
||||
return (total == 0 ? -1 : (ssize_t)total);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'token_cb()' - Token callback for ASCII IPP data file parser.
|
||||
*/
|
||||
|
||||
@@ -1245,6 +1245,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
printf(" %s(%s): PPD_CUSTOM_UNKNOWN (error)\n", cparam->name, cparam->text);
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
printf(" %s(%s): PPD_CUSTOM_CURVE (%g to %g)\n",
|
||||
cparam->name, cparam->text,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Raster test program 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
|
||||
@@ -22,8 +22,7 @@
|
||||
|
||||
static int do_ras_file(const char *filename);
|
||||
static int do_raster_tests(cups_mode_t mode);
|
||||
static void print_changes(cups_page_header2_t *header,
|
||||
cups_page_header2_t *expected);
|
||||
static void print_changes(cups_page_header2_t *header, cups_page_header2_t *expected);
|
||||
|
||||
|
||||
/*
|
||||
@@ -174,6 +173,8 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
|
||||
header.cupsPageSize[0] = 288.0f;
|
||||
header.cupsPageSize[1] = 288.0f;
|
||||
|
||||
strlcpy(header.MediaType, "auto", sizeof(header.MediaType));
|
||||
|
||||
if (page & 1)
|
||||
{
|
||||
header.cupsBytesPerLine *= 4;
|
||||
@@ -308,6 +309,8 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
|
||||
expected.PageSize[0] = 288;
|
||||
expected.PageSize[1] = 288;
|
||||
|
||||
strlcpy(expected.MediaType, "auto", sizeof(expected.MediaType));
|
||||
|
||||
if (mode != CUPS_RASTER_WRITE_PWG)
|
||||
{
|
||||
expected.cupsPageSize[0] = 288.0f;
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
/*
|
||||
* Threaded test program for CUPS.
|
||||
*
|
||||
* Copyright © 2012-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/thread-private.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int enum_dests_cb(void *_name, unsigned flags, cups_dest_t *dest);
|
||||
static void *run_query(cups_dest_t *dest);
|
||||
static void show_supported(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, const char *option, const char *value);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
/*
|
||||
* Go through all the available destinations to find the requested one...
|
||||
*/
|
||||
|
||||
(void)argc;
|
||||
|
||||
cupsEnumDests(CUPS_DEST_FLAGS_NONE, -1, NULL, 0, 0, enum_dests_cb, argv[1]);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'enum_dests_cb()' - Destination enumeration function...
|
||||
*/
|
||||
|
||||
static int /* O - 1 to continue, 0 to stop */
|
||||
enum_dests_cb(void *_name, /* I - Printer name, if any */
|
||||
unsigned flags, /* I - Enumeration flags */
|
||||
cups_dest_t *dest) /* I - Found destination */
|
||||
{
|
||||
const char *name = (const char *)_name;
|
||||
/* Printer name */
|
||||
cups_dest_t *cdest; /* Copied destination */
|
||||
|
||||
|
||||
(void)flags;
|
||||
|
||||
/*
|
||||
* If a name was specified, compare it...
|
||||
*/
|
||||
|
||||
if (name && strcasecmp(name, dest->name))
|
||||
return (1); /* Continue */
|
||||
|
||||
/*
|
||||
* Copy the destination and run the query on a separate thread...
|
||||
*/
|
||||
|
||||
cupsCopyDest(dest, 0, &cdest);
|
||||
_cupsThreadWait(_cupsThreadCreate((_cups_thread_func_t)run_query, cdest));
|
||||
|
||||
cupsFreeDests(1, cdest);
|
||||
|
||||
/*
|
||||
* Continue if no name was specified or the name matches...
|
||||
*/
|
||||
|
||||
return (!name || !strcasecmp(name, dest->name));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'run_query()' - Query printer capabilities on a separate thread.
|
||||
*/
|
||||
|
||||
static void * /* O - Return value (not used) */
|
||||
run_query(cups_dest_t *dest) /* I - Destination to query */
|
||||
{
|
||||
http_t *http; /* Connection to destination */
|
||||
cups_dinfo_t *dinfo; /* Destination info */
|
||||
unsigned dflags = CUPS_DEST_FLAGS_NONE;
|
||||
/* Destination flags */
|
||||
|
||||
|
||||
if ((http = cupsConnectDest(dest, dflags, 300, NULL, NULL, 0, NULL, NULL)) == NULL)
|
||||
{
|
||||
printf("testthreads: Unable to connect to destination \"%s\": %s\n", dest->name, cupsLastErrorString());
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((dinfo = cupsCopyDestInfo(http, dest)) == NULL)
|
||||
{
|
||||
printf("testdest: Unable to get information for destination \"%s\": %s\n", dest->name, cupsLastErrorString());
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
printf("\n%s:\n", dest->name);
|
||||
|
||||
show_supported(http, dest, dinfo, NULL, NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 'show_supported()' - Show supported options, values, etc.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_supported(http_t *http, /* I - Connection to destination */
|
||||
cups_dest_t *dest, /* I - Destination */
|
||||
cups_dinfo_t *dinfo, /* I - Destination information */
|
||||
const char *option, /* I - Option, if any */
|
||||
const char *value) /* I - Value, if any */
|
||||
{
|
||||
ipp_attribute_t *attr; /* Attribute */
|
||||
int i, /* Looping var */
|
||||
count; /* Number of values */
|
||||
|
||||
|
||||
if (!option)
|
||||
{
|
||||
attr = cupsFindDestSupported(http, dest, dinfo, "job-creation-attributes");
|
||||
if (attr)
|
||||
{
|
||||
count = ippGetCount(attr);
|
||||
for (i = 0; i < count; i ++)
|
||||
show_supported(http, dest, dinfo, ippGetString(attr, i, NULL), NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
static const char * const options[] =
|
||||
{ /* List of standard options */
|
||||
CUPS_COPIES,
|
||||
CUPS_FINISHINGS,
|
||||
CUPS_MEDIA,
|
||||
CUPS_NUMBER_UP,
|
||||
CUPS_ORIENTATION,
|
||||
CUPS_PRINT_COLOR_MODE,
|
||||
CUPS_PRINT_QUALITY,
|
||||
CUPS_SIDES
|
||||
};
|
||||
|
||||
puts(" No job-creation-attributes-supported attribute, probing instead.");
|
||||
|
||||
for (i = 0; i < (int)(sizeof(options) / sizeof(options[0])); i ++)
|
||||
if (cupsCheckDestSupported(http, dest, dinfo, options[i], NULL))
|
||||
show_supported(http, dest, dinfo, options[i], NULL);
|
||||
}
|
||||
}
|
||||
else if (!value)
|
||||
{
|
||||
printf(" %s (%s - %s)\n", option, cupsLocalizeDestOption(http, dest, dinfo, option), cupsCheckDestSupported(http, dest, dinfo, option, NULL) ? "supported" : "not-supported");
|
||||
|
||||
if ((attr = cupsFindDestSupported(http, dest, dinfo, option)) != NULL)
|
||||
{
|
||||
count = ippGetCount(attr);
|
||||
|
||||
switch (ippGetValueTag(attr))
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %d\n", ippGetInteger(attr, i));
|
||||
break;
|
||||
|
||||
case IPP_TAG_ENUM :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int val = ippGetInteger(attr, i);
|
||||
char valstr[256];
|
||||
|
||||
snprintf(valstr, sizeof(valstr), "%d", val);
|
||||
printf(" %s (%s)\n", ippEnumString(option, ippGetInteger(attr, i)), cupsLocalizeDestValue(http, dest, dinfo, option, valstr));
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int upper, lower = ippGetRange(attr, i, &upper);
|
||||
|
||||
printf(" %d-%d\n", lower, upper);
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int xres, yres;
|
||||
ipp_res_t units;
|
||||
xres = ippGetResolution(attr, i, &yres, &units);
|
||||
|
||||
if (xres == yres)
|
||||
printf(" %d%s\n", xres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
else
|
||||
printf(" %dx%d%s\n", xres, yres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_KEYWORD :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %s (%s)\n", ippGetString(attr, i, NULL), cupsLocalizeDestValue(http, dest, dinfo, option, ippGetString(attr, i, NULL)));
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXTLANG :
|
||||
case IPP_TAG_NAMELANG :
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %s\n", ippGetString(attr, i, NULL));
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int j, len;
|
||||
unsigned char *data = ippGetOctetString(attr, i, &len);
|
||||
|
||||
fputs(" ", stdout);
|
||||
for (j = 0; j < len; j ++)
|
||||
{
|
||||
if (data[j] < ' ' || data[j] >= 0x7f)
|
||||
printf("<%02X>", data[j]);
|
||||
else
|
||||
putchar(data[j]);
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
break;
|
||||
|
||||
default :
|
||||
printf(" %s\n", ippTagString(ippGetValueTag(attr)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (cupsCheckDestSupported(http, dest, dinfo, option, value))
|
||||
puts("YES");
|
||||
else
|
||||
puts("NO");
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* TLS support code for CUPS on macOS.
|
||||
*
|
||||
* 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 information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/**** This file is included from tls.c ****/
|
||||
@@ -14,52 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <spawn.h>
|
||||
|
||||
extern char **environ;
|
||||
|
||||
|
||||
#ifdef HAVE_SECURETRANSPORTPRIV_H
|
||||
# include <Security/SecureTransportPriv.h>
|
||||
#endif /* HAVE_SECURETRANSPORTPRIV_H */
|
||||
#ifdef HAVE_SECBASEPRIV_H
|
||||
# include <Security/SecBasePriv.h>
|
||||
#endif /* HAVE_SECBASEPRIV_H */
|
||||
#ifdef HAVE_SECCERTIFICATEPRIV_H
|
||||
# include <Security/SecCertificatePriv.h>
|
||||
#else
|
||||
# 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);
|
||||
#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 */
|
||||
|
||||
#include "tls-darwin.h"
|
||||
|
||||
/*
|
||||
* Constants, very secure stuff...
|
||||
@@ -77,7 +33,7 @@ static int tls_auto_create = 0;
|
||||
/* Auto-create self-signed certs? */
|
||||
static char *tls_common_name = NULL;
|
||||
/* Default common name */
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
static int tls_cups_keychain = 0;
|
||||
/* Opened the CUPS keychain? */
|
||||
static SecKeychainRef tls_keychain = NULL;
|
||||
@@ -85,7 +41,7 @@ static SecKeychainRef tls_keychain = NULL;
|
||||
#else
|
||||
static SecIdentityRef tls_selfsigned = NULL;
|
||||
/* Temporary self-signed cert */
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
static char *tls_keypath = NULL;
|
||||
/* Server cert keychain path */
|
||||
static _cups_mutex_t tls_mutex = _CUPS_MUTEX_INITIALIZER;
|
||||
@@ -101,11 +57,11 @@ static int tls_options = -1,/* Options for TLS connections */
|
||||
|
||||
static CFArrayRef http_cdsa_copy_server(const char *common_name);
|
||||
static SecCertificateRef http_cdsa_create_credential(http_credential_t *credential);
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
static const char *http_cdsa_default_path(char *buffer, size_t bufsize);
|
||||
static SecKeychainRef http_cdsa_open_keychain(const char *path, char *filename, size_t filesize);
|
||||
static SecKeychainRef http_cdsa_open_system_keychain(void);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
static OSStatus http_cdsa_read(SSLConnectionRef connection, void *data, size_t *dataLength);
|
||||
static int http_cdsa_set_credentials(http_t *http);
|
||||
static OSStatus http_cdsa_write(SSLConnectionRef connection, const void *data, size_t *dataLength);
|
||||
@@ -125,7 +81,107 @@ cupsMakeServerCredentials(
|
||||
const char **alt_names, /* I - Subject Alternate Names */
|
||||
time_t expiration_date) /* I - Expiration date */
|
||||
{
|
||||
#if defined(HAVE_SECGENERATESELFSIGNEDCERTIFICATE)
|
||||
#if TARGET_OS_OSX
|
||||
int pid, /* Process ID of command */
|
||||
status, /* Status of command */
|
||||
i; /* Looping var */
|
||||
char command[1024], /* Command */
|
||||
*argv[5], /* Command-line arguments */
|
||||
*envp[1000], /* Environment variables */
|
||||
days[32], /* CERTTOOL_EXPIRATION_DAYS env var */
|
||||
keychain[1024], /* Keychain argument */
|
||||
infofile[1024], /* Type-in information for cert */
|
||||
filename[1024]; /* Default keychain path */
|
||||
cups_file_t *fp; /* Seed/info file */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsMakeServerCredentials(path=\"%s\", common_name=\"%s\", num_alt_names=%d, alt_names=%p, expiration_date=%d)", path, common_name, num_alt_names, (void *)alt_names, (int)expiration_date));
|
||||
|
||||
(void)num_alt_names;
|
||||
(void)alt_names;
|
||||
|
||||
if (!path)
|
||||
path = http_cdsa_default_path(filename, sizeof(filename));
|
||||
|
||||
/*
|
||||
* Run the "certtool" command to generate a self-signed certificate...
|
||||
*/
|
||||
|
||||
if (!cupsFileFind("certtool", getenv("PATH"), 1, command, sizeof(command)))
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Create a file with the certificate information fields...
|
||||
*
|
||||
* Note: This assumes that the default questions are asked by the certtool
|
||||
* command...
|
||||
*/
|
||||
|
||||
if ((fp = cupsTempFile2(infofile, sizeof(infofile))) == NULL)
|
||||
return (-1);
|
||||
|
||||
cupsFilePrintf(fp,
|
||||
"CUPS Self-Signed Certificate\n"
|
||||
/* Enter key and certificate label */
|
||||
"r\n" /* Generate RSA key pair */
|
||||
"2048\n" /* 2048 bit encryption key */
|
||||
"y\n" /* OK (y = yes) */
|
||||
"b\n" /* Usage (b=signing/encryption) */
|
||||
"2\n" /* Sign with SHA256 */
|
||||
"y\n" /* OK (y = yes) */
|
||||
"%s\n" /* Common name */
|
||||
"\n" /* Country (default) */
|
||||
"\n" /* Organization (default) */
|
||||
"\n" /* Organizational unit (default) */
|
||||
"\n" /* State/Province (default) */
|
||||
"\n" /* Email address */
|
||||
"y\n", /* OK (y = yes) */
|
||||
common_name);
|
||||
cupsFileClose(fp);
|
||||
|
||||
snprintf(keychain, sizeof(keychain), "k=%s", path);
|
||||
|
||||
argv[0] = "certtool";
|
||||
argv[1] = "c";
|
||||
argv[2] = keychain;
|
||||
argv[3] = NULL;
|
||||
|
||||
snprintf(days, sizeof(days), "CERTTOOL_EXPIRATION_DAYS=%d", (int)((expiration_date - time(NULL) + 86399) / 86400));
|
||||
envp[0] = days;
|
||||
for (i = 0; i < (int)(sizeof(envp) / sizeof(envp[0]) - 2) && environ[i]; i ++)
|
||||
envp[i + 1] = environ[i];
|
||||
envp[i] = NULL;
|
||||
|
||||
posix_spawn_file_actions_t actions; /* File actions */
|
||||
|
||||
posix_spawn_file_actions_init(&actions);
|
||||
posix_spawn_file_actions_addclose(&actions, 0);
|
||||
posix_spawn_file_actions_addopen(&actions, 0, infofile, O_RDONLY, 0);
|
||||
posix_spawn_file_actions_addclose(&actions, 1);
|
||||
posix_spawn_file_actions_addopen(&actions, 1, "/dev/null", O_WRONLY, 0);
|
||||
posix_spawn_file_actions_addclose(&actions, 2);
|
||||
posix_spawn_file_actions_addopen(&actions, 2, "/dev/null", O_WRONLY, 0);
|
||||
|
||||
if (posix_spawn(&pid, command, &actions, NULL, argv, envp))
|
||||
{
|
||||
unlink(infofile);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
posix_spawn_file_actions_destroy(&actions);
|
||||
|
||||
unlink(infofile);
|
||||
|
||||
while (waitpid(pid, &status, 0) < 0)
|
||||
if (errno != EINTR)
|
||||
{
|
||||
status = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return (!status);
|
||||
|
||||
#else
|
||||
int status = 0; /* Return status */
|
||||
OSStatus err; /* Error code (if any) */
|
||||
CFStringRef cfcommon_name = NULL;
|
||||
@@ -283,107 +339,7 @@ cleanup:
|
||||
DEBUG_printf(("1cupsMakeServerCredentials: Returning %d.", status));
|
||||
|
||||
return (status);
|
||||
|
||||
#else /* !HAVE_SECGENERATESELFSIGNEDCERTIFICATE */
|
||||
int pid, /* Process ID of command */
|
||||
status, /* Status of command */
|
||||
i; /* Looping var */
|
||||
char command[1024], /* Command */
|
||||
*argv[5], /* Command-line arguments */
|
||||
*envp[1000], /* Environment variables */
|
||||
days[32], /* CERTTOOL_EXPIRATION_DAYS env var */
|
||||
keychain[1024], /* Keychain argument */
|
||||
infofile[1024], /* Type-in information for cert */
|
||||
filename[1024]; /* Default keychain path */
|
||||
cups_file_t *fp; /* Seed/info file */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsMakeServerCredentials(path=\"%s\", common_name=\"%s\", num_alt_names=%d, alt_names=%p, expiration_date=%d)", path, common_name, num_alt_names, (void *)alt_names, (int)expiration_date));
|
||||
|
||||
(void)num_alt_names;
|
||||
(void)alt_names;
|
||||
|
||||
if (!path)
|
||||
path = http_cdsa_default_path(filename, sizeof(filename));
|
||||
|
||||
/*
|
||||
* Run the "certtool" command to generate a self-signed certificate...
|
||||
*/
|
||||
|
||||
if (!cupsFileFind("certtool", getenv("PATH"), 1, command, sizeof(command)))
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Create a file with the certificate information fields...
|
||||
*
|
||||
* Note: This assumes that the default questions are asked by the certtool
|
||||
* command...
|
||||
*/
|
||||
|
||||
if ((fp = cupsTempFile2(infofile, sizeof(infofile))) == NULL)
|
||||
return (-1);
|
||||
|
||||
cupsFilePrintf(fp,
|
||||
"CUPS Self-Signed Certificate\n"
|
||||
/* Enter key and certificate label */
|
||||
"r\n" /* Generate RSA key pair */
|
||||
"2048\n" /* 2048 bit encryption key */
|
||||
"y\n" /* OK (y = yes) */
|
||||
"b\n" /* Usage (b=signing/encryption) */
|
||||
"2\n" /* Sign with SHA256 */
|
||||
"y\n" /* OK (y = yes) */
|
||||
"%s\n" /* Common name */
|
||||
"\n" /* Country (default) */
|
||||
"\n" /* Organization (default) */
|
||||
"\n" /* Organizational unit (default) */
|
||||
"\n" /* State/Province (default) */
|
||||
"\n" /* Email address */
|
||||
"y\n", /* OK (y = yes) */
|
||||
common_name);
|
||||
cupsFileClose(fp);
|
||||
|
||||
snprintf(keychain, sizeof(keychain), "k=%s", path);
|
||||
|
||||
argv[0] = "certtool";
|
||||
argv[1] = "c";
|
||||
argv[2] = keychain;
|
||||
argv[3] = NULL;
|
||||
|
||||
snprintf(days, sizeof(days), "CERTTOOL_EXPIRATION_DAYS=%d", (int)((expiration_date - time(NULL) + 86399) / 86400));
|
||||
envp[0] = days;
|
||||
for (i = 0; i < (int)(sizeof(envp) / sizeof(envp[0]) - 2) && environ[i]; i ++)
|
||||
envp[i + 1] = environ[i];
|
||||
envp[i] = NULL;
|
||||
|
||||
posix_spawn_file_actions_t actions; /* File actions */
|
||||
|
||||
posix_spawn_file_actions_init(&actions);
|
||||
posix_spawn_file_actions_addclose(&actions, 0);
|
||||
posix_spawn_file_actions_addopen(&actions, 0, infofile, O_RDONLY, 0);
|
||||
posix_spawn_file_actions_addclose(&actions, 1);
|
||||
posix_spawn_file_actions_addopen(&actions, 1, "/dev/null", O_WRONLY, 0);
|
||||
posix_spawn_file_actions_addclose(&actions, 2);
|
||||
posix_spawn_file_actions_addopen(&actions, 2, "/dev/null", O_WRONLY, 0);
|
||||
|
||||
if (posix_spawn(&pid, command, &actions, NULL, argv, envp))
|
||||
{
|
||||
unlink(infofile);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
posix_spawn_file_actions_destroy(&actions);
|
||||
|
||||
unlink(infofile);
|
||||
|
||||
while (waitpid(pid, &status, 0) < 0)
|
||||
if (errno != EINTR)
|
||||
{
|
||||
status = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return (!status);
|
||||
#endif /* HAVE_SECGENERATESELFSIGNEDCERTIFICATE && HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
}
|
||||
|
||||
|
||||
@@ -404,7 +360,7 @@ cupsSetServerCredentials(
|
||||
{
|
||||
DEBUG_printf(("cupsSetServerCredentials(path=\"%s\", common_name=\"%s\", auto_create=%d)", path, common_name, auto_create));
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
char filename[1024]; /* Keychain filename */
|
||||
SecKeychainRef keychain = http_cdsa_open_keychain(path, filename, sizeof(filename));
|
||||
|
||||
@@ -454,7 +410,7 @@ cupsSetServerCredentials(
|
||||
tls_common_name = _cupsStrAlloc(common_name);
|
||||
|
||||
return (1);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
}
|
||||
|
||||
|
||||
@@ -849,8 +805,10 @@ httpCredentialsString(
|
||||
* issuer name is, um, "interesting"...
|
||||
*/
|
||||
|
||||
CFStringRef cf_string; /* CF string */
|
||||
# if TARGET_OS_OSX
|
||||
CFDictionaryRef cf_dict; /* Dictionary for certificate */
|
||||
# endif /* TARGET_OS_OSX */
|
||||
CFStringRef cf_string; /* CF string */
|
||||
char commonName[256],/* Common name associated with cert */
|
||||
issuer[256], /* Issuer name */
|
||||
sigalg[256]; /* Signature algorithm */
|
||||
@@ -870,6 +828,7 @@ httpCredentialsString(
|
||||
strlcpy(issuer, "unknown", sizeof(issuer));
|
||||
strlcpy(sigalg, "UnknownSignature", sizeof(sigalg));
|
||||
|
||||
# if TARGET_OS_OSX
|
||||
if ((cf_dict = SecCertificateCopyValues(secCert, NULL, NULL)) != NULL)
|
||||
{
|
||||
CFDictionaryRef cf_issuer = CFDictionaryGetValue(cf_dict, kSecOIDX509V1IssuerName);
|
||||
@@ -916,6 +875,7 @@ httpCredentialsString(
|
||||
|
||||
CFRelease(cf_dict);
|
||||
}
|
||||
# endif /* TARGET_OS_OSX */
|
||||
|
||||
expiration = (time_t)(SecCertificateNotValidAfter(secCert) + kCFAbsoluteTimeIntervalSince1970);
|
||||
|
||||
@@ -960,12 +920,12 @@ httpLoadCredentials(
|
||||
const char *common_name) /* I - Common name for credentials */
|
||||
{
|
||||
OSStatus err; /* Error info */
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
char filename[1024]; /* Filename for keychain */
|
||||
SecKeychainRef keychain = NULL,/* Keychain reference */
|
||||
syschain = NULL;/* System keychain */
|
||||
CFArrayRef list; /* Keychain list */
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
SecCertificateRef cert = NULL; /* Certificate */
|
||||
CFDataRef data; /* Certificate data */
|
||||
SecPolicyRef policy = NULL; /* Policy ref */
|
||||
@@ -981,7 +941,7 @@ httpLoadCredentials(
|
||||
|
||||
*credentials = NULL;
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
keychain = http_cdsa_open_keychain(path, filename, sizeof(filename));
|
||||
|
||||
if (!keychain)
|
||||
@@ -992,7 +952,7 @@ httpLoadCredentials(
|
||||
#else
|
||||
if (path)
|
||||
return (-1);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
|
||||
cfcommon_name = CFStringCreateWithCString(kCFAllocatorDefault, common_name, kCFStringEncodingUTF8);
|
||||
|
||||
@@ -1012,7 +972,7 @@ httpLoadCredentials(
|
||||
CFDictionaryAddValue(query, kSecReturnRef, kCFBooleanTrue);
|
||||
CFDictionaryAddValue(query, kSecMatchLimit, kSecMatchLimitOne);
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
if (syschain)
|
||||
{
|
||||
const void *values[2] = { syschain, keychain };
|
||||
@@ -1023,7 +983,7 @@ httpLoadCredentials(
|
||||
list = CFArrayCreate(kCFAllocatorDefault, (const void **)&keychain, 1, &kCFTypeArrayCallBacks);
|
||||
CFDictionaryAddValue(query, kSecMatchSearchList, list);
|
||||
CFRelease(list);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
|
||||
err = SecItemCopyMatching(query, (CFTypeRef *)&cert);
|
||||
|
||||
@@ -1044,13 +1004,13 @@ httpLoadCredentials(
|
||||
|
||||
cleanup :
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
if (keychain)
|
||||
CFRelease(keychain);
|
||||
|
||||
if (syschain)
|
||||
CFRelease(syschain);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
if (cert)
|
||||
CFRelease(cert);
|
||||
if (policy)
|
||||
@@ -1078,11 +1038,11 @@ httpSaveCredentials(
|
||||
{
|
||||
int ret = -1; /* Return value */
|
||||
OSStatus err; /* Error info */
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
char filename[1024]; /* Filename for keychain */
|
||||
SecKeychainRef keychain = NULL;/* Keychain reference */
|
||||
CFArrayRef list; /* Keychain list */
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
SecCertificateRef cert = NULL; /* Certificate */
|
||||
CFMutableDictionaryRef attrs = NULL; /* Attributes for add */
|
||||
|
||||
@@ -1103,7 +1063,7 @@ httpSaveCredentials(
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
keychain = http_cdsa_open_keychain(path, filename, sizeof(filename));
|
||||
|
||||
if (!keychain)
|
||||
@@ -1112,7 +1072,7 @@ httpSaveCredentials(
|
||||
#else
|
||||
if (path)
|
||||
return (-1);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
|
||||
if ((attrs = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)) == NULL)
|
||||
{
|
||||
@@ -1123,7 +1083,7 @@ httpSaveCredentials(
|
||||
CFDictionaryAddValue(attrs, kSecClass, kSecClassCertificate);
|
||||
CFDictionaryAddValue(attrs, kSecValueRef, cert);
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
if ((list = CFArrayCreate(kCFAllocatorDefault, (const void **)&keychain, 1, &kCFTypeArrayCallBacks)) == NULL)
|
||||
{
|
||||
DEBUG_puts("1httpSaveCredentials: Unable to create list of keychains.");
|
||||
@@ -1131,7 +1091,7 @@ httpSaveCredentials(
|
||||
}
|
||||
CFDictionaryAddValue(attrs, kSecMatchSearchList, list);
|
||||
CFRelease(list);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
|
||||
/* Note: SecItemAdd consumes "attrs"... */
|
||||
err = SecItemAdd(attrs, NULL);
|
||||
@@ -1139,10 +1099,10 @@ httpSaveCredentials(
|
||||
|
||||
cleanup :
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
if (keychain)
|
||||
CFRelease(keychain);
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
if (cert)
|
||||
CFRelease(cert);
|
||||
|
||||
@@ -1262,6 +1222,7 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
/* Pointer to library globals */
|
||||
OSStatus error; /* Error code */
|
||||
const char *message = NULL;/* Error message */
|
||||
char msgbuf[1024]; /* Error message buffer */
|
||||
cups_array_t *credentials; /* Credentials array */
|
||||
cups_array_t *names; /* CUPS distinguished names */
|
||||
CFArrayRef dn_array; /* CF distinguished names array */
|
||||
@@ -1280,7 +1241,7 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
DEBUG_printf(("4_httpTLSStart: tls_options=%x, tls_min_version=%d, tls_max_version=%d", tls_options, tls_min_version, tls_max_version));
|
||||
}
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
if (http->mode == _HTTP_MODE_SERVER && !tls_keychain)
|
||||
{
|
||||
DEBUG_puts("4_httpTLSStart: cupsSetServerCredentials not called.");
|
||||
@@ -1290,7 +1251,7 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
|
||||
return (-1);
|
||||
}
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
|
||||
if ((http->tls = SSLCreateContext(kCFAllocatorDefault, http->mode == _HTTP_MODE_CLIENT ? kSSLClientSide : kSSLServerSide, kSSLStreamType)) == NULL)
|
||||
{
|
||||
@@ -1342,7 +1303,6 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
}
|
||||
}
|
||||
|
||||
# if HAVE_SSLSETENABLEDCIPHERS
|
||||
if (!error)
|
||||
{
|
||||
SSLCipherSuite supported[100]; /* Supported cipher suites */
|
||||
@@ -1502,7 +1462,6 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
error = SSLSetEnabledCiphers(http->tls, enabled, num_enabled);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_SSLSETENABLEDCIPHERS */
|
||||
|
||||
if (!error && http->mode == _HTTP_MODE_CLIENT)
|
||||
{
|
||||
@@ -1802,11 +1761,13 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
if (!message)
|
||||
#ifdef HAVE_CSSMERRORSTRING
|
||||
message = cssmErrorString(error);
|
||||
#else
|
||||
message = _("Unable to establish a secure connection to host.");
|
||||
#endif /* HAVE_CSSMERRORSTRING */
|
||||
{
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
snprintf(msgbuf, sizeof(msgbuf), _cupsLangString(cg->lang_default, _("Unable to establish a secure connection to host (%d).")), error);
|
||||
message = msgbuf;
|
||||
}
|
||||
|
||||
_cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, message, 1);
|
||||
|
||||
@@ -1901,7 +1862,7 @@ static CFArrayRef /* O - Array of certificates or NULL */
|
||||
http_cdsa_copy_server(
|
||||
const char *common_name) /* I - Server's hostname */
|
||||
{
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
OSStatus err; /* Error info */
|
||||
SecIdentityRef identity = NULL;/* Identity */
|
||||
CFArrayRef certificates = NULL;
|
||||
@@ -1999,11 +1960,13 @@ http_cdsa_copy_server(
|
||||
return (certificates);
|
||||
#else
|
||||
|
||||
(void)common_name;
|
||||
|
||||
if (!tls_selfsigned)
|
||||
return (NULL);
|
||||
|
||||
return (CFArrayCreate(NULL, (const void **)&tls_selfsigned, 1, &kCFTypeArrayCallBacks));
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
}
|
||||
|
||||
|
||||
@@ -2015,14 +1978,22 @@ static SecCertificateRef /* O - Certificate */
|
||||
http_cdsa_create_credential(
|
||||
http_credential_t *credential) /* I - Credential */
|
||||
{
|
||||
SecCertificateRef cert; /* Certificate */
|
||||
CFDataRef data; /* Data object */
|
||||
|
||||
|
||||
if (!credential)
|
||||
return (NULL);
|
||||
|
||||
return (SecCertificateCreateWithBytes(kCFAllocatorDefault, credential->data, (CFIndex)credential->datalen));
|
||||
data = CFDataCreate(kCFAllocatorDefault, credential->data, (CFIndex)credential->datalen);
|
||||
cert = SecCertificateCreateWithData(kCFAllocatorDefault, data);
|
||||
CFRelease(data);
|
||||
|
||||
return (cert);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
#if TARGET_OS_OSX
|
||||
/*
|
||||
* 'http_cdsa_default_path()' - Get the default keychain path.
|
||||
*/
|
||||
@@ -2031,7 +2002,8 @@ static const char * /* O - Keychain path */
|
||||
http_cdsa_default_path(char *buffer, /* I - Path buffer */
|
||||
size_t bufsize) /* I - Size of buffer */
|
||||
{
|
||||
const char *home = getenv("HOME"); /* HOME environment variable */
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Pointer to library globals */
|
||||
|
||||
|
||||
/*
|
||||
@@ -2040,8 +2012,8 @@ http_cdsa_default_path(char *buffer, /* I - Path buffer */
|
||||
* 10.11.4 (!), so we need to create our own keychain just for CUPS.
|
||||
*/
|
||||
|
||||
if (getuid() && home)
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", home);
|
||||
if (cg->home)
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", cg->home);
|
||||
else
|
||||
strlcpy(buffer, "/etc/cups/ssl.keychain", bufsize);
|
||||
|
||||
@@ -2198,7 +2170,7 @@ http_cdsa_open_system_keychain(void)
|
||||
|
||||
return (keychain);
|
||||
}
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
#endif /* TARGET_OS_OSX */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* TLS support header for CUPS on macOS.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**** This file is included from tls-darwin.c ****/
|
||||
|
||||
extern char **environ;
|
||||
|
||||
#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 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);
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* TLS support code for CUPS using GNU TLS.
|
||||
*
|
||||
* 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
|
||||
@@ -168,10 +168,33 @@ cupsMakeServerCredentials(
|
||||
gnutls_x509_crt_set_activation_time(crt, curtime);
|
||||
gnutls_x509_crt_set_expiration_time(crt, curtime + 10 * 365 * 86400);
|
||||
gnutls_x509_crt_set_ca_status(crt, 0);
|
||||
gnutls_x509_crt_set_subject_alt_name(crt, GNUTLS_SAN_DNSNAME, common_name, (unsigned)strlen(common_name), GNUTLS_FSAN_SET);
|
||||
if (!strchr(common_name, '.'))
|
||||
{
|
||||
/*
|
||||
* Add common_name.local to the list, too...
|
||||
*/
|
||||
|
||||
char localname[256]; /* hostname.local */
|
||||
|
||||
snprintf(localname, sizeof(localname), "%s.local", common_name);
|
||||
gnutls_x509_crt_set_subject_alt_name(crt, GNUTLS_SAN_DNSNAME, localname, (unsigned)strlen(localname), GNUTLS_FSAN_APPEND);
|
||||
}
|
||||
gnutls_x509_crt_set_subject_alt_name(crt, GNUTLS_SAN_DNSNAME, "localhost", 9, GNUTLS_FSAN_APPEND);
|
||||
if (num_alt_names > 0)
|
||||
gnutls_x509_crt_set_subject_alternative_name(crt, GNUTLS_SAN_DNSNAME, alt_names[0]);
|
||||
{
|
||||
int i; /* Looping var */
|
||||
|
||||
for (i = 0; i < num_alt_names; i ++)
|
||||
{
|
||||
if (strcmp(alt_names[i], "localhost"))
|
||||
{
|
||||
gnutls_x509_crt_set_subject_alt_name(crt, GNUTLS_SAN_DNSNAME, alt_names[i], (unsigned)strlen(alt_names[i]), GNUTLS_FSAN_APPEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
gnutls_x509_crt_set_key_purpose_oid(crt, GNUTLS_KP_TLS_WWW_SERVER, 0);
|
||||
gnutls_x509_crt_set_key_usage(crt, GNUTLS_KEY_KEY_ENCIPHERMENT);
|
||||
gnutls_x509_crt_set_key_usage(crt, GNUTLS_KEY_DIGITAL_SIGNATURE | GNUTLS_KEY_KEY_ENCIPHERMENT);
|
||||
gnutls_x509_crt_set_version(crt, 3);
|
||||
|
||||
bytes = sizeof(buffer);
|
||||
@@ -375,8 +398,8 @@ httpCredentialsAreValidForName(
|
||||
|
||||
if (result)
|
||||
{
|
||||
int i, /* Looping var */
|
||||
count; /* Number of revoked certificates */
|
||||
gnutls_x509_crl_iter_t iter = NULL;
|
||||
/* Iterator */
|
||||
unsigned char cserial[1024], /* Certificate serial number */
|
||||
rserial[1024]; /* Revoked serial number */
|
||||
size_t cserial_size, /* Size of cert serial number */
|
||||
@@ -384,22 +407,24 @@ httpCredentialsAreValidForName(
|
||||
|
||||
_cupsMutexLock(&tls_mutex);
|
||||
|
||||
count = gnutls_x509_crl_get_crt_count(tls_crl);
|
||||
|
||||
if (count > 0)
|
||||
if (gnutls_x509_crl_get_crt_count(tls_crl) > 0)
|
||||
{
|
||||
cserial_size = sizeof(cserial);
|
||||
gnutls_x509_crt_get_serial(cert, cserial, &cserial_size);
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
rserial_size = sizeof(rserial);
|
||||
if (!gnutls_x509_crl_get_crt_serial(tls_crl, (unsigned)i, rserial, &rserial_size, NULL) && cserial_size == rserial_size && !memcmp(cserial, rserial, rserial_size))
|
||||
rserial_size = sizeof(rserial);
|
||||
|
||||
while (!gnutls_x509_crl_iter_crt_serial(tls_crl, &iter, rserial, &rserial_size, NULL))
|
||||
{
|
||||
if (cserial_size == rserial_size && !memcmp(cserial, rserial, rserial_size))
|
||||
{
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
rserial_size = sizeof(rserial);
|
||||
}
|
||||
gnutls_x509_crl_iter_deinit(iter);
|
||||
}
|
||||
|
||||
_cupsMutexUnlock(&tls_mutex);
|
||||
@@ -644,7 +669,7 @@ httpCredentialsString(
|
||||
issuer[256]; /* Issuer associated with cert */
|
||||
size_t len; /* Length of string */
|
||||
time_t expiration; /* Expiration date of cert */
|
||||
int sigalg; /* Signature algorithm */
|
||||
int sigalg; /* Signature algorithm */
|
||||
unsigned char md5_digest[16]; /* MD5 result */
|
||||
|
||||
len = sizeof(name) - 1;
|
||||
@@ -664,7 +689,7 @@ httpCredentialsString(
|
||||
|
||||
cupsHashData("md5", first->data, first->datalen, md5_digest, sizeof(md5_digest));
|
||||
|
||||
snprintf(buffer, bufsize, "%s (issued by %s) / %s / %s / %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", name, issuer, httpGetDateString(expiration), gnutls_sign_get_name(sigalg), md5_digest[0], md5_digest[1], md5_digest[2], md5_digest[3], md5_digest[4], md5_digest[5], md5_digest[6], md5_digest[7], md5_digest[8], md5_digest[9], md5_digest[10], md5_digest[11], md5_digest[12], md5_digest[13], md5_digest[14], md5_digest[15]);
|
||||
snprintf(buffer, bufsize, "%s (issued by %s) / %s / %s / %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", name, issuer, httpGetDateString(expiration), gnutls_sign_get_name((gnutls_sign_algorithm_t)sigalg), md5_digest[0], md5_digest[1], md5_digest[2], md5_digest[3], md5_digest[4], md5_digest[5], md5_digest[6], md5_digest[7], md5_digest[8], md5_digest[9], md5_digest[10], md5_digest[11], md5_digest[12], md5_digest[13], md5_digest[14], md5_digest[15]);
|
||||
|
||||
gnutls_x509_crt_deinit(cert);
|
||||
}
|
||||
@@ -910,12 +935,13 @@ static const char * /* O - Path or NULL on error */
|
||||
http_gnutls_default_path(char *buffer,/* I - Path buffer */
|
||||
size_t bufsize)/* I - Size of path buffer */
|
||||
{
|
||||
const char *home = getenv("HOME"); /* HOME environment variable */
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Pointer to library globals */
|
||||
|
||||
|
||||
if (getuid() && home)
|
||||
if (cg->home)
|
||||
{
|
||||
snprintf(buffer, bufsize, "%s/.cups", home);
|
||||
snprintf(buffer, bufsize, "%s/.cups", cg->home);
|
||||
if (access(buffer, 0))
|
||||
{
|
||||
DEBUG_printf(("1http_gnutls_default_path: Making directory \"%s\".", buffer));
|
||||
@@ -926,7 +952,7 @@ http_gnutls_default_path(char *buffer,/* I - Path buffer */
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl", home);
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl", cg->home);
|
||||
if (access(buffer, 0))
|
||||
{
|
||||
DEBUG_printf(("1http_gnutls_default_path: Making directory \"%s\".", buffer));
|
||||
|
||||
@@ -1967,6 +1967,8 @@ http_sspi_make_credentials(
|
||||
|
||||
GetSystemTime(&et);
|
||||
et.wYear += years;
|
||||
if (et.wMonth == 2 && et.wDay == 29)
|
||||
et.wDay = 28; /* Avoid Feb 29th due to leap years */
|
||||
|
||||
ZeroMemory(&exts, sizeof(exts));
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* User, system, and password routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -22,6 +23,9 @@
|
||||
# include <termios.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif /* _WIN32 */
|
||||
#ifdef __APPLE__
|
||||
# include <sys/sysctl.h>
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
/*
|
||||
@@ -29,14 +33,27 @@
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
# define kCUPSPrintingPrefs CFSTR("org.cups.PrintingPrefs")
|
||||
# define kAllowAnyRootKey CFSTR("AllowAnyRoot")
|
||||
# define kAllowExpiredCertsKey CFSTR("AllowExpiredCerts")
|
||||
# define kEncryptionKey CFSTR("Encryption")
|
||||
# define kGSSServiceNameKey CFSTR("GSSServiceName")
|
||||
# define kSSLOptionsKey CFSTR("SSLOptions")
|
||||
# define kTrustOnFirstUseKey CFSTR("TrustOnFirstUse")
|
||||
# define kValidateCertsKey CFSTR("ValidateCerts")
|
||||
# if TARGET_OS_OSX
|
||||
# define kCUPSPrintingPrefs CFSTR("org.cups.PrintingPrefs")
|
||||
# define kPREFIX ""
|
||||
# else
|
||||
# define kCUPSPrintingPrefs CFSTR(".GlobalPreferences")
|
||||
# define kPREFIX "AirPrint"
|
||||
# endif /* TARGET_OS_OSX */
|
||||
# define kDigestOptionsKey CFSTR(kPREFIX "DigestOptions")
|
||||
# define kUserKey CFSTR(kPREFIX "User")
|
||||
# define kUserAgentTokensKey CFSTR(kPREFIX "UserAgentTokens")
|
||||
# define kAllowAnyRootKey CFSTR(kPREFIX "AllowAnyRoot")
|
||||
# define kAllowExpiredCertsKey CFSTR(kPREFIX "AllowExpiredCerts")
|
||||
# define kEncryptionKey CFSTR(kPREFIX "Encryption")
|
||||
# define kGSSServiceNameKey CFSTR(kPREFIX "GSSServiceName")
|
||||
# define kSSLOptionsKey CFSTR(kPREFIX "SSLOptions")
|
||||
# define kTrustOnFirstUseKey CFSTR(kPREFIX "TrustOnFirstUse")
|
||||
# define kValidateCertsKey CFSTR(kPREFIX "ValidateCerts")
|
||||
/* Deprecated */
|
||||
# define kAllowRC4 CFSTR(kPREFIX "AllowRC4")
|
||||
# define kAllowSSL3 CFSTR(kPREFIX "AllowSSL3")
|
||||
# define kAllowDH CFSTR(kPREFIX "AllowDH")
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#define _CUPS_PASSCHAR '*' /* Character that is echoed for password */
|
||||
@@ -48,6 +65,8 @@
|
||||
|
||||
typedef struct _cups_client_conf_s /**** client.conf config data ****/
|
||||
{
|
||||
_cups_digestoptions_t digestoptions; /* DigestOptions values */
|
||||
_cups_uatokens_t uatokens; /* UserAgentTokens values */
|
||||
#ifdef HAVE_SSL
|
||||
int ssl_options, /* SSLOptions values */
|
||||
ssl_min_version,/* Minimum SSL/TLS version */
|
||||
@@ -81,6 +100,7 @@ static void cups_finalize_client_conf(_cups_client_conf_t *cc);
|
||||
static void cups_init_client_conf(_cups_client_conf_t *cc);
|
||||
static void cups_read_client_conf(cups_file_t *fp, _cups_client_conf_t *cc);
|
||||
static void cups_set_default_ipp_port(_cups_globals_t *cg);
|
||||
static void cups_set_digestoptions(_cups_client_conf_t *cc, const char *value);
|
||||
static void cups_set_encryption(_cups_client_conf_t *cc, const char *value);
|
||||
#ifdef HAVE_GSSAPI
|
||||
static void cups_set_gss_service_name(_cups_client_conf_t *cc, const char *value);
|
||||
@@ -89,6 +109,7 @@ static void cups_set_server_name(_cups_client_conf_t *cc, const char *value);
|
||||
#ifdef HAVE_SSL
|
||||
static void cups_set_ssl_options(_cups_client_conf_t *cc, const char *value);
|
||||
#endif /* HAVE_SSL */
|
||||
static void cups_set_uatokens(_cups_client_conf_t *cc, const char *value);
|
||||
static void cups_set_user(_cups_client_conf_t *cc, const char *value);
|
||||
|
||||
|
||||
@@ -488,6 +509,11 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or @code NULL@
|
||||
#ifdef _WIN32
|
||||
SYSTEM_INFO sysinfo; /* System information */
|
||||
OSVERSIONINFOA version; /* OS version info */
|
||||
const char *machine; /* Hardware/machine name */
|
||||
#elif defined(__APPLE__)
|
||||
struct utsname name; /* uname info */
|
||||
char version[256]; /* macOS/iOS version */
|
||||
size_t len; /* Length of value */
|
||||
#else
|
||||
struct utsname name; /* uname info */
|
||||
#endif /* _WIN32 */
|
||||
@@ -499,30 +525,103 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or @code NULL@
|
||||
return;
|
||||
}
|
||||
|
||||
if (cg->uatokens < _CUPS_UATOKENS_OS)
|
||||
{
|
||||
switch (cg->uatokens)
|
||||
{
|
||||
default :
|
||||
case _CUPS_UATOKENS_NONE :
|
||||
cg->user_agent[0] = '\0';
|
||||
break;
|
||||
case _CUPS_UATOKENS_PRODUCT_ONLY :
|
||||
strlcpy(cg->user_agent, "CUPS IPP", sizeof(cg->user_agent));
|
||||
break;
|
||||
case _CUPS_UATOKENS_MAJOR :
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), "CUPS/%d IPP/2", CUPS_VERSION_MAJOR);
|
||||
break;
|
||||
case _CUPS_UATOKENS_MINOR :
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), "CUPS/%d.%d IPP/2.1", CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR);
|
||||
break;
|
||||
case _CUPS_UATOKENS_MINIMAL :
|
||||
strlcpy(cg->user_agent, CUPS_MINIMAL " IPP/2.1", sizeof(cg->user_agent));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
* Gather Windows version information for the User-Agent string...
|
||||
*/
|
||||
|
||||
version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionExA(&version);
|
||||
GetNativeSystemInfo(&sysinfo);
|
||||
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent),
|
||||
CUPS_MINIMAL " (Windows %d.%d; %s) IPP/2.0",
|
||||
version.dwMajorVersion, version.dwMinorVersion,
|
||||
sysinfo.wProcessorArchitecture
|
||||
== PROCESSOR_ARCHITECTURE_AMD64 ? "amd64" :
|
||||
sysinfo.wProcessorArchitecture
|
||||
== PROCESSOR_ARCHITECTURE_ARM ? "arm" :
|
||||
sysinfo.wProcessorArchitecture
|
||||
== PROCESSOR_ARCHITECTURE_IA64 ? "ia64" :
|
||||
sysinfo.wProcessorArchitecture
|
||||
== PROCESSOR_ARCHITECTURE_INTEL ? "intel" :
|
||||
"unknown");
|
||||
switch (sysinfo.wProcessorArchitecture)
|
||||
{
|
||||
case PROCESSOR_ARCHITECTURE_AMD64 :
|
||||
machine = "amd64";
|
||||
break;
|
||||
|
||||
case PROCESSOR_ARCHITECTURE_ARM :
|
||||
machine = "arm";
|
||||
break;
|
||||
|
||||
case PROCESSOR_ARCHITECTURE_IA64 :
|
||||
machine = "ia64";
|
||||
break;
|
||||
|
||||
case PROCESSOR_ARCHITECTURE_INTEL :
|
||||
machine = "intel";
|
||||
break;
|
||||
|
||||
default :
|
||||
machine = "unknown";
|
||||
break;
|
||||
}
|
||||
|
||||
if (cg->uatokens == _CUPS_UATOKENS_OS)
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (Windows %d.%d) IPP/2.0", version.dwMajorVersion, version.dwMinorVersion);
|
||||
else
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (Windows %d.%d; %s) IPP/2.0", version.dwMajorVersion, version.dwMinorVersion, machine);
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
/*
|
||||
* Gather macOS/iOS version information for the User-Agent string...
|
||||
*/
|
||||
|
||||
#else
|
||||
uname(&name);
|
||||
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent),
|
||||
CUPS_MINIMAL " (%s %s; %s) IPP/2.0",
|
||||
name.sysname, name.release, name.machine);
|
||||
len = sizeof(version) - 1;
|
||||
if (!sysctlbyname("kern.osproductversion", version, &len, NULL, 0))
|
||||
version[len] = '\0';
|
||||
else
|
||||
strlcpy(version, "unknown", sizeof(version));
|
||||
|
||||
# if TARGET_OS_OSX
|
||||
if (cg->uatokens == _CUPS_UATOKENS_OS)
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (macOS %s) IPP/2.0", version);
|
||||
else
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (macOS %s; %s) IPP/2.0", version, name.machine);
|
||||
|
||||
# else
|
||||
if (cg->uatokens == _CUPS_UATOKENS_OS)
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (iOS %s) IPP/2.0", version);
|
||||
else
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (iOS %s; %s) IPP/2.0", version, name.machine);
|
||||
# endif /* TARGET_OS_OSX */
|
||||
|
||||
#else
|
||||
/*
|
||||
* Gather generic UNIX version information for the User-Agent string...
|
||||
*/
|
||||
|
||||
uname(&name);
|
||||
|
||||
if (cg->uatokens == _CUPS_UATOKENS_OS)
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (%s %s) IPP/2.0", name.sysname, name.release);
|
||||
else
|
||||
snprintf(cg->user_agent, sizeof(cg->user_agent), CUPS_MINIMAL " (%s %s; %s) IPP/2.0", name.sysname, name.release, name.machine);
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
@@ -872,7 +971,6 @@ void
|
||||
_cupsSetDefaults(void)
|
||||
{
|
||||
cups_file_t *fp; /* File */
|
||||
const char *home; /* Home directory of user */
|
||||
char filename[1024]; /* Filename */
|
||||
_cups_client_conf_t cc; /* client.conf values */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
@@ -898,19 +996,13 @@ _cupsSetDefaults(void)
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
# ifdef HAVE_GETEUID
|
||||
if ((geteuid() == getuid() || !getuid()) && getegid() == getgid() && (home = getenv("HOME")) != NULL)
|
||||
# elif !defined(_WIN32)
|
||||
if (getuid() && (home = getenv("HOME")) != NULL)
|
||||
# else
|
||||
if ((home = getenv("HOME")) != NULL)
|
||||
# endif /* HAVE_GETEUID */
|
||||
if (cg->home)
|
||||
{
|
||||
/*
|
||||
* Look for ~/.cups/client.conf...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/client.conf", cg->home);
|
||||
if ((fp = cupsFileOpen(filename, "r")) != NULL)
|
||||
{
|
||||
cups_read_client_conf(fp, &cc);
|
||||
@@ -924,6 +1016,8 @@ _cupsSetDefaults(void)
|
||||
|
||||
cups_finalize_client_conf(&cc);
|
||||
|
||||
cg->uatokens = cc.uatokens;
|
||||
|
||||
if (cg->encryption == (http_encryption_t)-1)
|
||||
cg->encryption = cc.encryption;
|
||||
|
||||
@@ -1081,17 +1175,22 @@ cups_finalize_client_conf(
|
||||
|
||||
if (!cc->server_name[0])
|
||||
{
|
||||
#ifdef CUPS_DEFAULT_DOMAINSOCKET
|
||||
/*
|
||||
* If we are compiled with domain socket support, only use the
|
||||
* domain socket if it exists and has the right permissions...
|
||||
*/
|
||||
|
||||
#if defined(__APPLE__) && !TARGET_OS_OSX
|
||||
cups_set_server_name(cc, "/private/var/run/printd");
|
||||
|
||||
#else
|
||||
# ifdef CUPS_DEFAULT_DOMAINSOCKET
|
||||
if (!access(CUPS_DEFAULT_DOMAINSOCKET, R_OK))
|
||||
cups_set_server_name(cc, CUPS_DEFAULT_DOMAINSOCKET);
|
||||
else
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
cups_set_server_name(cc, "localhost");
|
||||
# endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
cups_set_server_name(cc, "localhost");
|
||||
#endif /* __APPLE__ && !TARGET_OS_OSX */
|
||||
}
|
||||
|
||||
if (!cc->user[0])
|
||||
@@ -1161,6 +1260,12 @@ cups_init_client_conf(
|
||||
|
||||
memset(cc, 0, sizeof(_cups_client_conf_t));
|
||||
|
||||
cc->uatokens = _CUPS_UATOKENS_MINIMAL;
|
||||
|
||||
#if defined(__APPLE__) && !TARGET_OS_OSX
|
||||
cups_set_user(cc, "mobile");
|
||||
#endif /* __APPLE__ && !TARGET_OS_OSX */
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
cc->ssl_min_version = _HTTP_TLS_1_0;
|
||||
cc->ssl_max_version = _HTTP_TLS_MAX;
|
||||
@@ -1176,8 +1281,9 @@ cups_init_client_conf(
|
||||
* everything...)
|
||||
*/
|
||||
|
||||
#if defined(__APPLE__) && defined(HAVE_SSL)
|
||||
#if defined(__APPLE__)
|
||||
char sval[1024]; /* String value */
|
||||
# ifdef HAVE_SSL
|
||||
int bval; /* Boolean value */
|
||||
|
||||
if (cups_apple_get_boolean(kAllowAnyRootKey, &bval))
|
||||
@@ -1190,14 +1296,40 @@ cups_init_client_conf(
|
||||
cups_set_encryption(cc, sval);
|
||||
|
||||
if (cups_apple_get_string(kSSLOptionsKey, sval, sizeof(sval)))
|
||||
{
|
||||
cups_set_ssl_options(cc, sval);
|
||||
}
|
||||
else
|
||||
{
|
||||
sval[0] = '\0';
|
||||
|
||||
if (cups_apple_get_boolean(kAllowRC4, &bval) && bval)
|
||||
strlcat(sval, " AllowRC4", sizeof(sval));
|
||||
if (cups_apple_get_boolean(kAllowSSL3, &bval) && bval)
|
||||
strlcat(sval, " AllowSSL3", sizeof(sval));
|
||||
if (cups_apple_get_boolean(kAllowDH, &bval) && bval)
|
||||
strlcat(sval, " AllowDH", sizeof(sval));
|
||||
|
||||
if (sval[0])
|
||||
cups_set_ssl_options(cc, sval);
|
||||
}
|
||||
|
||||
if (cups_apple_get_boolean(kTrustOnFirstUseKey, &bval))
|
||||
cc->trust_first = bval;
|
||||
|
||||
if (cups_apple_get_boolean(kValidateCertsKey, &bval))
|
||||
cc->validate_certs = bval;
|
||||
#endif /* __APPLE__ && HAVE_SSL */
|
||||
# endif /* HAVE_SSL */
|
||||
|
||||
if (cups_apple_get_string(kDigestOptionsKey, sval, sizeof(sval)))
|
||||
cups_set_digestoptions(cc, sval);
|
||||
|
||||
if (cups_apple_get_string(kUserKey, sval, sizeof(sval)))
|
||||
strlcpy(cc->user, sval, sizeof(cc->user));
|
||||
|
||||
if (cups_apple_get_string(kUserAgentTokensKey, sval, sizeof(sval)))
|
||||
cups_set_uatokens(cc, sval);
|
||||
#endif /* __APPLE__ */
|
||||
}
|
||||
|
||||
|
||||
@@ -1222,7 +1354,9 @@ cups_read_client_conf(
|
||||
linenum = 0;
|
||||
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if (!_cups_strcasecmp(line, "Encryption") && value)
|
||||
if (!_cups_strcasecmp(line, "DigestOptions") && value)
|
||||
cups_set_digestoptions(cc, value);
|
||||
else if (!_cups_strcasecmp(line, "Encryption") && value)
|
||||
cups_set_encryption(cc, value);
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
@@ -1234,6 +1368,8 @@ cups_read_client_conf(
|
||||
#endif /* !__APPLE__ */
|
||||
else if (!_cups_strcasecmp(line, "User") && value)
|
||||
cups_set_user(cc, value);
|
||||
else if (!_cups_strcasecmp(line, "UserAgentTokens") && value)
|
||||
cups_set_uatokens(cc, value);
|
||||
else if (!_cups_strcasecmp(line, "TrustOnFirstUse") && value)
|
||||
cc->trust_first = cups_boolean_value(value);
|
||||
else if (!_cups_strcasecmp(line, "AllowAnyRoot") && value)
|
||||
@@ -1275,6 +1411,23 @@ cups_set_default_ipp_port(
|
||||
cg->ipp_port = CUPS_DEFAULT_IPP_PORT;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_digestoptions()' - Set the DigestOptions value.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_set_digestoptions(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
if (!_cups_strcasecmp(value, "DenyMD5"))
|
||||
cc->digestoptions = _CUPS_DIGESTOPTIONS_DENYMD5;
|
||||
else if (!_cups_strcasecmp(value, "None"))
|
||||
cc->digestoptions = _CUPS_DIGESTOPTIONS_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_encryption()' - Set the Encryption value.
|
||||
*/
|
||||
@@ -1403,6 +1556,38 @@ cups_set_ssl_options(
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_uatokens()' - Set the UserAgentTokens value.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_set_uatokens(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
static const char * const uatokens[] =/* UserAgentTokens values */
|
||||
{
|
||||
"NONE",
|
||||
"PRODUCTONLY",
|
||||
"MAJOR",
|
||||
"MINOR",
|
||||
"MINIMAL",
|
||||
"OS",
|
||||
"FULL"
|
||||
};
|
||||
|
||||
for (i = 0; i < (int)(sizeof(uatokens) / sizeof(uatokens[0])); i ++)
|
||||
{
|
||||
if (!_cups_strcasecmp(value, uatokens[i]))
|
||||
{
|
||||
cc->uatokens = (_cups_uatokens_t)i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_user()' - Set the User value.
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* API versioning definitions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@@ -96,7 +96,7 @@
|
||||
* Note: Using any of the _CUPS_API macros automatically adds _CUPS_PUBLIC.
|
||||
*/
|
||||
|
||||
# if defined(__APPLE__) && !defined(_CUPS_SOURCE) && !TARGET_OS_IOS
|
||||
# if defined(__APPLE__) && !defined(_CUPS_SOURCE) && TARGET_OS_OSX
|
||||
/*
|
||||
* On Apple operating systems, the _CUPS_API_* constants are defined using the
|
||||
* API_ macros in <os/availability.h>.
|
||||
@@ -116,9 +116,9 @@
|
||||
# define _CUPS_API_1_7 API_AVAILABLE(macos(10.9), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_0 API_AVAILABLE(macos(10.10), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2 API_AVAILABLE(macos(10.12), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_4 API_AVAILABLE(macos(10.13), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_7 API_AVAILABLE(macos(10.14), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_3 _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_4 API_AVAILABLE(macos(10.13), ios(12.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_7 API_AVAILABLE(macos(10.14), ios(13.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_3 API_AVAILABLE(macos(10.14), ios(13.0)) _CUPS_PUBLIC
|
||||
# else
|
||||
# define _CUPS_API_1_1_19 _CUPS_PUBLIC
|
||||
# define _CUPS_API_1_1_20 _CUPS_PUBLIC
|
||||
@@ -164,10 +164,10 @@
|
||||
*/
|
||||
# define _CUPS_DEPRECATED __attribute__ ((unavailable)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
|
||||
# elif defined(__APPLE__)
|
||||
/*
|
||||
@@ -175,10 +175,10 @@
|
||||
*/
|
||||
# define _CUPS_DEPRECATED __attribute__ ((deprecated)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12)) API_UNAVAILABLE(ios) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12), ios(11.0,11.0)) _CUPS_PUBLIC
|
||||
|
||||
# elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE) && defined(_CUPS_NO_DEPRECATED)
|
||||
/*
|
||||
|
||||
|
Antes Largura: | Altura: | Tamanho: 4.8 KiB Depois Largura: | Altura: | Tamanho: 3.3 KiB |
|
Antes Largura: | Altura: | Tamanho: 503 B Depois Largura: | Altura: | Tamanho: 362 B |
|
Antes Largura: | Altura: | Tamanho: 9.9 KiB Depois Largura: | Altura: | Tamanho: 5.8 KiB |