Comparar commits
108 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| b646dd35b1 | |||
| 5c0e456621 | |||
| e52ed6e0a7 | |||
| d2d26087df | |||
| 29ff85270e | |||
| 6bde932e8a | |||
| 8cae1ac9af | |||
| 91480df95e | |||
| f626646001 | |||
| a0e8526903 | |||
| f94124cb92 | |||
| 840c1efb00 | |||
| 344ab3b0e2 | |||
| 0d6f0677c3 | |||
| 60f4a67a67 | |||
| 0417631599 | |||
| 4cc64a80fd | |||
| 8056da7897 | |||
| b1f200bb75 | |||
| 6355478e27 | |||
| ba4f314f2b | |||
| d3331249b0 | |||
| bc05464ada | |||
| 348ce78265 | |||
| be91b849f0 | |||
| c8d724e6bb | |||
| 00d0ae86f6 | |||
| a215cf8413 | |||
| 4ef75dec45 | |||
| 86243a7551 | |||
| b93671244e | |||
| 5d2cc5d32d | |||
| 71389998b8 | |||
| 72265b0595 | |||
| 9825762812 | |||
| d40220801e | |||
| 3d1f41307e | |||
| fbd45c3e08 | |||
| 873a628b1c | |||
| 023692e684 | |||
| 308c21ef44 | |||
| 244a10b5c8 | |||
| 031f71f0a8 | |||
| c4df903b2d | |||
| 6b139a7e91 | |||
| 105d3c6459 | |||
| 309e860e17 | |||
| d15d70899b | |||
| 101de55370 | |||
| 7d6c76f898 | |||
| 73e83483db | |||
| 0151d6018c | |||
| 0360d41094 | |||
| 73f741aebc | |||
| dca2386d81 | |||
| c8111ca923 | |||
| 62f67a21cc | |||
| d7915e0baf | |||
| 6a16dd94b9 | |||
| 2bc3c8e63d | |||
| 0d44b6f9a4 | |||
| 8f7630cffc | |||
| e3c4c55263 | |||
| bf5fce9867 | |||
| 306d87d977 | |||
| 5638753fdf | |||
| 9f8ca40773 | |||
| 5415d8c212 | |||
| 22c761b4a8 | |||
| ce8b298254 | |||
| ca0c126882 | |||
| e7d39d5957 | |||
| 36a710dd8a | |||
| 8c535064f7 | |||
| 6c019649f4 | |||
| 94f7cfc5d0 | |||
| 962493c168 | |||
| ea1500e49d | |||
| ef80c6e4e9 | |||
| 0d66577b2d | |||
| 90af1dd8be | |||
| 16a3c06507 | |||
| 98c6e426bc | |||
| 40457f6cc5 | |||
| f4d45889eb | |||
| 588cfd8b22 | |||
| 0e27be7747 | |||
| 03163319af | |||
| 87473b5777 | |||
| 72f8a73af8 | |||
| 35929e590c | |||
| 1576ab1c78 | |||
| 104ec216a3 | |||
| 7c399480cd | |||
| c09f64e2f3 | |||
| 2106cc63ca | |||
| 2f96aa3b41 | |||
| 1bd4599421 | |||
| d780a217b3 | |||
| 42cf2f9f2e | |||
| 530f64721a | |||
| 8a2e36146f | |||
| d67e4b67b2 | |||
| cd5ce0053e | |||
| a20f5c90aa | |||
| 1110e39948 | |||
| 6aa0a54981 | |||
| e1de635a20 |
+144
@@ -0,0 +1,144 @@
|
||||
*.a
|
||||
*.cgi
|
||||
*.dylib
|
||||
*.gz
|
||||
*.o
|
||||
*.so
|
||||
*.so.*
|
||||
.buildrev
|
||||
autom4te.cache
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
cups-config
|
||||
Makedefs
|
||||
backend/dnssd
|
||||
backend/http
|
||||
backend/ipp
|
||||
backend/lpd
|
||||
backend/mdns
|
||||
backend/snmp
|
||||
backend/socket
|
||||
backend/test1284
|
||||
backend/testbackend
|
||||
backend/testsupplies
|
||||
backend/usb
|
||||
berkeley/lpc
|
||||
berkeley/lpq
|
||||
berkeley/lpr
|
||||
berkeley/lprm
|
||||
cgi-bin/testcgi
|
||||
cgi-bin/testhi
|
||||
cgi-bin/testhi.index
|
||||
cgi-bin/testtemplate
|
||||
conf/cups-files.conf
|
||||
conf/cupsd.conf
|
||||
conf/mime.convs
|
||||
conf/pam.std
|
||||
conf/snmp.conf
|
||||
cups/locale/
|
||||
cups/test.pwg
|
||||
cups/testadmin
|
||||
cups/testarray
|
||||
cups/testcache
|
||||
cups/testconflicts
|
||||
cups/testcups
|
||||
cups/testdest
|
||||
cups/testfile
|
||||
cups/testhttp
|
||||
cups/testi18n
|
||||
cups/testipp
|
||||
cups/testlang
|
||||
cups/testoptions
|
||||
cups/testppd
|
||||
cups/testpwg
|
||||
cups/testsnmp
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
filter/commandtops
|
||||
filter/gziptoany
|
||||
filter/pstops
|
||||
filter/rasterbench
|
||||
filter/rastertoepson
|
||||
filter/rastertohp
|
||||
filter/rastertolabel
|
||||
filter/rastertopwg
|
||||
filter/test.raster
|
||||
filter/testraster
|
||||
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
|
||||
notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
patches
|
||||
ppdc/genstrings
|
||||
ppdc/ppd/
|
||||
ppdc/ppd2/
|
||||
ppdc/ppdc
|
||||
ppdc/ppdc-static
|
||||
ppdc/ppdhtml
|
||||
ppdc/ppdi
|
||||
ppdc/ppdi-static
|
||||
ppdc/ppdmerge
|
||||
ppdc/ppdpo
|
||||
ppdc/sample-import.drv
|
||||
ppdc/sample.c
|
||||
ppdc/testcatalog
|
||||
scheduler/convert
|
||||
scheduler/cups-deviced
|
||||
scheduler/cups-driverd
|
||||
scheduler/cups-exec
|
||||
scheduler/cups-lpd
|
||||
scheduler/cups-lpd.xinetd
|
||||
scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
scheduler/cupsd
|
||||
scheduler/cupsfilter
|
||||
scheduler/org.cups.cups-lpd.plist
|
||||
scheduler/org.cups.cups-lpdAT.service
|
||||
scheduler/org.cups.cupsd.path
|
||||
scheduler/org.cups.cupsd.service
|
||||
scheduler/org.cups.cupsd.socket
|
||||
scheduler/testlpd
|
||||
scheduler/testmime
|
||||
scheduler/testspeed
|
||||
scheduler/testsub
|
||||
systemv/accept
|
||||
systemv/cancel
|
||||
systemv/cupsaccept
|
||||
systemv/cupsaddsmb
|
||||
systemv/cupsctl
|
||||
systemv/cupsdisable
|
||||
systemv/cupsenable
|
||||
systemv/cupsreject
|
||||
systemv/cupstestdsc
|
||||
systemv/cupstestppd
|
||||
systemv/lp
|
||||
systemv/lpadmin
|
||||
systemv/lpinfo
|
||||
systemv/lpmove
|
||||
systemv/lpoptions
|
||||
systemv/lpstat
|
||||
systemv/reject
|
||||
templates/header.tmpl
|
||||
test/cups-str-*.html
|
||||
test/error_log-*
|
||||
test/ippfind
|
||||
test/ippfind-static
|
||||
test/ippserver
|
||||
test/ipptool
|
||||
test/ipptool-static
|
||||
@@ -0,0 +1,215 @@
|
||||
CHANGES-2.0.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V2.0.4
|
||||
|
||||
- Fixed a bug in cupsRasterWritePixels (STR #4650)
|
||||
- Fixed redirection in the web interface (STR #4538)
|
||||
- The IPP backend did not respond to side-channel requests (STR #4645)
|
||||
- The scheduler did not start all pending jobs at once (STR #4646)
|
||||
- The web search incorrectly searched time-at-xxx values (STR #4652)
|
||||
- Fixed an RPM spec file issue (STR #4657)
|
||||
- The scheduler incorrectly started jobs while canceling multiple jobs
|
||||
(STR #4648)
|
||||
- Fixed processing of server overrides without port numbers (STR #4675)
|
||||
- Documentation changes (STR #4651, STR #4674)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.3
|
||||
|
||||
- Security: Fixed CERT VU #810572 exploiting the dynamic linker
|
||||
(STR #4609)
|
||||
- Security: The scheduler could hang with malformed gzip data
|
||||
(STR #4602)
|
||||
- Restored missing generic printer icon file (STR #4587)
|
||||
- Fixed logging of configuration errors to show up as errors (STR #4582)
|
||||
- Fixed potential buffer overflows in raster code and filters
|
||||
(STR #4598, STR #4599, STR #4600, STR #4601)
|
||||
- Fixed a gzip processing bug (#4602)
|
||||
- Fixed <Limit> inside <Location> (STR #4575)
|
||||
- Fixed lpadmin when both -m and -o are used (STR #4578)
|
||||
- The web interface always showed support for 2-sided printing
|
||||
(STR #4595)
|
||||
- cupsRasterReadHeader did not fully validate the raster header
|
||||
(STR #4596)
|
||||
- The rastertopwg filter did not check for truncated input (STR #4597)
|
||||
- The cups-lpd mini-daemon did not check for request parameters
|
||||
(STR #4603)
|
||||
- The scheduler could get caught in a busy loop (STR #4605)
|
||||
- The sample Epson driver could crash (STR #4616)
|
||||
- The IPP backend now correctly monitors jobs
|
||||
(<rdar://problem/20495955>)
|
||||
- The ppdhtml and ppdpo utilities crashed when the -D option was used
|
||||
before a driver information file (STR #4627)
|
||||
- ippfind incorrectly substituted "=port" for service_port.
|
||||
- The IPP/1.1 test file did not handle the initial print job
|
||||
completing early (STR #4576)
|
||||
- Fixed a memory leak in cupsConnectDest (STR #4634)
|
||||
- PWG Raster Format output contained invalid ImageBox values
|
||||
(<rdar://problem/21144309>)
|
||||
- Added Russian translation (STR #4577)
|
||||
- Added German translation (STR #4635)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.2
|
||||
|
||||
- Security: cupsRasterReadPixels buffer overflow with invalid page
|
||||
header and compressed raster data (STR #4551)
|
||||
- Command-line programs were not localized on Mac OS X
|
||||
(<rdar://problem/14546232>)
|
||||
- The scheduler incorrectly cleared the MakeModel string in the
|
||||
printers.conf file after a restart (<rdar://problem/16827518>)
|
||||
- CUPS did not compile with older versions of GNU TLS (STR #4527)
|
||||
- CUPS did not compile without Avahi or mDNSResponder (STR #4523)
|
||||
- ippLength() did not return the correct length for IPP_TAG_CONST
|
||||
string values.
|
||||
- The scheduler incorrectly aborted jobs after a job was restarted
|
||||
(<rdar://problem/19129387>)
|
||||
- The cups-files.conf file contained the old ServerCertificate/Key
|
||||
directives instead of ServerKeychain.
|
||||
- Fixed builds when no SSL/TLS library is available, or when explicitly
|
||||
disabled (STR #4531)
|
||||
- Fixed an OpenBSD charset transcoding issue.
|
||||
- Fixed USB printing on OpenBSD (STR #4525)
|
||||
- The --without-xinetd configure option did not work (STR #4542)
|
||||
- Backends needing to load OS X kernel extensions did not work
|
||||
(<rdar://problem/19015679>)
|
||||
- Mapping of PPD keywords to IPP keywords did not work if the PPD
|
||||
keyword was already an IPP keyword (<rdar://problem/19121005>)
|
||||
- cupsGetPPD* sent bad requests (STR #4567)
|
||||
- ippserver used the wrong temporary directory on Windows (STR #4547)
|
||||
- ippserver did not handle Bonjour registrations properly (STR #4548)
|
||||
- The scheduler could crash during shutdown if Avahi was shutdown
|
||||
first (STR #4550)
|
||||
- Added a USB quirk rule for Intermec printers (STR #4553)
|
||||
- The scheduler did not always log which configuration file had the
|
||||
error (STR #4559)
|
||||
- The ippfind and ipptool programs now correctly match hostnames with
|
||||
trailing dots (STR #4563)
|
||||
- The ipptool timeout option did not work (STR #4515)
|
||||
- Fixed several issues with client.conf, CUPS_SERVER, and the "-h"
|
||||
option of most commands (STR #4528)
|
||||
- Another change for OpenBSD (STR #4526)
|
||||
- Added Japanese localization (STR #4524)
|
||||
- Documentation changes (STR #4569)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.1
|
||||
|
||||
- Security: SSLv3 is now disabled by default to protect against the
|
||||
POODLE attack (STR #4476)
|
||||
- Printer sharing did not work when systemd was being used (STR #4497)
|
||||
- cupsGetPPD* would return a symlink to the PPD in /etc/cups/ppd even if
|
||||
it was not readable by the user (STR #4500)
|
||||
- The web interface now protects against frame "click-jacking" attacks
|
||||
(STR #4492)
|
||||
- Fixed a crash in ippAttributeString (<rdar://problem/17903871>)
|
||||
- Fixed a crash in the scheduler on Linux/*BSD if colord was not running
|
||||
(STR #4496)
|
||||
- Fixed a random crash in the scheduler when not using systemd
|
||||
(STR #4484)
|
||||
- Added systemd support for cups-lpd (STR #4493)
|
||||
- The scheduler did not honor the FatalErrors directive for mis-
|
||||
configured Group and SystemGroup values (STR #4495)
|
||||
- The network backends no longer report waste-receptacle conditions when
|
||||
using SNMP (STR #4499)
|
||||
- The IPP backend did not work with some configurations of Windows
|
||||
(STR #4503)
|
||||
- RPMs did not build (STR #4490)
|
||||
- Added a USB quirk rule for the Brother HL-1250 (STR #4519)
|
||||
- Fixed compiles on unsupported platforms (STR #4510)
|
||||
- "cancel -a" did not cancel all jobs on all destinations (STR #4513)
|
||||
- The web interface did not work on OpenBSD (STR #4496)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0.0
|
||||
|
||||
- The scheduler did not preserve listener sockets from launchd or
|
||||
systemd after a restart (<rdar://problem/18112848>)
|
||||
- Added some USB quirk rules for the libusb-based USB backend
|
||||
(STR #4482)
|
||||
- Spanish localization update (STR #4487)
|
||||
- Updated documentation for 2.0.0 release.
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0rc1
|
||||
|
||||
- Documentation updates (STR #4464)
|
||||
- The scheduler now monitors the AC power status on OS X, allowing for
|
||||
"sleep printing" when sharing printers (<rdar://problem/17325852>)
|
||||
- The scheduler incorrectly called launch_activate_socket multiple times
|
||||
on OS X (<rdar://problem/17523218>)
|
||||
- The ippserver test program now passes the IPP Everywhere self-
|
||||
certification tests (STR #4101)
|
||||
- Relaxed the new OS X filter sandbox slightly (STR #4471,
|
||||
<rdar://problem/17483959>)
|
||||
- Dropped the old Epson Stylus Color/Photo sample drivers since they
|
||||
don't work with any current printers and there are free alternatives
|
||||
that produce much better output (<rdar://problem/18036889>)
|
||||
- Log and configuration files that are not world-readable are again
|
||||
accessible via the web interface (STR #4461)
|
||||
- PPD files are now created using the permissions specified by the
|
||||
ConfigFilePerm directive.
|
||||
- Fixed RPM build issues (STR #4459)
|
||||
- Fixed the spinner image and restart page when reconfiguring the
|
||||
scheduler through the web interface (STR #4475)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.0b1
|
||||
|
||||
- Added a "--list-filters" option to the cupsfilter command (STR #4325)
|
||||
- Added systemd support (STR #3917)
|
||||
- Added support for re-sending a job as a raster file if a higher-level
|
||||
format such as PDF fails (<rdar://problem/15583721>)
|
||||
- Added support for regular expression matching in the MIME type rules
|
||||
(<rdar://problem/11131245>)
|
||||
- Added support for TLS certificate validation and policy enforcement
|
||||
(STR #1616)
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
- Added support for auto-typing of TIFF files by ipptool (STR #4418)
|
||||
- The scheduler now returns completed jobs in the correct newest-to-
|
||||
oldest order (STR #4396)
|
||||
- The configure script now supports target-specific tools for pkg-config
|
||||
and others (STR #4423)
|
||||
- The ipptool program now supports EXPECT statements for collection
|
||||
member attributes (<rdar://problem/15355218>)
|
||||
- The ipptool program now supports collection attributes with multiple
|
||||
values (<rdar://problem/15355124>)
|
||||
- The sample drivers now include all of the installed localizations by
|
||||
default (<rdar://problem/14756625>)
|
||||
- Adopted Linux man page conventions and updated all man pages
|
||||
(STR #4372, STR #4329)
|
||||
- The scheduler now supports the "first-index" operation attribute for
|
||||
the Get-Jobs operation (STR #2913)
|
||||
- Changed the default AccessLogLevel and PageLogFormat to disable the
|
||||
access_log and page_log files by default (<rdar://problem/16495000>)
|
||||
- cupsRasterInterpretPPD now supports the Orientation header in order to
|
||||
support long-edge feed raster printers (<rdar://problem/15837926>)
|
||||
- The scheduler now allows run-as-root backends to have group read and
|
||||
execute permissions (STR #2935)
|
||||
- The ippFindAttribute and ippFindNextAttribute functions now support
|
||||
hierarchical searches (STR #4395)
|
||||
- Dropped OpenSSL support in favor of GNU TLS.
|
||||
- Dropped "dark wake" support on OS X, which was preventing portables
|
||||
from going to sleep when there was a stuck job. We now use a variation
|
||||
of the CUPS 1.4 sleep support to do a cleaner sleep
|
||||
(<rdar://problem/14323704>)
|
||||
- Dropped support for AIX, HP-UX, and OSF/1 (aka Digital UNIX)
|
||||
- Dropped lppasswd and support for Digest authentication in in the
|
||||
scheduler (STR #4321)
|
||||
- The cupsGetClasses, cupsGetPrinters, and cupsTempFile functions are no
|
||||
longer supported.
|
||||
- The scheduler now caches more job history data and limits the number
|
||||
of completed jobs returned by Get-Jobs as needed in order to prevent a
|
||||
denial-of-service on busy servers (STR #2913)
|
||||
- The filter/backend sandbox on OS X now defaults to a more strict
|
||||
whitelist (<rdar://problem/15939788>)
|
||||
- Increased the default idle exit timeout to 60 seconds on OS X
|
||||
(<rdar://problem/16041820>)
|
||||
- Printer classes were not accessible on OS X
|
||||
(<rdar://problem/16385643>)
|
||||
- The scheduler now uses </DefaultPrinter> to close the default printer
|
||||
definition in printers.conf (STR #4153)
|
||||
- Canceling all jobs in the web interface now just cancels the jobs
|
||||
(STR #1914)
|
||||
+145
-58
@@ -1,61 +1,148 @@
|
||||
CHANGES.txt - 2.0b1 - 2014-07-30
|
||||
CHANGES.txt - 2.1.4 - 2016-06-14
|
||||
--------------------------------
|
||||
|
||||
CHANGES IN CUPS V2.0b1
|
||||
CHANGES IN CUPS V2.1.4
|
||||
|
||||
- Fixed reporting of 1284 Device IDs (Issue #3835, PR #3836)
|
||||
- Fixed printing of multiple files to raw queues (Issue #4782)
|
||||
- The scheduler did not implement the Hold-New-Jobs opertion correctly
|
||||
(Issue #4767)
|
||||
- The ipptool program truncated values at 8k (Issue #4786)
|
||||
- The ipptool program did not correctly report uriScheme values in plist
|
||||
output (Issue #4785)
|
||||
- The cups-lpd mini-daemon incorrectly included the document-name
|
||||
attribute when creating a job. It should only be included when
|
||||
sending a job (Issue #4790)
|
||||
- USB quirk updates (Issue #4778, Issue #4789)
|
||||
- Documentation update (Issue #4772)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.3
|
||||
|
||||
- The default password function did not work on some platforms
|
||||
(Issue #4750)
|
||||
- The scheduler should not exit under memory pressure
|
||||
(<rdar://problem/23255001>)
|
||||
- The EPL2 and ZPL sample drivers did not properly support the CutMedia
|
||||
option.
|
||||
- Pending subscriptions would prevent the scheduler from idle exiting
|
||||
(Issue #4754)
|
||||
- Fixed some issues in ipptool for skipped tests
|
||||
(<rdar://problem/24137160>)
|
||||
- The "lp -H resume" command did not reset the "job-state-reasons"
|
||||
attribute value (Issue #4752)
|
||||
- The scheduler did not allow access to resource files (icons, etc.)
|
||||
when the web interface was disabled (Issue #4755)
|
||||
- Localization fix (Issue #4756)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.2
|
||||
|
||||
- Re-release of CUPS 2.1.1 as CUPS 2.1.2 due to error in tagging of the
|
||||
2.1.1 release (pulled content from the 2.2.x tree instead)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.1
|
||||
|
||||
- Security hardening fixes (<rdar://problem/23131948>,
|
||||
<rdar://problem/23132108>, <rdar://problem/23132353>,
|
||||
<rdar://problem/23132803>, <rdar://problem/23133230>,
|
||||
<rdar://problem/23133393>, <rdar://problem/23133466>,
|
||||
<rdar://problem/23133833>, <rdar://problem/23133998>,
|
||||
<rdar://problem/23134228>, <rdar://problem/23134299>,
|
||||
<rdar://problem/23134356>, <rdar://problem/23134415>,
|
||||
<rdar://problem/23134506>, <rdar://problem/23135066>,
|
||||
<rdar://problem/23135122>, <rdar://problem/23135207>,
|
||||
<rdar://problem/23144290>, <rdar://problem/23144358>,
|
||||
<rdar://problem/23144461>)
|
||||
- The cupsGetPPD* functions did not work with IPP printers (Issue #4725)
|
||||
- Some older HP LaserJet printers need a delayed close when printing
|
||||
using the libusb-based USB backend (Issue #4549)
|
||||
- The libusb-based USB backend did not unload the kernel usblp module
|
||||
if it was preventing the backend from accessing the printer
|
||||
(Issue #4707)
|
||||
- Current Primera printers were incorrectly reported as Fargo printers
|
||||
(Issue #4708)
|
||||
- The IPP backend did not always handle jobs getting canceled at the
|
||||
printer (<rdar://problem/22716820>)
|
||||
- Scheduler logging change (Issue #4728)
|
||||
- Added USB quirk for Canon MP530 (Issue #4730)
|
||||
- The scheduler did not deliver job notifications for jobs submitted to
|
||||
classes (Issue #4733)
|
||||
- Changing the printer-is-shared value for a remote queue did not
|
||||
produce an error (Issue #4738)
|
||||
- The IPP backend incorrectly included the job-password attribute in
|
||||
Validate-Job requests (<rdar://problem/23531939>)
|
||||
- Updated localizations (Issue #4709)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1.0
|
||||
|
||||
- Fixed more scheduler crash bugs in the new logging code (Issue #4687,
|
||||
Issue #4690)
|
||||
- The scheduler did not use the ConfigFilePerm setting when copying PPD
|
||||
files or interface scripts attached to a request (Issue #4703)
|
||||
- Now support new Chinese locale IDs and their correct fallback locales
|
||||
(<rdar://problem/22086642>, <rdar://problem/22130168>)
|
||||
- "make check" incorrectly reported an expectation of 18 warning
|
||||
messages when 8 were expected (Issue #4684)
|
||||
- The new PDF file type rule did not work (Issue #4692)
|
||||
- The scheduler did not update the jobs.cache file when job files were
|
||||
expired (Issue #4706)
|
||||
- Fixed some configure script issues (Issue #4694, Issue #4695, Issue #4698)
|
||||
- Documentation updates (Issue #4691, Issue #4693)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1rc1
|
||||
|
||||
- Added support for 3D printers (basic types only, no built-in filters)
|
||||
based on PWG white paper.
|
||||
- Fixed bugs in the new journald support (Issue #4655, Issue #4658,
|
||||
Issue #4661)
|
||||
- Fixed domain socket support on Linux (Issue #4679)
|
||||
- Fixed signal handlers in the dnssd and usb backends (Issue #4671)
|
||||
- <Limit All> in <Policy> sections now applies to all operations when
|
||||
used by itself (Issue #4659)
|
||||
- Configure script changes for systemd support (Issue #4669)
|
||||
- Updated autoconf sources to use newer form of AC_INIT (Issue #4664)
|
||||
|
||||
|
||||
CHANGES IN CUPS V2.1b1
|
||||
|
||||
- Improved speed of ppdMarkDefaults for complex/large PPDs
|
||||
(<rdar://problem/15146999>)
|
||||
- The IPP backend now stops sending print data if the printer indicates
|
||||
the job has been aborted or canceled (<rdar://problem/17837631>)
|
||||
- The IPP backend now sends the job-pages-per-set attribute when
|
||||
printing multiple copy jobs with finishings
|
||||
(<rdar://problem/16792757>)
|
||||
- The IPP backend now updates the cupsMandatory values when the printer
|
||||
configuration changes (<rdar://problem/18126570>)
|
||||
- No longer install banner files since third-party banner filters now
|
||||
supply their own (Issue #4518)
|
||||
- Added support for EXPECT-ALL directive in ipptool test files
|
||||
(Issue #4469)
|
||||
- Added support for WITH-VALUE-FROM predicate in ipptool test files
|
||||
(Issue #4470)
|
||||
- The scheduler no longer listens on the loopback interface unless the
|
||||
web interface or printer sharing are enabled
|
||||
(<rdar://problem/9136448>)
|
||||
- Added a PPD generator for IPP Everywhere printers (Issue #4258)
|
||||
- Now install "default" versions of more configuration files
|
||||
(<rdar://problem/19024491>)
|
||||
- The cupstestppd program did not handle "maxsize(nnn)" entries in
|
||||
cupsFilter/cupsFilter2 values (<rdar://problem/18974858>)
|
||||
- The scheduler now checks the return value of rename() calls
|
||||
(Issue #4589)
|
||||
- The scheduler now validates ErrorPolicy values in config files
|
||||
(Issue #4591)
|
||||
- Long cookies caused the web interface to stop working (Issue #4619)
|
||||
- Added SSLOptions values to allow Diffie-Hellman key exchange and
|
||||
disable TLS/1.0 support.
|
||||
- Updated the scheduler to support more IPP Everywhere attributes
|
||||
(Issue #4630)
|
||||
- The scheduler now supports advanced ASL and journald logging when
|
||||
"syslog" output is configured (Issue #4474)
|
||||
- The scheduler now supports logging to stderr when running in the
|
||||
foreground (Issue #4505)
|
||||
|
||||
- Added a "--list-filters" option to the cupsfilter command (STR #4325)
|
||||
- Added systemd support (STR #3917)
|
||||
- Added support for re-sending a job as a raster file if a higher-level
|
||||
format such as PDF fails (<rdar://problem/15583721>)
|
||||
- Added support for regular expression matching in the MIME type rules
|
||||
(<rdar://problem/11131245>)
|
||||
- Added support for TLS certificate validation and policy enforcement
|
||||
(STR #1616)
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
- Added support for auto-typing of TIFF files by ipptool (STR #4418)
|
||||
- The scheduler now returns completed jobs in the correct newest-to-
|
||||
oldest order (STR #4396)
|
||||
- The configure script now supports target-specific tools for pkg-config
|
||||
and others (STR #4423)
|
||||
- The ipptool program now supports EXPECT statements for collection
|
||||
member attributes (<rdar://problem/15355218>)
|
||||
- The ipptool program now supports collection attributes with multiple
|
||||
values (<rdar://problem/15355124>)
|
||||
- The sample drivers now include all of the installed localizations by
|
||||
default (<rdar://problem/14756625>)
|
||||
- Adopted Linux man page conventions and updated all man pages
|
||||
(STR #4372, STR #4329)
|
||||
- The scheduler now supports the "first-index" operation attribute for
|
||||
the Get-Jobs operation (STR #2913)
|
||||
- Changed the default AccessLogLevel and PageLogFormat to disable the
|
||||
access_log and page_log files by default (<rdar://problem/16495000>)
|
||||
- cupsRasterInterpretPPD now supports the Orientation header in order to
|
||||
support long-edge feed raster printers (<rdar://problem/15837926>)
|
||||
- The scheduler now allows run-as-root backends to have group read and
|
||||
execute permissions (STR #2935)
|
||||
- The ippFindAttribute and ippFindNextAttribute functions now support
|
||||
hierarchical searches (STR #4395)
|
||||
- Dropped OpenSSL support in favor of GNU TLS.
|
||||
- Dropped "dark wake" support on OS X, which was preventing portables
|
||||
from going to sleep when there was a stuck job. We now use a variation
|
||||
of the CUPS 1.4 sleep support to do a cleaner sleep
|
||||
(<rdar://problem/14323704>)
|
||||
- Dropped support for AIX, HP-UX, and OSF/1 (aka Digital UNIX)
|
||||
- Dropped lppasswd and support for Digest authentication in in the
|
||||
scheduler (STR #4321)
|
||||
- The cupsGetClasses, cupsGetPrinters, and cupsTempFile functions are no
|
||||
longer supported.
|
||||
- The scheduler now caches more job history data and limits the number
|
||||
of completed jobs returned by Get-Jobs as needed in order to prevent a
|
||||
denial-of-service on busy servers (STR #2913)
|
||||
- The filter/backend sandbox on OS X now defaults to a more strict
|
||||
whitelist (<rdar://problem/15939788>)
|
||||
- Increased the default idle exit timeout to 60 seconds on OS X
|
||||
(<rdar://problem/16041820>)
|
||||
- Printer classes were not accessible on OS X
|
||||
(<rdar://problem/16385643>)
|
||||
- The scheduler now uses </DefaultPrinter> to close the default printer
|
||||
definition in printers.conf (STR #4153)
|
||||
- Canceling all jobs in the web interface now just cancels the jobs
|
||||
(STR #1914)
|
||||
|
||||
+10
-7
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v2.0b1 - 2014-07-30
|
||||
INSTALL - CUPS v2.1.4 - 2016-06-14
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
@@ -98,6 +98,11 @@ CONFIGURATION
|
||||
and diagnose a variety of common problems - use the "--enable-unit-tests"
|
||||
configure option to run them at build time.
|
||||
|
||||
On OS X, use the "--with-archflags" option to build with the correct set of
|
||||
architectures:
|
||||
|
||||
./configure --with-archflags="-arch i386 -arch x86_64" ...
|
||||
|
||||
Once you have configured things, just type:
|
||||
|
||||
make ENTER
|
||||
@@ -136,6 +141,10 @@ INSTALLING THE SOFTWARE
|
||||
|
||||
gmake install ENTER
|
||||
|
||||
Use the BUILDROOT variable to install to an alternate root directory:
|
||||
|
||||
make BUILDROOT=/some/other/root/directory install ENTER
|
||||
|
||||
You can also build binary packages that can be installed on other machines
|
||||
using the RPM spec file ("packaging/cups.spec") or EPM list file
|
||||
("packaging/cups.list"). The latter also supports building of binary RPMs,
|
||||
@@ -165,17 +174,11 @@ CREATING BINARY DISTRIBUTIONS WITH EPM
|
||||
following:
|
||||
|
||||
epm - Builds a script + tarfile package
|
||||
aix - Builds an AIX package
|
||||
bsd - Builds a *BSD package
|
||||
deb - Builds a Debian package
|
||||
depot - Builds a HP-UX package (also swinstall)
|
||||
inst - Builds an IRIX package (also tardist)
|
||||
pkg - Builds a Solaris package
|
||||
rpm - Builds a RPM package
|
||||
setld - Build a Tru64 UNIX package
|
||||
slackware - Build a Slackware package
|
||||
swinstall - Build a HP-UX package (also depot)
|
||||
tardist - Builds an IRIX package (also inst)
|
||||
|
||||
|
||||
GETTING DEBUG LOGGING FROM CUPS
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
# "$Id: Makedefs.in 12519 2015-02-17 13:10:19Z msweet $"
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
@@ -264,5 +264,5 @@ USBQUIRKS = @USBQUIRKS@
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
# End of "$Id: Makedefs.in 12519 2015-02-17 13:10:19Z msweet $"
|
||||
#
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: Makefile 12074 2014-07-31 01:10:14Z msweet $"
|
||||
# "$Id: Makefile 12414 2015-01-21 00:02:04Z msweet $"
|
||||
#
|
||||
# Top-level Makefile for CUPS.
|
||||
#
|
||||
@@ -105,7 +105,7 @@ distclean: clean
|
||||
$(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.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket
|
||||
$(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
|
||||
@@ -319,7 +319,7 @@ sloc:
|
||||
|
||||
EPMFLAGS = -v --output-dir dist $(EPMARCH)
|
||||
|
||||
bsd deb pkg slackware tardist:
|
||||
bsd deb pkg slackware:
|
||||
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
|
||||
|
||||
epm:
|
||||
@@ -348,5 +348,5 @@ dist: all
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 12074 2014-07-31 01:10:14Z msweet $".
|
||||
# End of "$Id: Makefile 12414 2015-01-21 00:02:04Z msweet $".
|
||||
#
|
||||
|
||||
+9
-33
@@ -1,19 +1,6 @@
|
||||
README - CUPS v2.0b1 - 2014-07-30
|
||||
README - CUPS v2.1.4 - 2016-06-14
|
||||
---------------------------------
|
||||
|
||||
********************************************************************************
|
||||
********************************************************************************
|
||||
******** ********
|
||||
******** ********
|
||||
******** THIS IS BETA-RELEASE SOFTWARE AND SHOULD NOT BE USED ON ********
|
||||
******** PRODUCTION SYSTEMS. ********
|
||||
******** ********
|
||||
******** ********
|
||||
********************************************************************************
|
||||
********************************************************************************
|
||||
|
||||
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt" instead...
|
||||
|
||||
|
||||
@@ -54,10 +41,10 @@ READING THE DOCUMENTATION
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide many
|
||||
discussion forums which are available at:
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide two
|
||||
mailing lists which are available at:
|
||||
|
||||
http://www.cups.org/newsgroups.php
|
||||
http://www.cups.org/lists.php
|
||||
|
||||
See the CUPS web site at "http://www.cups.org/" for other resources.
|
||||
|
||||
@@ -91,10 +78,6 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
----------------------------- ------------------------------
|
||||
Dymo Label Printers drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
|
||||
EPSON Stylus Color Series drv:///sample.drv/stcolor.ppd
|
||||
EPSON Stylus Photo Series drv:///sample.drv/stphoto.ppd
|
||||
EPSON Stylus New Color Series drv:///sample.drv/stcolor2.ppd
|
||||
EPSON Stylus New Photo Series drv:///sample.drv/stphoto2.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
|
||||
@@ -126,11 +109,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
lpadmin -p printername -E -v lpd://11.22.33.44/ -m ppd-name
|
||||
|
||||
The sample drivers provide basic printing capabilities, but generally do not
|
||||
exercise the full potential of the printers or CUPS. The CUPS web site
|
||||
provides links and drivers:
|
||||
|
||||
http://www.cups.org/ppd.php PPD files
|
||||
http://www.cups.org/links.php Links to other drivers
|
||||
exercise the full potential of the printers or CUPS.
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
@@ -147,8 +126,8 @@ PRINTING FILES
|
||||
lpr -o media=A4 -o resolution=600dpi filename
|
||||
|
||||
CUPS recognizes many types of images files as well as PDF, PostScript,
|
||||
HP-GL/2, and text files, so you can print those files directly rather than
|
||||
through an application.
|
||||
and text files, so you can print those files directly rather than through
|
||||
an application.
|
||||
|
||||
If you have an application that generates output specifically for your
|
||||
printer then you need to use the "-oraw" or "-l" options:
|
||||
@@ -156,19 +135,16 @@ PRINTING FILES
|
||||
lp -o raw filename
|
||||
lpr -l filename
|
||||
|
||||
This will prevent the filters from misinterpreting your print
|
||||
file.
|
||||
This will prevent the filters from misinterpreting your print file.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2014 by Apple Inc. CUPS and the CUPS logo are
|
||||
CUPS is Copyright 2007-2016 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
This software is based in part on the work of the Independent JPEG Group.
|
||||
|
||||
CUPS is provided under the terms of version 2 of the GNU General Public
|
||||
License and GNU Library General Public License. This program is distributed
|
||||
in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
|
||||
+10
-18
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: dnssd.c 11969 2014-06-30 14:27:01Z msweet $"
|
||||
* "$Id: dnssd.c 12970 2015-11-13 20:02:51Z msweet $"
|
||||
*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2014 by Apple Inc.
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -318,7 +318,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if ((simple_poll = avahi_simple_poll_new()) == NULL)
|
||||
{
|
||||
fputs("DEBUG: Unable to create Avahi simple poll object.\n", stderr);
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
avahi_simple_poll_set_func(simple_poll, poll_callback, NULL);
|
||||
@@ -328,7 +328,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (!client)
|
||||
{
|
||||
fputs("DEBUG: Unable to create Avahi client.\n", stderr);
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
browsers = 6;
|
||||
@@ -921,13 +921,6 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
* Yes, add the device...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DNSSD
|
||||
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
|
||||
#else /* HAVE_AVAHI */
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName,
|
||||
serviceName, regtype, replyDomain);
|
||||
#endif /* HAVE_DNSSD */
|
||||
|
||||
device = calloc(sizeof(cups_device_t), 1);
|
||||
device->name = strdup(serviceName);
|
||||
device->domain = strdup(replyDomain);
|
||||
@@ -943,8 +936,7 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
#ifdef HAVE_DNSSD
|
||||
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
|
||||
#else /* HAVE_AVAHI */
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName,
|
||||
serviceName, regtype, replyDomain);
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName, serviceName, regtype, replyDomain);
|
||||
#endif /* HAVE_DNSSD */
|
||||
|
||||
device->fullName = strdup(fullName);
|
||||
@@ -1202,9 +1194,9 @@ query_callback(
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
make_and_model, model);
|
||||
else if (!_cups_strncasecmp(model, "designjet ", 10))
|
||||
snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s", model + 10);
|
||||
snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;", model + 10);
|
||||
else if (!_cups_strncasecmp(model, "stylus ", 7))
|
||||
snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s", model + 7);
|
||||
snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;", model + 7);
|
||||
else if ((ptr = strchr(model, ' ')) != NULL)
|
||||
{
|
||||
/*
|
||||
@@ -1214,7 +1206,7 @@ query_callback(
|
||||
memcpy(make_and_model, model, (size_t)(ptr - model));
|
||||
make_and_model[ptr - model] = '\0';
|
||||
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s",
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
make_and_model, ptr + 1);
|
||||
}
|
||||
}
|
||||
@@ -1289,7 +1281,7 @@ sigterm_handler(int sig) /* I - Signal number (unused) */
|
||||
(void)sig;
|
||||
|
||||
if (job_canceled)
|
||||
exit(CUPS_BACKEND_OK);
|
||||
_exit(CUPS_BACKEND_OK);
|
||||
else
|
||||
job_canceled = 1;
|
||||
}
|
||||
@@ -1330,5 +1322,5 @@ unquote(char *dst, /* I - Destination buffer */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dnssd.c 11969 2014-06-30 14:27:01Z msweet $".
|
||||
* End of "$Id: dnssd.c 12970 2015-11-13 20:02:51Z msweet $".
|
||||
*/
|
||||
|
||||
+78
-332
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: ipp.c 12048 2014-07-18 14:26:14Z msweet $"
|
||||
* "$Id: ipp.c 12896 2015-10-09 13:15:22Z msweet $"
|
||||
*
|
||||
* IPP backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -64,6 +64,7 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
|
||||
version, /* IPP version */
|
||||
job_id, /* Job ID for submitted job */
|
||||
job_reasons, /* Job state reasons bits */
|
||||
create_job, /* Support Create-Job? */
|
||||
get_job_attrs; /* Support Get-Job-Attributes? */
|
||||
const char *job_name; /* Job name for submitted job */
|
||||
http_encryption_t encryption; /* Use encryption? */
|
||||
@@ -121,6 +122,7 @@ static const char * const pattrs[] = /* Printer attributes we want */
|
||||
"printer-alert",
|
||||
"printer-alert-description",
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-mandatory-job-attributes",
|
||||
"printer-state",
|
||||
"printer-state-message",
|
||||
"printer-state-reasons"
|
||||
@@ -144,6 +146,8 @@ static cups_option_t *attr_cache = NULL;
|
||||
static cups_array_t *state_reasons; /* Array of printe-state-reasons keywords */
|
||||
static char tmpfilename[1024] = "";
|
||||
/* Temporary spool file name */
|
||||
static char mandatory_attrs[1024] = "";
|
||||
/* cupsMandatory value */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1294,11 +1298,16 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Load the PPD file and generate PWG attribute mapping information...
|
||||
*/
|
||||
|
||||
ppd_attr_t *mandatory; /* cupsMandatory value */
|
||||
|
||||
ppd = ppdOpenFile(getenv("PPD"));
|
||||
pc = _ppdCacheCreateWithPPD(ppd);
|
||||
|
||||
ppdMarkDefaults(ppd);
|
||||
cupsMarkOptions(ppd, num_options, options);
|
||||
|
||||
if ((mandatory = ppdFindAttr(ppd, "cupsMandatory", NULL)) != NULL)
|
||||
strlcpy(mandatory_attrs, mandatory->value, sizeof(mandatory_attrs));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1396,6 +1405,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
monitor.port = port;
|
||||
monitor.version = version;
|
||||
monitor.job_id = 0;
|
||||
monitor.create_job = create_job;
|
||||
monitor.get_job_attrs = get_job_attrs;
|
||||
monitor.encryption = cupsEncryption();
|
||||
monitor.job_state = IPP_JOB_PENDING;
|
||||
@@ -1457,6 +1467,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
|
||||
goto cleanup;
|
||||
else if (ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
|
||||
ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED)
|
||||
{
|
||||
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
@@ -1560,6 +1571,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
FD_ZERO(&input);
|
||||
FD_SET(fd, &input);
|
||||
FD_SET(snmp_fd, &input);
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
while (select(fd > snmp_fd ? fd + 1 : snmp_fd + 1, &input, NULL, NULL,
|
||||
NULL) <= 0 && !job_canceled);
|
||||
@@ -1788,7 +1800,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
|
||||
{
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
@@ -1806,6 +1818,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
}
|
||||
|
||||
if (job_canceled)
|
||||
break;
|
||||
|
||||
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
|
||||
{
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
@@ -2015,12 +2030,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
remote_job_states[job_state->values[0].integer -
|
||||
IPP_JOB_PENDING]);
|
||||
|
||||
if ((job_sheets = ippFindAttribute(response,
|
||||
"job-media-sheets-completed",
|
||||
IPP_TAG_INTEGER)) == NULL)
|
||||
job_sheets = ippFindAttribute(response,
|
||||
"job-impressions-completed",
|
||||
IPP_TAG_INTEGER);
|
||||
if ((job_sheets = ippFindAttribute(response, "job-impressions-completed", IPP_TAG_INTEGER)) == NULL)
|
||||
job_sheets = ippFindAttribute(response, "job-media-sheets-completed", IPP_TAG_INTEGER);
|
||||
|
||||
if (job_sheets)
|
||||
fprintf(stderr, "PAGE: total %d\n",
|
||||
@@ -2336,6 +2347,15 @@ monitor_printer(
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT)
|
||||
password_tries = 0;
|
||||
|
||||
if (monitor->job_id == 0 && monitor->create_job)
|
||||
{
|
||||
/*
|
||||
* No job-id yet, so continue...
|
||||
*/
|
||||
|
||||
goto monitor_disconnect;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the status of the job itself...
|
||||
*/
|
||||
@@ -2427,6 +2447,17 @@ monitor_printer(
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
|
||||
ippEnumString("job-state", monitor->job_state));
|
||||
|
||||
if (!job_canceled &&
|
||||
(monitor->job_state == IPP_JOB_CANCELED ||
|
||||
monitor->job_state == IPP_JOB_ABORTED))
|
||||
{
|
||||
job_canceled = -1;
|
||||
fprintf(stderr, "DEBUG: (monitor) job_canceled = -1\n");
|
||||
}
|
||||
|
||||
if ((attr = ippFindAttribute(response, "job-state-reasons",
|
||||
IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
@@ -2448,6 +2479,9 @@ monitor_printer(
|
||||
new_reasons |= _CUPS_JSR_JOB_PASSWORD_WAIT;
|
||||
else if (!strcmp(attr->values[i].string.text, "job-release-wait"))
|
||||
new_reasons |= _CUPS_JSR_JOB_RELEASE_WAIT;
|
||||
if (!job_canceled &&
|
||||
(!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
|
||||
job_canceled = 1;
|
||||
}
|
||||
|
||||
if (new_reasons != monitor->job_reasons)
|
||||
@@ -2473,7 +2507,7 @@ monitor_printer(
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state=%s\n",
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
|
||||
ippEnumString("job-state", monitor->job_state));
|
||||
|
||||
if (!job_canceled &&
|
||||
@@ -2485,6 +2519,8 @@ monitor_printer(
|
||||
* Disconnect from the printer - we'll reconnect on the next poll...
|
||||
*/
|
||||
|
||||
monitor_disconnect:
|
||||
|
||||
_httpDisconnect(http);
|
||||
}
|
||||
|
||||
@@ -2509,7 +2545,10 @@ monitor_printer(
|
||||
monitor->user, monitor->version);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: (monitor) cancel_job() = %s\n", cupsLastErrorString());
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2546,19 +2585,10 @@ new_request(
|
||||
ipp_attribute_t *print_color_mode_sup)
|
||||
/* I - Printer supports print-color-mode */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_t *request; /* Request data */
|
||||
const char *keyword; /* PWG keyword */
|
||||
_pwg_size_t *size; /* PWG media size */
|
||||
ipp_t *media_col, /* media-col value */
|
||||
*media_size; /* media-size value */
|
||||
const char *media_source, /* media-source value */
|
||||
*media_type, /* media-type value */
|
||||
*collate_str, /* multiple-document-handling value */
|
||||
*mandatory; /* Mandatory attributes */
|
||||
ipp_tag_t group; /* Current group */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
const char *color_attr_name; /* Supported color attribute */
|
||||
char buffer[1024]; /* Value buffer */
|
||||
|
||||
|
||||
@@ -2578,36 +2608,31 @@ new_request(
|
||||
* Add standard attributes...
|
||||
*/
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
fprintf(stderr, "DEBUG: printer-uri=\"%s\"\n", uri);
|
||||
|
||||
if (user && *user)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, user);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, user);
|
||||
fprintf(stderr, "DEBUG: requesting-user-name=\"%s\"\n", user);
|
||||
}
|
||||
|
||||
if (title && *title)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
|
||||
title);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, title);
|
||||
fprintf(stderr, "DEBUG: job-name=\"%s\"\n", title);
|
||||
}
|
||||
|
||||
if (format && op != IPP_CREATE_JOB)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
"document-format", NULL, format);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, format);
|
||||
fprintf(stderr, "DEBUG: document-format=\"%s\"\n", format);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (compression && op != IPP_OP_CREATE_JOB && op != IPP_OP_VALIDATE_JOB)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"compression", NULL, compression);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "compression", NULL, compression);
|
||||
fprintf(stderr, "DEBUG: compression=\"%s\"\n", compression);
|
||||
}
|
||||
#endif /* HAVE_LIBZ */
|
||||
@@ -2620,313 +2645,13 @@ new_request(
|
||||
{
|
||||
if (pc)
|
||||
{
|
||||
int num_finishings = 0, /* Number of finishing values */
|
||||
finishings[10]; /* Finishing enum values */
|
||||
ppd_choice_t *choice; /* Marked choice */
|
||||
|
||||
/*
|
||||
* Send standard IPP attributes...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Adding standard IPP operation/job attributes.\n", stderr);
|
||||
|
||||
if (pc->password &&
|
||||
(keyword = cupsGetOption("job-password", num_options,
|
||||
options)) != NULL)
|
||||
{
|
||||
ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", keyword, (int)strlen(keyword));
|
||||
|
||||
if ((keyword = cupsGetOption("job-password-encryption", num_options,
|
||||
options)) == NULL)
|
||||
keyword = "none";
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"job-password-encryption", NULL, keyword);
|
||||
}
|
||||
|
||||
if (pc->account_id)
|
||||
{
|
||||
if ((keyword = cupsGetOption("job-account-id", num_options,
|
||||
options)) == NULL)
|
||||
keyword = cupsGetOption("job-billing", num_options, options);
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id",
|
||||
NULL, keyword);
|
||||
}
|
||||
|
||||
if (pc->accounting_user_id)
|
||||
{
|
||||
if ((keyword = cupsGetOption("job-accounting-user-id", num_options,
|
||||
options)) == NULL)
|
||||
keyword = user;
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
|
||||
"job-accounting-user-id", NULL, keyword);
|
||||
}
|
||||
|
||||
for (mandatory = (char *)cupsArrayFirst(pc->mandatory);
|
||||
mandatory;
|
||||
mandatory = (char *)cupsArrayNext(pc->mandatory))
|
||||
{
|
||||
if (strcmp(mandatory, "copies") &&
|
||||
strcmp(mandatory, "destination-uris") &&
|
||||
strcmp(mandatory, "finishings") &&
|
||||
strcmp(mandatory, "job-account-id") &&
|
||||
strcmp(mandatory, "job-accounting-user-id") &&
|
||||
strcmp(mandatory, "job-password") &&
|
||||
strcmp(mandatory, "job-password-encryption") &&
|
||||
strcmp(mandatory, "media") &&
|
||||
strncmp(mandatory, "media-col", 9) &&
|
||||
strcmp(mandatory, "multiple-document-handling") &&
|
||||
strcmp(mandatory, "output-bin") &&
|
||||
strcmp(mandatory, "print-color-mode") &&
|
||||
strcmp(mandatory, "print-quality") &&
|
||||
strcmp(mandatory, "sides") &&
|
||||
(keyword = cupsGetOption(mandatory, num_options, options)) != NULL)
|
||||
{
|
||||
_ipp_option_t *opt = _ippFindOption(mandatory);
|
||||
/* Option type */
|
||||
ipp_tag_t value_tag = opt ? opt->value_tag : IPP_TAG_NAME;
|
||||
/* Value type */
|
||||
|
||||
switch (value_tag)
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
ippAddInteger(request, IPP_TAG_JOB, value_tag, mandatory,
|
||||
atoi(keyword));
|
||||
break;
|
||||
case IPP_TAG_BOOLEAN :
|
||||
ippAddBoolean(request, IPP_TAG_JOB, mandatory,
|
||||
!_cups_strcasecmp(keyword, "true"));
|
||||
break;
|
||||
case IPP_TAG_RANGE :
|
||||
{
|
||||
int lower, upper; /* Range */
|
||||
|
||||
if (sscanf(keyword, "%d-%d", &lower, &upper) != 2)
|
||||
lower = upper = atoi(keyword);
|
||||
|
||||
ippAddRange(request, IPP_TAG_JOB, mandatory, lower, upper);
|
||||
}
|
||||
break;
|
||||
case IPP_TAG_STRING :
|
||||
ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword, (int)strlen(keyword));
|
||||
break;
|
||||
default :
|
||||
if (!strcmp(mandatory, "print-color-mode") && !strcmp(keyword, "monochrome"))
|
||||
{
|
||||
if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
|
||||
keyword = "auto-monochrome";
|
||||
else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
|
||||
keyword = "process-monochrome";
|
||||
}
|
||||
|
||||
ippAddString(request, IPP_TAG_JOB, value_tag, mandatory,
|
||||
NULL, keyword);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("PageSize", num_options, options)) == NULL)
|
||||
keyword = cupsGetOption("media", num_options, options);
|
||||
|
||||
if ((size = _ppdCacheGetSize(pc, keyword)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Add a media-col value...
|
||||
*/
|
||||
|
||||
media_size = ippNew();
|
||||
ippAddInteger(media_size, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"x-dimension", size->width);
|
||||
ippAddInteger(media_size, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"y-dimension", size->length);
|
||||
|
||||
media_col = ippNew();
|
||||
ippAddCollection(media_col, IPP_TAG_ZERO, "media-size", media_size);
|
||||
|
||||
media_source = _ppdCacheGetSource(pc, cupsGetOption("InputSlot",
|
||||
num_options,
|
||||
options));
|
||||
media_type = _ppdCacheGetType(pc, cupsGetOption("MediaType",
|
||||
num_options,
|
||||
options));
|
||||
|
||||
for (i = 0; i < media_col_sup->num_values; i ++)
|
||||
{
|
||||
if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-left-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-left-margin", size->left);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-bottom-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-bottom-margin", size->bottom);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-right-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-right-margin", size->right);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-top-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-top-margin", size->top);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-source") && media_source)
|
||||
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
|
||||
"media-source", NULL, media_source);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-type") && media_type)
|
||||
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
|
||||
"media-type", NULL, media_type);
|
||||
}
|
||||
|
||||
ippAddCollection(request, IPP_TAG_JOB, "media-col", media_col);
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("output-bin", num_options,
|
||||
options)) == NULL)
|
||||
{
|
||||
if ((choice = ppdFindMarkedChoice(ppd, "OutputBin")) != NULL)
|
||||
keyword = _ppdCacheGetBin(pc, choice->choice);
|
||||
}
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin",
|
||||
NULL, keyword);
|
||||
|
||||
color_attr_name = print_color_mode_sup ? "print-color-mode" : "output-mode";
|
||||
|
||||
if ((keyword = cupsGetOption("print-color-mode", num_options,
|
||||
options)) == NULL)
|
||||
{
|
||||
if ((choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(choice->choice, "Gray"))
|
||||
keyword = "monochrome";
|
||||
else
|
||||
keyword = "color";
|
||||
}
|
||||
}
|
||||
|
||||
if (keyword && !strcmp(keyword, "monochrome"))
|
||||
{
|
||||
if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
|
||||
keyword = "auto-monochrome";
|
||||
else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
|
||||
keyword = "process-monochrome";
|
||||
}
|
||||
|
||||
if (keyword)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, color_attr_name,
|
||||
NULL, keyword);
|
||||
|
||||
if ((keyword = cupsGetOption("print-quality", num_options,
|
||||
options)) != NULL)
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
atoi(keyword));
|
||||
else if ((choice = ppdFindMarkedChoice(ppd, "cupsPrintQuality")) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(choice->choice, "draft"))
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
IPP_QUALITY_DRAFT);
|
||||
else if (!_cups_strcasecmp(choice->choice, "normal"))
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
IPP_QUALITY_NORMAL);
|
||||
else if (!_cups_strcasecmp(choice->choice, "high"))
|
||||
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
|
||||
IPP_QUALITY_HIGH);
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("sides", num_options, options)) != NULL)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, keyword);
|
||||
else if (pc->sides_option &&
|
||||
(choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(choice->choice, pc->sides_1sided))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, "one-sided");
|
||||
else if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_long))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, "two-sided-long-edge");
|
||||
if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_short))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
|
||||
NULL, "two-sided-short-edge");
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("multiple-document-handling",
|
||||
num_options, options)) != NULL)
|
||||
{
|
||||
if (strstr(keyword, "uncollated"))
|
||||
keyword = "false";
|
||||
else
|
||||
keyword = "true";
|
||||
}
|
||||
else if ((keyword = cupsGetOption("collate", num_options,
|
||||
options)) == NULL)
|
||||
keyword = "true";
|
||||
|
||||
if (format)
|
||||
{
|
||||
if (!_cups_strcasecmp(format, "image/gif") ||
|
||||
!_cups_strcasecmp(format, "image/jp2") ||
|
||||
!_cups_strcasecmp(format, "image/jpeg") ||
|
||||
!_cups_strcasecmp(format, "image/png") ||
|
||||
!_cups_strcasecmp(format, "image/tiff") ||
|
||||
!_cups_strncasecmp(format, "image/x-", 8))
|
||||
{
|
||||
/*
|
||||
* Collation makes no sense for single page image formats...
|
||||
*/
|
||||
|
||||
keyword = "false";
|
||||
}
|
||||
else if (!_cups_strncasecmp(format, "image/", 6) ||
|
||||
!_cups_strcasecmp(format, "application/vnd.cups-raster"))
|
||||
{
|
||||
/*
|
||||
* Multi-page image formats will have copies applied by the upstream
|
||||
* filters...
|
||||
*/
|
||||
|
||||
copies = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (doc_handling_sup)
|
||||
{
|
||||
if (!_cups_strcasecmp(keyword, "true"))
|
||||
collate_str = "separate-documents-collated-copies";
|
||||
else
|
||||
collate_str = "separate-documents-uncollated-copies";
|
||||
|
||||
for (i = 0; i < doc_handling_sup->num_values; i ++)
|
||||
if (!strcmp(doc_handling_sup->values[i].string.text, collate_str))
|
||||
{
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD,
|
||||
"multiple-document-handling", NULL, collate_str);
|
||||
break;
|
||||
}
|
||||
|
||||
if (i >= doc_handling_sup->num_values)
|
||||
copies = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map finishing options...
|
||||
*/
|
||||
|
||||
num_finishings = _ppdCacheGetFinishingValues(pc, num_options, options,
|
||||
(int)(sizeof(finishings) /
|
||||
sizeof(finishings[0])),
|
||||
finishings);
|
||||
if (num_finishings > 0)
|
||||
ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings",
|
||||
num_finishings, finishings);
|
||||
copies = _cupsConvertOptions(request, ppd, pc, media_col_sup, doc_handling_sup, print_color_mode_sup, user, format, copies, num_options, options);
|
||||
|
||||
/*
|
||||
* Map FaxOut options...
|
||||
@@ -3208,6 +2933,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
{
|
||||
ipp_attribute_t *pa, /* printer-alert */
|
||||
*pam, /* printer-alert-message */
|
||||
*pmja, /* printer-mandatory-job-attributes */
|
||||
*psm, /* printer-state-message */
|
||||
*reasons, /* printer-state-reasons */
|
||||
*marker; /* marker-* attributes */
|
||||
@@ -3228,6 +2954,26 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
IPP_TAG_TEXT)) != NULL)
|
||||
report_attr(pam);
|
||||
|
||||
if ((pmja = ippFindAttribute(ipp, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL)
|
||||
{
|
||||
int i, /* Looping var */
|
||||
count = ippGetCount(pmja); /* Number of values */
|
||||
|
||||
for (i = 0, valptr = value; i < count; i ++, valptr += strlen(valptr))
|
||||
{
|
||||
if (i)
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value), " %s", ippGetString(pmja, i, NULL));
|
||||
else
|
||||
strlcpy(value, ippGetString(pmja, i, NULL), sizeof(value));
|
||||
}
|
||||
|
||||
if (strcmp(value, mandatory_attrs))
|
||||
{
|
||||
strlcpy(mandatory_attrs, value, sizeof(mandatory_attrs));
|
||||
fprintf(stderr, "PPD: cupsMandatory=\"%s\"\n", value);
|
||||
}
|
||||
}
|
||||
|
||||
if ((psm = ippFindAttribute(ipp, "printer-state-message",
|
||||
IPP_TAG_TEXT)) != NULL)
|
||||
{
|
||||
@@ -3530,7 +3276,7 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
* Flag that the job should be canceled...
|
||||
*/
|
||||
|
||||
write(2, "DEBUG: job_canceled = 1.\n", 25);
|
||||
write(2, "DEBUG: sigterm_handler: job_canceled = 1.\n", 25);
|
||||
|
||||
job_canceled = 1;
|
||||
return;
|
||||
@@ -3756,5 +3502,5 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
}
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp.c 12048 2014-07-18 14:26:14Z msweet $".
|
||||
* End of "$Id: ipp.c 12896 2015-10-09 13:15:22Z msweet $".
|
||||
*/
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $"
|
||||
* "$Id: lpd.c 13040 2016-01-11 20:29:13Z msweet $"
|
||||
*
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
*
|
||||
@@ -1251,7 +1251,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */
|
||||
*/
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.addr.sa_family = family;
|
||||
addr.addr.sa_family = (sa_family_t)family;
|
||||
|
||||
/*
|
||||
* Try to bind the socket to a reserved port...
|
||||
@@ -1320,5 +1320,5 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $".
|
||||
* End of "$Id: lpd.c 13040 2016-01-11 20:29:13Z msweet $".
|
||||
*/
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: network.c 11970 2014-07-01 14:35:25Z msweet $"
|
||||
* "$Id: network.c 12124 2014-08-28 15:37:22Z msweet $"
|
||||
*
|
||||
* Common backend network APIs for CUPS.
|
||||
*
|
||||
@@ -175,13 +175,13 @@ backendNetworkSideCB(
|
||||
{
|
||||
case CUPS_ASN1_BOOLEAN :
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%d", packet.object_value.boolean);
|
||||
datalen += strlen(dataptr);
|
||||
datalen += (int)strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_INTEGER :
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%d",
|
||||
packet.object_value.integer);
|
||||
datalen += strlen(dataptr);
|
||||
datalen += (int)strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_BIT_STRING :
|
||||
@@ -193,13 +193,13 @@ backendNetworkSideCB(
|
||||
|
||||
memcpy(dataptr, packet.object_value.string.bytes, i);
|
||||
|
||||
datalen += i;
|
||||
datalen += (int)i;
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_OID :
|
||||
_cupsSNMPOIDToString(packet.object_value.oid, dataptr,
|
||||
sizeof(data) - (size_t)(dataptr - data));
|
||||
datalen += strlen(dataptr);
|
||||
datalen += (int)strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_HEX_STRING :
|
||||
@@ -208,22 +208,22 @@ backendNetworkSideCB(
|
||||
dataptr < (data + sizeof(data) - 3);
|
||||
i ++, dataptr += 2)
|
||||
sprintf(dataptr, "%02X", packet.object_value.string.bytes[i]);
|
||||
datalen += strlen(dataptr);
|
||||
datalen += (int)strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_COUNTER :
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.counter);
|
||||
datalen += strlen(dataptr);
|
||||
datalen += (int)strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_GAUGE :
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.gauge);
|
||||
datalen += strlen(dataptr);
|
||||
datalen += (int)strlen(dataptr);
|
||||
break;
|
||||
|
||||
case CUPS_ASN1_TIMETICKS :
|
||||
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.timeticks);
|
||||
datalen += strlen(dataptr);
|
||||
datalen += (int)strlen(dataptr);
|
||||
break;
|
||||
|
||||
default :
|
||||
@@ -304,5 +304,5 @@ backendNetworkSideCB(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: network.c 11970 2014-07-01 14:35:25Z msweet $".
|
||||
* End of "$Id: network.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# product ID (omit for all vendor products), and a list of known issues:
|
||||
#
|
||||
# blacklist The printer is not functional with the USB backend.
|
||||
# delay-close Delay close/reset of selected interface
|
||||
# no-reattach Do no re-attach usblp kernel module after printing.
|
||||
# soft-reset Do a soft reset after printing for cleanup.
|
||||
# unidir Only supported unidirectional I/O
|
||||
@@ -51,64 +52,67 @@
|
||||
# NEC Picty800 (HP OEM)
|
||||
0x0409 0xf1be unidir
|
||||
|
||||
# Lexmark International, Inc. (e250d), https://bugs.launchpad.net/bugs/1084164
|
||||
# Lexmark International, Inc. (e250d) (https://bugs.launchpad.net/bugs/1084164)
|
||||
0x043d 0x00f3 no-reattach
|
||||
|
||||
# Kyocera Mita FS 820, by zut <kernel@zut.de>
|
||||
0x0482 0x0010 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP6000D Printer, https://bugs.launchpad.net/bugs/1160638
|
||||
# Canon, Inc. PIXMA iP6000D Printer (https://bugs.launchpad.net/bugs/1160638)
|
||||
0x04a9 0x1095 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP4200 Printer, http://www.cups.org/str.php?L4155
|
||||
# Canon, Inc. PIXMA iP4200 Printer (Issue #4155)
|
||||
0x04a9 0x10a2 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP4300 Printer, https://bugs.launchpad.net/bugs/1032385
|
||||
# Canon, Inc. PIXMA iP4300 Printer (https://bugs.launchpad.net/bugs/1032385)
|
||||
0x04a9 0x10b6 unidir
|
||||
|
||||
# Canon, Inc. MP210 https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53
|
||||
# Canon, Inc. MP210 (https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53)
|
||||
0x04a9 0x1721 unidir
|
||||
|
||||
# Canon, Inc. MP500 Printer, https://bugs.launchpad.net/bugs/1032456
|
||||
# Canon, Inc. MP500 Printer (https://bugs.launchpad.net/bugs/1032456)
|
||||
0x04a9 0x170c unidir
|
||||
|
||||
# Canon, Inc. MP510 Printer, https://bugs.launchpad.net/bugs/1050009
|
||||
# Canon, Inc. MP510 Printer (https://bugs.launchpad.net/bugs/1050009)
|
||||
0x04a9 0x1717 unidir
|
||||
|
||||
# Canon, Inc. MP550 Printer, http://www.cups.org/str.php?L4155
|
||||
# Canon, Inc. MP550 Printer (Issue #4155)
|
||||
0x04a9 0x173d unidir
|
||||
|
||||
# Canon, Inc. MP560 Printer, http://www.cups.org/str.php?L4155
|
||||
# Canon, Inc. MP560 Printer (Issue #4155)
|
||||
0x04a9 0x173e unidir
|
||||
|
||||
# Canon, Inc. MF4150 Printer, https://bugs.launchpad.net/bugs/1160638
|
||||
# Canon, Inc. MF4150 Printer (https://bugs.launchpad.net/bugs/1160638)
|
||||
0x04a9 0x26a3 no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1430 Laser Printer, https://bugs.launchpad.net/bugs/1038695
|
||||
# Brother Industries, Ltd HL-1250 Laser Printer (https://bugs.debian.org/712512)
|
||||
0x04f9 0x0007 no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1430 Laser Printer (https://bugs.launchpad.net/bugs/1038695)
|
||||
0x04f9 0x001a no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1440 Laser Printer, https://bugs.launchpad.net/bugs/1000253
|
||||
# Brother Industries, Ltd HL-1440 Laser Printer (https://bugs.launchpad.net/bugs/1000253)
|
||||
0x04f9 0x000d no-reattach unidir
|
||||
|
||||
# Brother Industries, Ltd HL-1450 Laser Printer, https://bugs.launchpad.net/bugs/1000253
|
||||
# Brother Industries, Ltd HL-1450 Laser Printer (https://bugs.launchpad.net/bugs/1000253)
|
||||
0x04f9 0x000e no-reattach unidir
|
||||
|
||||
# Oki Data Corp. Okipage 14ex Printer, https://bugs.launchpad.net/bugs/872483
|
||||
# Oki Data Corp. Okipage 14ex Printer (https://bugs.launchpad.net/bugs/872483)
|
||||
0x06bc 0x000b no-reattach
|
||||
|
||||
# Oki Data Corp. B410d, https://bugs.launchpad.net/bugs/872483
|
||||
# Oki Data Corp. B410d (https://bugs.launchpad.net/bugs/872483)
|
||||
0x06bc 0x01c7 no-reattach
|
||||
|
||||
# Seiko Epson Corp. Stylus Color 740 / Photo 750, http://bugs.debian.org/697970
|
||||
# Seiko Epson Corp. Stylus Color 740 / Photo 750 (http://bugs.debian.org/697970)
|
||||
0x04b8 0x0001 no-reattach unidir
|
||||
|
||||
# Seiko Epson Corp. Stylus Color 670, https://bugs.launchpad.net/bugs/872483
|
||||
# Seiko Epson Corp. Stylus Color 670 (https://bugs.launchpad.net/bugs/872483)
|
||||
0x04b8 0x0005 no-reattach
|
||||
|
||||
# Seiko Epson Receipt Printer M129C
|
||||
0x04b8 0x0202 vendor-class
|
||||
|
||||
# Prolific Technology, Inc. PL2305 Parallel Port (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485
|
||||
# Prolific Technology, Inc. PL2305 Parallel Port (USB -> Parallel adapter) (https://bugs.launchpad.net/bugs/987485)
|
||||
0x067b 0x2305 no-reattach soft-reset unidir
|
||||
|
||||
# Xerox Phaser 3124 https://bugzilla.redhat.com/show_bug.cgi?id=867392
|
||||
@@ -117,13 +121,13 @@
|
||||
# Xerox WorkCentre 3210 https://bugs.launchpad.net/bugs/1102470
|
||||
0x0924 0x4293 no-reattach
|
||||
|
||||
# QinHeng Electronics CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253
|
||||
# QinHeng Electronics CH340S (USB -> Parallel adapter) (https://bugs.launchpad.net/bugs/1000253)
|
||||
0x1a86 0x7584 no-reattach
|
||||
|
||||
# All Samsung devices, https://bugs.launchpad.net/bugs/1032456
|
||||
# All Samsung devices (https://bugs.launchpad.net/bugs/1032456)
|
||||
0x04e8 soft-reset
|
||||
|
||||
# All Zebra devices, https://bugs.launchpad.net/bugs/1001028
|
||||
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028)
|
||||
0x0a5f unidir
|
||||
|
||||
# Canon CP-10
|
||||
@@ -213,5 +217,33 @@
|
||||
# Lexmark E238 (<rdar://problem/14493054>)
|
||||
0x043d 0x00d7 no-reattach
|
||||
|
||||
# Lexmark E238 (STR #4448)
|
||||
# Lexmark E238 (Issue #4448)
|
||||
0x043d 0x009a no-reattach
|
||||
|
||||
# Canon MX310 (Issue #4482)
|
||||
0x04a9 0x1728 unidir
|
||||
|
||||
# Canon MX320 (Issue #4482)
|
||||
0x04A9 0x1736 unidir
|
||||
|
||||
# All Intermec devices (Issue #4553)
|
||||
0x067e no-reattach
|
||||
|
||||
# HP LaserJet 1150 (Issue #4549)
|
||||
0x03f0 0x0f17 delay-close
|
||||
|
||||
# HP LaserJet 1300 (Issue #4549)
|
||||
0x03f0 0x1017 delay-close
|
||||
0x03f0 0x1117 delay-close
|
||||
|
||||
# HP LaserJet 1320 (Issue #4549)
|
||||
0x03f0 0x1d17 delay-close
|
||||
|
||||
# Canon, Inc. MP530 Printer
|
||||
0x04a9 0x1712 unidir
|
||||
|
||||
# Xerox WorkCentre 3220 (https://bugs.launchpad.net/bugs/1406203, Issue #4789)
|
||||
0x0924 0x4294 no-reattach
|
||||
|
||||
# Lexmark C540n (Issue #4778)
|
||||
0x043d 0x0139 no-reattach
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: snmp-supplies.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
* "$Id: snmp-supplies.c 12227 2014-10-21 13:42:04Z msweet $"
|
||||
*
|
||||
* SNMP supplies functions for CUPS.
|
||||
*
|
||||
@@ -297,6 +297,7 @@ backendSNMPSupplies(
|
||||
else
|
||||
new_supply_state |= CUPS_OPC_NEAR_EOL;
|
||||
break;
|
||||
#if 0 /* Because no two vendors report waste containers the same, disable SNMP reporting of same */
|
||||
case CUPS_TC_wasteInk :
|
||||
case CUPS_TC_wastePaper :
|
||||
case CUPS_TC_wasteToner :
|
||||
@@ -307,6 +308,7 @@ backendSNMPSupplies(
|
||||
else
|
||||
new_supply_state |= CUPS_WASTE_ALMOST_FULL;
|
||||
break;
|
||||
#endif /* 0 */
|
||||
case CUPS_TC_cleanerUnit :
|
||||
case CUPS_TC_fuserCleaningPad :
|
||||
if (percent <= 1)
|
||||
@@ -1096,5 +1098,5 @@ utf16_to_utf8(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: snmp-supplies.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
* End of "$Id: snmp-supplies.c 12227 2014-10-21 13:42:04Z msweet $".
|
||||
*/
|
||||
|
||||
+579
-390
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+29
-7
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: usb-libusb.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* "$Id: usb-libusb.c 12881 2015-09-15 21:20:02Z msweet $"
|
||||
*
|
||||
* LIBUSB interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -103,6 +103,7 @@ typedef struct usb_globals_s /* Global USB printer information */
|
||||
#define USB_QUIRK_USB_INIT 0x0010 /* Needs vendor USB init string */
|
||||
#define USB_QUIRK_VENDOR_CLASS 0x0020 /* Descriptor uses vendor-specific
|
||||
Class or SubClass */
|
||||
#define USB_QUIRK_DELAY_CLOSE 0x0040 /* Delay close */
|
||||
#define USB_QUIRK_WHITELIST 0x0000 /* no quirks */
|
||||
|
||||
|
||||
@@ -641,6 +642,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* Close the connection and input file and general clean up...
|
||||
*/
|
||||
|
||||
if (g.printer->quirks & USB_QUIRK_DELAY_CLOSE)
|
||||
sleep(1);
|
||||
|
||||
close_device(g.printer);
|
||||
|
||||
/*
|
||||
@@ -915,7 +919,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
write_endp = endp;
|
||||
}
|
||||
|
||||
if (write_endp >= 0)
|
||||
if (write_endp != 0xff)
|
||||
{
|
||||
/*
|
||||
* Save the best match so far...
|
||||
@@ -1211,6 +1215,9 @@ load_quirks(void)
|
||||
if (strstr(line, " blacklist"))
|
||||
quirk->quirks |= USB_QUIRK_BLACKLIST;
|
||||
|
||||
if (strstr(line, " delay-close"))
|
||||
quirk->quirks |= USB_QUIRK_DELAY_CLOSE;
|
||||
|
||||
if (strstr(line, " no-reattach"))
|
||||
quirk->quirks |= USB_QUIRK_NO_REATTACH;
|
||||
|
||||
@@ -1451,9 +1458,14 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
else
|
||||
{
|
||||
printer->usblp_attached = 0;
|
||||
fprintf(stderr, "DEBUG: Failed to check whether %04x:%04x has the \"usblp\" kernel module attached\n",
|
||||
devdesc.idVendor, devdesc.idProduct);
|
||||
goto error;
|
||||
|
||||
if (errcode != LIBUSB_ERROR_NOT_SUPPORTED)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG: Failed to check whether %04x:%04x has the \"usblp\" "
|
||||
"kernel module attached\n", devdesc.idVendor, devdesc.idProduct);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1517,6 +1529,16 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
|
||||
goto error;
|
||||
}
|
||||
else if ((errcode = libusb_detach_kernel_driver(printer->handle, printer->iface)) < 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG: Failed to detach \"usblp\" module from %04x:%04x\n",
|
||||
devdesc.idVendor, devdesc.idProduct);
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
sleep (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1999,6 +2021,6 @@ soft_reset_printer(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-libusb.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
* End of "$Id: usb-libusb.c 12881 2015-09-15 21:20:02Z msweet $".
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: usb-unix.c 11342 2013-10-18 20:36:01Z msweet $"
|
||||
* "$Id: usb-unix.c 12124 2014-08-28 15:37:22Z msweet $"
|
||||
*
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
@@ -146,7 +146,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
tcgetattr(device_fd, &opts);
|
||||
|
||||
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
|
||||
opts.c_lflag &= ~(unsigned)(ICANON | ECHO | ISIG); /* Raw mode */
|
||||
|
||||
/**** No options supported yet ****/
|
||||
|
||||
@@ -603,5 +603,5 @@ side_cb(int print_fd, /* I - Print file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-unix.c 11342 2013-10-18 20:36:01Z msweet $".
|
||||
* End of "$Id: usb-unix.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: Makefile 11777 2014-03-28 19:18:10Z msweet $"
|
||||
# "$Id: Makefile 12519 2015-02-17 13:10:19Z msweet $"
|
||||
#
|
||||
# CGI makefile for CUPS.
|
||||
#
|
||||
@@ -353,5 +353,5 @@ include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 11777 2014-03-28 19:18:10Z msweet $".
|
||||
# End of "$Id: Makefile 12519 2015-02-17 13:10:19Z msweet $".
|
||||
#
|
||||
|
||||
+91
-12
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: admin.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* "$Id: admin.c 12516 2015-02-12 20:18:11Z msweet $"
|
||||
*
|
||||
* Administration CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
|
||||
#include "cgi-private.h"
|
||||
#include <cups/http-private.h>
|
||||
#include <cups/ppd-private.h>
|
||||
#include <cups/adminutil.h>
|
||||
#include <cups/ppd.h>
|
||||
#include <errno.h>
|
||||
@@ -38,12 +40,7 @@ static int current_device = 0; /* Current device shown */
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void choose_device_cb(const char *device_class,
|
||||
const char *device_id, const char *device_info,
|
||||
const char *device_make_and_model,
|
||||
const char *device_uri,
|
||||
const char *device_location,
|
||||
const char *title);
|
||||
static void choose_device_cb(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, const char *device_location, const char *title);
|
||||
static void do_add_rss_subscription(http_t *http);
|
||||
static void do_am_class(http_t *http, int modify);
|
||||
static void do_am_printer(http_t *http, int modify);
|
||||
@@ -61,6 +58,7 @@ static void do_set_sharing(http_t *http);
|
||||
static char *get_option_value(ppd_file_t *ppd, const char *name,
|
||||
char *buffer, size_t bufsize);
|
||||
static double get_points(double number, const char *uval);
|
||||
static char *get_printer_ppd(const char *uri, char *buffer, size_t bufsize);
|
||||
|
||||
|
||||
/*
|
||||
@@ -832,7 +830,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
const cgi_file_t *file; /* Uploaded file, if any */
|
||||
const char *var; /* CGI variable */
|
||||
char uri[HTTP_MAX_URI], /* Device or printer URI */
|
||||
*uriptr; /* Pointer into URI */
|
||||
*uriptr, /* Pointer into URI */
|
||||
evefile[1024] = ""; /* IPP Everywhere PPD file */
|
||||
int maxrate; /* Maximum baud rate */
|
||||
char baudrate[255]; /* Baud rate string */
|
||||
const char *name, /* Pointer to class name */
|
||||
@@ -1331,7 +1330,9 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
if (!file)
|
||||
{
|
||||
var = cgiGetVariable("PPD_NAME");
|
||||
if (strcmp(var, "__no_change__"))
|
||||
if (!strcmp(var, "everywhere"))
|
||||
get_printer_ppd(cgiGetVariable("DEVICE_URI"), evefile, sizeof(evefile));
|
||||
else if (strcmp(var, "__no_change__"))
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, var);
|
||||
}
|
||||
@@ -1384,6 +1385,11 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (file)
|
||||
ippDelete(cupsDoFileRequest(http, request, "/admin/", file->tempfile));
|
||||
else if (evefile[0])
|
||||
{
|
||||
ippDelete(cupsDoFileRequest(http, request, "/admin/", evefile));
|
||||
unlink(evefile);
|
||||
}
|
||||
else
|
||||
ippDelete(cupsDoRequest(http, request, "/admin/"));
|
||||
|
||||
@@ -1897,7 +1903,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
}
|
||||
else
|
||||
{
|
||||
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
|
||||
cgiSetVariable("refresh_page", "5;URL=/admin/");
|
||||
|
||||
cgiStartHTML(cgiText(_("Edit Configuration File")));
|
||||
cgiCopyTemplateLang("restart.tmpl");
|
||||
@@ -4198,5 +4204,78 @@ get_points(double number, /* I - Original number */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: admin.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
* 'get_printer_ppd()' - Get an IPP Everywhere PPD file for the given URI.
|
||||
*/
|
||||
|
||||
static char * /* O - Filename or NULL */
|
||||
get_printer_ppd(const char *uri, /* I - Printer URI */
|
||||
char *buffer, /* I - Filename buffer */
|
||||
size_t bufsize) /* I - Size of filename buffer */
|
||||
{
|
||||
http_t *http; /* Connection to printer */
|
||||
ipp_t *request, /* Get-Printer-Attributes request */
|
||||
*response; /* Get-Printer-Attributes response */
|
||||
char resolved[1024], /* Resolved URI */
|
||||
scheme[32], /* URI scheme */
|
||||
userpass[256], /* Username:password */
|
||||
host[256], /* Hostname */
|
||||
resource[256]; /* Resource path */
|
||||
int port; /* Port number */
|
||||
|
||||
|
||||
/*
|
||||
* Connect to the printer...
|
||||
*/
|
||||
|
||||
if (strstr(uri, "._tcp"))
|
||||
{
|
||||
/*
|
||||
* Resolve URI...
|
||||
*/
|
||||
|
||||
if (!_httpResolveURI(uri, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL))
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to resolve \"%s\".\n", uri);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
uri = resolved;
|
||||
}
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Bad printer URI \"%s\".\n", uri);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
http = httpConnect2(host, port, NULL, AF_UNSPEC, !strcmp(scheme, "ipps") ? HTTP_ENCRYPTION_ALWAYS : HTTP_ENCRYPTION_IF_REQUESTED, 1, 30000, NULL);
|
||||
if (!http)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to connect to \"%s:%d\": %s\n", host, port, cupsLastErrorString());
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Send a Get-Printer-Attributes request...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
if (!_ppdCreateFromIPP(buffer, bufsize, response))
|
||||
fprintf(stderr, "ERROR: Unable to create PPD file: %s\n", strerror(errno));
|
||||
|
||||
ippDelete(response);
|
||||
httpClose(http);
|
||||
|
||||
if (buffer[0])
|
||||
return (buffer);
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: admin.c 12516 2015-02-12 20:18:11Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: help-index.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* "$Id: help-index.c 12644 2015-05-19 21:22:35Z msweet $"
|
||||
*
|
||||
* Online help index routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -884,7 +884,7 @@ help_load_file(
|
||||
|
||||
|
||||
DEBUG_printf(("2help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", "
|
||||
"mtime=%ld)", hi, filename, relative, mtime));
|
||||
"mtime=%ld)", hi, filename, relative, (long)mtime));
|
||||
|
||||
if ((fp = cupsFileOpen(filename, "r")) == NULL)
|
||||
return (-1);
|
||||
@@ -1220,7 +1220,7 @@ help_new_node(const char *filename, /* I - Filename */
|
||||
|
||||
n->filename = strdup(filename);
|
||||
n->anchor = anchor ? strdup(anchor) : NULL;
|
||||
n->section = (section && *section) ? strdup(section) : NULL;
|
||||
n->section = *section ? strdup(section) : NULL;
|
||||
n->text = strdup(text);
|
||||
n->mtime = mtime;
|
||||
n->offset = offset;
|
||||
@@ -1306,5 +1306,5 @@ help_sort_words(help_word_t *w1, /* I - Second word */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: help-index.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
* End of "$Id: help-index.c 12644 2015-05-19 21:22:35Z msweet $".
|
||||
*/
|
||||
|
||||
+7
-18
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: ipp-var.c 11889 2014-05-22 13:54:15Z msweet $"
|
||||
* "$Id: ipp-var.c 12768 2015-06-30 16:13:38Z msweet $"
|
||||
*
|
||||
* CGI <-> IPP variable routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -222,6 +222,9 @@ cgiGetIPPObjects(ipp_t *response, /* I - IPP response */
|
||||
break;
|
||||
|
||||
case IPP_TAG_INTEGER :
|
||||
if (!strncmp(ippGetName(attr), "time-at-", 8))
|
||||
break; /* Ignore time-at-xxx */
|
||||
|
||||
for (i = 0; !add && i < attr->num_values; i ++)
|
||||
{
|
||||
char buf[255]; /* Number buffer */
|
||||
@@ -1202,21 +1205,7 @@ cgiSetIPPObjectVars(
|
||||
* Rewrite URIs...
|
||||
*/
|
||||
|
||||
if (!strcmp(name, "member_uris"))
|
||||
{
|
||||
char url[1024]; /* URL for class member... */
|
||||
|
||||
|
||||
cgiRewriteURL(attr->values[i].string.text, url,
|
||||
sizeof(url), NULL);
|
||||
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
|
||||
"<A HREF=\"%s\">%s</A>", url,
|
||||
strrchr(attr->values[i].string.text, '/') + 1);
|
||||
}
|
||||
else
|
||||
cgiRewriteURL(attr->values[i].string.text, valptr,
|
||||
(int)(sizeof(value) - (size_t)(valptr - value)), NULL);
|
||||
cgiRewriteURL(attr->values[i].string.text, valptr, (int)(sizeof(value) - (size_t)(valptr - value)), NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1561,5 +1550,5 @@ cgiText(const char *message) /* I - Message */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp-var.c 11889 2014-05-22 13:54:15Z msweet $".
|
||||
* End of "$Id: ipp-var.c 12768 2015-06-30 16:13:38Z msweet $".
|
||||
*/
|
||||
|
||||
+4
-36
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: template.c 11685 2014-03-05 20:03:29Z msweet $"
|
||||
* "$Id: template.c 12700 2015-06-08 18:32:35Z msweet $"
|
||||
*
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -648,39 +648,7 @@ cgi_puts(const char *s, /* I - String to output */
|
||||
while (*s)
|
||||
{
|
||||
if (*s == '<')
|
||||
{
|
||||
/*
|
||||
* Pass <A HREF="url"> and </A>, otherwise quote it...
|
||||
*/
|
||||
|
||||
if (!_cups_strncasecmp(s, "<A HREF=\"", 9))
|
||||
{
|
||||
fputs("<A HREF=\"", out);
|
||||
s += 9;
|
||||
|
||||
while (*s && *s != '\"')
|
||||
{
|
||||
if (*s == '&')
|
||||
fputs("&", out);
|
||||
else
|
||||
putc(*s, out);
|
||||
|
||||
s ++;
|
||||
}
|
||||
|
||||
if (*s)
|
||||
s ++;
|
||||
|
||||
fputs("\">", out);
|
||||
}
|
||||
else if (!_cups_strncasecmp(s, "</A>", 4))
|
||||
{
|
||||
fputs("</A>", out);
|
||||
s += 3;
|
||||
}
|
||||
else
|
||||
fputs("<", out);
|
||||
}
|
||||
fputs("<", out);
|
||||
else if (*s == '>')
|
||||
fputs(">", out);
|
||||
else if (*s == '\"')
|
||||
@@ -718,5 +686,5 @@ cgi_puturi(const char *s, /* I - String to output */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: template.c 11685 2014-03-05 20:03:29Z msweet $".
|
||||
* End of "$Id: template.c 12700 2015-06-08 18:32:35Z msweet $".
|
||||
*/
|
||||
|
||||
+27
-8
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: var.c 12034 2014-07-16 19:37:34Z msweet $"
|
||||
* "$Id: var.c 12621 2015-05-06 21:32:18Z msweet $"
|
||||
*
|
||||
* CGI form variable and array functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -626,6 +626,8 @@ cgi_initialize_cookies(void)
|
||||
|
||||
while (*cookie)
|
||||
{
|
||||
int skip = 0; /* Skip this cookie? */
|
||||
|
||||
/*
|
||||
* Skip leading whitespace...
|
||||
*/
|
||||
@@ -641,9 +643,14 @@ cgi_initialize_cookies(void)
|
||||
|
||||
for (ptr = name; *cookie && *cookie != '=';)
|
||||
if (ptr < (name + sizeof(name) - 1))
|
||||
{
|
||||
*ptr++ = *cookie++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
{
|
||||
skip = 1;
|
||||
cookie ++;
|
||||
}
|
||||
|
||||
if (*cookie != '=')
|
||||
break;
|
||||
@@ -659,26 +666,38 @@ cgi_initialize_cookies(void)
|
||||
{
|
||||
for (cookie ++, ptr = value; *cookie && *cookie != '\"';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
{
|
||||
*ptr++ = *cookie++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
{
|
||||
skip = 1;
|
||||
cookie ++;
|
||||
}
|
||||
|
||||
if (*cookie == '\"')
|
||||
cookie ++;
|
||||
else
|
||||
skip = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ptr = value; *cookie && *cookie != ';';)
|
||||
if (ptr < (value + sizeof(value) - 1))
|
||||
{
|
||||
*ptr++ = *cookie++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
{
|
||||
skip = 1;
|
||||
cookie ++;
|
||||
}
|
||||
}
|
||||
|
||||
if (*cookie == ';')
|
||||
cookie ++;
|
||||
else if (*cookie)
|
||||
break;
|
||||
skip = 1;
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
@@ -687,7 +706,7 @@ cgi_initialize_cookies(void)
|
||||
* "$"...
|
||||
*/
|
||||
|
||||
if (name[0] != '$')
|
||||
if (name[0] != '$' && !skip)
|
||||
num_cookies = cupsAddOption(name, value, num_cookies, &cookies);
|
||||
}
|
||||
}
|
||||
@@ -1278,5 +1297,5 @@ cgi_unlink_file(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: var.c 12034 2014-07-16 19:37:34Z msweet $".
|
||||
* End of "$Id: var.c 12621 2015-05-06 21:32:18Z msweet $".
|
||||
*/
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
# "$Id: Makefile 12533 2015-02-27 12:30:26Z msweet $"
|
||||
#
|
||||
# Configuration file makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 2007-2015 by Apple Inc.
|
||||
# Copyright 1993-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -76,8 +76,8 @@ install-data:
|
||||
else \
|
||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \
|
||||
fi ; \
|
||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \
|
||||
done
|
||||
$(INSTALL_CONFIG) -g $(CUPS_GROUP) cupsd.conf $(SERVERROOT)/cupsd.conf.default
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/mime
|
||||
for file in $(REPLACE); do \
|
||||
if test -r $(DATADIR)/mime/$$file ; then \
|
||||
@@ -139,5 +139,5 @@ uninstall:
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
# End of "$Id: Makefile 12533 2015-02-27 12:30:26Z msweet $".
|
||||
#
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#Group @CUPS_GROUP@
|
||||
|
||||
# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
|
||||
# This cannot contain the Group value for security reasons...
|
||||
SystemGroup @CUPS_SYSTEM_GROUPS@
|
||||
@CUPS_SYSTEM_AUTHKEY@
|
||||
|
||||
@@ -74,11 +75,8 @@ PageLog @CUPS_LOGDIR@/page_log
|
||||
# Location of helper programs...
|
||||
#ServerBin @CUPS_SERVERBIN@
|
||||
|
||||
# SSL/TLS certificate for the scheduler...
|
||||
#ServerCertificate @CUPS_SERVERCERT@
|
||||
|
||||
# SSL/TLS private key for the scheduler...
|
||||
#ServerKey @CUPS_SERVERKEY@
|
||||
# SSL/TLS keychain for the scheduler...
|
||||
#ServerKeychain @CUPS_SERVERKEYCHAIN@
|
||||
|
||||
# Location of other configuration files...
|
||||
#ServerRoot @CUPS_SERVERROOT@
|
||||
|
||||
@@ -39,6 +39,13 @@ WebInterface @CUPS_WEBIF@
|
||||
Order allow,deny
|
||||
</Location>
|
||||
|
||||
# Restrict access to log files...
|
||||
<Location /admin/log>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order allow,deny
|
||||
</Location>
|
||||
|
||||
# Set the default printer/job policies...
|
||||
<Policy default>
|
||||
# Job/subscription privacy...
|
||||
|
||||
+9
-2
@@ -7,7 +7,7 @@
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 2007-2015 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -71,7 +71,7 @@
|
||||
#
|
||||
|
||||
#application/msword doc string(0,<D0CF11E0A1B11AE1>)
|
||||
application/pdf pdf regex(0,^[\\n\\r]*%PDF)
|
||||
application/pdf pdf regex(0,^[\n\r]*%PDF)
|
||||
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
contains(0,128,<1B>%-12345X) + \
|
||||
(contains(0,4096,"LANGUAGE=POSTSCRIPT") \
|
||||
@@ -81,6 +81,13 @@ application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
(contains(0,4096,<0a>%!) + \
|
||||
!contains(0,4096,"ENTER LANGUAGE")))
|
||||
|
||||
application/g-code gcode
|
||||
application/sla stl string(0,"solid ") + contains(0,4096,"facet") + contains(0,4096,"vertex")
|
||||
application/vnd.makerbot-s3g x3g
|
||||
model/amf amf
|
||||
model/vnd.collada+xml dae
|
||||
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Image files...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 12073 2014-07-31 00:58:00Z msweet $"
|
||||
dnl "$Id: cups-common.m4 12852 2015-08-28 13:29:21Z msweet $"
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -13,18 +13,26 @@ dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION=2.0b1
|
||||
CUPS_REVISION=
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
#fi
|
||||
CUPS_VERSION="AC_PACKAGE_VERSION"
|
||||
|
||||
case "$CUPS_VERSION" in
|
||||
*svn)
|
||||
if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
else
|
||||
CUPS_REVISION=""
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
CUPS_REVISION=""
|
||||
;;
|
||||
esac
|
||||
|
||||
CUPS_BUILD="cups-$CUPS_VERSION"
|
||||
|
||||
AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ],
|
||||
@@ -33,8 +41,8 @@ AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" str
|
||||
AC_SUBST(CUPS_VERSION)
|
||||
AC_SUBST(CUPS_REVISION)
|
||||
AC_SUBST(CUPS_BUILD)
|
||||
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
|
||||
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
|
||||
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "AC_PACKAGE_NAME v$CUPS_VERSION$CUPS_REVISION")
|
||||
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "AC_PACKAGE_NAME/$CUPS_VERSION$CUPS_REVISION")
|
||||
|
||||
dnl Default compiler flags...
|
||||
CFLAGS="${CFLAGS:=}"
|
||||
@@ -137,6 +145,7 @@ AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
|
||||
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
|
||||
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
|
||||
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
|
||||
AC_CHECK_HEADER(asl.h,AC_DEFINE(HAVE_ASL_H))
|
||||
|
||||
dnl Checks for iconv.h and iconv_open
|
||||
AC_CHECK_HEADER(iconv.h,
|
||||
@@ -145,6 +154,9 @@ AC_CHECK_HEADER(iconv.h,
|
||||
AC_SEARCH_LIBS(iconv_open,iconv,
|
||||
AC_DEFINE(HAVE_ICONV_H)
|
||||
SAVELIBS="$SAVELIBS $LIBS")
|
||||
AC_SEARCH_LIBS(libiconv_open,iconv,
|
||||
AC_DEFINE(HAVE_ICONV_H)
|
||||
SAVELIBS="$SAVELIBS $LIBS")
|
||||
LIBS="$SAVELIBS")
|
||||
|
||||
dnl Checks for Mini-XML (www.minixml.org)...
|
||||
@@ -315,7 +327,7 @@ DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$uname" != xDarwin; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -369,9 +381,6 @@ case $uname in
|
||||
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
|
||||
AC_CHECK_FUNCS(mbr_uid_to_uuid)
|
||||
|
||||
dnl Check for the vproc_transaction_begin/end stuff...
|
||||
AC_CHECK_FUNCS(vproc_transaction_begin)
|
||||
|
||||
dnl Need <dlfcn.h> header...
|
||||
AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H))
|
||||
|
||||
@@ -465,5 +474,5 @@ esac
|
||||
AC_SUBST(BUILDDIRS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 12073 2014-07-31 00:58:00Z msweet $".
|
||||
dnl End of "$Id: cups-common.m4 12852 2015-08-28 13:29:21Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 11683 2014-03-05 20:00:54Z msweet $"
|
||||
dnl "$Id: cups-compiler.m4 12742 2015-06-23 14:48:53Z msweet $"
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
@@ -110,7 +110,7 @@ if test -n "$GCC"; then
|
||||
# The -fstack-protector option is available with some versions of
|
||||
# GCC and adds "stack canaries" which detect when the return address
|
||||
# has been overwritten, preventing many types of exploit attacks.
|
||||
AC_MSG_CHECKING(if GCC supports -fstack-protector)
|
||||
AC_MSG_CHECKING(whether compiler supports -fstack-protector)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fstack-protector"
|
||||
AC_TRY_LINK(,,
|
||||
@@ -130,7 +130,7 @@ if test -n "$GCC"; then
|
||||
# exploits that depend on a fixed address for common functions.
|
||||
#
|
||||
# Not available to LSB binaries...
|
||||
AC_MSG_CHECKING(if GCC supports -fPIE)
|
||||
AC_MSG_CHECKING(whether compiler supports -fPIE)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
@@ -154,9 +154,27 @@ if test -n "$GCC"; then
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k -Wsign-conversion -Wunused $OPTIM"
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
|
||||
AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
|
||||
AC_MSG_CHECKING(whether compiler supports -Wno-unused-result)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-unused-result"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-unused-result"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wsign-conversion)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wsign-conversion"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wsign-conversion"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wno-tautological-compare)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
|
||||
AC_TRY_COMPILE(,,
|
||||
@@ -211,7 +229,7 @@ else
|
||||
# should contribute the necessary options to
|
||||
# cups-support@cups.org...
|
||||
echo "Building CUPS with default compiler optimizations; contact"
|
||||
echo "cups-bugs@cups.org with uname and compiler options needed"
|
||||
echo "cups-devel@cups.org with uname and compiler options needed"
|
||||
echo "for your platform, or set the CFLAGS and LDFLAGS environment"
|
||||
echo "variables before running configure."
|
||||
;;
|
||||
@@ -228,5 +246,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 11683 2014-03-05 20:00:54Z msweet $".
|
||||
dnl End of "$Id: cups-compiler.m4 12742 2015-06-23 14:48:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $"
|
||||
dnl "$Id: cups-defaults.m4 12846 2015-08-26 18:26:22Z msweet $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -85,7 +85,7 @@ AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
|
||||
|
||||
dnl Default PageLogFormat
|
||||
AC_ARG_WITH(page_logging, [ --enable-page-logging enable page_log by default])
|
||||
AC_ARG_ENABLE(page_logging, [ --enable-page-logging enable page_log by default])
|
||||
if test "x$enable_page_logging" = xyes; then
|
||||
CUPS_PAGE_LOG_FORMAT=""
|
||||
else
|
||||
@@ -409,5 +409,5 @@ AC_SUBST(CUPS_WEBIF)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $".
|
||||
dnl End of "$Id: cups-defaults.m4 12846 2015-08-26 18:26:22Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl "$Id: cups-dnssd.m4 12845 2015-08-26 18:23:53Z msweet $"
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -26,7 +26,7 @@ DNSSD_BACKEND=""
|
||||
IPPFIND_BIN=""
|
||||
IPPFIND_MAN=""
|
||||
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$uname != xDarwin; then
|
||||
AC_MSG_CHECKING(for Avahi)
|
||||
if $PKGCONFIG --exists avahi-client; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -82,5 +82,5 @@ AC_SUBST(IPPFIND_BIN)
|
||||
AC_SUBST(IPPFIND_MAN)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl End of "$Id: cups-dnssd.m4 12845 2015-08-26 18:23:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 11719 2014-03-21 18:07:23Z msweet $"
|
||||
dnl "$Id: cups-network.m4 12324 2014-12-09 20:28:39Z msweet $"
|
||||
dnl
|
||||
dnl Networking stuff for CUPS.
|
||||
dnl
|
||||
@@ -13,7 +13,12 @@ dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H))
|
||||
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),,[
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/ip.h>])
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
AC_SEARCH_LIBS(gethostbyaddr, nsl)
|
||||
AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS))
|
||||
@@ -67,5 +72,5 @@ AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
|
||||
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 11719 2014-03-21 18:07:23Z msweet $".
|
||||
dnl End of "$Id: cups-network.m4 12324 2014-12-09 20:28:39Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 11911 2014-06-10 13:54:53Z msweet $"
|
||||
dnl "$Id: cups-ssl.m4 12645 2015-05-20 01:20:52Z msweet $"
|
||||
dnl
|
||||
dnl TLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -20,8 +20,7 @@ AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support
|
||||
SSLFLAGS=""
|
||||
SSLLIBS=""
|
||||
have_ssl=0
|
||||
CUPS_SERVERCERT=""
|
||||
CUPS_SERVERKEY=""
|
||||
CUPS_SERVERKEYCHAIN=""
|
||||
|
||||
if test x$enable_ssl != xno; then
|
||||
dnl Look for CDSA...
|
||||
@@ -31,7 +30,7 @@ if test x$enable_ssl != xno; then
|
||||
have_ssl=1
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_CDSASSL)
|
||||
CUPS_SERVERCERT="/Library/Keychains/System.keychain"
|
||||
CUPS_SERVERKEYCHAIN="/Library/Keychains/System.keychain"
|
||||
|
||||
dnl Check for the various security headers...
|
||||
AC_CHECK_HEADER(Security/SecureTransportPriv.h,
|
||||
@@ -54,6 +53,10 @@ if test x$enable_ssl != xno; then
|
||||
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)
|
||||
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
|
||||
|
||||
if test $uversion -ge 150; then
|
||||
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -76,8 +79,13 @@ if test x$enable_ssl != xno; then
|
||||
fi
|
||||
|
||||
if test $have_ssl = 1; then
|
||||
CUPS_SERVERCERT="ssl/server.crt"
|
||||
CUPS_SERVERKEY="ssl/server.key"
|
||||
CUPS_SERVERKEYCHAIN="ssl"
|
||||
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS $SSLLIBS"
|
||||
AC_CHECK_FUNC(gnutls_transport_set_pull_timeout_function, AC_DEFINE(HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION))
|
||||
AC_CHECK_FUNC(gnutls_priority_set_direct, AC_DEFINE(HAVE_GNUTLS_PRIORITY_SET_DIRECT))
|
||||
LIBS="$SAVELIBS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -91,8 +99,7 @@ elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes; then
|
||||
AC_MSG_ERROR([Unable to enable SSL support.])
|
||||
fi
|
||||
|
||||
AC_SUBST(CUPS_SERVERCERT)
|
||||
AC_SUBST(CUPS_SERVERKEY)
|
||||
AC_SUBST(CUPS_SERVERKEYCHAIN)
|
||||
AC_SUBST(IPPALIASES)
|
||||
AC_SUBST(SSLFLAGS)
|
||||
AC_SUBST(SSLLIBS)
|
||||
@@ -101,5 +108,5 @@ EXPORT_SSLLIBS="$SSLLIBS"
|
||||
AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ssl.m4 11911 2014-06-10 13:54:53Z msweet $".
|
||||
dnl End of "$Id: cups-ssl.m4 12645 2015-05-20 01:20:52Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-startup.m4 11747 2014-03-27 01:15:48Z msweet $"
|
||||
dnl "$Id: cups-startup.m4 12857 2015-08-31 15:00:45Z msweet $"
|
||||
dnl
|
||||
dnl Launch-on-demand/startup stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -56,17 +56,33 @@ if test x$enable_systemd != xno; then
|
||||
AC_MSG_ERROR(Need pkg-config to enable systemd support.)
|
||||
fi
|
||||
else
|
||||
AC_MSG_CHECKING(for libsystemd-daemon)
|
||||
if $PKGCONFIG --exists libsystemd-daemon; then
|
||||
have_systemd=no
|
||||
AC_MSG_CHECKING(for libsystemd)
|
||||
if $PKGCONFIG --exists libsystemd; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
have_systemd=yes
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd`
|
||||
elif $PKGCONFIG --exists libsystemd-daemon; then
|
||||
AC_MSG_RESULT(yes - legacy)
|
||||
have_systemd=yes
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
|
||||
if $PKGCONFIG --exists libsystemd-journal; then
|
||||
ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
|
||||
ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
if test $have_systemd = yes; then
|
||||
AC_DEFINE(HAVE_SYSTEMD)
|
||||
AC_CHECK_HEADER(systemd/sd-journal.h,AC_DEFINE(HAVE_SYSTEMD_SD_JOURNAL_H))
|
||||
if test "x$SYSTEMD_DIR" = x; then
|
||||
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -166,11 +182,11 @@ if test "x$xinetd" = x; then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
elif test "x$xinet" != xno; then
|
||||
elif test "x$xinetd" != xno; then
|
||||
XINETD="$xinetd"
|
||||
fi
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-startup.m4 11747 2014-03-27 01:15:48Z msweet $".
|
||||
dnl End of "$Id: cups-startup.m4 12857 2015-08-31 15:00:45Z msweet $".
|
||||
dnl
|
||||
|
||||
+41
-15
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: config.h.in 11717 2014-03-21 16:42:53Z msweet $"
|
||||
* "$Id: config.h.in 12687 2015-06-03 17:19:04Z msweet $"
|
||||
*
|
||||
* Configuration file for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -93,7 +93,7 @@
|
||||
* Default MaxCopies value...
|
||||
*/
|
||||
|
||||
#define CUPS_DEFAULT_MAX_COPIES 100
|
||||
#define CUPS_DEFAULT_MAX_COPIES 9999
|
||||
|
||||
|
||||
/*
|
||||
@@ -150,10 +150,7 @@
|
||||
* Do we have PAM stuff?
|
||||
*/
|
||||
|
||||
#ifndef HAVE_LIBPAM
|
||||
#define HAVE_LIBPAM 0
|
||||
#endif /* !HAVE_LIBPAM */
|
||||
|
||||
#undef HAVE_PAM_PAM_APPL_H
|
||||
#undef HAVE_PAM_SET_ITEM
|
||||
#undef HAVE_PAM_SETCRED
|
||||
@@ -245,6 +242,20 @@
|
||||
#undef HAVE_VSYSLOG
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the ASL functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_ASL_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the systemd journal functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYSTEMD_SD_JOURNAL_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the (v)snprintf() functions?
|
||||
*/
|
||||
@@ -297,9 +308,24 @@
|
||||
|
||||
#undef HAVE_CDSASSL
|
||||
#undef HAVE_GNUTLS
|
||||
#undef HAVE_SSPISSL
|
||||
#undef HAVE_SSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the gnutls_transport_set_pull_timeout_function function?
|
||||
*/
|
||||
|
||||
#undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the gnutls_priority_set_direct function?
|
||||
*/
|
||||
|
||||
#undef HAVE_GNUTLS_PRIORITY_SET_DIRECT
|
||||
|
||||
|
||||
/*
|
||||
* What Security framework headers do we have?
|
||||
*/
|
||||
@@ -336,6 +362,13 @@
|
||||
#undef HAVE_SECKEYCHAINOPEN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have (a working) SSLSetEnabledCiphers function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SSLSETENABLEDCIPHERS
|
||||
|
||||
|
||||
/*
|
||||
* Do we have libpaper?
|
||||
*/
|
||||
@@ -619,7 +652,7 @@
|
||||
|
||||
#ifdef HAVE_ARC4RANDOM
|
||||
# define CUPS_RAND() arc4random()
|
||||
# define CUPS_SRAND(v) arc4random_stir()
|
||||
# define CUPS_SRAND(v)
|
||||
#elif defined(HAVE_RANDOM)
|
||||
# define CUPS_RAND() random()
|
||||
# define CUPS_SRAND(v) srandom(v)
|
||||
@@ -632,13 +665,6 @@
|
||||
#endif /* HAVE_ARC4RANDOM */
|
||||
|
||||
|
||||
/*
|
||||
* Do we have vproc_transaction_begin/end?
|
||||
*/
|
||||
|
||||
#undef HAVE_VPROC_TRANSACTION_BEGIN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have libusb?
|
||||
*/
|
||||
@@ -714,5 +740,5 @@ static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: config.h.in 11717 2014-03-21 16:42:53Z msweet $".
|
||||
* End of "$Id: config.h.in 12687 2015-06-03 17:19:04Z msweet $".
|
||||
*/
|
||||
|
||||
externo
+243
-74
@@ -1,6 +1,8 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.68.
|
||||
# Generated by GNU Autoconf 2.68 for CUPS 2.1.4.
|
||||
#
|
||||
# Report bugs to <https://www.cups.org/str.php>.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@@ -236,7 +238,8 @@ fi
|
||||
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
|
||||
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
|
||||
else
|
||||
$as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
|
||||
$as_echo "$0: Please tell bug-autoconf@gnu.org and
|
||||
$0: https://www.cups.org/str.php about your system,
|
||||
$0: including any error possibly output before this
|
||||
$0: message. Then install a modern shell, or manually run
|
||||
$0: the script under such a shell if you do have one."
|
||||
@@ -555,14 +558,13 @@ MFLAGS=
|
||||
MAKEFLAGS=
|
||||
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME=
|
||||
PACKAGE_TARNAME=
|
||||
PACKAGE_VERSION=
|
||||
PACKAGE_STRING=
|
||||
PACKAGE_BUGREPORT=
|
||||
PACKAGE_URL=
|
||||
PACKAGE_NAME='CUPS'
|
||||
PACKAGE_TARNAME='cups'
|
||||
PACKAGE_VERSION='2.1.4'
|
||||
PACKAGE_STRING='CUPS 2.1.4'
|
||||
PACKAGE_BUGREPORT='https://www.cups.org/str.php'
|
||||
PACKAGE_URL='https://www.cups.org/'
|
||||
|
||||
ac_unique_file="cups/cups.h"
|
||||
# Factoring default headers for most tests.
|
||||
ac_includes_default="\
|
||||
#include <stdio.h>
|
||||
@@ -659,8 +661,7 @@ EXPORT_SSLLIBS
|
||||
SSLLIBS
|
||||
SSLFLAGS
|
||||
IPPALIASES
|
||||
CUPS_SERVERKEY
|
||||
CUPS_SERVERCERT
|
||||
CUPS_SERVERKEYCHAIN
|
||||
LIBGCRYPTCONFIG
|
||||
LIBGNUTLSCONFIG
|
||||
PTHREAD_FLAGS
|
||||
@@ -871,7 +872,7 @@ with_log_file_perm
|
||||
with_fatal_errors
|
||||
with_log_level
|
||||
with_access_log_level
|
||||
with_page_logging
|
||||
enable_page_logging
|
||||
enable_browsing
|
||||
with_local_protocols
|
||||
enable_default_shared
|
||||
@@ -944,7 +945,7 @@ sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE}'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
infodir='${datarootdir}/info'
|
||||
htmldir='${docdir}'
|
||||
dvidir='${docdir}'
|
||||
@@ -1446,7 +1447,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 this package to adapt to many kinds of systems.
|
||||
\`configure' configures CUPS 2.1.4 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1494,7 +1495,7 @@ Fine tuning of the installation directories:
|
||||
--infodir=DIR info documentation [DATAROOTDIR/info]
|
||||
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
|
||||
--mandir=DIR man documentation [DATAROOTDIR/man]
|
||||
--docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
|
||||
--docdir=DIR documentation root [DATAROOTDIR/doc/cups]
|
||||
--htmldir=DIR html documentation [DOCDIR]
|
||||
--dvidir=DIR dvi documentation [DOCDIR]
|
||||
--pdfdir=DIR pdf documentation [DOCDIR]
|
||||
@@ -1506,7 +1507,9 @@ _ACEOF
|
||||
fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of CUPS 2.1.4:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
Optional Features:
|
||||
@@ -1539,6 +1542,7 @@ Optional Features:
|
||||
--disable-dnssd disable DNS Service Discovery support using mDNSResponder
|
||||
--disable-launchd disable launchd support
|
||||
--disable-systemd disable systemd support
|
||||
--enable-page-logging enable page_log by default
|
||||
--disable-browsing disable Browsing by default
|
||||
--disable-default-shared
|
||||
disable DefaultShared by default
|
||||
@@ -1588,7 +1592,6 @@ Optional Packages:
|
||||
--with-fatal-errors set default FatalErrors value, default=config
|
||||
--with-log-level set default LogLevel value, default=warn
|
||||
--with-access-log-level set default AccessLogLevel value, default=none
|
||||
--enable-page-logging enable page_log by default
|
||||
--with-local-protocols set default BrowseLocalProtocols, default=""
|
||||
--with-cups-user set default user for CUPS
|
||||
--with-cups-group set default group for CUPS
|
||||
@@ -1620,7 +1623,8 @@ Some influential environment variables:
|
||||
Use these variables to override the choices made by `configure' or to help
|
||||
it to find libraries and programs with nonstandard names/locations.
|
||||
|
||||
Report bugs to the package provider.
|
||||
Report bugs to <https://www.cups.org/str.php>.
|
||||
CUPS home page: <https://www.cups.org/>.
|
||||
_ACEOF
|
||||
ac_status=$?
|
||||
fi
|
||||
@@ -1683,7 +1687,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
configure
|
||||
CUPS configure 2.1.4
|
||||
generated by GNU Autoconf 2.68
|
||||
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
@@ -1968,6 +1972,10 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
|
||||
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
|
||||
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
|
||||
( $as_echo "## ------------------------------------------- ##
|
||||
## Report this to https://www.cups.org/str.php ##
|
||||
## ------------------------------------------- ##"
|
||||
) | sed "s/^/$as_me: WARNING: /" >&2
|
||||
;;
|
||||
esac
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
|
||||
@@ -2143,7 +2151,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 $as_me, which was
|
||||
It was created by CUPS $as_me 2.1.4, which was
|
||||
generated by GNU Autoconf 2.68. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2515,16 +2523,25 @@ esac
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
CUPS_VERSION=2.0b1
|
||||
CUPS_REVISION=
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
#fi
|
||||
CUPS_VERSION="2.1.4"
|
||||
|
||||
case "$CUPS_VERSION" in
|
||||
*svn)
|
||||
if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'`"
|
||||
else
|
||||
CUPS_REVISION=""
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
CUPS_REVISION=""
|
||||
;;
|
||||
esac
|
||||
|
||||
CUPS_BUILD="cups-$CUPS_VERSION"
|
||||
|
||||
|
||||
@@ -4911,6 +4928,13 @@ if test "x$ac_cv_header_sys_ucred_h" = xyes; then :
|
||||
fi
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "asl.h" "ac_cv_header_asl_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_asl_h" = xyes; then :
|
||||
$as_echo "#define HAVE_ASL_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_iconv_h" = xyes; then :
|
||||
@@ -4967,6 +4991,64 @@ fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv_open" >&5
|
||||
$as_echo "$ac_cv_search_iconv_open" >&6; }
|
||||
ac_res=$ac_cv_search_iconv_open
|
||||
if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
$as_echo "#define HAVE_ICONV_H 1" >>confdefs.h
|
||||
|
||||
SAVELIBS="$SAVELIBS $LIBS"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing libiconv_open" >&5
|
||||
$as_echo_n "checking for library containing libiconv_open... " >&6; }
|
||||
if ${ac_cv_search_libiconv_open+:} 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 libiconv_open ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return libiconv_open ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
for ac_lib in '' iconv; 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_libiconv_open=$ac_res
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext
|
||||
if ${ac_cv_search_libiconv_open+:} false; then :
|
||||
break
|
||||
fi
|
||||
done
|
||||
if ${ac_cv_search_libiconv_open+:} false; then :
|
||||
|
||||
else
|
||||
ac_cv_search_libiconv_open=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_libiconv_open" >&5
|
||||
$as_echo "$ac_cv_search_libiconv_open" >&6; }
|
||||
ac_res=$ac_cv_search_libiconv_open
|
||||
if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
$as_echo "#define HAVE_ICONV_H 1" >>confdefs.h
|
||||
@@ -5578,7 +5660,7 @@ DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$uname" != xDarwin; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5
|
||||
$as_echo_n "checking for DBUS... " >&6; }
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
@@ -5692,18 +5774,6 @@ if test "x$ac_cv_func_mbr_uid_to_uuid" = xyes; then :
|
||||
#define HAVE_MBR_UID_TO_UUID 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
for ac_func in vproc_transaction_begin
|
||||
do :
|
||||
ac_fn_c_check_func "$LINENO" "vproc_transaction_begin" "ac_cv_func_vproc_transaction_begin"
|
||||
if test "x$ac_cv_func_vproc_transaction_begin" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_VPROC_TRANSACTION_BEGIN 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -6625,8 +6695,8 @@ if test -n "$GCC"; then
|
||||
# The -fstack-protector option is available with some versions of
|
||||
# GCC and adds "stack canaries" which detect when the return address
|
||||
# has been overwritten, preventing many types of exploit attacks.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if GCC supports -fstack-protector" >&5
|
||||
$as_echo_n "checking if GCC supports -fstack-protector... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -fstack-protector" >&5
|
||||
$as_echo_n "checking whether compiler supports -fstack-protector... " >&6; }
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fstack-protector"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
@@ -6663,8 +6733,8 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
# exploits that depend on a fixed address for common functions.
|
||||
#
|
||||
# Not available to LSB binaries...
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if GCC supports -fPIE" >&5
|
||||
$as_echo_n "checking if GCC supports -fPIE... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -fPIE" >&5
|
||||
$as_echo_n "checking whether compiler supports -fPIE... " >&6; }
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
@@ -6722,10 +6792,62 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k -Wsign-conversion -Wunused $OPTIM"
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if GCC supports -Wno-tautological-compare" >&5
|
||||
$as_echo_n "checking if GCC supports -Wno-tautological-compare... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-unused-result" >&5
|
||||
$as_echo_n "checking whether compiler supports -Wno-unused-result... " >&6; }
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-unused-result"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
OPTIM="$OPTIM -Wno-unused-result"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wsign-conversion" >&5
|
||||
$as_echo_n "checking whether compiler supports -Wsign-conversion... " >&6; }
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wsign-conversion"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
OPTIM="$OPTIM -Wsign-conversion"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-tautological-compare" >&5
|
||||
$as_echo_n "checking whether compiler supports -Wno-tautological-compare... " >&6; }
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
@@ -6796,7 +6918,7 @@ else
|
||||
# should contribute the necessary options to
|
||||
# cups-support@cups.org...
|
||||
echo "Building CUPS with default compiler optimizations; contact"
|
||||
echo "cups-bugs@cups.org with uname and compiler options needed"
|
||||
echo "cups-devel@cups.org with uname and compiler options needed"
|
||||
echo "for your platform, or set the CFLAGS and LDFLAGS environment"
|
||||
echo "variables before running configure."
|
||||
;;
|
||||
@@ -6815,7 +6937,13 @@ esac
|
||||
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "$ac_includes_default"
|
||||
ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/ip.h>
|
||||
"
|
||||
if test "x$ac_cv_header_resolv_h" = xyes; then :
|
||||
$as_echo "#define HAVE_RESOLV_H 1" >>confdefs.h
|
||||
|
||||
@@ -7993,8 +8121,7 @@ fi
|
||||
SSLFLAGS=""
|
||||
SSLLIBS=""
|
||||
have_ssl=0
|
||||
CUPS_SERVERCERT=""
|
||||
CUPS_SERVERKEY=""
|
||||
CUPS_SERVERKEYCHAIN=""
|
||||
|
||||
if test x$enable_ssl != xno; then
|
||||
if test $have_ssl = 0 -a "x$enable_cdsassl" != "xno"; then
|
||||
@@ -8007,7 +8134,7 @@ if test "x$ac_cv_header_Security_SecureTransport_h" = xyes; then :
|
||||
|
||||
$as_echo "#define HAVE_CDSASSL 1" >>confdefs.h
|
||||
|
||||
CUPS_SERVERCERT="/Library/Keychains/System.keychain"
|
||||
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 :
|
||||
@@ -8074,6 +8201,11 @@ fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $uversion -ge 150; then
|
||||
$as_echo "#define HAVE_SSLSETENABLEDCIPHERS 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -8293,8 +8425,23 @@ fi
|
||||
fi
|
||||
|
||||
if test $have_ssl = 1; then
|
||||
CUPS_SERVERCERT="ssl/server.crt"
|
||||
CUPS_SERVERKEY="ssl/server.key"
|
||||
CUPS_SERVERKEYCHAIN="ssl"
|
||||
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS $SSLLIBS"
|
||||
ac_fn_c_check_func "$LINENO" "gnutls_transport_set_pull_timeout_function" "ac_cv_func_gnutls_transport_set_pull_timeout_function"
|
||||
if test "x$ac_cv_func_gnutls_transport_set_pull_timeout_function" = xyes; then :
|
||||
$as_echo "#define HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_c_check_func "$LINENO" "gnutls_priority_set_direct" "ac_cv_func_gnutls_priority_set_direct"
|
||||
if test "x$ac_cv_func_gnutls_priority_set_direct" = xyes; then :
|
||||
$as_echo "#define HAVE_GNUTLS_PRIORITY_SET_DIRECT 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -8315,7 +8462,6 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
EXPORT_SSLLIBS="$SSLLIBS"
|
||||
|
||||
|
||||
@@ -8876,7 +9022,7 @@ DNSSD_BACKEND=""
|
||||
IPPFIND_BIN=""
|
||||
IPPFIND_MAN=""
|
||||
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$uname != xDarwin; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Avahi" >&5
|
||||
$as_echo_n "checking for Avahi... " >&6; }
|
||||
if $PKGCONFIG --exists avahi-client; then
|
||||
@@ -9032,21 +9178,44 @@ if test x$enable_systemd != xno; then
|
||||
as_fn_error $? "Need pkg-config to enable systemd support." "$LINENO" 5
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd-daemon" >&5
|
||||
$as_echo_n "checking for libsystemd-daemon... " >&6; }
|
||||
if $PKGCONFIG --exists libsystemd-daemon; then
|
||||
have_systemd=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsystemd" >&5
|
||||
$as_echo_n "checking for libsystemd... " >&6; }
|
||||
if $PKGCONFIG --exists libsystemd; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
have_systemd=yes
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd`
|
||||
elif $PKGCONFIG --exists libsystemd-daemon; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - legacy" >&5
|
||||
$as_echo "yes - legacy" >&6; }
|
||||
have_systemd=yes
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
|
||||
if $PKGCONFIG --exists libsystemd-journal; then
|
||||
ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
|
||||
ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test $have_systemd = yes; then
|
||||
$as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-journal.h" "ac_cv_header_systemd_sd_journal_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_systemd_sd_journal_h" = xyes; then :
|
||||
$as_echo "#define HAVE_SYSTEMD_SD_JOURNAL_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test "x$SYSTEMD_DIR" = x; then
|
||||
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -9183,7 +9352,7 @@ if test "x$xinetd" = x; then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
elif test "x$xinet" != xno; then
|
||||
elif test "x$xinetd" != xno; then
|
||||
XINETD="$xinetd"
|
||||
fi
|
||||
|
||||
@@ -9311,10 +9480,9 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
||||
# Check whether --with-page_logging was given.
|
||||
if test "${with_page_logging+set}" = set; then :
|
||||
withval=$with_page_logging;
|
||||
# Check whether --enable-page_logging was given.
|
||||
if test "${enable_page_logging+set}" = set; then :
|
||||
enableval=$enable_page_logging;
|
||||
fi
|
||||
|
||||
if test "x$enable_page_logging" = xyes; then
|
||||
@@ -10077,7 +10245,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 data/testprint desktop/cups.desktop doc/index.html man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
|
||||
ac_config_files="$ac_config_files Makedefs conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf cups-config desktop/cups.desktop doc/index.html man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket templates/header.tmpl packaging/cups.list $LANGFILES"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
@@ -10597,7 +10765,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 $as_me, which was
|
||||
This file was extended by CUPS $as_me 2.1.4, which was
|
||||
generated by GNU Autoconf 2.68. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -10653,13 +10821,14 @@ $config_files
|
||||
Configuration headers:
|
||||
$config_headers
|
||||
|
||||
Report bugs to the package provider."
|
||||
Report bugs to <https://www.cups.org/str.php>.
|
||||
CUPS home page: <https://www.cups.org/>."
|
||||
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
config.status
|
||||
CUPS config.status 2.1.4
|
||||
configured by $0, generated by GNU Autoconf 2.68,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
@@ -10789,7 +10958,6 @@ do
|
||||
"conf/pam.std") CONFIG_FILES="$CONFIG_FILES conf/pam.std" ;;
|
||||
"conf/snmp.conf") CONFIG_FILES="$CONFIG_FILES conf/snmp.conf" ;;
|
||||
"cups-config") CONFIG_FILES="$CONFIG_FILES cups-config" ;;
|
||||
"data/testprint") CONFIG_FILES="$CONFIG_FILES data/testprint" ;;
|
||||
"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" ;;
|
||||
@@ -10804,6 +10972,7 @@ do
|
||||
"scheduler/cups.sh") CONFIG_FILES="$CONFIG_FILES scheduler/cups.sh" ;;
|
||||
"scheduler/cups.xml") CONFIG_FILES="$CONFIG_FILES scheduler/cups.xml" ;;
|
||||
"scheduler/org.cups.cups-lpd.plist") CONFIG_FILES="$CONFIG_FILES scheduler/org.cups.cups-lpd.plist" ;;
|
||||
"scheduler/org.cups.cups-lpdAT.service") CONFIG_FILES="$CONFIG_FILES scheduler/org.cups.cups-lpdAT.service" ;;
|
||||
"scheduler/org.cups.cupsd.path") CONFIG_FILES="$CONFIG_FILES scheduler/org.cups.cupsd.path" ;;
|
||||
"scheduler/org.cups.cupsd.service") CONFIG_FILES="$CONFIG_FILES scheduler/org.cups.cupsd.service" ;;
|
||||
"scheduler/org.cups.cupsd.socket") CONFIG_FILES="$CONFIG_FILES scheduler/org.cups.cupsd.socket" ;;
|
||||
|
||||
+9
-5
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: configure.ac 11823 2014-04-21 12:22:03Z msweet $"
|
||||
dnl "$Id: configure.ac 13087 2016-02-12 18:53:24Z msweet $"
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -13,7 +13,11 @@ dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_INIT(cups/cups.h)
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Package name and version...
|
||||
AC_INIT([CUPS], [2.1.4], [https://www.cups.org/str.php], [cups], [https://www.cups.org/])
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
@@ -66,7 +70,6 @@ AC_OUTPUT(Makedefs
|
||||
conf/pam.std
|
||||
conf/snmp.conf
|
||||
cups-config
|
||||
data/testprint
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
man/client.conf.man
|
||||
@@ -81,6 +84,7 @@ AC_OUTPUT(Makedefs
|
||||
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
|
||||
@@ -91,5 +95,5 @@ AC_OUTPUT(Makedefs
|
||||
chmod +x cups-config
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: configure.ac 11823 2014-04-21 12:22:03Z msweet $".
|
||||
dnl End of "$Id: configure.ac 13087 2016-02-12 18:53:24Z msweet $".
|
||||
dnl
|
||||
|
||||
+9
-4
@@ -4,8 +4,9 @@ adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h adminutil.h
|
||||
array.o: array.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h
|
||||
array.o: array.c ../cups/cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
language.h pwg.h string-private.h ../config.h debug-private.h \
|
||||
array-private.h
|
||||
attr.o: attr.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
@@ -223,8 +224,12 @@ snmp.o: snmp.c cups-private.h string-private.h ../config.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h snmp-private.h
|
||||
snprintf.o: snprintf.c string-private.h ../config.h
|
||||
string.o: string.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h thread-private.h array.h
|
||||
string.o: string.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
|
||||
thread-private.h
|
||||
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
|
||||
+17
-4
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: Makefile 12032 2014-07-15 20:37:32Z msweet $"
|
||||
# "$Id: Makefile 12850 2015-08-27 19:29:06Z msweet $"
|
||||
#
|
||||
# API library Makefile for CUPS.
|
||||
#
|
||||
@@ -83,6 +83,7 @@ LIBOBJS = \
|
||||
TESTOBJS = \
|
||||
testadmin.o \
|
||||
testarray.o \
|
||||
testcache.o \
|
||||
testconflicts.o \
|
||||
testcups.o \
|
||||
testdest.o \
|
||||
@@ -94,7 +95,8 @@ TESTOBJS = \
|
||||
testlang.o \
|
||||
testppd.o \
|
||||
testpwg.o \
|
||||
testsnmp.o
|
||||
testsnmp.o \
|
||||
tlscheck.o
|
||||
OBJS = \
|
||||
$(LIBOBJS) \
|
||||
$(TESTOBJS)
|
||||
@@ -161,7 +163,8 @@ UNITTARGETS = \
|
||||
testoptions \
|
||||
testppd \
|
||||
testpwg \
|
||||
testsnmp
|
||||
testsnmp \
|
||||
tlscheck
|
||||
|
||||
TARGETS = \
|
||||
$(LIBTARGETS)
|
||||
@@ -539,6 +542,16 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# tlscheck (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
#
|
||||
# Automatic API help files...
|
||||
#
|
||||
@@ -665,5 +678,5 @@ tls.o: tls-darwin.c tls-gnutls.c tls-sspi.c
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 12032 2014-07-15 20:37:32Z msweet $".
|
||||
# End of "$Id: Makefile 12850 2015-08-27 19:29:06Z msweet $".
|
||||
#
|
||||
|
||||
+47
-4
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: adminutil.c 11598 2014-02-18 18:58:19Z msweet $"
|
||||
* "$Id: adminutil.c 12945 2015-10-26 19:46:02Z msweet $"
|
||||
*
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -1175,6 +1175,7 @@ cupsAdminSetServerSettings(
|
||||
in_cancel_job, /* In a cancel-job section? */
|
||||
in_admin_location, /* In the /admin location? */
|
||||
in_conf_location, /* In the /admin/conf location? */
|
||||
in_log_location, /* In the /admin/log location? */
|
||||
in_root_location; /* In the / location? */
|
||||
const char *val; /* Setting value */
|
||||
int share_printers, /* Share local printers */
|
||||
@@ -1188,6 +1189,7 @@ cupsAdminSetServerSettings(
|
||||
wrote_loglevel, /* Wrote the LogLevel line? */
|
||||
wrote_admin_location, /* Wrote the /admin location? */
|
||||
wrote_conf_location, /* Wrote the /admin/conf location? */
|
||||
wrote_log_location, /* Wrote the /admin/log location? */
|
||||
wrote_root_location; /* Wrote the / location? */
|
||||
int indent; /* Indentation */
|
||||
int cupsd_num_settings; /* New number of settings */
|
||||
@@ -1401,12 +1403,14 @@ cupsAdminSetServerSettings(
|
||||
in_conf_location = 0;
|
||||
in_default_policy = 0;
|
||||
in_location = 0;
|
||||
in_log_location = 0;
|
||||
in_policy = 0;
|
||||
in_root_location = 0;
|
||||
linenum = 0;
|
||||
wrote_admin_location = 0;
|
||||
wrote_browsing = 0;
|
||||
wrote_conf_location = 0;
|
||||
wrote_log_location = 0;
|
||||
wrote_loglevel = 0;
|
||||
wrote_policy = 0;
|
||||
wrote_port_listen = 0;
|
||||
@@ -1550,8 +1554,10 @@ cupsAdminSetServerSettings(
|
||||
indent += 2;
|
||||
if (!strcmp(value, "/admin"))
|
||||
in_admin_location = 1;
|
||||
if (!strcmp(value, "/admin/conf"))
|
||||
else if (!strcmp(value, "/admin/conf"))
|
||||
in_conf_location = 1;
|
||||
else if (!strcmp(value, "/admin/log"))
|
||||
in_log_location = 1;
|
||||
else if (!strcmp(value, "/"))
|
||||
in_root_location = 1;
|
||||
|
||||
@@ -1593,6 +1599,23 @@ cupsAdminSetServerSettings(
|
||||
cupsFilePrintf(temp, " Allow %s\n",
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
}
|
||||
else if (in_log_location && remote_admin >= 0)
|
||||
{
|
||||
wrote_log_location = 1;
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePuts(temp, " # Allow remote access to the log "
|
||||
"files...\n");
|
||||
else
|
||||
cupsFilePuts(temp, " # Restrict access to the log "
|
||||
"files...\n");
|
||||
|
||||
cupsFilePuts(temp, " Order allow,deny\n");
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n",
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
}
|
||||
else if (in_root_location &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
{
|
||||
@@ -1619,6 +1642,7 @@ cupsAdminSetServerSettings(
|
||||
|
||||
in_admin_location = 0;
|
||||
in_conf_location = 0;
|
||||
in_log_location = 0;
|
||||
in_root_location = 0;
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
@@ -1867,6 +1891,25 @@ cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
|
||||
if (!wrote_log_location && remote_admin >= 0)
|
||||
{
|
||||
if (remote_admin)
|
||||
cupsFilePuts(temp,
|
||||
"# Allow remote access to the log files...\n");
|
||||
else
|
||||
cupsFilePuts(temp, "# Restrict access to the log files...\n");
|
||||
|
||||
cupsFilePuts(temp, "<Location /admin/log>\n"
|
||||
" AuthType Default\n"
|
||||
" Require user @SYSTEM\n"
|
||||
" Order allow,deny\n");
|
||||
|
||||
if (remote_admin)
|
||||
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
|
||||
if (!wrote_policy && user_cancel_any >= 0)
|
||||
{
|
||||
cupsFilePuts(temp, "<Policy default>\n"
|
||||
@@ -2326,5 +2369,5 @@ write_option(cups_file_t *dstfp, /* I - PPD file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: adminutil.c 11598 2014-02-18 18:58:19Z msweet $".
|
||||
* End of "$Id: adminutil.c 12945 2015-10-26 19:46:02Z msweet $".
|
||||
*/
|
||||
|
||||
+24
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
Filter and backend programming introduction for CUPS.
|
||||
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
Copyright 2007-2014 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
@@ -81,7 +81,7 @@ directory to write to.</p>
|
||||
|
||||
<p>In addition, some operating systems provide additional security mechanisms
|
||||
that further limit file system access, even for backends running as root. On
|
||||
OS X, for example, no backend may write to a user's home directory.</p>
|
||||
OS X, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on OS X</a> section for more information.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3><a name="SIGNALS">Canceled Jobs and Signal Handling</a></h3>
|
||||
@@ -852,3 +852,25 @@ void *my_data;
|
||||
|
||||
<a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
|
||||
</pre>
|
||||
|
||||
<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
|
||||
|
||||
<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
|
||||
|
||||
<ol>
|
||||
|
||||
<li>Reading of files: pursuant to normal UNIX file permissions, filters and backends can read files for the current job from the <var>/private/var/spool/cups</var> directory and other files on mounted filesystems <em>except</em> for user home directories under <var>/Users</var>.</li>
|
||||
|
||||
<li>Writing of files: pursuant to normal UNIX file permissions, filters and backends can read/write files to the cache directory specified by the <code>CUPS_CACHEDIR</code> environment variable, to the state directory specified by the <code>CUPS_STATEDIR</code> environment variable, to the temporary directory specified by the <code>TMPDIR</code> environment variable, and under the <var>/private/var/db</var>, <var>/private/var/folders</var>, <var>/private/var/lib</var>, <var>/private/var/mysql</var>, <var>/private/var/run</var>, <var>/private/var/spool</var> (except <var>/private/var/spool/cups</var>), <var>/Library/Application Support</var>, <var>/Library/Caches</var>, <var>/Library/Logs</var>, <var>/Library/Preferences</var>, <var>/Library/WebServer</var>, and <var>/Users/Shared</var> directories.</li>
|
||||
|
||||
<li>Execution of programs: pursuant to normal UNIX file permissions, filters and backends can execute any program not located under the <var>/Users</var> directory. Child processes inherit the sandbox and are subject to the same restrictions as the parent.</li>
|
||||
|
||||
<li>Bluetooth and USB: backends can access Bluetooth and USB printers through IOKit. <em>Filters cannot access Bluetooth and USB printers directly.</em></li>
|
||||
|
||||
<li>Network: filters and backends can access UNIX domain sockets under the <var>/private/tmp</var>, <var>/private/var/run</var>, and <var>/private/var/tmp</var> directories. Backends can also create IPv4 and IPv6 TCP (outgoing) and UDP (incoming and outgoing) socket, and bind to local source ports. <em>Filters cannot directly create IPv4 and IPv6 TCP or UDP sockets.</em></li>
|
||||
|
||||
<li>Notifications: filters and backends can send notifications via the Darwin <code>notify_post()</code> API.</li>
|
||||
|
||||
</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>
|
||||
|
||||
+10
-24
@@ -1,22 +1,16 @@
|
||||
/*
|
||||
* "$Id: attr.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: attr.c 12867 2015-09-13 23:49:19Z msweet $"
|
||||
*
|
||||
* PPD model-specific attribute routines for CUPS.
|
||||
* PPD model-specific attribute routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ppdFindAttr() - Find the first matching attribute.
|
||||
* ppdFindNextAttr() - Find the next matching attribute.
|
||||
* _ppdNormalizeMakeAndModel() - Normalize a product/make-and-model string.
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -229,14 +223,6 @@ _ppdNormalizeMakeAndModel(
|
||||
|
||||
snprintf(buffer, bufsize, "Canon %s", make_and_model);
|
||||
}
|
||||
else if (!_cups_strncasecmp(make_and_model, "primera", 7))
|
||||
{
|
||||
/*
|
||||
* Fargo...
|
||||
*/
|
||||
|
||||
snprintf(buffer, bufsize, "Fargo %s", make_and_model);
|
||||
}
|
||||
else if (!_cups_strncasecmp(make_and_model, "designjet", 9) ||
|
||||
!_cups_strncasecmp(make_and_model, "deskjet", 7))
|
||||
{
|
||||
@@ -331,5 +317,5 @@ _ppdNormalizeMakeAndModel(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: attr.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: attr.c 12867 2015-09-13 23:49:19Z msweet $".
|
||||
*/
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: auth.c 11776 2014-03-28 19:16:05Z msweet $"
|
||||
* "$Id: auth.c 12619 2015-05-06 21:00:19Z msweet $"
|
||||
*
|
||||
* Authentication functions for CUPS.
|
||||
*
|
||||
@@ -311,7 +311,7 @@ _cupsSetNegotiateAuthString(
|
||||
* to use it...
|
||||
*/
|
||||
|
||||
if (gss_init_sec_context == NULL)
|
||||
if (&gss_init_sec_context == NULL)
|
||||
{
|
||||
DEBUG_puts("1_cupsSetNegotiateAuthString: Weak-linked GSSAPI/Kerberos "
|
||||
"framework is not present");
|
||||
@@ -761,7 +761,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
|
||||
if (
|
||||
# ifdef HAVE_GSSAPI
|
||||
strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) &&
|
||||
_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) &&
|
||||
# endif /* HAVE_GSSAPI */
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
!httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
|
||||
@@ -808,7 +808,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
filename, strerror(errno)));
|
||||
|
||||
# ifdef HAVE_GSSAPI
|
||||
if (!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
|
||||
if (!_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
|
||||
{
|
||||
/*
|
||||
* Kerberos required, don't try the root certificate...
|
||||
@@ -876,5 +876,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: auth.c 11776 2014-03-28 19:16:05Z msweet $".
|
||||
* End of "$Id: auth.c 12619 2015-05-06 21:00:19Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: cups-private.h 11851 2014-05-07 23:55:35Z msweet $"
|
||||
* "$Id: cups-private.h 12441 2015-01-29 14:42:32Z msweet $"
|
||||
*
|
||||
* Private definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -281,5 +281,5 @@ extern char *_cupsUserDefault(char *name, size_t namesize);
|
||||
#endif /* !_CUPS_CUPS_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: cups-private.h 11851 2014-05-07 23:55:35Z msweet $".
|
||||
* End of "$Id: cups-private.h 12441 2015-01-29 14:42:32Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-12
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: cups.h 11884 2014-05-16 21:54:22Z msweet $"
|
||||
* "$Id: cups.h 13087 2016-02-12 18:53:24Z msweet $"
|
||||
*
|
||||
* API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -35,6 +35,15 @@ typedef off_t ssize_t; /* @private@ */
|
||||
# include "language.h"
|
||||
# include "pwg.h"
|
||||
|
||||
/*
|
||||
* Define _PPD_DEPRECATED to silence the warnings about PPD functions being
|
||||
* deprecated...
|
||||
*/
|
||||
|
||||
# ifndef _PPD_DEPRECATED
|
||||
# define _PPD_DEPRECATED _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.")
|
||||
# endif /* !_PPD_DEPRECATED */
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
@@ -49,10 +58,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 2.0000
|
||||
# define CUPS_VERSION 2.0104
|
||||
# define CUPS_VERSION_MAJOR 2
|
||||
# define CUPS_VERSION_MINOR 0
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
# define CUPS_VERSION_MINOR 1
|
||||
# define CUPS_VERSION_PATCH 4
|
||||
|
||||
# define CUPS_BC_FD 3
|
||||
/* Back-channel file descriptor for
|
||||
@@ -241,6 +250,7 @@ enum cups_ptype_e /* Printer type/capability bit
|
||||
* @since CUPS 1.4/OS X 10.6@ */
|
||||
CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities
|
||||
* @since CUPS 1.4/OS X 10.6@ */
|
||||
CUPS_PRINTER_3D = 0x8000000, /* 3D Printing @since CUPS 2.1@ */
|
||||
CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT |
|
||||
* DEFAULT | FAX | REJECTING | DELETE |
|
||||
* NOT_SHARED | AUTHENTICATED |
|
||||
@@ -354,8 +364,7 @@ extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDes
|
||||
extern const char *cupsGetDefault(void);
|
||||
extern int cupsGetJobs(cups_job_t **jobs, const char *name,
|
||||
int myjobs, int whichjobs);
|
||||
extern const char *cupsGetPPD(const char *name)
|
||||
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo instead.");
|
||||
extern const char *cupsGetPPD(const char *name) _PPD_DEPRECATED;
|
||||
extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
|
||||
extern ipp_status_t cupsLastError(void);
|
||||
extern int cupsPrintFile(const char *name, const char *filename,
|
||||
@@ -413,8 +422,7 @@ extern int cupsGetDests2(http_t *http, cups_dest_t **dests)
|
||||
extern int cupsGetJobs2(http_t *http, cups_job_t **jobs,
|
||||
const char *name, int myjobs,
|
||||
int whichjobs) _CUPS_API_1_1_21;
|
||||
extern const char *cupsGetPPD2(http_t *http, const char *name)
|
||||
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo instead.");
|
||||
extern const char *cupsGetPPD2(http_t *http, const char *name) _PPD_DEPRECATED;
|
||||
extern int cupsPrintFile2(http_t *http, const char *name,
|
||||
const char *filename,
|
||||
const char *title, int num_options,
|
||||
@@ -479,7 +487,7 @@ extern const char *cupsGetPassword2(const char *prompt, http_t *http,
|
||||
const char *resource) _CUPS_API_1_4;
|
||||
extern http_status_t cupsGetPPD3(http_t *http, const char *name,
|
||||
time_t *modtime, char *buffer,
|
||||
size_t bufsize) _CUPS_API_1_4;
|
||||
size_t bufsize) _PPD_DEPRECATED;
|
||||
extern ipp_t *cupsGetResponse(http_t *http,
|
||||
const char *resource) _CUPS_API_1_4;
|
||||
extern ssize_t cupsReadResponseData(http_t *http, char *buffer,
|
||||
@@ -615,7 +623,7 @@ extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
|
||||
extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
|
||||
extern const char *cupsUserAgent(void) _CUPS_API_1_7;
|
||||
|
||||
/* New in CUPS 2.0 */
|
||||
/* New in CUPS 2.0/OS X 10.10 */
|
||||
extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
|
||||
extern const char *cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, cups_dinfo_t *info, unsigned flags, cups_size_t *size) _CUPS_API_2_0;
|
||||
extern int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date) _CUPS_API_2_0;
|
||||
@@ -628,5 +636,5 @@ extern int cupsSetServerCredentials(const char *path, const char *common_name,
|
||||
#endif /* !_CUPS_CUPS_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: cups.h 11884 2014-05-16 21:54:22Z msweet $".
|
||||
* End of "$Id: cups.h 13087 2016-02-12 18:53:24Z msweet $".
|
||||
*/
|
||||
|
||||
+325
-323
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: debug.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
* "$Id: debug.c 12928 2015-10-23 21:31:58Z msweet $"
|
||||
*
|
||||
* Debugging functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2014 by Apple Inc.
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -81,325 +81,6 @@ debug_thread_id(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'debug_vsnprintf()' - Format a string into a fixed size buffer.
|
||||
*/
|
||||
|
||||
static ssize_t /* O - Number of bytes formatted */
|
||||
debug_vsnprintf(char *buffer, /* O - Output buffer */
|
||||
size_t bufsize, /* O - Size of output buffer */
|
||||
const char *format, /* I - printf-style format string */
|
||||
va_list ap) /* I - Pointer to additional arguments */
|
||||
{
|
||||
char *bufptr, /* Pointer to position in buffer */
|
||||
*bufend, /* Pointer to end of buffer */
|
||||
size, /* Size character (h, l, L) */
|
||||
type; /* Format type character */
|
||||
int width, /* Width of field */
|
||||
prec; /* Number of characters of precision */
|
||||
char tformat[100], /* Temporary format string for sprintf() */
|
||||
*tptr, /* Pointer into temporary format */
|
||||
temp[1024]; /* Buffer for formatted numbers */
|
||||
char *s; /* Pointer to string */
|
||||
ssize_t bytes; /* Total number of bytes needed */
|
||||
|
||||
|
||||
if (!buffer || bufsize < 2 || !format)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Loop through the format string, formatting as needed...
|
||||
*/
|
||||
|
||||
bufptr = buffer;
|
||||
bufend = buffer + bufsize - 1;
|
||||
bytes = 0;
|
||||
|
||||
while (*format)
|
||||
{
|
||||
if (*format == '%')
|
||||
{
|
||||
tptr = tformat;
|
||||
*tptr++ = *format++;
|
||||
|
||||
if (*format == '%')
|
||||
{
|
||||
if (bufptr < bufend)
|
||||
*bufptr++ = *format;
|
||||
bytes ++;
|
||||
format ++;
|
||||
continue;
|
||||
}
|
||||
else if (strchr(" -+#\'", *format))
|
||||
*tptr++ = *format++;
|
||||
|
||||
if (*format == '*')
|
||||
{
|
||||
/*
|
||||
* Get width from argument...
|
||||
*/
|
||||
|
||||
format ++;
|
||||
width = va_arg(ap, int);
|
||||
|
||||
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", width);
|
||||
tptr += strlen(tptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
width = 0;
|
||||
|
||||
while (isdigit(*format & 255))
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
width = width * 10 + *format++ - '0';
|
||||
}
|
||||
}
|
||||
|
||||
if (*format == '.')
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
format ++;
|
||||
|
||||
if (*format == '*')
|
||||
{
|
||||
/*
|
||||
* Get precision from argument...
|
||||
*/
|
||||
|
||||
format ++;
|
||||
prec = va_arg(ap, int);
|
||||
|
||||
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", prec);
|
||||
tptr += strlen(tptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
prec = 0;
|
||||
|
||||
while (isdigit(*format & 255))
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
prec = prec * 10 + *format++ - '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*format == 'l' && format[1] == 'l')
|
||||
{
|
||||
size = 'L';
|
||||
|
||||
if (tptr < (tformat + sizeof(tformat) - 2))
|
||||
{
|
||||
*tptr++ = 'l';
|
||||
*tptr++ = 'l';
|
||||
}
|
||||
|
||||
format += 2;
|
||||
}
|
||||
else if (*format == 'h' || *format == 'l' || *format == 'L')
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
size = *format++;
|
||||
}
|
||||
else
|
||||
size = 0;
|
||||
|
||||
if (!*format)
|
||||
break;
|
||||
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
type = *format++;
|
||||
*tptr = '\0';
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 'E' : /* Floating point formats */
|
||||
case 'G' :
|
||||
case 'e' :
|
||||
case 'f' :
|
||||
case 'g' :
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
sprintf(temp, tformat, va_arg(ap, double));
|
||||
|
||||
bytes += (int)strlen(temp);
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'B' : /* Integer formats */
|
||||
case 'X' :
|
||||
case 'b' :
|
||||
case 'd' :
|
||||
case 'i' :
|
||||
case 'o' :
|
||||
case 'u' :
|
||||
case 'x' :
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
# ifdef HAVE_LONG_LONG
|
||||
if (size == 'L')
|
||||
sprintf(temp, tformat, va_arg(ap, long long));
|
||||
else
|
||||
# endif /* HAVE_LONG_LONG */
|
||||
if (size == 'l')
|
||||
sprintf(temp, tformat, va_arg(ap, long));
|
||||
else
|
||||
sprintf(temp, tformat, va_arg(ap, int));
|
||||
|
||||
bytes += (int)strlen(temp);
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p' : /* Pointer value */
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
sprintf(temp, tformat, va_arg(ap, void *));
|
||||
|
||||
bytes += (int)strlen(temp);
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'c' : /* Character or character array */
|
||||
bytes += width;
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
if (width <= 1)
|
||||
*bufptr++ = (char)va_arg(ap, int);
|
||||
else
|
||||
{
|
||||
if ((bufptr + width) > bufend)
|
||||
width = (int)(bufend - bufptr);
|
||||
|
||||
memcpy(bufptr, va_arg(ap, char *), (size_t)width);
|
||||
bufptr += width;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 's' : /* String */
|
||||
if ((s = va_arg(ap, char *)) == NULL)
|
||||
s = "(null)";
|
||||
|
||||
/*
|
||||
* Copy the C string, replacing control chars and \ with
|
||||
* C character escapes...
|
||||
*/
|
||||
|
||||
for (bufend --; *s && bufptr < bufend; s ++)
|
||||
{
|
||||
if (*s == '\n')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'n';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\r')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'r';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\t')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 't';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\\')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\\';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\'')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\'';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\"')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\"';
|
||||
bytes += 2;
|
||||
}
|
||||
else if ((*s & 255) < ' ')
|
||||
{
|
||||
if ((bufptr + 2) >= bufend)
|
||||
break;
|
||||
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '0';
|
||||
*bufptr++ = '0' + *s / 8;
|
||||
*bufptr++ = '0' + (*s & 7);
|
||||
bytes += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
*bufptr++ = *s;
|
||||
bytes ++;
|
||||
}
|
||||
}
|
||||
|
||||
bufend ++;
|
||||
break;
|
||||
|
||||
case 'n' : /* Output number of chars so far */
|
||||
*(va_arg(ap, int *)) = (int)bytes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bytes ++;
|
||||
|
||||
if (bufptr < bufend)
|
||||
*bufptr++ = *format;
|
||||
|
||||
format ++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Nul-terminate the string and return the number of characters needed.
|
||||
*/
|
||||
|
||||
*bufptr = '\0';
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cups_debug_printf()' - Write a formatted line to the log.
|
||||
*/
|
||||
@@ -461,7 +142,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
(int)(curtime.tv_sec % 60), (int)(curtime.tv_usec / 1000));
|
||||
|
||||
va_start(ap, format);
|
||||
bytes = debug_vsnprintf(buffer + 19, sizeof(buffer) - 20, format, ap) + 19;
|
||||
bytes = _cups_safe_vsnprintf(buffer + 19, sizeof(buffer) - 20, format, ap) + 19;
|
||||
va_end(ap);
|
||||
|
||||
if ((size_t)bytes >= (sizeof(buffer) - 1))
|
||||
@@ -643,5 +324,326 @@ _cups_debug_set(const char *logfile, /* I - Log file or NULL */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: debug.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
* '_cups_safe_vsnprintf()' - Format a string into a fixed size buffer,
|
||||
* quoting special characters.
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes formatted */
|
||||
_cups_safe_vsnprintf(
|
||||
char *buffer, /* O - Output buffer */
|
||||
size_t bufsize, /* O - Size of output buffer */
|
||||
const char *format, /* I - printf-style format string */
|
||||
va_list ap) /* I - Pointer to additional arguments */
|
||||
{
|
||||
char *bufptr, /* Pointer to position in buffer */
|
||||
*bufend, /* Pointer to end of buffer */
|
||||
size, /* Size character (h, l, L) */
|
||||
type; /* Format type character */
|
||||
int width, /* Width of field */
|
||||
prec; /* Number of characters of precision */
|
||||
char tformat[100], /* Temporary format string for snprintf() */
|
||||
*tptr, /* Pointer into temporary format */
|
||||
temp[1024]; /* Buffer for formatted numbers */
|
||||
char *s; /* Pointer to string */
|
||||
ssize_t bytes; /* Total number of bytes needed */
|
||||
|
||||
|
||||
if (!buffer || bufsize < 2 || !format)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Loop through the format string, formatting as needed...
|
||||
*/
|
||||
|
||||
bufptr = buffer;
|
||||
bufend = buffer + bufsize - 1;
|
||||
bytes = 0;
|
||||
|
||||
while (*format)
|
||||
{
|
||||
if (*format == '%')
|
||||
{
|
||||
tptr = tformat;
|
||||
*tptr++ = *format++;
|
||||
|
||||
if (*format == '%')
|
||||
{
|
||||
if (bufptr < bufend)
|
||||
*bufptr++ = *format;
|
||||
bytes ++;
|
||||
format ++;
|
||||
continue;
|
||||
}
|
||||
else if (strchr(" -+#\'", *format))
|
||||
*tptr++ = *format++;
|
||||
|
||||
if (*format == '*')
|
||||
{
|
||||
/*
|
||||
* Get width from argument...
|
||||
*/
|
||||
|
||||
format ++;
|
||||
width = va_arg(ap, int);
|
||||
|
||||
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", width);
|
||||
tptr += strlen(tptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
width = 0;
|
||||
|
||||
while (isdigit(*format & 255))
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
width = width * 10 + *format++ - '0';
|
||||
}
|
||||
}
|
||||
|
||||
if (*format == '.')
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
format ++;
|
||||
|
||||
if (*format == '*')
|
||||
{
|
||||
/*
|
||||
* Get precision from argument...
|
||||
*/
|
||||
|
||||
format ++;
|
||||
prec = va_arg(ap, int);
|
||||
|
||||
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", prec);
|
||||
tptr += strlen(tptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
prec = 0;
|
||||
|
||||
while (isdigit(*format & 255))
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
prec = prec * 10 + *format++ - '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*format == 'l' && format[1] == 'l')
|
||||
{
|
||||
size = 'L';
|
||||
|
||||
if (tptr < (tformat + sizeof(tformat) - 2))
|
||||
{
|
||||
*tptr++ = 'l';
|
||||
*tptr++ = 'l';
|
||||
}
|
||||
|
||||
format += 2;
|
||||
}
|
||||
else if (*format == 'h' || *format == 'l' || *format == 'L')
|
||||
{
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
size = *format++;
|
||||
}
|
||||
else
|
||||
size = 0;
|
||||
|
||||
if (!*format)
|
||||
break;
|
||||
|
||||
if (tptr < (tformat + sizeof(tformat) - 1))
|
||||
*tptr++ = *format;
|
||||
|
||||
type = *format++;
|
||||
*tptr = '\0';
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 'E' : /* Floating point formats */
|
||||
case 'G' :
|
||||
case 'e' :
|
||||
case 'f' :
|
||||
case 'g' :
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
snprintf(temp, sizeof(temp), tformat, va_arg(ap, double));
|
||||
|
||||
bytes += (int)strlen(temp);
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'B' : /* Integer formats */
|
||||
case 'X' :
|
||||
case 'b' :
|
||||
case 'd' :
|
||||
case 'i' :
|
||||
case 'o' :
|
||||
case 'u' :
|
||||
case 'x' :
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
# ifdef HAVE_LONG_LONG
|
||||
if (size == 'L')
|
||||
snprintf(temp, sizeof(temp), tformat, va_arg(ap, long long));
|
||||
else
|
||||
# endif /* HAVE_LONG_LONG */
|
||||
if (size == 'l')
|
||||
snprintf(temp, sizeof(temp), tformat, va_arg(ap, long));
|
||||
else
|
||||
snprintf(temp, sizeof(temp), tformat, va_arg(ap, int));
|
||||
|
||||
bytes += (int)strlen(temp);
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p' : /* Pointer value */
|
||||
if ((size_t)(width + 2) > sizeof(temp))
|
||||
break;
|
||||
|
||||
snprintf(temp, sizeof(temp), tformat, va_arg(ap, void *));
|
||||
|
||||
bytes += (int)strlen(temp);
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
|
||||
bufptr += strlen(bufptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'c' : /* Character or character array */
|
||||
bytes += width;
|
||||
|
||||
if (bufptr)
|
||||
{
|
||||
if (width <= 1)
|
||||
*bufptr++ = (char)va_arg(ap, int);
|
||||
else
|
||||
{
|
||||
if ((bufptr + width) > bufend)
|
||||
width = (int)(bufend - bufptr);
|
||||
|
||||
memcpy(bufptr, va_arg(ap, char *), (size_t)width);
|
||||
bufptr += width;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 's' : /* String */
|
||||
if ((s = va_arg(ap, char *)) == NULL)
|
||||
s = "(null)";
|
||||
|
||||
/*
|
||||
* Copy the C string, replacing control chars and \ with
|
||||
* C character escapes...
|
||||
*/
|
||||
|
||||
for (bufend --; *s && bufptr < bufend; s ++)
|
||||
{
|
||||
if (*s == '\n')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'n';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\r')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 'r';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\t')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = 't';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\\')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\\';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\'')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\'';
|
||||
bytes += 2;
|
||||
}
|
||||
else if (*s == '\"')
|
||||
{
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '\"';
|
||||
bytes += 2;
|
||||
}
|
||||
else if ((*s & 255) < ' ')
|
||||
{
|
||||
if ((bufptr + 2) >= bufend)
|
||||
break;
|
||||
|
||||
*bufptr++ = '\\';
|
||||
*bufptr++ = '0';
|
||||
*bufptr++ = '0' + *s / 8;
|
||||
*bufptr++ = '0' + (*s & 7);
|
||||
bytes += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
*bufptr++ = *s;
|
||||
bytes ++;
|
||||
}
|
||||
}
|
||||
|
||||
bufend ++;
|
||||
break;
|
||||
|
||||
case 'n' : /* Output number of chars so far */
|
||||
*(va_arg(ap, int *)) = (int)bytes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bytes ++;
|
||||
|
||||
if (bufptr < bufend)
|
||||
*bufptr++ = *format;
|
||||
|
||||
format ++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Nul-terminate the string and return the number of characters needed.
|
||||
*/
|
||||
|
||||
*bufptr = '\0';
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: debug.c 12928 2015-10-23 21:31:58Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: dest-localization.c 11894 2014-05-23 03:18:00Z msweet $"
|
||||
* "$Id: dest-localization.c 12094 2014-08-19 12:15:11Z msweet $"
|
||||
*
|
||||
* Destination localization support for CUPS.
|
||||
*
|
||||
@@ -38,7 +38,7 @@ static char *cups_scan_strings(char *buffer);
|
||||
* The returned string is stored in the destination information and will become
|
||||
* invalid if the destination information is deleted.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
*/
|
||||
|
||||
const char * /* O - Localized string */
|
||||
@@ -535,5 +535,5 @@ cups_scan_strings(char *buffer) /* I - Start of string */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dest-localization.c 11894 2014-05-23 03:18:00Z msweet $".
|
||||
* End of "$Id: dest-localization.c 12094 2014-08-19 12:15:11Z msweet $".
|
||||
*/
|
||||
|
||||
+13
-13
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: dest.c 11959 2014-06-26 18:30:19Z msweet $"
|
||||
* "$Id: dest.c 13075 2016-01-29 21:14:05Z msweet $"
|
||||
*
|
||||
* User-defined destination (and option) support for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -122,7 +122,7 @@ typedef struct _cups_dnssd_resolve_s /* Data for resolving URI */
|
||||
#ifdef __APPLE__
|
||||
static CFArrayRef appleCopyLocations(void);
|
||||
static CFStringRef appleCopyNetwork(void);
|
||||
static char *appleGetPaperSize(char *name, int namesize);
|
||||
static char *appleGetPaperSize(char *name, size_t namesize);
|
||||
static CFStringRef appleGetPrinter(CFArrayRef locations,
|
||||
CFStringRef network, CFIndex *locindex);
|
||||
#endif /* __APPLE__ */
|
||||
@@ -657,6 +657,7 @@ cupsConnectDest(
|
||||
|
||||
http = httpConnect2(hostname, port, addrlist, AF_UNSPEC, encryption, 1, 0,
|
||||
NULL);
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
/*
|
||||
* Connect if requested...
|
||||
@@ -870,7 +871,7 @@ cupsEnumDests(
|
||||
*/
|
||||
|
||||
num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL,
|
||||
&dests, type, mask);
|
||||
&dests, type, mask | CUPS_PRINTER_3D);
|
||||
|
||||
if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL)
|
||||
defprinter = name;
|
||||
@@ -1310,7 +1311,7 @@ _cupsGetDestResource(
|
||||
*
|
||||
* "uri" is the "ipp" or "ipps" URI for the printer.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
*/
|
||||
|
||||
cups_dest_t * /* O - Destination or @code NULL@ */
|
||||
@@ -1742,7 +1743,7 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
*/
|
||||
|
||||
*dests = (cups_dest_t *)0;
|
||||
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, dests, 0, 0);
|
||||
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, dests, 0, CUPS_PRINTER_3D);
|
||||
|
||||
if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
|
||||
{
|
||||
@@ -1959,7 +1960,7 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
* Get the printer's attributes...
|
||||
*/
|
||||
|
||||
if (!_cupsGetDests(http, op, name, &dest, 0, 0))
|
||||
if (!_cupsGetDests(http, op, name, &dest, 0, CUPS_PRINTER_3D))
|
||||
return (NULL);
|
||||
|
||||
if (instance)
|
||||
@@ -2135,7 +2136,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
* Get the server destinations...
|
||||
*/
|
||||
|
||||
num_temps = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &temps, 0, 0);
|
||||
num_temps = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &temps, 0, CUPS_PRINTER_3D);
|
||||
|
||||
if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
|
||||
{
|
||||
@@ -2490,8 +2491,8 @@ appleCopyNetwork(void)
|
||||
*/
|
||||
|
||||
static char * /* O - Default paper size */
|
||||
appleGetPaperSize(char *name, /* I - Paper size name buffer */
|
||||
int namesize) /* I - Size of buffer */
|
||||
appleGetPaperSize(char *name, /* I - Paper size name buffer */
|
||||
size_t namesize) /* I - Size of buffer */
|
||||
{
|
||||
CFStringRef defaultPaperID; /* Default paper ID */
|
||||
pwg_media_t *pwgmedia; /* PWG media size */
|
||||
@@ -2500,8 +2501,7 @@ appleGetPaperSize(char *name, /* I - Paper size name buffer */
|
||||
defaultPaperID = _cupsAppleCopyDefaultPaperID();
|
||||
if (!defaultPaperID ||
|
||||
CFGetTypeID(defaultPaperID) != CFStringGetTypeID() ||
|
||||
!CFStringGetCString(defaultPaperID, name, namesize,
|
||||
kCFStringEncodingUTF8))
|
||||
!CFStringGetCString(defaultPaperID, name, (CFIndex)namesize, kCFStringEncodingUTF8))
|
||||
name[0] = '\0';
|
||||
else if ((pwgmedia = pwgMediaForLegacy(name)) != NULL)
|
||||
strlcpy(name, pwgmedia->pwg, namesize);
|
||||
@@ -3942,5 +3942,5 @@ cups_make_string(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: dest.c 11959 2014-06-26 18:30:19Z msweet $".
|
||||
* End of "$Id: dest.c 13075 2016-01-29 21:14:05Z msweet $".
|
||||
*/
|
||||
|
||||
+10
-6
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: encode.c 11733 2014-03-25 18:01:41Z msweet $"
|
||||
* "$Id: encode.c 13064 2016-01-27 16:05:09Z msweet $"
|
||||
*
|
||||
* Option encoding routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -117,6 +117,9 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "copies", IPP_TAG_INTEGER, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "copies-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "date-time-at-completed",IPP_TAG_DATE, IPP_TAG_ZERO }, /* never send as option */
|
||||
{ 0, "date-time-at-creation", IPP_TAG_DATE, IPP_TAG_ZERO }, /* never send as option */
|
||||
{ 0, "date-time-at-processing",IPP_TAG_DATE, IPP_TAG_ZERO }, /* never send as option */
|
||||
{ 0, "device-uri", IPP_TAG_URI, IPP_TAG_PRINTER },
|
||||
{ 1, "document-copies", IPP_TAG_RANGE, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT,
|
||||
@@ -274,6 +277,7 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-commands", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-geo-location", IPP_TAG_URI, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
@@ -538,14 +542,13 @@ cupsEncodeOptions2(
|
||||
else if (*sep == ',' && !quote)
|
||||
count ++;
|
||||
else if (*sep == '\\' && sep[1])
|
||||
sep ++;
|
||||
sep += 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
count = 1;
|
||||
|
||||
DEBUG_printf(("2cupsEncodeOptions2: option=\"%s\", count=%d",
|
||||
option->name, count));
|
||||
DEBUG_printf(("2cupsEncodeOptions2: option=\"%s\", value=\"%s\", count=%d", option->name, option->value, count));
|
||||
|
||||
/*
|
||||
* Allocate memory for the attribute values...
|
||||
@@ -629,6 +632,7 @@ cupsEncodeOptions2(
|
||||
* Skip quoted character...
|
||||
*/
|
||||
|
||||
memmove(sep, sep + 1, strlen(sep));
|
||||
sep ++;
|
||||
}
|
||||
}
|
||||
@@ -849,5 +853,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: encode.c 11733 2014-03-25 18:01:41Z msweet $".
|
||||
* End of "$Id: encode.c 13064 2016-01-27 16:05:09Z msweet $".
|
||||
*/
|
||||
|
||||
+115
-34
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: file.c 11627 2014-02-20 16:15:09Z msweet $"
|
||||
* "$Id: file.c 12641 2015-05-19 15:04:39Z msweet $"
|
||||
*
|
||||
* File functions for CUPS.
|
||||
*
|
||||
@@ -8,7 +8,7 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -288,6 +288,7 @@ _cupsFileCheckFilter(
|
||||
|
||||
switch (result)
|
||||
{
|
||||
default :
|
||||
case _CUPS_FILE_CHECK_OK :
|
||||
prefix = "DEBUG2";
|
||||
break;
|
||||
@@ -638,6 +639,8 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("4cupsFileGetChar(fp=%p)", fp));
|
||||
|
||||
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
|
||||
{
|
||||
DEBUG_puts("5cupsFileGetChar: Bad arguments!");
|
||||
@@ -648,8 +651,10 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
|
||||
* If the input buffer is empty, try to read more data...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("5cupsFileGetChar: fp->eof=%d, fp->ptr=%p, fp->end=%p", fp->eof, fp->ptr, fp->end));
|
||||
|
||||
if (fp->ptr >= fp->end)
|
||||
if (cups_fill(fp) < 0)
|
||||
if (cups_fill(fp) <= 0)
|
||||
{
|
||||
DEBUG_puts("5cupsFileGetChar: Unable to fill buffer!");
|
||||
return (-1);
|
||||
@@ -1283,7 +1288,7 @@ cupsFilePeekChar(cups_file_t *fp) /* I - CUPS file */
|
||||
*/
|
||||
|
||||
if (fp->ptr >= fp->end)
|
||||
if (cups_fill(fp) < 0)
|
||||
if (cups_fill(fp) <= 0)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
@@ -1778,7 +1783,7 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
|
||||
* Preload a buffer to determine whether the file is compressed...
|
||||
*/
|
||||
|
||||
if (cups_fill(fp) < 0)
|
||||
if (cups_fill(fp) <= 0)
|
||||
return (-1);
|
||||
}
|
||||
#endif /* HAVE_LIBZ */
|
||||
@@ -2194,6 +2199,8 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
DEBUG_printf(("9cups_fill: cups_read() returned " CUPS_LLFMT,
|
||||
CUPS_LLCAST bytes));
|
||||
|
||||
fp->eof = 1;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -2233,6 +2240,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Can't read from file!
|
||||
*/
|
||||
|
||||
DEBUG_puts("9cups_fill: Extra gzip header data missing, returning -1.");
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -2245,6 +2257,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Can't read from file!
|
||||
*/
|
||||
|
||||
DEBUG_puts("9cups_fill: Extra gzip header data does not fit in initial buffer, returning -1.");
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -2266,6 +2283,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Can't read from file!
|
||||
*/
|
||||
|
||||
DEBUG_puts("9cups_fill: Original filename in gzip header data does not fit in initial buffer, returning -1.");
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -2287,6 +2309,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Can't read from file!
|
||||
*/
|
||||
|
||||
DEBUG_puts("9cups_fill: Comment in gzip header data does not fit in initial buffer, returning -1.");
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -2305,6 +2332,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
* Can't read from file!
|
||||
*/
|
||||
|
||||
DEBUG_puts("9cups_fill: Header CRC in gzip header data does not fit in initial buffer, returning -1.");
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -2329,8 +2361,15 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
fp->stream.avail_out = 0;
|
||||
fp->crc = crc32(0L, Z_NULL, 0);
|
||||
|
||||
if (inflateInit2(&(fp->stream), -15) != Z_OK)
|
||||
if ((status = inflateInit2(&(fp->stream), -15)) != Z_OK)
|
||||
{
|
||||
DEBUG_printf(("9cups_fill: inflateInit2 returned %d, returning -1.", status));
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
fp->compressed = 1;
|
||||
}
|
||||
@@ -2342,7 +2381,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
*/
|
||||
|
||||
if (fp->eof)
|
||||
return (-1);
|
||||
{
|
||||
DEBUG_puts("9cups_fill: EOF, returning 0.");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill the decompression buffer as needed...
|
||||
@@ -2351,7 +2394,13 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
if (fp->stream.avail_in == 0)
|
||||
{
|
||||
if ((bytes = cups_read(fp, (char *)fp->cbuf, sizeof(fp->cbuf))) <= 0)
|
||||
return (-1);
|
||||
{
|
||||
DEBUG_printf(("9cups_fill: cups_read error, returning %d.", (int)bytes));
|
||||
|
||||
fp->eof = 1;
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
|
||||
fp->stream.next_in = fp->cbuf;
|
||||
fp->stream.avail_in = (uInt)bytes;
|
||||
@@ -2378,42 +2427,69 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
|
||||
unsigned char trailer[8]; /* Trailer bytes */
|
||||
uLong tcrc; /* Trailer CRC */
|
||||
ssize_t tbytes = 0; /* Number of bytes */
|
||||
|
||||
|
||||
if (read(fp->fd, trailer, sizeof(trailer)) < (ssize_t)sizeof(trailer))
|
||||
if (fp->stream.avail_in > 0)
|
||||
{
|
||||
/*
|
||||
* Can't get it, so mark end-of-file...
|
||||
*/
|
||||
if (fp->stream.avail_in > sizeof(trailer))
|
||||
tbytes = (ssize_t)sizeof(trailer);
|
||||
else
|
||||
tbytes = (ssize_t)fp->stream.avail_in;
|
||||
|
||||
fp->eof = 1;
|
||||
memcpy(trailer, fp->stream.next_in, (size_t)tbytes);
|
||||
fp->stream.next_in += tbytes;
|
||||
fp->stream.avail_in -= (size_t)tbytes;
|
||||
}
|
||||
else
|
||||
{
|
||||
tcrc = ((((((uLong)trailer[3] << 8) | (uLong)trailer[2]) << 8) |
|
||||
(uLong)trailer[1]) << 8) | (uLong)trailer[0];
|
||||
|
||||
if (tcrc != fp->crc)
|
||||
if (tbytes < (ssize_t)sizeof(trailer))
|
||||
{
|
||||
if (read(fp->fd, trailer + tbytes, sizeof(trailer) - (size_t)tbytes) < ((ssize_t)sizeof(trailer) - tbytes))
|
||||
{
|
||||
/*
|
||||
* Bad CRC, mark end-of-file...
|
||||
* Can't get it, so mark end-of-file...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("9cups_fill: tcrc=%08x != fp->crc=%08x",
|
||||
(unsigned int)tcrc, (unsigned int)fp->crc));
|
||||
DEBUG_puts("9cups_fill: Unable to read gzip CRC trailer, returning -1.");
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
tcrc = ((((((uLong)trailer[3] << 8) | (uLong)trailer[2]) << 8) |
|
||||
(uLong)trailer[1]) << 8) | (uLong)trailer[0];
|
||||
|
||||
if (tcrc != fp->crc)
|
||||
{
|
||||
/*
|
||||
* Otherwise, reset the compressed flag so that we re-read the
|
||||
* file header...
|
||||
* Bad CRC, mark end-of-file...
|
||||
*/
|
||||
|
||||
fp->compressed = 0;
|
||||
DEBUG_printf(("9cups_fill: tcrc=%08x != fp->crc=%08x, returning -1.", (unsigned int)tcrc, (unsigned int)fp->crc));
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Otherwise, reset the compressed flag so that we re-read the
|
||||
* file header...
|
||||
*/
|
||||
|
||||
fp->compressed = 0;
|
||||
}
|
||||
else if (status < Z_OK)
|
||||
{
|
||||
DEBUG_printf(("9cups_fill: inflate returned %d, returning -1.", status));
|
||||
|
||||
fp->eof = 1;
|
||||
errno = EIO;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
bytes = (ssize_t)sizeof(fp->buf) - (ssize_t)fp->stream.avail_out;
|
||||
@@ -2426,7 +2502,10 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
fp->end = fp->buf + bytes;
|
||||
|
||||
if (bytes)
|
||||
{
|
||||
DEBUG_printf(("9cups_fill: Returning %d.", (int)bytes));
|
||||
return (bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_LIBZ */
|
||||
@@ -2444,17 +2523,19 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
|
||||
fp->eof = 1;
|
||||
fp->ptr = fp->buf;
|
||||
fp->end = fp->buf;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Return the bytes we read...
|
||||
*/
|
||||
|
||||
return (-1);
|
||||
fp->eof = 0;
|
||||
fp->ptr = fp->buf;
|
||||
fp->end = fp->buf + bytes;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the bytes we read...
|
||||
*/
|
||||
|
||||
fp->eof = 0;
|
||||
fp->ptr = fp->buf;
|
||||
fp->end = fp->buf + bytes;
|
||||
DEBUG_printf(("9cups_fill: Not gzip, returning %d.", (int)bytes));
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
@@ -2671,5 +2752,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: file.c 11627 2014-02-20 16:15:09Z msweet $".
|
||||
* End of "$Id: file.c 12641 2015-05-19 15:04:39Z msweet $".
|
||||
*/
|
||||
|
||||
+7
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: globals.c 11851 2014-05-07 23:55:35Z msweet $"
|
||||
* "$Id: globals.c 12480 2015-02-03 12:36:34Z msweet $"
|
||||
*
|
||||
* Global variable access routines for CUPS.
|
||||
*
|
||||
@@ -216,9 +216,9 @@ cups_globals_alloc(void)
|
||||
memset(cg, 0, sizeof(_cups_globals_t));
|
||||
cg->encryption = (http_encryption_t)-1;
|
||||
cg->password_cb = (cups_password_cb2_t)_cupsGetPassword;
|
||||
cg->any_root = 1;
|
||||
cg->expired_certs = 1;
|
||||
cg->validate_certs = 0;
|
||||
cg->any_root = -1;
|
||||
cg->expired_certs = -1;
|
||||
cg->validate_certs = -1;
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
@@ -361,7 +361,9 @@ cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
|
||||
|
||||
httpClose(cg->http);
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
_httpFreeCredentials(cg->tls_credentials);
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
cupsFileClose(cg->stdio_files[0]);
|
||||
cupsFileClose(cg->stdio_files[1]);
|
||||
@@ -392,5 +394,5 @@ cups_globals_init(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: globals.c 11851 2014-05-07 23:55:35Z msweet $".
|
||||
* End of "$Id: globals.c 12480 2015-02-03 12:36:34Z msweet $".
|
||||
*/
|
||||
|
||||
+12
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: http-addr.c 11627 2014-02-20 16:15:09Z msweet $"
|
||||
* "$Id: http-addr.c 12129 2014-08-28 19:26:31Z msweet $"
|
||||
*
|
||||
* HTTP address routines for CUPS.
|
||||
*
|
||||
@@ -64,7 +64,7 @@ httpAddrAny(const http_addr_t *addr) /* I - Address to check */
|
||||
* listen address for sockets created with @link httpAddrListen@. This will
|
||||
* ensure that domain sockets are removed when closed.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on failure */
|
||||
@@ -653,7 +653,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
*
|
||||
* Returns @code NULL@ if the socket is currently unconnected.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
http_addr_t * /* O - Connected address or @code NULL@ */
|
||||
@@ -865,6 +865,13 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
}
|
||||
#endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure .local hostnames end with a period...
|
||||
*/
|
||||
|
||||
if (strlen(s) > 6 && !strcmp(s + strlen(s) - 6, ".local"))
|
||||
strlcat(s, ".", (size_t)slen);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -879,7 +886,7 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
|
||||
* 'httpResolveHostname()' - Resolve the hostname of the HTTP connection
|
||||
* address.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
const char * /* O - Resolved hostname or @code NULL@ */
|
||||
@@ -917,5 +924,5 @@ httpResolveHostname(http_t *http, /* I - HTTP connection */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: http-addr.c 11627 2014-02-20 16:15:09Z msweet $".
|
||||
* End of "$Id: http-addr.c 12129 2014-08-28 19:26:31Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-8
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: http-private.h 12044 2014-07-17 21:21:21Z msweet $"
|
||||
* "$Id: http-private.h 12645 2015-05-20 01:20:52Z msweet $"
|
||||
*
|
||||
* Private HTTP definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -76,7 +76,6 @@ typedef int socklen_t;
|
||||
# ifdef HAVE_GNUTLS
|
||||
# include <gnutls/gnutls.h>
|
||||
# include <gnutls/x509.h>
|
||||
# include <gcrypt.h>
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
# include <CoreFoundation/CoreFoundation.h>
|
||||
# include <Security/Security.h>
|
||||
@@ -127,6 +126,7 @@ extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate)
|
||||
|
||||
# ifndef WIN32
|
||||
# include <net/if.h>
|
||||
# include <resolv.h>
|
||||
# ifdef HAVE_GETIFADDRS
|
||||
# include <ifaddrs.h>
|
||||
# else
|
||||
@@ -162,6 +162,12 @@ extern "C" {
|
||||
#define _HTTP_RESOLVE_FQDN 2 /* Resolve to a FQDN */
|
||||
#define _HTTP_RESOLVE_FAXOUT 4 /* Resolve FaxOut service? */
|
||||
|
||||
#define _HTTP_TLS_NONE 0 /* No TLS options */
|
||||
#define _HTTP_TLS_ALLOW_RC4 1 /* Allow RC4 cipher suites */
|
||||
#define _HTTP_TLS_ALLOW_SSL3 2 /* Allow SSL 3.0 */
|
||||
#define _HTTP_TLS_ALLOW_DH 4 /* Allow DH/DHE key negotiation */
|
||||
#define _HTTP_TLS_DENY_TLS10 16 /* Deny TLS 1.0 */
|
||||
|
||||
|
||||
/*
|
||||
* Types and functions for SSL support...
|
||||
@@ -184,10 +190,6 @@ typedef gnutls_certificate_credentials_t *http_tls_credentials_t;
|
||||
# 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 */
|
||||
# ifndef HAVE_SECITEMPRIV_H /* Declare constants from that header... */
|
||||
extern const CFTypeRef kSecClassCertificate;
|
||||
extern const CFTypeRef kSecClassIdentity;
|
||||
# endif /* !HAVE_SECITEMPRIV_H */
|
||||
# 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,
|
||||
@@ -421,6 +423,7 @@ extern void _httpTLSInitialize(void);
|
||||
extern size_t _httpTLSPending(http_t *http);
|
||||
extern int _httpTLSRead(http_t *http, char *buf, int len);
|
||||
extern int _httpTLSSetCredentials(http_t *http);
|
||||
extern void _httpTLSSetOptions(int options);
|
||||
extern int _httpTLSStart(http_t *http);
|
||||
extern void _httpTLSStop(http_t *http);
|
||||
extern int _httpTLSWrite(http_t *http, const char *buf, int len);
|
||||
@@ -439,5 +442,5 @@ extern int _httpWait(http_t *http, int msec, int usessl);
|
||||
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: http-private.h 12044 2014-07-17 21:21:21Z msweet $".
|
||||
* End of "$Id: http-private.h 12645 2015-05-20 01:20:52Z msweet $".
|
||||
*/
|
||||
|
||||
+13
-7
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: http-support.c 11844 2014-05-02 11:58:54Z msweet $"
|
||||
* "$Id: http-support.c 12970 2015-11-13 20:02:51Z msweet $"
|
||||
*
|
||||
* HTTP support routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -649,7 +649,7 @@ httpDecode64_2(char *out, /* I - String to write to */
|
||||
break;
|
||||
case 3 :
|
||||
if (outptr < outend)
|
||||
*outptr++ |= base64;
|
||||
*outptr++ |= (char)base64;
|
||||
pos = 0;
|
||||
break;
|
||||
}
|
||||
@@ -1233,6 +1233,12 @@ httpSeparateURI(
|
||||
|
||||
*port = (int)strtol(uri + 1, (char **)&uri, 10);
|
||||
|
||||
if (*port <= 0 || *port > 65535)
|
||||
{
|
||||
*port = 0;
|
||||
return (HTTP_URI_STATUS_BAD_PORT);
|
||||
}
|
||||
|
||||
if (*uri != '/' && *uri)
|
||||
{
|
||||
*port = 0;
|
||||
@@ -1300,7 +1306,7 @@ httpSeparateURI(
|
||||
/*
|
||||
* 'httpStateString()' - Return the string describing a HTTP state value.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
const char * /* O - State string */
|
||||
@@ -1433,7 +1439,7 @@ httpStatus(http_status_t status) /* I - HTTP status code */
|
||||
/*
|
||||
* 'httpURIStatusString()' - Return a string describing a URI status code.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
const char * /* O - Localized status string */
|
||||
@@ -1722,7 +1728,7 @@ _httpResolveURI(
|
||||
while (time(NULL) < end_time)
|
||||
{
|
||||
if (options & _HTTP_RESOLVE_STDERR)
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Looking for printer."));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Looking for printer..."));
|
||||
|
||||
if (cb && !(*cb)(context))
|
||||
{
|
||||
@@ -2544,5 +2550,5 @@ http_resolve_cb(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: http-support.c 11844 2014-05-02 11:58:54Z msweet $".
|
||||
* End of "$Id: http-support.c 12970 2015-11-13 20:02:51Z msweet $".
|
||||
*/
|
||||
|
||||
+46
-18
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: http.c 12034 2014-07-16 19:37:34Z msweet $"
|
||||
* "$Id: http.c 12970 2015-11-13 20:02:51Z msweet $"
|
||||
*
|
||||
* HTTP routines for CUPS.
|
||||
*
|
||||
@@ -393,7 +393,7 @@ httpClose(http_t *http) /* I - HTTP connection */
|
||||
/*
|
||||
* 'httpCompareCredentials()' - Compare two sets of X.509 credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 if they match, 0 if they do not */
|
||||
@@ -759,7 +759,7 @@ httpGet(http_t *http, /* I - HTTP connection */
|
||||
*
|
||||
* The return value is the UNIX time of the last read or write.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
time_t /* O - Time of last read or write */
|
||||
@@ -898,7 +898,7 @@ httpGetContentEncoding(http_t *http) /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
const char * /* O - Cookie data or NULL */
|
||||
httpGetCookie(http_t *http) /* I - HTTP connecion */
|
||||
httpGetCookie(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
return (http ? http->cookie : NULL);
|
||||
}
|
||||
@@ -911,7 +911,7 @@ httpGetCookie(http_t *http) /* I - HTTP connecion */
|
||||
* @link httpIsEncrypted@ function to determine whether a TLS session has
|
||||
* been established.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
http_encryption_t /* O - Current encryption mode */
|
||||
@@ -995,7 +995,7 @@ httpGetField(http_t *http, /* I - HTTP connection */
|
||||
/*
|
||||
* 'httpGetKeepAlive()' - Get the current Keep-Alive state of the connection.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
http_keepalive_t /* O - Keep-Alive state */
|
||||
@@ -1104,7 +1104,7 @@ httpGetLength2(http_t *http) /* I - HTTP connection */
|
||||
/*
|
||||
* 'httpGetPending()' - Get the number of bytes that are buffered for writing.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
size_t /* O - Number of bytes buffered */
|
||||
@@ -1117,7 +1117,7 @@ httpGetPending(http_t *http) /* I - HTTP connection */
|
||||
/*
|
||||
* 'httpGetReady()' - Get the number of bytes that can be read without blocking.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
size_t /* O - Number of bytes available */
|
||||
@@ -1143,7 +1143,7 @@ httpGetReady(http_t *http) /* I - HTTP connection */
|
||||
* The @link httpIsChunked@ function can be used to determine whether the
|
||||
* message body is chunked or fixed-length.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
size_t /* O - Remaining bytes */
|
||||
@@ -1582,7 +1582,7 @@ httpInitialize(void)
|
||||
* This function returns non-zero if the message body is composed of
|
||||
* variable-length chunks.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 if chunked, 0 if not */
|
||||
@@ -1597,7 +1597,7 @@ httpIsChunked(http_t *http) /* I - HTTP connection */
|
||||
*
|
||||
* This function returns non-zero if the connection is currently encrypted.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 if encrypted, 0 if not */
|
||||
@@ -1793,8 +1793,8 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
|
||||
memcpy(http->sbuffer + http->stream.avail_in, http->buffer, buflen);
|
||||
http->stream.avail_in += buflen;
|
||||
http->used -= buflen;
|
||||
http->data_remaining -= buflen;
|
||||
http->used -= (int)buflen;
|
||||
http->data_remaining -= (off_t)buflen;
|
||||
|
||||
if (http->used > 0)
|
||||
memmove(http->buffer, http->buffer + buflen, (size_t)http->used);
|
||||
@@ -2557,9 +2557,11 @@ httpSetCredentials(http_t *http, /* I - HTTP connection */
|
||||
if (!http || cupsArrayCount(credentials) < 1)
|
||||
return (-1);
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
_httpFreeCredentials(http->tls_credentials);
|
||||
|
||||
http->tls_credentials = _httpCreateCredentials(credentials);
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
return (http->tls_credentials ? 0 : -1);
|
||||
}
|
||||
@@ -2700,6 +2702,19 @@ httpSetField(http_t *http, /* I - HTTP connection */
|
||||
http->server = _cupsStrAlloc(value);
|
||||
break;
|
||||
|
||||
case HTTP_FIELD_WWW_AUTHENTICATE :
|
||||
/* CUPS STR #4503 - don't override WWW-Authenticate for unknown auth schemes */
|
||||
if (http->fields[HTTP_FIELD_WWW_AUTHENTICATE][0] &&
|
||||
_cups_strncasecmp(value, "Basic ", 6) &&
|
||||
_cups_strncasecmp(value, "Digest ", 7) &&
|
||||
_cups_strncasecmp(value, "Negotiate ", 10))
|
||||
{
|
||||
DEBUG_printf(("1httpSetField: Ignoring unknown auth scheme in \"%s\".", value));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Fall through to copy */
|
||||
|
||||
default :
|
||||
strlcpy(http->fields[field], value, HTTP_MAX_VALUE);
|
||||
break;
|
||||
@@ -2769,7 +2784,7 @@ httpSetField(http_t *http, /* I - HTTP connection */
|
||||
/*
|
||||
* 'httpSetKeepAlive()' - Set the current Keep-Alive state of a connection.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -2847,7 +2862,7 @@ httpSetTimeout(
|
||||
/*
|
||||
* 'httpShutdown()' - Shutdown one side of an HTTP connection.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -2856,8 +2871,10 @@ httpShutdown(http_t *http) /* I - HTTP connection */
|
||||
if (!http || http->fd < 0)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls)
|
||||
_httpTLSStop(http);
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
#ifdef WIN32
|
||||
shutdown(http->fd, SD_RECEIVE); /* Microsoft-ism... */
|
||||
@@ -2986,7 +3003,7 @@ _httpUpdate(http_t *http, /* I - HTTP connection */
|
||||
*status = http->status;
|
||||
return (0);
|
||||
}
|
||||
else if (!strncmp(line, "HTTP/", 5))
|
||||
else if (!strncmp(line, "HTTP/", 5) && http->mode == _HTTP_MODE_CLIENT)
|
||||
{
|
||||
/*
|
||||
* Got the beginning of a response...
|
||||
@@ -3607,6 +3624,17 @@ httpWriteResponse(http_t *http, /* I - HTTP connection */
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* "Click-jacking" defense (STR #4492)...
|
||||
*/
|
||||
|
||||
if (httpPrintf(http, "X-Frame-Options: DENY\r\n"
|
||||
"Content-Security-Policy: frame-ancestors 'none'\r\n") < 1)
|
||||
{
|
||||
http->status = HTTP_STATUS_ERROR;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (httpWrite2(http, "\r\n", 2) < 2)
|
||||
@@ -4004,7 +4032,7 @@ http_debug_hex(const char *prefix, /* I - Prefix for line */
|
||||
for (i = 0; i < bytes; i += 16)
|
||||
{
|
||||
for (j = 0, ptr = start; j < 16 && (i + j) < bytes; j ++, ptr += 2)
|
||||
sprintf(ptr, "%02X", buffer[i + j] & 255);
|
||||
snprintf(ptr, 3, "%02X", buffer[i + j] & 255);
|
||||
|
||||
while (j < 16)
|
||||
{
|
||||
@@ -4822,5 +4850,5 @@ http_write_chunk(http_t *http, /* I - HTTP connection */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: http.c 12034 2014-07-16 19:37:34Z msweet $".
|
||||
* End of "$Id: http.c 12970 2015-11-13 20:02:51Z msweet $".
|
||||
*/
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: http.h 11850 2014-05-07 23:12:48Z msweet $"
|
||||
* "$Id: http.h 12848 2015-08-26 18:51:57Z msweet $"
|
||||
*
|
||||
* Hyper-Text Transport Protocol definitions for CUPS.
|
||||
*
|
||||
@@ -246,7 +246,7 @@ typedef enum http_status_e /**** HTTP status codes ****/
|
||||
HTTP_STATUS_NOT_AUTHORITATIVE, /* Information isn't authoritative */
|
||||
HTTP_STATUS_NO_CONTENT, /* Successful command, no new data */
|
||||
HTTP_STATUS_RESET_CONTENT, /* Content was reset/recreated */
|
||||
HTTP_STATUS_PARTIAL_CONTENT, /* Only a partial file was recieved/sent */
|
||||
HTTP_STATUS_PARTIAL_CONTENT, /* Only a partial file was received/sent */
|
||||
|
||||
HTTP_STATUS_MULTIPLE_CHOICES = 300, /* Multiple files match request */
|
||||
HTTP_STATUS_MOVED_PERMANENTLY, /* Document has moved permanently */
|
||||
@@ -342,7 +342,7 @@ typedef enum http_status_e /**** HTTP status codes ****/
|
||||
# endif /* !_CUPS_NO_DEPRECATED */
|
||||
} http_status_t;
|
||||
|
||||
typedef enum http_trust_e /**** Level of trust for credentials @since CUPS 2.0@ */
|
||||
typedef enum http_trust_e /**** Level of trust for credentials @since CUPS 2.0/OS 10.10@ */
|
||||
{
|
||||
HTTP_TRUST_OK = 0, /* Credentials are OK/trusted */
|
||||
HTTP_TRUST_INVALID, /* Credentials are invalid */
|
||||
@@ -620,7 +620,7 @@ extern void httpSetDefaultField(http_t *http, http_field_t field,
|
||||
extern http_state_t httpWriteResponse(http_t *http,
|
||||
http_status_t status) _CUPS_API_1_7;
|
||||
|
||||
/* New in CUPS 2.0 */
|
||||
/* New in CUPS 2.0/OS X 10.10 */
|
||||
extern int httpAddrClose(http_addr_t *addr, int fd) _CUPS_API_2_0;
|
||||
extern int httpAddrFamily(http_addr_t *addr) _CUPS_API_2_0;
|
||||
extern int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2) _CUPS_API_2_0;
|
||||
@@ -656,5 +656,5 @@ extern const char *httpURIStatusString(http_uri_status_t status) _CUPS_API_2_0;
|
||||
#endif /* !_CUPS_HTTP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: http.h 11850 2014-05-07 23:12:48Z msweet $".
|
||||
* End of "$Id: http.h 12848 2015-08-26 18:51:57Z msweet $".
|
||||
*/
|
||||
|
||||
+35
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: ipp-support.c 11806 2014-04-09 16:12:27Z msweet $"
|
||||
* "$Id: ipp-support.c 12666 2015-05-25 19:38:09Z msweet $"
|
||||
*
|
||||
* Internet Printing Protocol support functions for CUPS.
|
||||
*
|
||||
@@ -195,7 +195,7 @@ static const char * const ipp_std_ops[] =
|
||||
"Suspend-Current-Job",
|
||||
"Resume-Job",
|
||||
|
||||
/* 0x0030 - 0x003e */
|
||||
/* 0x0030 - 0x003f */
|
||||
"Promote-Job",
|
||||
"Schedule-Job-After",
|
||||
"0x0032",
|
||||
@@ -210,7 +210,21 @@ static const char * const ipp_std_ops[] =
|
||||
"Close-Job",
|
||||
"Identify-Printer",
|
||||
"Validate-Document",
|
||||
"Send-Hardcopy-Document"
|
||||
"Send-Hardcopy-Document",
|
||||
"Acknowledge-Document",
|
||||
|
||||
/* 0x0040 - 0x004a */
|
||||
"Acknowledge-Identify-Printer",
|
||||
"Acknowledge-Job",
|
||||
"Fetch-Document",
|
||||
"Fetch-Job",
|
||||
"Get-Output-Device-Attributes",
|
||||
"Update-Active-Jobs",
|
||||
"Deregister-Output-Device",
|
||||
"Update-Document-Status",
|
||||
"Update-Job-Status",
|
||||
"Update-Output-Device-Attributes",
|
||||
"Get-Next-Document-Data"
|
||||
},
|
||||
* const ipp_cups_ops[] =
|
||||
{
|
||||
@@ -669,7 +683,14 @@ ippAttributeString(
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
if (buffer && bufptr < bufend)
|
||||
if (val->resolution.xres == val->resolution.yres)
|
||||
{
|
||||
if (buffer && bufptr < bufend)
|
||||
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d%s", val->resolution.xres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
else
|
||||
bufptr += snprintf(temp, sizeof(temp), "%d%s", val->resolution.xres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
}
|
||||
else if (buffer && bufptr < bufend)
|
||||
bufptr += snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
else
|
||||
bufptr += snprintf(temp, sizeof(temp), "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
@@ -2122,7 +2143,7 @@ ippSetPort(int p) /* I - Port number to use */
|
||||
/*
|
||||
* 'ippStateString()' - Return the name corresponding to a state value.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
const char * /* O - State name */
|
||||
@@ -2216,6 +2237,14 @@ ipp_col_string(ipp_t *col, /* I - Collection attribute */
|
||||
ipp_attribute_t *attr; /* Current member attribute */
|
||||
|
||||
|
||||
if (!col)
|
||||
{
|
||||
if (buffer)
|
||||
*buffer = '\0';
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
bufptr = buffer;
|
||||
bufend = buffer + bufsize - 1;
|
||||
|
||||
@@ -2256,5 +2285,5 @@ ipp_col_string(ipp_t *col, /* I - Collection attribute */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp-support.c 11806 2014-04-09 16:12:27Z msweet $".
|
||||
* End of "$Id: ipp-support.c 12666 2015-05-25 19:38:09Z msweet $".
|
||||
*/
|
||||
|
||||
+22
-6
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: ipp.c 11840 2014-04-29 15:57:26Z msweet $"
|
||||
* "$Id: ipp.c 12468 2015-02-01 04:50:43Z msweet $"
|
||||
*
|
||||
* Internet Printing Protocol functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -1728,7 +1728,7 @@ ippCopyAttribute(
|
||||
/*
|
||||
* 'ippCopyAttributes()' - Copy attributes from one IPP message to another.
|
||||
*
|
||||
* Zero or more attributes are copied from the source IPP message, @code@ src, to the
|
||||
* Zero or more attributes are copied from the source IPP message, @code src@, to the
|
||||
* destination IPP message, @code dst@. When @code quickcopy@ is non-zero, a "shallow"
|
||||
* reference copy of the attribute is created - this should only be done as long as the
|
||||
* original source IPP message will not be freed for the life of the destination.
|
||||
@@ -2032,7 +2032,7 @@ ippFindNextAttribute(ipp_t *ipp, /* I - IPP message */
|
||||
*childattr; /* Child attribute */
|
||||
ipp_tag_t value_tag; /* Value tag */
|
||||
char parent[1024], /* Parent attribute name */
|
||||
*child; /* Child attribute name */
|
||||
*child = NULL; /* Child attribute name */
|
||||
|
||||
|
||||
DEBUG_printf(("2ippFindNextAttribute(ipp=%p, name=\"%s\", type=%02x(%s))",
|
||||
@@ -6675,7 +6675,7 @@ ipp_length(ipp_t *ipp, /* I - IPP message or collection */
|
||||
DEBUG_printf(("5ipp_length: attr->name=\"%s\", attr->num_values=%d, "
|
||||
"bytes=" CUPS_LLFMT, attr->name, attr->num_values, CUPS_LLCAST bytes));
|
||||
|
||||
if (attr->value_tag < IPP_TAG_EXTENSION)
|
||||
if ((attr->value_tag & ~IPP_TAG_CUPS_CONST) < IPP_TAG_EXTENSION)
|
||||
bytes += (size_t)attr->num_values;/* Value tag for each value */
|
||||
else
|
||||
bytes += (size_t)(5 * attr->num_values);
|
||||
@@ -6830,6 +6830,22 @@ ipp_read_http(http_t *http, /* I - Client connection */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (http->used == 0 && http->timeout_value > 0)
|
||||
{
|
||||
/*
|
||||
* Wait up to timeout seconds for more data on blocking sockets...
|
||||
*/
|
||||
|
||||
if (!httpWait(http, (int)(1000 * http->timeout_value)))
|
||||
{
|
||||
/*
|
||||
* Signal no data...
|
||||
*/
|
||||
|
||||
bytes = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((bytes = httpRead2(http, (char *)buffer, length - (size_t)tbytes)) < 0)
|
||||
{
|
||||
@@ -7046,5 +7062,5 @@ ipp_write_file(int *fd, /* I - File descriptor */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp.c 11840 2014-04-29 15:57:26Z msweet $".
|
||||
* End of "$Id: ipp.c 12468 2015-02-01 04:50:43Z msweet $".
|
||||
*/
|
||||
|
||||
+40
-27
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: ipp.h 11806 2014-04-09 16:12:27Z msweet $"
|
||||
* "$Id: ipp.h 12666 2015-05-25 19:38:09Z msweet $"
|
||||
*
|
||||
* Internet Printing Protocol definitions for CUPS.
|
||||
*
|
||||
@@ -246,11 +246,11 @@ typedef enum ipp_op_e /**** IPP operations ****/
|
||||
IPP_OP_CUPS_INVALID = -1, /* Invalid operation name for @link ippOpValue@ */
|
||||
IPP_OP_CUPS_NONE = 0, /* No operation @private@ */
|
||||
IPP_OP_PRINT_JOB = 0x0002, /* Print a single file */
|
||||
IPP_OP_PRINT_URI, /* Print a single URL @private@ */
|
||||
IPP_OP_PRINT_URI, /* Print a single URL */
|
||||
IPP_OP_VALIDATE_JOB, /* Validate job options */
|
||||
IPP_OP_CREATE_JOB, /* Create an empty print job */
|
||||
IPP_OP_SEND_DOCUMENT, /* Add a file to a job */
|
||||
IPP_OP_SEND_URI, /* Add a URL to a job @private@ */
|
||||
IPP_OP_SEND_URI, /* Add a URL to a job */
|
||||
IPP_OP_CANCEL_JOB, /* Cancel a job */
|
||||
IPP_OP_GET_JOB_ATTRIBUTES, /* Get job attributes */
|
||||
IPP_OP_GET_JOBS, /* Get a list of jobs */
|
||||
@@ -261,7 +261,7 @@ typedef enum ipp_op_e /**** IPP operations ****/
|
||||
IPP_OP_PAUSE_PRINTER = 0x0010, /* Stop a printer */
|
||||
IPP_OP_RESUME_PRINTER, /* Start a printer */
|
||||
IPP_OP_PURGE_JOBS, /* Cancel all jobs */
|
||||
IPP_OP_SET_PRINTER_ATTRIBUTES, /* Set printer attributes @private@ */
|
||||
IPP_OP_SET_PRINTER_ATTRIBUTES, /* Set printer attributes */
|
||||
IPP_OP_SET_JOB_ATTRIBUTES, /* Set job attributes */
|
||||
IPP_OP_GET_PRINTER_SUPPORTED_VALUES, /* Get supported attribute values */
|
||||
IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS, /* Create one or more printer subscriptions @since CUPS 1.2/OS X 10.5@ */
|
||||
@@ -279,32 +279,45 @@ typedef enum ipp_op_e /**** IPP operations ****/
|
||||
IPP_OP_ENABLE_PRINTER, /* Start a printer */
|
||||
IPP_OP_DISABLE_PRINTER, /* Stop a printer */
|
||||
IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB,
|
||||
/* Stop printer after the current job @private@ */
|
||||
IPP_OP_HOLD_NEW_JOBS, /* Hold new jobs @private@ */
|
||||
IPP_OP_RELEASE_HELD_NEW_JOBS, /* Release new jobs @private@ */
|
||||
IPP_OP_DEACTIVATE_PRINTER, /* Stop a printer @private@ */
|
||||
IPP_OP_ACTIVATE_PRINTER, /* Start a printer @private@ */
|
||||
IPP_OP_RESTART_PRINTER, /* Restart a printer @private@ */
|
||||
IPP_OP_SHUTDOWN_PRINTER, /* Turn a printer off @private@ */
|
||||
IPP_OP_STARTUP_PRINTER, /* Turn a printer on @private@ */
|
||||
IPP_OP_REPROCESS_JOB, /* Reprint a job @private@ */
|
||||
IPP_OP_CANCEL_CURRENT_JOB, /* Cancel the current job @private@ */
|
||||
IPP_OP_SUSPEND_CURRENT_JOB, /* Suspend the current job @private@ */
|
||||
IPP_OP_RESUME_JOB, /* Resume the current job @private@ */
|
||||
IPP_OP_PROMOTE_JOB, /* Promote a job to print sooner @private@ */
|
||||
IPP_OP_SCHEDULE_JOB_AFTER, /* Schedule a job to print after another @private@ */
|
||||
IPP_OP_CANCEL_DOCUMENT = 0x0033, /* Cancel-Document @private@ */
|
||||
IPP_OP_GET_DOCUMENT_ATTRIBUTES, /* Get-Document-Attributes @private@ */
|
||||
IPP_OP_GET_DOCUMENTS, /* Get-Documents @private@ */
|
||||
IPP_OP_DELETE_DOCUMENT, /* Delete-Document @private@ */
|
||||
IPP_OP_SET_DOCUMENT_ATTRIBUTES, /* Set-Document-Attributes @private@ */
|
||||
/* Stop printer after the current job */
|
||||
IPP_OP_HOLD_NEW_JOBS, /* Hold new jobs */
|
||||
IPP_OP_RELEASE_HELD_NEW_JOBS, /* Release new jobs */
|
||||
IPP_OP_DEACTIVATE_PRINTER, /* Stop a printer */
|
||||
IPP_OP_ACTIVATE_PRINTER, /* Start a printer */
|
||||
IPP_OP_RESTART_PRINTER, /* Restart a printer */
|
||||
IPP_OP_SHUTDOWN_PRINTER, /* Turn a printer off */
|
||||
IPP_OP_STARTUP_PRINTER, /* Turn a printer on */
|
||||
IPP_OP_REPROCESS_JOB, /* Reprint a job */
|
||||
IPP_OP_CANCEL_CURRENT_JOB, /* Cancel the current job */
|
||||
IPP_OP_SUSPEND_CURRENT_JOB, /* Suspend the current job */
|
||||
IPP_OP_RESUME_JOB, /* Resume the current job */
|
||||
IPP_OP_PROMOTE_JOB, /* Promote a job to print sooner */
|
||||
IPP_OP_SCHEDULE_JOB_AFTER, /* Schedule a job to print after another */
|
||||
IPP_OP_CANCEL_DOCUMENT = 0x0033, /* Cancel-Document */
|
||||
IPP_OP_GET_DOCUMENT_ATTRIBUTES, /* Get-Document-Attributes */
|
||||
IPP_OP_GET_DOCUMENTS, /* Get-Documents */
|
||||
IPP_OP_DELETE_DOCUMENT, /* Delete-Document */
|
||||
IPP_OP_SET_DOCUMENT_ATTRIBUTES, /* Set-Document-Attributes */
|
||||
IPP_OP_CANCEL_JOBS, /* Cancel-Jobs */
|
||||
IPP_OP_CANCEL_MY_JOBS, /* Cancel-My-Jobs */
|
||||
IPP_OP_RESUBMIT_JOB, /* Resubmit-Job */
|
||||
IPP_OP_CLOSE_JOB, /* Close-Job */
|
||||
IPP_OP_IDENTIFY_PRINTER, /* Identify-Printer @private@ */
|
||||
IPP_OP_VALIDATE_DOCUMENT, /* Validate-Document @private@ */
|
||||
IPP_OP_SEND_HARDCOPY_DOCUMENT, /* Send-Hardcopy-Document @private@ */
|
||||
IPP_OP_IDENTIFY_PRINTER, /* Identify-Printer */
|
||||
IPP_OP_VALIDATE_DOCUMENT, /* Validate-Document */
|
||||
IPP_OP_SEND_HARDCOPY_DOCUMENT, /* Send-Hardcopy-Document */
|
||||
IPP_OP_ACKNOWLEDGE_DOCUMENT, /* Acknowledge-Document */
|
||||
IPP_OP_ACKNOWLEDGE_IDENTIFY_PRINTER, /* Acknowledge-Identify-Printer */
|
||||
IPP_OP_ACKNOWLEDGE_JOB, /* Acknowledge-Job */
|
||||
IPP_OP_FETCH_DOCUMENT, /* Fetch-Document */
|
||||
IPP_OP_FETCH_JOB, /* Fetch-Job */
|
||||
IPP_OP_GET_OUTPUT_DEVICE_ATTRIBUTES, /* Get-Output-Device-Attributes */
|
||||
IPP_OP_UPDATE_ACTIVE_JOBS, /* Update-Active-Jobs */
|
||||
IPP_OP_DEREGISTER_OUTPUT_DEVICE, /* Deregister-Output-Device */
|
||||
IPP_OP_UPDATE_DOCUMENT_STATUS, /* Update-Document-Status */
|
||||
IPP_OP_UPDATE_JOB_STATUS, /* Update-Job-Status */
|
||||
IPP_OP_UPDATE_OUTPUT_DEVICE_ATTRIBUTES,
|
||||
/* Update-Output-Device-Attributes */
|
||||
IPP_OP_GET_NEXT_DOCUMENT_DATA, /* Get-Next-Document-Data */
|
||||
|
||||
IPP_OP_PRIVATE = 0x4000, /* Reserved @private@ */
|
||||
IPP_OP_CUPS_GET_DEFAULT, /* Get the default printer */
|
||||
@@ -1021,5 +1034,5 @@ extern const char *ippStateString(ipp_state_t state) _CUPS_API_2_0;
|
||||
#endif /* !_CUPS_IPP_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: ipp.h 11806 2014-04-09 16:12:27Z msweet $".
|
||||
* End of "$Id: ipp.h 12666 2015-05-25 19:38:09Z msweet $".
|
||||
*/
|
||||
|
||||
+73
-9
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: language.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
* "$Id: language.c 12841 2015-08-10 17:07:30Z msweet $"
|
||||
*
|
||||
* I18N/language support for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -1139,7 +1139,7 @@ appleLangDefault(void)
|
||||
int i; /* Looping var */
|
||||
CFBundleRef bundle; /* Main bundle (if any) */
|
||||
CFArrayRef bundleList; /* List of localizations in bundle */
|
||||
CFPropertyListRef localizationList;
|
||||
CFPropertyListRef localizationList = NULL;
|
||||
/* List of localization data */
|
||||
CFStringRef languageName; /* Current name */
|
||||
CFStringRef localeName; /* Canonical from of name */
|
||||
@@ -1165,14 +1165,42 @@ appleLangDefault(void)
|
||||
else if ((bundle = CFBundleGetMainBundle()) != NULL &&
|
||||
(bundleList = CFBundleCopyBundleLocalizations(bundle)) != NULL)
|
||||
{
|
||||
CFURLRef resources = CFBundleCopyResourcesDirectoryURL(bundle);
|
||||
|
||||
DEBUG_puts("3appleLangDefault: Getting localizationList from bundle.");
|
||||
|
||||
localizationList =
|
||||
CFBundleCopyPreferredLocalizationsFromArray(bundleList);
|
||||
if (resources)
|
||||
{
|
||||
CFStringRef cfpath = CFURLCopyPath(resources);
|
||||
char path[1024];
|
||||
|
||||
if (cfpath)
|
||||
{
|
||||
/*
|
||||
* See if we have an Info.plist file in the bundle...
|
||||
*/
|
||||
|
||||
CFStringGetCString(cfpath, path, sizeof(path), kCFStringEncodingUTF8);
|
||||
DEBUG_printf(("3appleLangDefault: Got a resource URL (\"%s\")", path));
|
||||
strlcat(path, "Contents/Info.plist", sizeof(path));
|
||||
|
||||
if (!access(path, R_OK))
|
||||
localizationList = CFBundleCopyPreferredLocalizationsFromArray(bundleList);
|
||||
else
|
||||
DEBUG_puts("3appleLangDefault: No Info.plist, ignoring resource URL...");
|
||||
|
||||
CFRelease(cfpath);
|
||||
}
|
||||
|
||||
CFRelease(resources);
|
||||
}
|
||||
else
|
||||
DEBUG_puts("3appleLangDefault: No resource URL.");
|
||||
|
||||
CFRelease(bundleList);
|
||||
}
|
||||
else
|
||||
|
||||
if (!localizationList)
|
||||
{
|
||||
DEBUG_puts("3appleLangDefault: Getting localizationList from preferences.");
|
||||
|
||||
@@ -1183,7 +1211,6 @@ appleLangDefault(void)
|
||||
|
||||
if (localizationList)
|
||||
{
|
||||
|
||||
#ifdef DEBUG
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID())
|
||||
DEBUG_printf(("3appleLangDefault: Got localizationList, %d entries.",
|
||||
@@ -1259,6 +1286,8 @@ appleLangDefault(void)
|
||||
strlcpy(cg->language, "en_US.UTF-8", sizeof(cg->language));
|
||||
}
|
||||
}
|
||||
else
|
||||
DEBUG_printf(("3appleLangDefault: Using previous locale \"%s\".", cg->language));
|
||||
|
||||
/*
|
||||
* Return the cached locale...
|
||||
@@ -1277,7 +1306,8 @@ static cups_array_t * /* O - Message catalog */
|
||||
appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
{
|
||||
char filename[1024], /* Path to cups.strings file */
|
||||
applelang[256]; /* Apple language ID */
|
||||
applelang[256], /* Apple language ID */
|
||||
baselang[3]; /* Base language */
|
||||
CFURLRef url; /* URL to cups.strings file */
|
||||
CFReadStreamRef stream = NULL; /* File stream */
|
||||
CFPropertyListRef plist = NULL; /* Localization file */
|
||||
@@ -1295,6 +1325,18 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
snprintf(filename, sizeof(filename),
|
||||
CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings",
|
||||
_cupsAppleLanguage(locale, applelang, sizeof(applelang)));
|
||||
|
||||
if (access(filename, 0))
|
||||
{
|
||||
/*
|
||||
* <rdar://problem/22086642>
|
||||
*
|
||||
* Try with original locale string...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", locale);
|
||||
}
|
||||
|
||||
DEBUG_printf(("1appleMessageLoad: filename=\"%s\"", filename));
|
||||
|
||||
if (access(filename, 0))
|
||||
@@ -1317,6 +1359,28 @@ appleMessageLoad(const char *locale) /* I - Locale ID */
|
||||
locale = "Japanese";
|
||||
else if (!strncmp(locale, "es", 2))
|
||||
locale = "Spanish";
|
||||
else if (!strcmp(locale, "zh_HK"))
|
||||
{
|
||||
/*
|
||||
* <rdar://problem/22130168>
|
||||
*
|
||||
* Try zh_TW first, then zh... Sigh...
|
||||
*/
|
||||
|
||||
if (!access(CUPS_BUNDLEDIR "/Resources/zh_TW.lproj/cups.strings", 0))
|
||||
locale = "zh_TW";
|
||||
else
|
||||
locale = "zh";
|
||||
}
|
||||
else if (strstr(locale, "_") != NULL || strstr(locale, "-") != NULL)
|
||||
{
|
||||
/*
|
||||
* Drop country code, just try language...
|
||||
*/
|
||||
|
||||
strlcpy(baselang, locale, sizeof(baselang));
|
||||
locale = baselang;
|
||||
}
|
||||
|
||||
snprintf(filename, sizeof(filename),
|
||||
CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", locale);
|
||||
@@ -1560,5 +1624,5 @@ cups_unquote(char *d, /* O - Unquoted string */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: language.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
* End of "$Id: language.c 12841 2015-08-10 17:07:30Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-5
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: localize.c 11698 2014-03-17 11:58:18Z msweet $"
|
||||
* "$Id: localize.c 12834 2015-08-06 13:56:32Z msweet $"
|
||||
*
|
||||
* PPD localization routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -664,8 +664,23 @@ _ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */
|
||||
snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll_CC, keyword);
|
||||
if ((attr = ppdFindAttr(ppd, lkeyword, spec)) == NULL)
|
||||
{
|
||||
snprintf(lkeyword, sizeof(lkeyword), "%2.2s.%s", ll_CC, keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
/*
|
||||
* <rdar://problem/22130168>
|
||||
*
|
||||
* Hong Kong locale needs special handling... Sigh...
|
||||
*/
|
||||
|
||||
if (!strcmp(ll_CC, "zh_HK"))
|
||||
{
|
||||
snprintf(lkeyword, sizeof(lkeyword), "zh_TW.%s", keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
}
|
||||
|
||||
if (!attr)
|
||||
{
|
||||
snprintf(lkeyword, sizeof(lkeyword), "%2.2s.%s", ll_CC, keyword);
|
||||
attr = ppdFindAttr(ppd, lkeyword, spec);
|
||||
}
|
||||
|
||||
if (!attr)
|
||||
{
|
||||
@@ -760,5 +775,5 @@ ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: localize.c 11698 2014-03-17 11:58:18Z msweet $".
|
||||
* End of "$Id: localize.c 12834 2015-08-06 13:56:32Z msweet $".
|
||||
*/
|
||||
|
||||
+9
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: mark.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
* "$Id: mark.c 12258 2014-11-19 12:38:44Z msweet $"
|
||||
*
|
||||
* Option marking routines for CUPS.
|
||||
*
|
||||
@@ -514,6 +514,12 @@ ppdMarkDefaults(ppd_file_t *ppd) /* I - PPD file record */
|
||||
|
||||
for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++)
|
||||
ppd_defaults(ppd, g);
|
||||
|
||||
/*
|
||||
* Finally, tag any conflicts (API compatibility) once at the end.
|
||||
*/
|
||||
|
||||
ppdConflicts(ppd);
|
||||
}
|
||||
|
||||
|
||||
@@ -710,7 +716,7 @@ ppd_defaults(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
for (i = g->num_options, o = g->options; i > 0; i --, o ++)
|
||||
if (_cups_strcasecmp(o->keyword, "PageRegion") != 0)
|
||||
ppdMarkOption(ppd, o->keyword, o->defchoice);
|
||||
ppd_mark_option(ppd, o->keyword, o->defchoice);
|
||||
|
||||
for (i = g->num_subgroups, sg = g->subgroups; i > 0; i --, sg ++)
|
||||
ppd_defaults(ppd, sg);
|
||||
@@ -1078,5 +1084,5 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mark.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
* End of "$Id: mark.c 12258 2014-11-19 12:38:44Z msweet $".
|
||||
*/
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: md5.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* "$Id: md5.c 12124 2014-08-28 15:37:22Z msweet $"
|
||||
*
|
||||
* Private MD5 implementation for CUPS.
|
||||
*
|
||||
@@ -333,7 +333,7 @@ _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16])
|
||||
for (i = 0; i < 8; ++i)
|
||||
data[i] = (unsigned char)(pms->count[i >> 2] >> ((i & 3) << 3));
|
||||
/* Pad to 56 bytes mod 64. */
|
||||
_cupsMD5Append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
|
||||
_cupsMD5Append(pms, pad, (int)((55 - (pms->count[0] >> 3)) & 63) + 1);
|
||||
/* Append the length. */
|
||||
_cupsMD5Append(pms, data, 8);
|
||||
for (i = 0; i < 16; ++i)
|
||||
@@ -342,5 +342,5 @@ _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16])
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: md5.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
* End of "$Id: md5.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
+1103
-4
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+19
-4
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: ppd-private.h 11558 2014-02-06 18:33:34Z msweet $"
|
||||
* "$Id: ppd-private.h 12733 2015-06-12 01:21:05Z msweet $"
|
||||
*
|
||||
* Private PPD definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -49,7 +49,7 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define _PPD_CACHE_VERSION 6 /* Version number in cache file */
|
||||
# define _PPD_CACHE_VERSION 7 /* Version number in cache file */
|
||||
|
||||
|
||||
/*
|
||||
@@ -109,6 +109,14 @@ typedef struct _pwg_finishings_s /**** PWG finishings mapping data ****/
|
||||
cups_option_t *options; /* Options to apply */
|
||||
} _pwg_finishings_t;
|
||||
|
||||
typedef struct _pwg_material_s /**** PWG material mapping data ****/
|
||||
{
|
||||
char *key, /* material-key value */
|
||||
*name; /* material-name value */
|
||||
int num_props; /* Number of properties */
|
||||
cups_option_t *props; /* Material properties */
|
||||
} _pwg_material_t;
|
||||
|
||||
struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
|
||||
{
|
||||
int num_bins; /* Number of output bins */
|
||||
@@ -148,6 +156,11 @@ struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
|
||||
cups_array_t *mandatory; /* cupsMandatory value */
|
||||
char *charge_info_uri; /* cupsChargeInfoURI value */
|
||||
cups_array_t *support_files; /* Support files - ICC profiles, etc. */
|
||||
char *cups_3d, /* cups3D value */
|
||||
*cups_layer_order; /* cupsLayerOrder value */
|
||||
int cups_accuracy[3]; /* cupsAccuracy value - x, y, and z in nanometers */
|
||||
int cups_volume[3]; /* cupsVolume value - x, y, and z in millimeters */
|
||||
cups_array_t *materials; /* cupsMaterial values */
|
||||
};
|
||||
|
||||
|
||||
@@ -155,6 +168,7 @@ struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern int _cupsConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options);
|
||||
extern _ppd_cache_t *_ppdCacheCreateWithFile(const char *filename,
|
||||
ipp_t **attrs);
|
||||
extern _ppd_cache_t *_ppdCacheCreateWithPPD(ppd_file_t *ppd);
|
||||
@@ -187,6 +201,7 @@ extern const char *_ppdCacheGetType(_ppd_cache_t *pc,
|
||||
const char *media_type);
|
||||
extern int _ppdCacheWriteFile(_ppd_cache_t *pc,
|
||||
const char *filename, ipp_t *attrs);
|
||||
extern char *_ppdCreateFromIPP(char *buffer, size_t bufsize, ipp_t *response);
|
||||
extern void _ppdFreeLanguages(cups_array_t *languages);
|
||||
extern cups_encoding_t _ppdGetEncoding(const char *name);
|
||||
extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd);
|
||||
@@ -221,5 +236,5 @@ extern const char *_pwgPageSizeForMedia(pwg_media_t *media,
|
||||
#endif /* !_CUPS_PPD_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: ppd-private.h 11558 2014-02-06 18:33:34Z msweet $".
|
||||
* End of "$Id: ppd-private.h 12733 2015-06-12 01:21:05Z msweet $".
|
||||
*/
|
||||
|
||||
+19
-9
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: ppd.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
* "$Id: ppd.c 12848 2015-08-26 18:51:57Z msweet $"
|
||||
*
|
||||
* PPD file routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -283,7 +283,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
|
||||
|
||||
/*
|
||||
* 'ppdErrorString()' - Returns the text assocated with a status.
|
||||
* 'ppdErrorString()' - Returns the text associated with a status.
|
||||
*
|
||||
* @since CUPS 1.1.19/OS X 10.3@
|
||||
*/
|
||||
@@ -418,10 +418,10 @@ _ppdOpen(
|
||||
char custom_name[PPD_MAX_NAME];
|
||||
/* CustomFoo attribute name */
|
||||
ppd_attr_t *custom_attr; /* CustomFoo attribute */
|
||||
char ll[4], /* Language + '.' */
|
||||
ll_CC[7]; /* Language + country + '.' */
|
||||
size_t ll_len = 0, /* Language length */
|
||||
ll_CC_len = 0; /* Language + country length */
|
||||
char ll[7], /* Base language + '.' */
|
||||
ll_CC[7]; /* Language w/country + '.' */
|
||||
size_t ll_len = 0, /* Base language length */
|
||||
ll_CC_len = 0; /* Language w/country length */
|
||||
static const char * const ui_keywords[] =
|
||||
{
|
||||
#ifdef CUPS_USE_FULL_UI_KEYWORDS_LIST
|
||||
@@ -519,7 +519,17 @@ _ppdOpen(
|
||||
return (NULL);
|
||||
|
||||
snprintf(ll_CC, sizeof(ll_CC), "%s.", lang->language);
|
||||
snprintf(ll, sizeof(ll), "%2.2s.", lang->language);
|
||||
|
||||
/*
|
||||
* <rdar://problem/22130168>
|
||||
*
|
||||
* Need to use a different base language for some locales...
|
||||
*/
|
||||
|
||||
if (!strcmp(lang->language, "zh_HK"))
|
||||
strlcpy(ll, "zh_TW.", sizeof(ll));
|
||||
else
|
||||
snprintf(ll, sizeof(ll), "%2.2s.", lang->language);
|
||||
|
||||
ll_CC_len = strlen(ll_CC);
|
||||
ll_len = strlen(ll);
|
||||
@@ -3346,5 +3356,5 @@ ppd_update_filters(ppd_file_t *ppd,/* I - PPD file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: ppd.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
* End of "$Id: ppd.c 12848 2015-08-26 18:51:57Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: sidechannel.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* "$Id: sidechannel.c 12124 2014-08-28 15:37:22Z msweet $"
|
||||
*
|
||||
* Side-channel API code for CUPS.
|
||||
*
|
||||
@@ -490,7 +490,7 @@ cupsSideChannelSNMPWalk(
|
||||
real_data[real_datalen] = '\0';
|
||||
|
||||
real_oidlen = strlen(real_data) + 1;
|
||||
real_datalen -= real_oidlen;
|
||||
real_datalen -= (int)real_oidlen;
|
||||
|
||||
/*
|
||||
* Call the callback with the OID and data...
|
||||
@@ -625,5 +625,5 @@ cupsSideChannelWrite(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: sidechannel.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
* End of "$Id: sidechannel.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: string-private.h 11889 2014-05-22 13:54:15Z msweet $"
|
||||
* "$Id: string-private.h 12928 2015-10-23 21:31:58Z msweet $"
|
||||
*
|
||||
* Private string definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -147,6 +147,7 @@ extern int _cups_toupper(int ch);
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern ssize_t _cups_safe_vsnprintf(char *, size_t, const char *, va_list);
|
||||
extern void _cups_strcpy(char *dst, const char *src);
|
||||
|
||||
# ifndef HAVE_STRDUP
|
||||
@@ -218,5 +219,5 @@ extern char *_cupsStrDate(char *buf, size_t bufsize, time_t timeval);
|
||||
#endif /* !_CUPS_STRING_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: string-private.h 11889 2014-05-22 13:54:15Z msweet $".
|
||||
* End of "$Id: string-private.h 12928 2015-10-23 21:31:58Z msweet $".
|
||||
*/
|
||||
|
||||
+12
-3
@@ -14,7 +14,7 @@
|
||||
*%
|
||||
*% Copyright 2007-2010 by Apple Inc.
|
||||
*% Copyright 2002-2006 by Easy Software Products.
|
||||
*%
|
||||
*%
|
||||
*% These coded instructions, statements, and computer programs are the
|
||||
*% property of Apple Inc. and are protected by Federal copyright
|
||||
*% law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
@@ -22,7 +22,7 @@
|
||||
*% file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*FormatVersion: "4.3"
|
||||
*FileVersion: "1.3"
|
||||
*LanguageVersion: English
|
||||
*LanguageVersion: English
|
||||
*LanguageEncoding: ISOLatin1
|
||||
*PCFileName: "TEST.PPD"
|
||||
*Manufacturer: "ESP"
|
||||
@@ -104,7 +104,7 @@
|
||||
*fr_CA.PageRegion A4/French Canadian A4: ""
|
||||
*fr_CA.PageRegion Env10/French Canadian #10 Envelope: ""
|
||||
|
||||
*DefaultImageableArea: Letter
|
||||
*DefaultImageableArea: Letter
|
||||
*ImageableArea Letter: "18 36 594 756"
|
||||
*ImageableArea Letter.Banner: "18 0 594 792"
|
||||
*ImageableArea Letter.Fullbleed: "0 0 612 792"
|
||||
@@ -145,6 +145,15 @@
|
||||
*MediaType Transparency/Transparency Film: "MediaType=Transparency"
|
||||
*CloseUI: *MediaType
|
||||
|
||||
*OpenUI *OutputBin/Output Tray: PickOne
|
||||
*OrderDependency: 25 AnySetup *OutputBin
|
||||
*DefaultOutputBin: Tray1
|
||||
*OutputBin Auto/Automatic Tray: "OutputBin=Auto"
|
||||
*OutputBin Tray1/Tray 1: "OutputBin=Tray1"
|
||||
*OutputBin Tray2/Tray 2: "OutputBin=Tray2"
|
||||
*OutputBin MainTray/Main Tray: "OutputBin=MainTray"
|
||||
*CloseUI: *OutputBin
|
||||
|
||||
*OpenUI *Duplex/2-Sided Printing: PickOne
|
||||
*OrderDependency: 10 DocumentSetup *Duplex
|
||||
*DefaultDuplex: None
|
||||
|
||||
+22
-6
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: testfile.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
* "$Id: testfile.c 12577 2015-03-30 19:07:17Z msweet $"
|
||||
*
|
||||
* File test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -205,14 +205,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* Cat the filename on the command-line...
|
||||
*/
|
||||
|
||||
char line[1024]; /* Line from file */
|
||||
char line[8192]; /* Line from file */
|
||||
|
||||
if ((fp = cupsFileOpen(argv[1], "r")) == NULL)
|
||||
{
|
||||
perror(argv[1]);
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
else if (argc == 2)
|
||||
{
|
||||
status = 0;
|
||||
|
||||
@@ -224,6 +224,21 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = 0;
|
||||
ssize_t bytes;
|
||||
|
||||
while ((bytes = cupsFileRead(fp, line, sizeof(line))) > 0)
|
||||
printf("%s: %d bytes\n", argv[1], (int)bytes);
|
||||
|
||||
if (cupsFileEOF(fp))
|
||||
printf("%s: EOF\n", argv[1]);
|
||||
else
|
||||
perror(argv[1]);
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
return (status);
|
||||
@@ -798,7 +813,8 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
* Remove the test file...
|
||||
*/
|
||||
|
||||
unlink(compression ? "testfile.dat.gz" : "testfile.dat");
|
||||
if (!status)
|
||||
unlink(compression ? "testfile.dat.gz" : "testfile.dat");
|
||||
|
||||
/*
|
||||
* Return the test status...
|
||||
@@ -809,5 +825,5 @@ read_write_tests(int compression) /* I - Use compression? */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testfile.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
* End of "$Id: testfile.c 12577 2015-03-30 19:07:17Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: testhttp.c 12028 2014-07-15 14:01:27Z msweet $"
|
||||
* "$Id: testhttp.c 12678 2015-05-28 19:09:48Z msweet $"
|
||||
*
|
||||
* HTTP test program for CUPS.
|
||||
*
|
||||
@@ -645,7 +645,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (lcreds && cupsArrayCount(creds) == cupsArrayCount(lcreds))
|
||||
{
|
||||
int i;
|
||||
http_credential_t *cred, *lcred;
|
||||
|
||||
for (i = 1, cred = (http_credential_t *)cupsArrayFirst(creds), lcred = (http_credential_t *)cupsArrayFirst(lcreds);
|
||||
@@ -890,5 +889,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testhttp.c 12028 2014-07-15 14:01:27Z msweet $".
|
||||
* End of "$Id: testhttp.c 12678 2015-05-28 19:09:48Z msweet $".
|
||||
*/
|
||||
|
||||
+47
-5
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: testlang.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
* "$Id: testlang.c 12841 2015-08-10 17:07:30Z msweet $"
|
||||
*
|
||||
* Localization test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -50,8 +50,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
};
|
||||
|
||||
|
||||
_cupsSetLocale(argv);
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
language = cupsLangDefault();
|
||||
@@ -61,8 +59,13 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
language = cupsLangGet(argv[1]);
|
||||
language2 = cupsLangGet(argv[1]);
|
||||
|
||||
setenv("LANG", argv[1], 1);
|
||||
setenv("SOFTWARE", "CUPS/" CUPS_SVERSION, 1);
|
||||
}
|
||||
|
||||
_cupsSetLocale(argv);
|
||||
|
||||
if (language != language2)
|
||||
{
|
||||
errors ++;
|
||||
@@ -105,10 +108,49 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 3)
|
||||
{
|
||||
ppd_file_t *ppd; /* PPD file */
|
||||
ppd_option_t *option; /* PageSize option */
|
||||
ppd_choice_t *choice; /* PageSize/Letter choice */
|
||||
|
||||
if ((ppd = ppdOpenFile(argv[2])) == NULL)
|
||||
{
|
||||
printf("Unable to open PPD file \"%s\".\n", argv[2]);
|
||||
errors ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
ppdLocalize(ppd);
|
||||
|
||||
if ((option = ppdFindOption(ppd, "PageSize")) == NULL)
|
||||
{
|
||||
puts("No PageSize option.");
|
||||
errors ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("PageSize: %s\n", option->text);
|
||||
|
||||
if ((choice = ppdFindChoice(option, "Letter")) == NULL)
|
||||
{
|
||||
puts("No Letter PageSize choice.");
|
||||
errors ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Letter: %s\n", choice->text);
|
||||
}
|
||||
}
|
||||
|
||||
ppdClose(ppd);
|
||||
}
|
||||
}
|
||||
|
||||
return (errors > 0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testlang.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
* End of "$Id: testlang.c 12841 2015-08-10 17:07:30Z msweet $".
|
||||
*/
|
||||
|
||||
+82
-17
@@ -1,21 +1,17 @@
|
||||
/*
|
||||
* "$Id: testoptions.c 1992 2010-03-24 14:32:08Z msweet $"
|
||||
* "$Id: testoptions.c 13061 2016-01-26 21:31:40Z msweet $"
|
||||
*
|
||||
* Option test program for CUPS.
|
||||
* Option unit test program for CUPS.
|
||||
*
|
||||
* Copyright 2008-2010 by Apple Inc.
|
||||
* Copyright 2008-2016 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Test option processing functions.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -37,6 +33,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
num_options; /* Number of options */
|
||||
cups_option_t *options; /* Options */
|
||||
const char *value; /* Value of an option */
|
||||
ipp_t *request; /* IPP request */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
int count; /* Number of attributes */
|
||||
|
||||
|
||||
if (argc == 1)
|
||||
@@ -53,11 +52,12 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
"baz={param1=1 param2=2} "
|
||||
"foobar=FOO\\ BAR "
|
||||
"barfoo=barfoo "
|
||||
"barfoo=\"\'BAR FOO\'\"", 0, &options);
|
||||
"barfoo=\"\'BAR FOO\'\" "
|
||||
"auth-info=user,pass\\\\,word\\\\\\\\", 0, &options);
|
||||
|
||||
if (num_options != 5)
|
||||
if (num_options != 6)
|
||||
{
|
||||
printf("FAIL (num_options=%d, expected 5)\n", num_options);
|
||||
printf("FAIL (num_options=%d, expected 6)\n", num_options);
|
||||
status ++;
|
||||
}
|
||||
else if ((value = cupsGetOption("foo", num_options, options)) == NULL ||
|
||||
@@ -91,6 +91,71 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
printf("FAIL (barfoo=\"%s\", expected \"\'BAR FOO\'\")\n", value);
|
||||
status ++;
|
||||
}
|
||||
else if ((value = cupsGetOption("auth-info", num_options, options)) == NULL ||
|
||||
strcmp(value, "user,pass\\,word\\\\"))
|
||||
{
|
||||
printf("FAIL (auth-info=\"%s\", expected \"user,pass\\,word\\\\\")\n", value);
|
||||
status ++;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
fputs("cupsEncodeOptions2: ", stdout);
|
||||
request = ippNew();
|
||||
ippSetOperation(request, IPP_OP_PRINT_JOB);
|
||||
|
||||
cupsEncodeOptions2(request, num_options, options, IPP_TAG_JOB);
|
||||
for (count = 0, attr = ippFirstAttribute(request); attr; attr = ippNextAttribute(request), count ++);
|
||||
if (count != 6)
|
||||
{
|
||||
printf("FAIL (%d attributes, expected 6)\n", count);
|
||||
status ++;
|
||||
}
|
||||
else if ((attr = ippFindAttribute(request, "foo", IPP_TAG_ZERO)) == NULL)
|
||||
{
|
||||
puts("FAIL (Unable to find attribute \"foo\")");
|
||||
status ++;
|
||||
}
|
||||
else if (ippGetValueTag(attr) != IPP_TAG_NAME)
|
||||
{
|
||||
printf("FAIL (\"foo\" of type %s, expected name)\n", ippTagString(ippGetValueTag(attr)));
|
||||
status ++;
|
||||
}
|
||||
else if (ippGetCount(attr) != 1)
|
||||
{
|
||||
printf("FAIL (\"foo\" has %d values, expected 1)\n", (int)ippGetCount(attr));
|
||||
status ++;
|
||||
}
|
||||
else if (strcmp(ippGetString(attr, 0, NULL), "1234"))
|
||||
{
|
||||
printf("FAIL (\"foo\" has value %s, expected 1234)\n", ippGetString(attr, 0, NULL));
|
||||
status ++;
|
||||
}
|
||||
else if ((attr = ippFindAttribute(request, "auth-info", IPP_TAG_ZERO)) == NULL)
|
||||
{
|
||||
puts("FAIL (Unable to find attribute \"auth-info\")");
|
||||
status ++;
|
||||
}
|
||||
else if (ippGetValueTag(attr) != IPP_TAG_TEXT)
|
||||
{
|
||||
printf("FAIL (\"auth-info\" of type %s, expected text)\n", ippTagString(ippGetValueTag(attr)));
|
||||
status ++;
|
||||
}
|
||||
else if (ippGetCount(attr) != 2)
|
||||
{
|
||||
printf("FAIL (\"auth-info\" has %d values, expected 2)\n", (int)ippGetCount(attr));
|
||||
status ++;
|
||||
}
|
||||
else if (strcmp(ippGetString(attr, 0, NULL), "user"))
|
||||
{
|
||||
printf("FAIL (\"auth-info\"[0] has value \"%s\", expected \"user\")\n", ippGetString(attr, 0, NULL));
|
||||
status ++;
|
||||
}
|
||||
else if (strcmp(ippGetString(attr, 1, NULL), "pass,word\\"))
|
||||
{
|
||||
printf("FAIL (\"auth-info\"[1] has value \"%s\", expected \"pass,word\\\")\n", ippGetString(attr, 1, NULL));
|
||||
status ++;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
}
|
||||
@@ -112,5 +177,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testoptions.c 1992 2010-03-24 14:32:08Z msweet $".
|
||||
* End of "$Id: testoptions.c 13061 2016-01-26 21:31:40Z msweet $".
|
||||
*/
|
||||
|
||||
+67
-4
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: testppd.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* "$Id: testppd.c 12603 2015-05-06 01:42:51Z msweet $"
|
||||
*
|
||||
* PPD test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -51,6 +51,11 @@ static const char *default_code =
|
||||
"%%EndFeature\n"
|
||||
"} stopped cleartomark\n"
|
||||
"[{\n"
|
||||
"%%BeginFeature: *OutputBin Tray1\n"
|
||||
"OutputBin=Tray1\n"
|
||||
"%%EndFeature\n"
|
||||
"} stopped cleartomark\n"
|
||||
"[{\n"
|
||||
"%%BeginFeature: *MediaType Plain\n"
|
||||
"MediaType=Plain\n"
|
||||
"%%EndFeature\n"
|
||||
@@ -80,6 +85,11 @@ static const char *custom_code =
|
||||
"%%EndFeature\n"
|
||||
"} stopped cleartomark\n"
|
||||
"[{\n"
|
||||
"%%BeginFeature: *OutputBin Tray1\n"
|
||||
"OutputBin=Tray1\n"
|
||||
"%%EndFeature\n"
|
||||
"} stopped cleartomark\n"
|
||||
"[{\n"
|
||||
"%%BeginFeature: *IntOption None\n"
|
||||
"%%EndFeature\n"
|
||||
"} stopped cleartomark\n"
|
||||
@@ -853,13 +863,66 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
status ++;
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[1], "ipp://", 6) || !strncmp(argv[1], "ipps://", 7))
|
||||
{
|
||||
/*
|
||||
* ipp://... or ipps://...
|
||||
*/
|
||||
|
||||
http_t *http; /* Connection to printer */
|
||||
ipp_t *request, /* Get-Printer-Attributes request */
|
||||
*response; /* Get-Printer-Attributes response */
|
||||
char scheme[32], /* URI scheme */
|
||||
userpass[256], /* Username:password */
|
||||
host[256], /* Hostname */
|
||||
resource[256]; /* Resource path */
|
||||
int port; /* Port number */
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, argv[1], scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
printf("Bad URI \"%s\".\n", argv[1]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
http = httpConnect2(host, port, NULL, AF_UNSPEC, !strcmp(scheme, "ipps") ? HTTP_ENCRYPTION_ALWAYS : HTTP_ENCRYPTION_IF_REQUESTED, 1, 30000, NULL);
|
||||
if (!http)
|
||||
{
|
||||
printf("Unable to connect to \"%s:%d\": %s\n", host, port, cupsLastErrorString());
|
||||
return (1);
|
||||
}
|
||||
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, argv[1]);
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
if (_ppdCreateFromIPP(buffer, sizeof(buffer), response))
|
||||
printf("Created PPD: %s\n", buffer);
|
||||
else
|
||||
puts("Unable to create PPD.");
|
||||
|
||||
ippDelete(response);
|
||||
httpClose(http);
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *filename; /* PPD filename */
|
||||
struct stat fileinfo; /* File information */
|
||||
|
||||
|
||||
if (!strncmp(argv[1], "-d", 2))
|
||||
if (strchr(argv[1], ':'))
|
||||
{
|
||||
/*
|
||||
* Server PPD...
|
||||
*/
|
||||
|
||||
if ((filename = cupsGetServerPPD(CUPS_HTTP_DEFAULT, argv[1])) == NULL)
|
||||
{
|
||||
printf("%s: %s\n", argv[1], cupsLastErrorString());
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(argv[1], "-d", 2))
|
||||
{
|
||||
const char *printer; /* Printer name */
|
||||
|
||||
@@ -1107,5 +1170,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: testppd.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
* End of "$Id: testppd.c 12603 2015-05-06 01:42:51Z msweet $".
|
||||
*/
|
||||
|
||||
+190
-15
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: tls-darwin.c 12029 2014-07-15 18:59:26Z msweet $"
|
||||
* "$Id: tls-darwin.c 12675 2015-05-28 01:14:32Z msweet $"
|
||||
*
|
||||
* TLS support code for CUPS on OS X.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -15,7 +15,7 @@
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/**** This file is included from http.c ****/
|
||||
/**** This file is included from tls.c ****/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
@@ -42,6 +42,7 @@ static char *tls_keypath = NULL;
|
||||
static _cups_mutex_t tls_mutex = _CUPS_MUTEX_INITIALIZER;
|
||||
/* Mutex for keychain/certs */
|
||||
#endif /* HAVE_SECKEYCHAINOPEN */
|
||||
static int tls_options = -1;/* Options for TLS connections */
|
||||
|
||||
|
||||
/*
|
||||
@@ -61,7 +62,7 @@ static OSStatus http_cdsa_write(SSLConnectionRef connection, const void *data,
|
||||
/*
|
||||
* 'cupsMakeServerCredentials()' - Make a self-signed certificate and private key pair.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -283,7 +284,7 @@ cleanup:
|
||||
* Note: The server credentials are used by all threads in the running process.
|
||||
* This function is threadsafe.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -452,7 +453,7 @@ _httpCreateCredentials(
|
||||
/*
|
||||
* 'httpCredentialsAreValidForName()' - Return whether the credentials are valid for the given name.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 if valid, 0 otherwise */
|
||||
@@ -515,7 +516,7 @@ httpCredentialsAreValidForName(
|
||||
/*
|
||||
* 'httpCredentialsGetTrust()' - Return the trust of credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
*/
|
||||
|
||||
http_trust_t /* O - Level of trust */
|
||||
@@ -537,6 +538,9 @@ httpCredentialsGetTrust(
|
||||
if ((secCert = http_cdsa_create_credential((http_credential_t *)cupsArrayFirst(credentials))) == NULL)
|
||||
return (HTTP_TRUST_UNKNOWN);
|
||||
|
||||
if (cg->any_root < 0)
|
||||
_cupsSetDefaults();
|
||||
|
||||
/*
|
||||
* Look this common name up in the default keychains...
|
||||
*/
|
||||
@@ -599,7 +603,7 @@ httpCredentialsGetTrust(
|
||||
/*
|
||||
* 'httpCredentialsGetExpiration()' - Return the expiration date of the credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
*/
|
||||
|
||||
time_t /* O - Expiration date of credentials */
|
||||
@@ -624,7 +628,7 @@ httpCredentialsGetExpiration(
|
||||
/*
|
||||
* 'httpCredentialsString()' - Return a string representing the credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS X 10.10@
|
||||
*/
|
||||
|
||||
size_t /* O - Total size of credentials string */
|
||||
@@ -697,7 +701,7 @@ _httpFreeCredentials(
|
||||
/*
|
||||
* 'httpLoadCredentials()' - Load X.509 credentials from a keychain file.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
@@ -803,7 +807,7 @@ httpLoadCredentials(
|
||||
/*
|
||||
* 'httpSaveCredentials()' - Save X.509 credentials to a keychain file.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - -1 on error, 0 on success */
|
||||
@@ -972,6 +976,17 @@ _httpTLSRead(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpTLSSetOptions()' - Set TLS protocol and cipher suite options.
|
||||
*/
|
||||
|
||||
void
|
||||
_httpTLSSetOptions(int options) /* I - Options */
|
||||
{
|
||||
tls_options = options;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpTLSStart()' - Set up SSL/TLS support on a connection.
|
||||
*/
|
||||
@@ -994,7 +1009,14 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
http_credential_t *credential; /* Credential data */
|
||||
|
||||
|
||||
DEBUG_printf(("7_httpTLSStart(http=%p)", http));
|
||||
DEBUG_printf(("3_httpTLSStart(http=%p)", http));
|
||||
|
||||
if (tls_options < 0)
|
||||
{
|
||||
DEBUG_puts("4_httpTLSStart: Setting defaults.");
|
||||
_cupsSetDefaults();
|
||||
DEBUG_printf(("4_httpTLSStart: tls_options=%x", tls_options));
|
||||
}
|
||||
|
||||
#ifdef HAVE_SECKEYCHAINOPEN
|
||||
if (http->mode == _HTTP_MODE_SERVER && !tls_keychain)
|
||||
@@ -1033,10 +1055,163 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
error = SSLSetSessionOption(http->tls, kSSLSessionOptionBreakOnServerAuth,
|
||||
true);
|
||||
DEBUG_printf(("4_httpTLSStart: SSLSetSessionOption, error=%d",
|
||||
(int)error));
|
||||
DEBUG_printf(("4_httpTLSStart: SSLSetSessionOption, error=%d", (int)error));
|
||||
}
|
||||
|
||||
if (!error)
|
||||
{
|
||||
SSLProtocol minProtocol;
|
||||
|
||||
if (tls_options & _HTTP_TLS_DENY_TLS10)
|
||||
minProtocol = kTLSProtocol11;
|
||||
else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
|
||||
minProtocol = kSSLProtocol3;
|
||||
else
|
||||
minProtocol = kTLSProtocol1;
|
||||
|
||||
error = SSLSetProtocolVersionMin(http->tls, minProtocol);
|
||||
DEBUG_printf(("4_httpTLSStart: SSLSetProtocolVersionMin(%d), error=%d", minProtocol, (int)error));
|
||||
}
|
||||
|
||||
# if HAVE_SSLSETENABLEDCIPHERS
|
||||
if (!error)
|
||||
{
|
||||
SSLCipherSuite supported[100]; /* Supported cipher suites */
|
||||
size_t num_supported; /* Number of supported cipher suites */
|
||||
SSLCipherSuite enabled[100]; /* Cipher suites to enable */
|
||||
size_t num_enabled; /* Number of cipher suites to enable */
|
||||
|
||||
num_supported = sizeof(supported) / sizeof(supported[0]);
|
||||
error = SSLGetSupportedCiphers(http->tls, supported, &num_supported);
|
||||
|
||||
if (!error)
|
||||
{
|
||||
DEBUG_printf(("4_httpTLSStart: %d cipher suites supported.", (int)num_supported));
|
||||
|
||||
for (i = 0, num_enabled = 0; i < (int)num_supported && num_enabled < (sizeof(enabled) / sizeof(enabled[0])); i ++)
|
||||
{
|
||||
switch (supported[i])
|
||||
{
|
||||
/* Obviously insecure cipher suites that we never want to use */
|
||||
case SSL_NULL_WITH_NULL_NULL :
|
||||
case SSL_RSA_WITH_NULL_MD5 :
|
||||
case SSL_RSA_WITH_NULL_SHA :
|
||||
case SSL_RSA_EXPORT_WITH_RC4_40_MD5 :
|
||||
case SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 :
|
||||
case SSL_RSA_EXPORT_WITH_DES40_CBC_SHA :
|
||||
case SSL_RSA_WITH_DES_CBC_SHA :
|
||||
case SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA :
|
||||
case SSL_DH_DSS_WITH_DES_CBC_SHA :
|
||||
case SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA :
|
||||
case SSL_DH_RSA_WITH_DES_CBC_SHA :
|
||||
case SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA :
|
||||
case SSL_DHE_DSS_WITH_DES_CBC_SHA :
|
||||
case SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA :
|
||||
case SSL_DHE_RSA_WITH_DES_CBC_SHA :
|
||||
case SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 :
|
||||
case SSL_DH_anon_WITH_RC4_128_MD5 :
|
||||
case SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA :
|
||||
case SSL_DH_anon_WITH_DES_CBC_SHA :
|
||||
case SSL_DH_anon_WITH_3DES_EDE_CBC_SHA :
|
||||
case SSL_FORTEZZA_DMS_WITH_NULL_SHA :
|
||||
case TLS_DH_anon_WITH_AES_128_CBC_SHA :
|
||||
case TLS_DH_anon_WITH_AES_256_CBC_SHA :
|
||||
case TLS_ECDH_ECDSA_WITH_NULL_SHA :
|
||||
case TLS_ECDHE_RSA_WITH_NULL_SHA :
|
||||
case TLS_ECDH_anon_WITH_NULL_SHA :
|
||||
case TLS_ECDH_anon_WITH_RC4_128_SHA :
|
||||
case TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA :
|
||||
case TLS_ECDH_anon_WITH_AES_128_CBC_SHA :
|
||||
case TLS_ECDH_anon_WITH_AES_256_CBC_SHA :
|
||||
case TLS_RSA_WITH_NULL_SHA256 :
|
||||
case TLS_DH_anon_WITH_AES_128_CBC_SHA256 :
|
||||
case TLS_DH_anon_WITH_AES_256_CBC_SHA256 :
|
||||
case TLS_PSK_WITH_NULL_SHA :
|
||||
case TLS_DHE_PSK_WITH_NULL_SHA :
|
||||
case TLS_RSA_PSK_WITH_NULL_SHA :
|
||||
case TLS_DH_anon_WITH_AES_128_GCM_SHA256 :
|
||||
case TLS_DH_anon_WITH_AES_256_GCM_SHA384 :
|
||||
case TLS_PSK_WITH_NULL_SHA256 :
|
||||
case TLS_PSK_WITH_NULL_SHA384 :
|
||||
case TLS_DHE_PSK_WITH_NULL_SHA256 :
|
||||
case TLS_DHE_PSK_WITH_NULL_SHA384 :
|
||||
case TLS_RSA_PSK_WITH_NULL_SHA256 :
|
||||
case TLS_RSA_PSK_WITH_NULL_SHA384 :
|
||||
case SSL_RSA_WITH_DES_CBC_MD5 :
|
||||
DEBUG_printf(("4_httpTLSStart: Excluding insecure cipher suite %d", supported[i]));
|
||||
break;
|
||||
|
||||
/* RC4 cipher suites that should only be used as a last resort */
|
||||
case SSL_RSA_WITH_RC4_128_MD5 :
|
||||
case SSL_RSA_WITH_RC4_128_SHA :
|
||||
case TLS_ECDH_ECDSA_WITH_RC4_128_SHA :
|
||||
case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA :
|
||||
case TLS_ECDH_RSA_WITH_RC4_128_SHA :
|
||||
case TLS_ECDHE_RSA_WITH_RC4_128_SHA :
|
||||
case TLS_PSK_WITH_RC4_128_SHA :
|
||||
case TLS_DHE_PSK_WITH_RC4_128_SHA :
|
||||
case TLS_RSA_PSK_WITH_RC4_128_SHA :
|
||||
if (tls_options & _HTTP_TLS_ALLOW_RC4)
|
||||
enabled[num_enabled ++] = supported[i];
|
||||
else
|
||||
DEBUG_printf(("4_httpTLSStart: Excluding RC4 cipher suite %d", supported[i]));
|
||||
break;
|
||||
|
||||
/* DH/DHE cipher suites that are problematic with parameters < 1024 bits */
|
||||
case TLS_DH_DSS_WITH_AES_128_CBC_SHA :
|
||||
case TLS_DH_RSA_WITH_AES_128_CBC_SHA :
|
||||
case TLS_DHE_DSS_WITH_AES_128_CBC_SHA :
|
||||
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA :
|
||||
case TLS_DH_DSS_WITH_AES_256_CBC_SHA :
|
||||
case TLS_DH_RSA_WITH_AES_256_CBC_SHA :
|
||||
case TLS_DHE_DSS_WITH_AES_256_CBC_SHA :
|
||||
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA :
|
||||
case TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA :
|
||||
case TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA :
|
||||
// case TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA :
|
||||
case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA :
|
||||
case TLS_DH_DSS_WITH_AES_128_CBC_SHA256 :
|
||||
case TLS_DH_RSA_WITH_AES_128_CBC_SHA256 :
|
||||
case TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 :
|
||||
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 :
|
||||
case TLS_DH_DSS_WITH_AES_256_CBC_SHA256 :
|
||||
case TLS_DH_RSA_WITH_AES_256_CBC_SHA256 :
|
||||
case TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 :
|
||||
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 :
|
||||
case TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA :
|
||||
case TLS_DHE_PSK_WITH_AES_128_CBC_SHA :
|
||||
case TLS_DHE_PSK_WITH_AES_256_CBC_SHA :
|
||||
// case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 :
|
||||
// case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 :
|
||||
case TLS_DH_RSA_WITH_AES_128_GCM_SHA256 :
|
||||
case TLS_DH_RSA_WITH_AES_256_GCM_SHA384 :
|
||||
// case TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 :
|
||||
// case TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 :
|
||||
case TLS_DH_DSS_WITH_AES_128_GCM_SHA256 :
|
||||
case TLS_DH_DSS_WITH_AES_256_GCM_SHA384 :
|
||||
case TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 :
|
||||
case TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 :
|
||||
case TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 :
|
||||
case TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 :
|
||||
if (tls_options & _HTTP_TLS_ALLOW_DH)
|
||||
enabled[num_enabled ++] = supported[i];
|
||||
else
|
||||
DEBUG_printf(("4_httpTLSStart: Excluding DH/DHE cipher suite %d", supported[i]));
|
||||
break;
|
||||
|
||||
/* Anything else we'll assume is secure */
|
||||
default :
|
||||
enabled[num_enabled ++] = supported[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_printf(("4_httpTLSStart: %d cipher suites enabled.", (int)num_enabled));
|
||||
error = SSLSetEnabledCiphers(http->tls, enabled, num_enabled);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_SSLSETENABLEDCIPHERS */
|
||||
|
||||
if (!error && http->mode == _HTTP_MODE_CLIENT)
|
||||
{
|
||||
/*
|
||||
@@ -1660,5 +1835,5 @@ http_cdsa_write(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: tls-darwin.c 12029 2014-07-15 18:59:26Z msweet $".
|
||||
* End of "$Id: tls-darwin.c 12675 2015-05-28 01:14:32Z msweet $".
|
||||
*/
|
||||
|
||||
+65
-13
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: tls-gnutls.c 12050 2014-07-18 16:51:12Z msweet $"
|
||||
* "$Id: tls-gnutls.c 12670 2015-05-27 19:48:05Z msweet $"
|
||||
*
|
||||
* TLS support code for CUPS using GNU TLS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -15,6 +15,7 @@
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/**** This file is included from tls.c ****/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
@@ -35,6 +36,7 @@ static char *tls_keypath = NULL;
|
||||
/* Server cert keychain path */
|
||||
static _cups_mutex_t tls_mutex = _CUPS_MUTEX_INITIALIZER;
|
||||
/* Mutex for keychain/certs */
|
||||
static int tls_options = -1;/* Options for TLS connections */
|
||||
|
||||
|
||||
/*
|
||||
@@ -51,7 +53,7 @@ static ssize_t http_gnutls_write(gnutls_transport_ptr_t ptr, const void *data,
|
||||
/*
|
||||
* 'cupsMakeServerCredentials()' - Make a self-signed certificate and private key pair.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -228,7 +230,7 @@ cupsMakeServerCredentials(
|
||||
* Note: The server credentials are used by all threads in the running process.
|
||||
* This function is threadsafe.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -357,7 +359,7 @@ _httpFreeCredentials(
|
||||
/*
|
||||
* 'httpCredentialsAreValidForName()' - Return whether the credentials are valid for the given name.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 if valid, 0 otherwise */
|
||||
@@ -383,7 +385,7 @@ httpCredentialsAreValidForName(
|
||||
/*
|
||||
* 'httpCredentialsGetTrust()' - Return the trust of credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
http_trust_t /* O - Level of trust */
|
||||
@@ -405,6 +407,9 @@ httpCredentialsGetTrust(
|
||||
if ((cert = http_gnutls_create_credential((http_credential_t *)cupsArrayFirst(credentials))) == NULL)
|
||||
return (HTTP_TRUST_UNKNOWN);
|
||||
|
||||
if (cg->any_root < 0)
|
||||
_cupsSetDefaults();
|
||||
|
||||
/*
|
||||
* Look this common name up in the default keychains...
|
||||
*/
|
||||
@@ -475,7 +480,7 @@ httpCredentialsGetTrust(
|
||||
/*
|
||||
* 'httpCredentialsGetExpiration()' - Return the expiration date of the credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
time_t /* O - Expiration date of credentials */
|
||||
@@ -500,7 +505,7 @@ httpCredentialsGetExpiration(
|
||||
/*
|
||||
* 'httpCredentialsString()' - Return a string representing the credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
size_t /* O - Total size of credentials string */
|
||||
@@ -556,7 +561,7 @@ httpCredentialsString(
|
||||
/*
|
||||
* 'httpLoadCredentials()' - Load X.509 credentials from a keychain file.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
@@ -682,7 +687,7 @@ httpLoadCredentials(
|
||||
/*
|
||||
* 'httpSaveCredentials()' - Save X.509 credentials to a keychain file.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - -1 on error, 0 on success */
|
||||
@@ -1000,6 +1005,17 @@ _httpTLSSetCredentials(http_t *http) /* I - Connection to server */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpTLSSetOptions()' - Set TLS protocol and cipher suite options.
|
||||
*/
|
||||
|
||||
void
|
||||
_httpTLSSetOptions(int options) /* I - Options */
|
||||
{
|
||||
tls_options = options;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpTLSStart()' - Set up SSL/TLS support on a connection.
|
||||
*/
|
||||
@@ -1012,9 +1028,18 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
|
||||
int status; /* Status of handshake */
|
||||
gnutls_certificate_credentials_t *credentials;
|
||||
/* TLS credentials */
|
||||
char priority_string[1024];
|
||||
/* Priority string */
|
||||
|
||||
|
||||
DEBUG_printf(("7_httpTLSStart(http=%p)", http));
|
||||
DEBUG_printf(("3_httpTLSStart(http=%p)", http));
|
||||
|
||||
if (tls_options < 0)
|
||||
{
|
||||
DEBUG_puts("4_httpTLSStart: Setting defaults.");
|
||||
_cupsSetDefaults();
|
||||
DEBUG_printf(("4_httpTLSStart: tls_options=%x", tls_options));
|
||||
}
|
||||
|
||||
if (http->mode == _HTTP_MODE_SERVER && !tls_keypath)
|
||||
{
|
||||
@@ -1094,7 +1119,6 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
|
||||
keyfile[1024]; /* Private key file */
|
||||
int have_creds = 0; /* Have credentials? */
|
||||
|
||||
|
||||
if (http->fields[HTTP_FIELD_HOST][0])
|
||||
{
|
||||
/*
|
||||
@@ -1184,9 +1208,37 @@ _httpTLSStart(http_t *http) /* I - Connection to server */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
strlcpy(priority_string, "NORMAL", sizeof(priority_string));
|
||||
|
||||
if (tls_options & _HTTP_TLS_DENY_TLS10)
|
||||
strlcat(priority_string, ":+VERS-TLS-ALL:-VERS-TLS1.0:-VERS-SSL3.0", sizeof(priority_string));
|
||||
else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
|
||||
strlcat(priority_string, ":+VERS-TLS-ALL", sizeof(priority_string));
|
||||
else
|
||||
strlcat(priority_string, ":+VERS-TLS-ALL:-VERS-SSL3.0", sizeof(priority_string));
|
||||
|
||||
if (!(tls_options & _HTTP_TLS_ALLOW_RC4))
|
||||
strlcat(priority_string, ":-ARCFOUR-128", sizeof(priority_string));
|
||||
|
||||
if (!(tls_options & _HTTP_TLS_ALLOW_DH))
|
||||
strlcat(priority_string, ":!ANON-DH", sizeof(priority_string));
|
||||
|
||||
#ifdef HAVE_GNUTLS_PRIORITY_SET_DIRECT
|
||||
gnutls_priority_set_direct(http->tls, priority_string, NULL);
|
||||
|
||||
#else
|
||||
gnutls_priority_t priority; /* Priority */
|
||||
|
||||
gnutls_priority_init(&priority, priority_string, NULL);
|
||||
gnutls_priority_set(http->tls, priority);
|
||||
gnutls_priority_deinit(priority);
|
||||
#endif /* HAVE_GNUTLS_PRIORITY_SET_DIRECT */
|
||||
|
||||
gnutls_transport_set_ptr(http->tls, (gnutls_transport_ptr_t)http);
|
||||
gnutls_transport_set_pull_function(http->tls, http_gnutls_read);
|
||||
#ifdef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION
|
||||
gnutls_transport_set_pull_timeout_function(http->tls, (gnutls_pull_timeout_func)httpWait);
|
||||
#endif /* HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION */
|
||||
gnutls_transport_set_push_function(http->tls, http_gnutls_write);
|
||||
|
||||
while ((status = gnutls_handshake(http->tls)) != GNUTLS_E_SUCCESS)
|
||||
@@ -1289,5 +1341,5 @@ _httpTLSWrite(http_t *http, /* I - Connection to server */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: tls-gnutls.c 12050 2014-07-18 16:51:12Z msweet $".
|
||||
* End of "$Id: tls-gnutls.c 12670 2015-05-27 19:48:05Z msweet $".
|
||||
*/
|
||||
|
||||
+83
-15
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* "$Id: tls-sspi.c 12047 2014-07-18 13:53:34Z msweet $"
|
||||
* "$Id: tls-sspi.c 12647 2015-05-20 18:37:52Z msweet $"
|
||||
*
|
||||
* TLS support for CUPS on Windows using SSPI.
|
||||
* TLS support for CUPS on Windows using the Security Support Provider
|
||||
* Interface (SSPI).
|
||||
*
|
||||
* Copyright 2010-2014 by Apple Inc.
|
||||
* Copyright 2010-2015 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -14,6 +15,8 @@
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/**** This file is included from tls.c ****/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
@@ -46,6 +49,14 @@
|
||||
# define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 /* Expired X509 Cert. */
|
||||
#endif /* !SECURITY_FLAG_IGNORE_CERT_DATE_INVALID */
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static int tls_options = -1;/* Options for TLS connections */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
@@ -66,7 +77,7 @@ static DWORD http_sspi_verify(PCCERT_CONTEXT cert, const char *common_name, DWOR
|
||||
/*
|
||||
* 'cupsMakeServerCredentials()' - Make a self-signed certificate and private key pair.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -102,7 +113,7 @@ cupsMakeServerCredentials(
|
||||
* Note: The server credentials are used by all threads in the running process.
|
||||
* This function is threadsafe.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -165,7 +176,7 @@ _httpCreateCredentials(
|
||||
/*
|
||||
* 'httpCredentialsAreValidForName()' - Return whether the credentials are valid for the given name.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 1 if valid, 0 otherwise */
|
||||
@@ -230,7 +241,7 @@ httpCredentialsAreValidForName(
|
||||
/*
|
||||
* 'httpCredentialsGetTrust()' - Return the trust of credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
http_trust_t /* O - Level of trust */
|
||||
@@ -251,6 +262,9 @@ httpCredentialsGetTrust(
|
||||
if (!cert)
|
||||
return (HTTP_TRUST_UNKNOWN);
|
||||
|
||||
if (cg->any_root < 0)
|
||||
_cupsSetDefaults();
|
||||
|
||||
if (cg->any_root)
|
||||
certFlags |= SECURITY_FLAG_IGNORE_UNKNOWN_CA;
|
||||
|
||||
@@ -272,7 +286,7 @@ httpCredentialsGetTrust(
|
||||
/*
|
||||
* 'httpCredentialsGetExpiration()' - Return the expiration date of the credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
time_t /* O - Expiration date of credentials */
|
||||
@@ -309,7 +323,7 @@ httpCredentialsGetExpiration(
|
||||
/*
|
||||
* 'httpCredentialsString()' - Return a string representing the credentials.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
size_t /* O - Total size of credentials string */
|
||||
@@ -399,7 +413,7 @@ _httpFreeCredentials(
|
||||
/*
|
||||
* 'httpLoadCredentials()' - Load X.509 credentials from a keychain file.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
@@ -523,7 +537,7 @@ cleanup:
|
||||
/*
|
||||
* 'httpSaveCredentials()' - Save X.509 credentials to a keychain file.
|
||||
*
|
||||
* @since CUPS 2.0@
|
||||
* @since CUPS 2.0/OS 10.10@
|
||||
*/
|
||||
|
||||
int /* O - -1 on error, 0 on success */
|
||||
@@ -894,6 +908,17 @@ _httpTLSRead(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpTLSSetOptions()' - Set TLS protocol and cipher suite options.
|
||||
*/
|
||||
|
||||
void
|
||||
_httpTLSSetOptions(int options) /* I - Options */
|
||||
{
|
||||
tls_options = options;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpTLSStart()' - Set up SSL/TLS support on a connection.
|
||||
*/
|
||||
@@ -905,7 +930,14 @@ _httpTLSStart(http_t *http) /* I - HTTP connection */
|
||||
*hostptr; /* Pointer into hostname */
|
||||
|
||||
|
||||
DEBUG_printf(("7_httpTLSStart(http=%p)", http));
|
||||
DEBUG_printf(("3_httpTLSStart(http=%p)", http));
|
||||
|
||||
if (tls_options < 0)
|
||||
{
|
||||
DEBUG_puts("4_httpTLSStart: Setting defaults.");
|
||||
_cupsSetDefaults();
|
||||
DEBUG_printf(("4_httpTLSStart: tls_options=%x", tls_options));
|
||||
}
|
||||
|
||||
if ((http->tls = http_sspi_alloc()) == NULL)
|
||||
return (-1);
|
||||
@@ -1725,11 +1757,47 @@ http_sspi_find_credentials(
|
||||
SchannelCred.paCred = &storedContext;
|
||||
|
||||
/*
|
||||
* SSPI doesn't seem to like it if grbitEnabledProtocols is set for a client.
|
||||
* Set supported protocols (can also be overriden in the registry...)
|
||||
*/
|
||||
|
||||
#ifdef SP_PROT_TLS1_2_SERVER
|
||||
if (http->mode == _HTTP_MODE_SERVER)
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_SSL3TLS1;
|
||||
{
|
||||
if (tls_options & _HTTP_TLS_DENY_TLS10)
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_2_SERVER | SP_PROT_TLS1_1_SERVER;
|
||||
else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_2_SERVER | SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_0_SERVER | SP_PROT_SSL3_SERVER;
|
||||
else
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_2_SERVER | SP_PROT_TLS1_1_SERVER | SP_PROT_TLS1_0_SERVER;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tls_options & _HTTP_TLS_DENY_TLS10)
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_2_CLIENT | SP_PROT_TLS1_1_CLIENT;
|
||||
else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_2_CLIENT | SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_0_CLIENT | SP_PROT_SSL3_CLIENT;
|
||||
else
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_2_CLIENT | SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_0_CLIENT;
|
||||
}
|
||||
|
||||
#else
|
||||
if (http->mode == _HTTP_MODE_SERVER)
|
||||
{
|
||||
if (tls_options & _HTTP_TLS_ALLOW_SSL3)
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_SERVER | SP_PROT_SSL3_SERVER;
|
||||
else
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_SERVER;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tls_options & _HTTP_TLS_ALLOW_SSL3)
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_CLIENT | SP_PROT_SSL3_CLIENT;
|
||||
else
|
||||
SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_CLIENT;
|
||||
}
|
||||
#endif /* SP_PROT_TLS1_2_SERVER */
|
||||
|
||||
/* TODO: Support _HTTP_TLS_ALLOW_RC4 and _HTTP_TLS_ALLOW_DH options; right now we'll rely on Windows registry to enable/disable RC4/DH... */
|
||||
|
||||
/*
|
||||
* Create an SSPI credential.
|
||||
@@ -2359,5 +2427,5 @@ http_sspi_verify(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: tls-sspi.c 12047 2014-07-18 13:53:34Z msweet $".
|
||||
* End of "$Id: tls-sspi.c 12647 2015-05-20 18:37:52Z msweet $".
|
||||
*/
|
||||
|
||||
+58
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: tls.c 11841 2014-04-29 16:39:25Z msweet $"
|
||||
* "$Id: tls.c 12136 2014-08-29 15:19:40Z msweet $"
|
||||
*
|
||||
* TLS routines for CUPS.
|
||||
*
|
||||
@@ -46,12 +46,67 @@
|
||||
# include "tls-gnutls.c"
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
# include "tls-darwin.c"
|
||||
# else
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
# include "tls-sspi.c"
|
||||
# endif /* HAVE_GNUTLS */
|
||||
#else
|
||||
/* Stubs for when TLS is not supported/available */
|
||||
int
|
||||
httpCopyCredentials(http_t *http, cups_array_t **credentials)
|
||||
{
|
||||
(void)http;
|
||||
if (credentials)
|
||||
*credentials = NULL;
|
||||
return (-1);
|
||||
}
|
||||
int
|
||||
httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name)
|
||||
{
|
||||
(void)credentials;
|
||||
(void)common_name;
|
||||
return (1);
|
||||
}
|
||||
time_t
|
||||
httpCredentialsGetExpiration(cups_array_t *credentials)
|
||||
{
|
||||
(void)credentials;
|
||||
return (INT_MAX);
|
||||
}
|
||||
http_trust_t
|
||||
httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name)
|
||||
{
|
||||
(void)credentials;
|
||||
(void)common_name;
|
||||
return (HTTP_TRUST_OK);
|
||||
}
|
||||
size_t
|
||||
httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize)
|
||||
{
|
||||
(void)credentials;
|
||||
(void)bufsize;
|
||||
if (buffer)
|
||||
*buffer = '\0';
|
||||
return (0);
|
||||
}
|
||||
int
|
||||
httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name)
|
||||
{
|
||||
(void)path;
|
||||
(void)credentials;
|
||||
(void)common_name;
|
||||
return (-1);
|
||||
}
|
||||
int
|
||||
httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name)
|
||||
{
|
||||
(void)path;
|
||||
(void)credentials;
|
||||
(void)common_name;
|
||||
return (-1);
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: tls.c 11841 2014-04-29 16:39:25Z msweet $".
|
||||
* End of "$Id: tls.c 12136 2014-08-29 15:19:40Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,739 @@
|
||||
/*
|
||||
* "$Id: tlscheck.c 12688 2015-06-03 17:31:30Z msweet $"
|
||||
*
|
||||
* TLS check program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
|
||||
|
||||
#ifndef HAVE_SSL
|
||||
int main(void) { puts("Sorry, no TLS support compiled in."); return (1); }
|
||||
#else
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void usage(void);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
http_t *http; /* HTTP connection */
|
||||
const char *server = NULL; /* Hostname from command-line */
|
||||
int port = 0; /* Port number */
|
||||
const char *cipherName = "UNKNOWN";/* Cipher suite name */
|
||||
int dhBits = 0; /* Diffie-Hellman bits */
|
||||
int tlsVersion = 0; /* TLS version number */
|
||||
char uri[1024], /* Printer URI */
|
||||
scheme[32], /* URI scheme */
|
||||
host[256], /* Hostname */
|
||||
userpass[256], /* Username/password */
|
||||
resource[256]; /* Resource path */
|
||||
int tls_options = _HTTP_TLS_NONE,
|
||||
/* TLS options */
|
||||
verbose = 0; /* Verbosity */
|
||||
ipp_t *request, /* IPP Get-Printer-Attributes request */
|
||||
*response; /* IPP Get-Printer-Attributes response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
const char *name; /* Attribute name */
|
||||
char value[1024]; /* Attribute (string) value */
|
||||
static const char * const pattrs[] = /* Requested attributes */
|
||||
{
|
||||
"color-supported",
|
||||
"compression-supported",
|
||||
"document-format-supported",
|
||||
"pages-per-minute",
|
||||
"printer-location",
|
||||
"printer-make-and-model",
|
||||
"printer-state",
|
||||
"printer-state-reasons",
|
||||
"sides-supported",
|
||||
"uri-authentication-supported",
|
||||
"uri-security-supported"
|
||||
};
|
||||
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (!strcmp(argv[i], "--dh"))
|
||||
{
|
||||
tls_options |= _HTTP_TLS_ALLOW_DH;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--no-tls10"))
|
||||
{
|
||||
tls_options |= _HTTP_TLS_DENY_TLS10;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--rc4"))
|
||||
{
|
||||
tls_options |= _HTTP_TLS_ALLOW_RC4;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--verbose") || !strcmp(argv[i], "-v"))
|
||||
{
|
||||
verbose = 1;
|
||||
}
|
||||
else if (argv[i][0] == '-')
|
||||
{
|
||||
printf("tlscheck: Unknown option '%s'.\n", argv[i]);
|
||||
usage();
|
||||
}
|
||||
else if (!server)
|
||||
{
|
||||
if (!strncmp(argv[i], "ipps://", 7))
|
||||
{
|
||||
httpSeparateURI(HTTP_URI_CODING_ALL, argv[i], scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource));
|
||||
server = host;
|
||||
}
|
||||
else
|
||||
{
|
||||
server = argv[i];
|
||||
strlcpy(resource, "/ipp/print", sizeof(resource));
|
||||
}
|
||||
}
|
||||
else if (!port && (argv[i][0] == '=' || isdigit(argv[i][0] & 255)))
|
||||
{
|
||||
if (argv[i][0] == '=')
|
||||
port = atoi(argv[i] + 1);
|
||||
else
|
||||
port = atoi(argv[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("tlscheck: Unexpected argument '%s'.\n", argv[i]);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (!server)
|
||||
usage();
|
||||
|
||||
if (!port)
|
||||
port = 631;
|
||||
|
||||
_httpTLSSetOptions(tls_options);
|
||||
|
||||
http = httpConnect2(server, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_ALWAYS, 1, 30000, NULL);
|
||||
if (!http)
|
||||
{
|
||||
printf("%s: ERROR (%s)\n", server, cupsLastErrorString());
|
||||
return (1);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
SSLProtocol protocol;
|
||||
SSLCipherSuite cipher;
|
||||
char unknownCipherName[256];
|
||||
int paramsNeeded = 0;
|
||||
const void *params;
|
||||
size_t paramsLen;
|
||||
OSStatus err;
|
||||
|
||||
if ((err = SSLGetNegotiatedProtocolVersion(http->tls, &protocol)) != noErr)
|
||||
{
|
||||
printf("%s: ERROR (No protocol version - %d)\n", server, (int)err);
|
||||
httpClose(http);
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (protocol)
|
||||
{
|
||||
default :
|
||||
tlsVersion = 0;
|
||||
break;
|
||||
case kSSLProtocol3 :
|
||||
tlsVersion = 30;
|
||||
break;
|
||||
case kTLSProtocol1 :
|
||||
tlsVersion = 10;
|
||||
break;
|
||||
case kTLSProtocol11 :
|
||||
tlsVersion = 11;
|
||||
break;
|
||||
case kTLSProtocol12 :
|
||||
tlsVersion = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((err = SSLGetNegotiatedCipher(http->tls, &cipher)) != noErr)
|
||||
{
|
||||
printf("%s: ERROR (No cipher suite - %d)\n", server, (int)err);
|
||||
httpClose(http);
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (cipher)
|
||||
{
|
||||
case TLS_NULL_WITH_NULL_NULL:
|
||||
cipherName = "TLS_NULL_WITH_NULL_NULL";
|
||||
break;
|
||||
case TLS_RSA_WITH_NULL_MD5:
|
||||
cipherName = "TLS_RSA_WITH_NULL_MD5";
|
||||
break;
|
||||
case TLS_RSA_WITH_NULL_SHA:
|
||||
cipherName = "TLS_RSA_WITH_NULL_SHA";
|
||||
break;
|
||||
case TLS_RSA_WITH_RC4_128_MD5:
|
||||
cipherName = "TLS_RSA_WITH_RC4_128_MD5";
|
||||
break;
|
||||
case TLS_RSA_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_RSA_WITH_RC4_128_SHA";
|
||||
break;
|
||||
case TLS_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_RSA_WITH_NULL_SHA256:
|
||||
cipherName = "TLS_RSA_WITH_NULL_SHA256";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_RSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_256_CBC_SHA256:
|
||||
cipherName = "TLS_RSA_WITH_AES_256_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_DH_DSS_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_DH_RSA_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_256_CBC_SHA256:
|
||||
cipherName = "TLS_DH_DSS_WITH_AES_256_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_256_CBC_SHA256:
|
||||
cipherName = "TLS_DH_RSA_WITH_AES_256_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_256_CBC_SHA256:
|
||||
cipherName = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256:
|
||||
cipherName = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_RC4_128_MD5:
|
||||
cipherName = "TLS_DH_anon_WITH_RC4_128_MD5";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_DH_anon_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_256_CBC_SHA256:
|
||||
cipherName = "TLS_DH_anon_WITH_AES_256_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_PSK_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_PSK_WITH_RC4_128_SHA";
|
||||
break;
|
||||
case TLS_PSK_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_PSK_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_PSK_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_PSK_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_PSK_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_PSK_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_DHE_PSK_WITH_RC4_128_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_DHE_PSK_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_DHE_PSK_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_RSA_PSK_WITH_RC4_128_SHA";
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_RSA_PSK_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_RSA_PSK_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_PSK_WITH_NULL_SHA:
|
||||
cipherName = "TLS_PSK_WITH_NULL_SHA";
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_NULL_SHA:
|
||||
cipherName = "TLS_DHE_PSK_WITH_NULL_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_NULL_SHA:
|
||||
cipherName = "TLS_RSA_PSK_WITH_NULL_SHA";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_RSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_RSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_DH_RSA_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_DH_RSA_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_DH_DSS_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_DH_DSS_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_DH_anon_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_DH_anon_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_PSK_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_PSK_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_PSK_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_PSK_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_DHE_PSK_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_DHE_PSK_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_RSA_PSK_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_RSA_PSK_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_PSK_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_PSK_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_PSK_WITH_AES_256_CBC_SHA384:
|
||||
cipherName = "TLS_PSK_WITH_AES_256_CBC_SHA384";
|
||||
break;
|
||||
case TLS_PSK_WITH_NULL_SHA256:
|
||||
cipherName = "TLS_PSK_WITH_NULL_SHA256";
|
||||
break;
|
||||
case TLS_PSK_WITH_NULL_SHA384:
|
||||
cipherName = "TLS_PSK_WITH_NULL_SHA384";
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_DHE_PSK_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_AES_256_CBC_SHA384:
|
||||
cipherName = "TLS_DHE_PSK_WITH_AES_256_CBC_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_NULL_SHA256:
|
||||
cipherName = "TLS_DHE_PSK_WITH_NULL_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_PSK_WITH_NULL_SHA384:
|
||||
cipherName = "TLS_DHE_PSK_WITH_NULL_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_RSA_PSK_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_AES_256_CBC_SHA384:
|
||||
cipherName = "TLS_RSA_PSK_WITH_AES_256_CBC_SHA384";
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_NULL_SHA256:
|
||||
cipherName = "TLS_RSA_PSK_WITH_NULL_SHA256";
|
||||
break;
|
||||
case TLS_RSA_PSK_WITH_NULL_SHA384:
|
||||
cipherName = "TLS_RSA_PSK_WITH_NULL_SHA384";
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_RSA_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_DH_DSS_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_DH_RSA_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_DH_anon_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_RSA_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_DH_DSS_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_DH_RSA_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_DH_anon_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_NULL_SHA:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_NULL_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_RC4_128_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_NULL_SHA:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_NULL_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_NULL_SHA:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_NULL_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_RC4_128_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_NULL_SHA:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_NULL_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_RC4_128_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_anon_WITH_NULL_SHA:
|
||||
cipherName = "TLS_ECDH_anon_WITH_NULL_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_anon_WITH_RC4_128_SHA:
|
||||
cipherName = "TLS_ECDH_anon_WITH_RC4_128_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_anon_WITH_AES_128_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_anon_WITH_AES_128_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
case TLS_ECDH_anon_WITH_AES_256_CBC_SHA:
|
||||
cipherName = "TLS_ECDH_anon_WITH_AES_256_CBC_SHA";
|
||||
paramsNeeded = 1;
|
||||
break;
|
||||
default :
|
||||
snprintf(unknownCipherName, sizeof(unknownCipherName), "UNKNOWN_%04X", cipher);
|
||||
cipherName = unknownCipherName;
|
||||
break;
|
||||
}
|
||||
|
||||
if (cipher == TLS_RSA_WITH_RC4_128_MD5 ||
|
||||
cipher == TLS_RSA_WITH_RC4_128_SHA)
|
||||
{
|
||||
printf("%s: ERROR (Printers MUST NOT negotiate RC4 cipher suites.)\n", server);
|
||||
httpClose(http);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if ((err = SSLGetDiffieHellmanParams(http->tls, ¶ms, ¶msLen)) != noErr && paramsNeeded)
|
||||
{
|
||||
printf("%s: ERROR (Unable to get Diffie-Hellman parameters - %d)\n", server, (int)err);
|
||||
httpClose(http);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (paramsLen < 128 && paramsLen != 0)
|
||||
{
|
||||
printf("%s: ERROR (Diffie-Hellman parameters MUST be at least 2048 bits, but Printer uses only %d bits/%d bytes)\n", server, (int)paramsLen * 8, (int)paramsLen);
|
||||
httpClose(http);
|
||||
return (1);
|
||||
}
|
||||
|
||||
dhBits = (int)paramsLen * 8;
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
if (dhBits > 0)
|
||||
printf("%s: OK (TLS: %d.%d, %s, %d DH bits)\n", server, tlsVersion / 10, tlsVersion % 10, cipherName, dhBits);
|
||||
else
|
||||
printf("%s: OK (TLS: %d.%d, %s)\n", server, tlsVersion / 10, tlsVersion % 10, cipherName);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipps", NULL, host, port, resource);
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
|
||||
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
for (attr = ippFirstAttribute(response); attr; attr = ippNextAttribute(response))
|
||||
{
|
||||
if (ippGetGroupTag(attr) != IPP_TAG_PRINTER)
|
||||
continue;
|
||||
|
||||
if ((name = ippGetName(attr)) == NULL)
|
||||
continue;
|
||||
|
||||
ippAttributeString(attr, value, sizeof(value));
|
||||
printf(" %s=%s\n", name, value);
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
httpClose(http);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'usage()' - Show program usage.
|
||||
*/
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
puts("Usage: ./tlscheck [options] server [port]");
|
||||
puts(" ./tlscheck [options] ipps://server[:port]/path");
|
||||
puts("");
|
||||
puts("Options:");
|
||||
puts(" --dh Allow DH/DHE key exchange");
|
||||
puts(" --no-tls10 Disable TLS/1.0");
|
||||
puts(" --rc4 Allow RC4 encryption");
|
||||
puts(" --verbose Be verbose");
|
||||
puts(" -v Be verbose");
|
||||
puts("");
|
||||
puts("The default port is 631.");
|
||||
|
||||
exit(1);
|
||||
}
|
||||
#endif /* !HAVE_SSL */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: tlscheck.c 12688 2015-06-03 17:31:30Z msweet $".
|
||||
*/
|
||||
+14
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: transcode.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* "$Id: transcode.c 12330 2014-12-09 20:57:28Z msweet $"
|
||||
*
|
||||
* Transcoding support for CUPS.
|
||||
*
|
||||
@@ -154,11 +154,15 @@ cupsCharsetToUTF8(
|
||||
|
||||
if (map_encoding != encoding)
|
||||
{
|
||||
char toset[1024]; /* Destination character set */
|
||||
|
||||
_cupsCharmapFlush();
|
||||
|
||||
snprintf(toset, sizeof(toset), "%s//IGNORE", _cupsEncodingName(encoding));
|
||||
|
||||
map_encoding = encoding;
|
||||
map_from_utf8 = iconv_open(_cupsEncodingName(encoding), "UTF-8");
|
||||
map_to_utf8 = iconv_open("UTF-8", _cupsEncodingName(encoding));
|
||||
map_encoding = encoding;
|
||||
map_to_utf8 = iconv_open("UTF-8", toset);
|
||||
}
|
||||
|
||||
if (map_to_utf8 != (iconv_t)-1)
|
||||
@@ -279,11 +283,15 @@ cupsUTF8ToCharset(
|
||||
|
||||
if (map_encoding != encoding)
|
||||
{
|
||||
char toset[1024]; /* Destination character set */
|
||||
|
||||
_cupsCharmapFlush();
|
||||
|
||||
map_from_utf8 = iconv_open(_cupsEncodingName(encoding), "UTF-8");
|
||||
map_to_utf8 = iconv_open("UTF-8", _cupsEncodingName(encoding));
|
||||
snprintf(toset, sizeof(toset), "%s//IGNORE", _cupsEncodingName(encoding));
|
||||
|
||||
map_encoding = encoding;
|
||||
map_from_utf8 = iconv_open(_cupsEncodingName(encoding), "UTF-8");
|
||||
map_to_utf8 = iconv_open("UTF-8", toset);
|
||||
}
|
||||
|
||||
if (map_from_utf8 != (iconv_t)-1)
|
||||
@@ -708,5 +716,5 @@ cupsUTF32ToUTF8(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: transcode.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
* End of "$Id: transcode.c 12330 2014-12-09 20:57:28Z msweet $"
|
||||
*/
|
||||
|
||||
+409
-249
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: usersys.c 11908 2014-06-09 18:57:44Z msweet $"
|
||||
* "$Id: usersys.c 13030 2016-01-04 14:35:45Z msweet $"
|
||||
*
|
||||
* User, system, and password routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -38,21 +38,46 @@
|
||||
#define _CUPS_PASSCHAR '*' /* Character that is echoed for password */
|
||||
|
||||
|
||||
/*
|
||||
* Local types...
|
||||
*/
|
||||
|
||||
typedef struct _cups_client_conf_s /**** client.conf config data ****/
|
||||
{
|
||||
#ifdef HAVE_SSL
|
||||
int ssl_options; /* SSLOptions values */
|
||||
#endif /* HAVE_SSL */
|
||||
int any_root, /* Allow any (e.g., self-signed) root */
|
||||
expired_certs, /* Allow expired certs */
|
||||
validate_certs; /* Validate certificates */
|
||||
http_encryption_t encryption; /* Encryption setting */
|
||||
char user[65], /* User name */
|
||||
server_name[256];
|
||||
/* Server hostname */
|
||||
#ifdef HAVE_GSSAPI
|
||||
char gss_service_name[32];
|
||||
/* Kerberos service name */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
} _cups_client_conf_t;
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void cups_read_client_conf(cups_file_t *fp,
|
||||
_cups_globals_t *cg,
|
||||
const char *cups_encryption,
|
||||
const char *cups_server,
|
||||
const char *cups_user,
|
||||
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_encryption(_cups_client_conf_t *cc, const char *value);
|
||||
#ifdef HAVE_GSSAPI
|
||||
const char *cups_gssservicename,
|
||||
static void cups_set_gss_service_name(_cups_client_conf_t *cc, const char *value);
|
||||
#endif /* HAVE_GSSAPI */
|
||||
const char *cups_anyroot,
|
||||
const char *cups_expiredcerts,
|
||||
const char *cups_validatecerts);
|
||||
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_user(_cups_client_conf_t *cc, const char *value);
|
||||
|
||||
|
||||
/*
|
||||
@@ -211,8 +236,10 @@ cupsSetCredentials(
|
||||
if (cupsArrayCount(credentials) < 1)
|
||||
return (-1);
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
_httpFreeCredentials(cg->tls_credentials);
|
||||
cg->tls_credentials = _httpCreateCredentials(credentials);
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
return (cg->tls_credentials ? 0 : -1);
|
||||
}
|
||||
@@ -356,6 +383,9 @@ cupsSetServer(const char *server) /* I - Server name */
|
||||
cg->ipp_port = atoi(port);
|
||||
}
|
||||
|
||||
if (!cg->ipp_port)
|
||||
cups_set_default_ipp_port(cg);
|
||||
|
||||
if (cg->server[0] == '/')
|
||||
strlcpy(cg->servername, "localhost", sizeof(cg->servername));
|
||||
else
|
||||
@@ -366,6 +396,7 @@ cupsSetServer(const char *server) /* I - Server name */
|
||||
cg->server[0] = '\0';
|
||||
cg->servername[0] = '\0';
|
||||
cg->server_version = 20;
|
||||
cg->ipp_port = 0;
|
||||
}
|
||||
|
||||
if (cg->http)
|
||||
@@ -679,6 +710,8 @@ _cupsGetPassword(const char *prompt) /* I - Prompt string */
|
||||
|
||||
noecho = original;
|
||||
noecho.c_lflag &= (tcflag_t)~(ICANON | ECHO | ECHOE | ISIG);
|
||||
noecho.c_cc[VMIN] = 1;
|
||||
noecho.c_cc[VTIME] = 0;
|
||||
|
||||
if (tcsetattr(tty, TCSAFLUSH, &noecho))
|
||||
{
|
||||
@@ -823,199 +856,154 @@ void
|
||||
_cupsSetDefaults(void)
|
||||
{
|
||||
cups_file_t *fp; /* File */
|
||||
const char *home, /* Home directory of user */
|
||||
*cups_encryption, /* CUPS_ENCRYPTION env var */
|
||||
*cups_server, /* CUPS_SERVER env var */
|
||||
*cups_user, /* CUPS_USER/USER env var */
|
||||
#ifdef HAVE_GSSAPI
|
||||
*cups_gssservicename, /* CUPS_GSSSERVICENAME env var */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
*cups_anyroot, /* CUPS_ANYROOT env var */
|
||||
*cups_expiredcerts, /* CUPS_EXPIREDCERTS env var */
|
||||
*cups_validatecerts; /* CUPS_VALIDATECERTS env var */
|
||||
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 */
|
||||
|
||||
|
||||
DEBUG_puts("_cupsSetDefaults()");
|
||||
|
||||
/*
|
||||
* First collect environment variables...
|
||||
* Load initial client.conf values...
|
||||
*/
|
||||
|
||||
cups_encryption = getenv("CUPS_ENCRYPTION");
|
||||
cups_server = getenv("CUPS_SERVER");
|
||||
#ifdef HAVE_GSSAPI
|
||||
cups_gssservicename = getenv("CUPS_GSSSERVICENAME");
|
||||
#endif /* HAVE_GSSAPI */
|
||||
cups_anyroot = getenv("CUPS_ANYROOT");
|
||||
cups_expiredcerts = getenv("CUPS_EXPIREDCERTS");
|
||||
cups_user = getenv("CUPS_USER");
|
||||
cups_validatecerts = getenv("CUPS_VALIDATECERTS");
|
||||
cups_init_client_conf(&cc);
|
||||
|
||||
/*
|
||||
* Then, if needed, read the ~/.cups/client.conf or /etc/cups/client.conf
|
||||
* files to get the default values...
|
||||
* Read the /etc/cups/client.conf and ~/.cups/client.conf files, if
|
||||
* present.
|
||||
*/
|
||||
|
||||
if (cg->encryption == (http_encryption_t)-1 || !cg->server[0] ||
|
||||
!cg->user[0] || !cg->ipp_port)
|
||||
snprintf(filename, sizeof(filename), "%s/client.conf", cg->cups_serverroot);
|
||||
if ((fp = cupsFileOpen(filename, "r")) != NULL)
|
||||
{
|
||||
# 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 */
|
||||
{
|
||||
/*
|
||||
* Look for ~/.cups/client.conf...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
|
||||
fp = cupsFileOpen(filename, "r");
|
||||
}
|
||||
else
|
||||
fp = NULL;
|
||||
|
||||
if (!fp)
|
||||
{
|
||||
/*
|
||||
* Look for CUPS_SERVERROOT/client.conf...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/client.conf",
|
||||
cg->cups_serverroot);
|
||||
fp = cupsFileOpen(filename, "r");
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the configuration file and apply any environment variables; both
|
||||
* functions handle NULL cups_file_t pointers...
|
||||
*/
|
||||
|
||||
cups_read_client_conf(fp, cg, cups_encryption, cups_server, cups_user,
|
||||
#ifdef HAVE_GSSAPI
|
||||
cups_gssservicename,
|
||||
#endif /* HAVE_GSSAPI */
|
||||
cups_anyroot, cups_expiredcerts, cups_validatecerts);
|
||||
cups_read_client_conf(fp, &cc);
|
||||
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 */
|
||||
{
|
||||
/*
|
||||
* Look for ~/.cups/client.conf...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
|
||||
if ((fp = cupsFileOpen(filename, "r")) != NULL)
|
||||
{
|
||||
cups_read_client_conf(fp, &cc);
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Finalize things so every client.conf value is set...
|
||||
*/
|
||||
|
||||
cups_finalize_client_conf(&cc);
|
||||
|
||||
if (cg->encryption == (http_encryption_t)-1)
|
||||
cg->encryption = cc.encryption;
|
||||
|
||||
if (!cg->server[0] || !cg->ipp_port)
|
||||
cupsSetServer(cc.server_name);
|
||||
|
||||
if (!cg->ipp_port)
|
||||
cups_set_default_ipp_port(cg);
|
||||
|
||||
if (!cg->user[0])
|
||||
strlcpy(cg->user, cc.user, sizeof(cg->user));
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (!cg->gss_service_name[0])
|
||||
strlcpy(cg->gss_service_name, cc.gss_service_name, sizeof(cg->gss_service_name));
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
if (cg->any_root < 0)
|
||||
cg->any_root = cc.any_root;
|
||||
|
||||
if (cg->expired_certs < 0)
|
||||
cg->expired_certs = cc.expired_certs;
|
||||
|
||||
if (cg->validate_certs < 0)
|
||||
cg->validate_certs = cc.validate_certs;
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
_httpTLSSetOptions(cc.ssl_options);
|
||||
#endif /* HAVE_SSL */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_read_client_conf()' - Read a client.conf file.
|
||||
* 'cups_boolean_value()' - Convert a string to a boolean value.
|
||||
*/
|
||||
|
||||
static int /* O - Boolean value */
|
||||
cups_boolean_value(const char *value) /* I - String value */
|
||||
{
|
||||
return (!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "on") || !_cups_strcasecmp(value, "true"));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_finalize_client_conf()' - Finalize client.conf values.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_read_client_conf(
|
||||
cups_file_t *fp, /* I - File to read */
|
||||
_cups_globals_t *cg, /* I - Global data */
|
||||
const char *cups_encryption, /* I - CUPS_ENCRYPTION env var */
|
||||
const char *cups_server, /* I - CUPS_SERVER env var */
|
||||
const char *cups_user, /* I - CUPS_USER env var */
|
||||
#ifdef HAVE_GSSAPI
|
||||
const char *cups_gssservicename,
|
||||
/* I - CUPS_GSSSERVICENAME env var */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
const char *cups_anyroot, /* I - CUPS_ANYROOT env var */
|
||||
const char *cups_expiredcerts, /* I - CUPS_EXPIREDCERTS env var */
|
||||
const char *cups_validatecerts)/* I - CUPS_VALIDATECERTS env var */
|
||||
cups_finalize_client_conf(
|
||||
_cups_client_conf_t *cc) /* I - client.conf values */
|
||||
{
|
||||
int linenum; /* Current line number */
|
||||
char line[1024], /* Line from file */
|
||||
*value, /* Pointer into line */
|
||||
encryption[1024], /* Encryption value */
|
||||
#ifndef __APPLE__
|
||||
server_name[1024], /* ServerName value */
|
||||
#endif /* !__APPLE__ */
|
||||
user[256], /* User value */
|
||||
any_root[1024], /* AllowAnyRoot value */
|
||||
expired_certs[1024], /* AllowExpiredCerts value */
|
||||
validate_certs[1024]; /* ValidateCerts value */
|
||||
const char *value; /* Environment variable */
|
||||
|
||||
|
||||
if ((value = getenv("CUPS_ANYROOT")) != NULL)
|
||||
cc->any_root = cups_boolean_value(value);
|
||||
|
||||
if ((value = getenv("CUPS_ENCRYPTION")) != NULL)
|
||||
cups_set_encryption(cc, value);
|
||||
|
||||
if ((value = getenv("CUPS_EXPIREDCERTS")) != NULL)
|
||||
cc->expired_certs = cups_boolean_value(value);
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
char gss_service_name[32]; /* GSSServiceName value */
|
||||
if ((value = getenv("CUPS_GSSSERVICENAME")) != NULL)
|
||||
cups_set_gss_service_name(cc, value);
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
if ((value = getenv("CUPS_SERVER")) != NULL)
|
||||
cups_set_server_name(cc, value);
|
||||
|
||||
if ((value = getenv("CUPS_USER")) != NULL)
|
||||
cups_set_user(cc, value);
|
||||
|
||||
if ((value = getenv("CUPS_VALIDATECERTS")) != NULL)
|
||||
cc->validate_certs = cups_boolean_value(value);
|
||||
|
||||
/*
|
||||
* Read from the file...
|
||||
* Then apply defaults for those values that haven't been set...
|
||||
*/
|
||||
|
||||
linenum = 0;
|
||||
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if (!cups_encryption && cg->encryption == (http_encryption_t)-1 &&
|
||||
!_cups_strcasecmp(line, "Encryption") && value)
|
||||
{
|
||||
strlcpy(encryption, value, sizeof(encryption));
|
||||
cups_encryption = encryption;
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
* The Server directive is not supported on OS X due to app sandboxing
|
||||
* restrictions, i.e. not all apps request network access.
|
||||
*/
|
||||
else if (!cups_server && (!cg->server[0] || !cg->ipp_port) &&
|
||||
!_cups_strcasecmp(line, "ServerName") && value)
|
||||
{
|
||||
strlcpy(server_name, value, sizeof(server_name));
|
||||
cups_server = server_name;
|
||||
}
|
||||
#endif /* !__APPLE__ */
|
||||
else if (!cups_user && !_cups_strcasecmp(line, "User") && value)
|
||||
{
|
||||
strlcpy(user, value, sizeof(user));
|
||||
cups_user = user;
|
||||
}
|
||||
else if (!cups_anyroot && !_cups_strcasecmp(line, "AllowAnyRoot") && value)
|
||||
{
|
||||
strlcpy(any_root, value, sizeof(any_root));
|
||||
cups_anyroot = any_root;
|
||||
}
|
||||
else if (!cups_expiredcerts && !_cups_strcasecmp(line, "AllowExpiredCerts") &&
|
||||
value)
|
||||
{
|
||||
strlcpy(expired_certs, value, sizeof(expired_certs));
|
||||
cups_expiredcerts = expired_certs;
|
||||
}
|
||||
else if (!cups_validatecerts && !_cups_strcasecmp(line, "ValidateCerts") && value)
|
||||
{
|
||||
strlcpy(validate_certs, value, sizeof(validate_certs));
|
||||
cups_validatecerts = validate_certs;
|
||||
}
|
||||
if (cc->any_root < 0)
|
||||
cc->any_root = 1;
|
||||
|
||||
if (cc->encryption == (http_encryption_t)-1)
|
||||
cc->encryption = HTTP_ENCRYPTION_IF_REQUESTED;
|
||||
|
||||
if (cc->expired_certs < 0)
|
||||
cc->expired_certs = 1;
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
else if (!cups_gssservicename && !_cups_strcasecmp(line, "GSSServiceName") &&
|
||||
value)
|
||||
{
|
||||
strlcpy(gss_service_name, value, sizeof(gss_service_name));
|
||||
cups_gssservicename = gss_service_name;
|
||||
}
|
||||
if (!cc->gss_service_name[0])
|
||||
cups_set_gss_service_name(cc, CUPS_DEFAULT_GSSSERVICENAME);
|
||||
#endif /* HAVE_GSSAPI */
|
||||
}
|
||||
|
||||
/*
|
||||
* Set values...
|
||||
*/
|
||||
|
||||
if (cg->encryption == (http_encryption_t)-1 && cups_encryption)
|
||||
{
|
||||
if (!_cups_strcasecmp(cups_encryption, "never"))
|
||||
cg->encryption = HTTP_ENCRYPTION_NEVER;
|
||||
else if (!_cups_strcasecmp(cups_encryption, "always"))
|
||||
cg->encryption = HTTP_ENCRYPTION_ALWAYS;
|
||||
else if (!_cups_strcasecmp(cups_encryption, "required"))
|
||||
cg->encryption = HTTP_ENCRYPTION_REQUIRED;
|
||||
else
|
||||
cg->encryption = HTTP_ENCRYPTION_IF_REQUESTED;
|
||||
}
|
||||
|
||||
if ((!cg->server[0] || !cg->ipp_port) && cups_server)
|
||||
cupsSetServer(cups_server);
|
||||
|
||||
if (!cg->server[0])
|
||||
if (!cc->server_name[0])
|
||||
{
|
||||
#ifdef CUPS_DEFAULT_DOMAINSOCKET
|
||||
/*
|
||||
@@ -1026,106 +1014,278 @@ cups_read_client_conf(
|
||||
struct stat sockinfo; /* Domain socket information */
|
||||
|
||||
if (!stat(CUPS_DEFAULT_DOMAINSOCKET, &sockinfo) &&
|
||||
(sockinfo.st_mode & S_IRWXO) == S_IRWXO)
|
||||
cups_server = CUPS_DEFAULT_DOMAINSOCKET;
|
||||
(sockinfo.st_mode & (S_IROTH | S_IWOTH)) == (S_IROTH | S_IWOTH))
|
||||
cups_set_server_name(cc, CUPS_DEFAULT_DOMAINSOCKET);
|
||||
else
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
cups_server = "localhost";
|
||||
|
||||
cupsSetServer(cups_server);
|
||||
cups_set_server_name(cc, "localhost");
|
||||
}
|
||||
|
||||
if (!cg->ipp_port)
|
||||
if (!cc->user[0])
|
||||
{
|
||||
const char *ipp_port; /* IPP_PORT environment variable */
|
||||
|
||||
if ((ipp_port = getenv("IPP_PORT")) != NULL)
|
||||
{
|
||||
if ((cg->ipp_port = atoi(ipp_port)) <= 0)
|
||||
cg->ipp_port = CUPS_DEFAULT_IPP_PORT;
|
||||
}
|
||||
else
|
||||
cg->ipp_port = CUPS_DEFAULT_IPP_PORT;
|
||||
}
|
||||
|
||||
if (!cg->user[0])
|
||||
{
|
||||
if (cups_user)
|
||||
strlcpy(cg->user, cups_user, sizeof(cg->user));
|
||||
else
|
||||
{
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Get the current user name from the OS...
|
||||
*/
|
||||
/*
|
||||
* Get the current user name from the OS...
|
||||
*/
|
||||
|
||||
DWORD size; /* Size of string */
|
||||
DWORD size; /* Size of string */
|
||||
|
||||
size = sizeof(cg->user);
|
||||
if (!GetUserName(cg->user, &size))
|
||||
size = sizeof(cc->user);
|
||||
if (!GetUserName(cc->user, &size))
|
||||
#else
|
||||
/*
|
||||
* Try the USER environment variable as the default username...
|
||||
*/
|
||||
|
||||
const char *envuser = getenv("USER");
|
||||
/* Default username */
|
||||
struct passwd *pw = NULL; /* Account information */
|
||||
|
||||
if (envuser)
|
||||
{
|
||||
/*
|
||||
* Try the USER environment variable as the default username...
|
||||
* Validate USER matches the current UID, otherwise don't allow it to
|
||||
* override things... This makes sure that printing after doing su
|
||||
* or sudo records the correct username.
|
||||
*/
|
||||
|
||||
const char *envuser = getenv("USER");
|
||||
/* Default username */
|
||||
struct passwd *pw = NULL; /* Account information */
|
||||
if ((pw = getpwnam(envuser)) != NULL && pw->pw_uid != getuid())
|
||||
pw = NULL;
|
||||
}
|
||||
|
||||
if (envuser)
|
||||
{
|
||||
/*
|
||||
* Validate USER matches the current UID, otherwise don't allow it to
|
||||
* override things... This makes sure that printing after doing su or
|
||||
* sudo records the correct username.
|
||||
*/
|
||||
if (!pw)
|
||||
pw = getpwuid(getuid());
|
||||
|
||||
if ((pw = getpwnam(envuser)) != NULL && pw->pw_uid != getuid())
|
||||
pw = NULL;
|
||||
}
|
||||
|
||||
if (!pw)
|
||||
pw = getpwuid(getuid());
|
||||
|
||||
if (pw)
|
||||
strlcpy(cg->user, pw->pw_name, sizeof(cg->user));
|
||||
else
|
||||
if (pw)
|
||||
strlcpy(cc->user, pw->pw_name, sizeof(cc->user));
|
||||
else
|
||||
#endif /* WIN32 */
|
||||
{
|
||||
/*
|
||||
* Use the default "unknown" user name...
|
||||
*/
|
||||
{
|
||||
/*
|
||||
* Use the default "unknown" user name...
|
||||
*/
|
||||
|
||||
strlcpy(cg->user, "unknown", sizeof(cg->user));
|
||||
}
|
||||
strlcpy(cc->user, "unknown", sizeof(cc->user));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (!cups_gssservicename)
|
||||
cups_gssservicename = CUPS_DEFAULT_GSSSERVICENAME;
|
||||
|
||||
strlcpy(cg->gss_service_name, cups_gssservicename,
|
||||
sizeof(cg->gss_service_name));
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
if (cups_anyroot)
|
||||
cg->any_root = !_cups_strcasecmp(cups_anyroot, "yes") ||
|
||||
!_cups_strcasecmp(cups_anyroot, "on") ||
|
||||
!_cups_strcasecmp(cups_anyroot, "true");
|
||||
|
||||
if (cups_expiredcerts)
|
||||
cg->expired_certs = !_cups_strcasecmp(cups_expiredcerts, "yes") ||
|
||||
!_cups_strcasecmp(cups_expiredcerts, "on") ||
|
||||
!_cups_strcasecmp(cups_expiredcerts, "true");
|
||||
|
||||
if (cups_validatecerts)
|
||||
cg->validate_certs = !_cups_strcasecmp(cups_validatecerts, "yes") ||
|
||||
!_cups_strcasecmp(cups_validatecerts, "on") ||
|
||||
!_cups_strcasecmp(cups_validatecerts, "true");
|
||||
if (cc->validate_certs < 0)
|
||||
cc->validate_certs = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usersys.c 11908 2014-06-09 18:57:44Z msweet $".
|
||||
* 'cups_init_client_conf()' - Initialize client.conf values.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_init_client_conf(
|
||||
_cups_client_conf_t *cc) /* I - client.conf values */
|
||||
{
|
||||
/*
|
||||
* Clear all values to "not set"...
|
||||
*/
|
||||
|
||||
memset(cc, 0, sizeof(_cups_client_conf_t));
|
||||
|
||||
cc->encryption = (http_encryption_t)-1;
|
||||
cc->any_root = -1;
|
||||
cc->expired_certs = -1;
|
||||
cc->validate_certs = -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_read_client_conf()' - Read a client.conf file.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_read_client_conf(
|
||||
cups_file_t *fp, /* I - File to read */
|
||||
_cups_client_conf_t *cc) /* I - client.conf values */
|
||||
{
|
||||
int linenum; /* Current line number */
|
||||
char line[1024], /* Line from file */
|
||||
*value; /* Pointer into line */
|
||||
|
||||
|
||||
/*
|
||||
* Read from the file...
|
||||
*/
|
||||
|
||||
linenum = 0;
|
||||
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if (!_cups_strcasecmp(line, "Encryption") && value)
|
||||
cups_set_encryption(cc, value);
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
* The ServerName directive is not supported on OS X due to app
|
||||
* sandboxing restrictions, i.e. not all apps request network access.
|
||||
*/
|
||||
else if (!_cups_strcasecmp(line, "ServerName") && value)
|
||||
cups_set_server_name(cc, value);
|
||||
#endif /* !__APPLE__ */
|
||||
else if (!_cups_strcasecmp(line, "User") && value)
|
||||
cups_set_user(cc, value);
|
||||
else if (!_cups_strcasecmp(line, "AllowAnyRoot") && value)
|
||||
cc->any_root = cups_boolean_value(value);
|
||||
else if (!_cups_strcasecmp(line, "AllowExpiredCerts") &&
|
||||
value)
|
||||
cc->expired_certs = cups_boolean_value(value);
|
||||
else if (!_cups_strcasecmp(line, "ValidateCerts") && value)
|
||||
cc->validate_certs = cups_boolean_value(value);
|
||||
#ifdef HAVE_GSSAPI
|
||||
else if (!_cups_strcasecmp(line, "GSSServiceName") && value)
|
||||
cups_set_gss_service_name(cc, value);
|
||||
#endif /* HAVE_GSSAPI */
|
||||
#ifdef HAVE_SSL
|
||||
else if (!_cups_strcasecmp(line, "SSLOptions") && value)
|
||||
cups_set_ssl_options(cc, value);
|
||||
#endif /* HAVE_SSL */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_default_ipp_port()' - Set the default IPP port value.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_set_default_ipp_port(
|
||||
_cups_globals_t *cg) /* I - Global data */
|
||||
{
|
||||
const char *ipp_port; /* IPP_PORT environment variable */
|
||||
|
||||
|
||||
if ((ipp_port = getenv("IPP_PORT")) != NULL)
|
||||
{
|
||||
if ((cg->ipp_port = atoi(ipp_port)) <= 0)
|
||||
cg->ipp_port = CUPS_DEFAULT_IPP_PORT;
|
||||
}
|
||||
else
|
||||
cg->ipp_port = CUPS_DEFAULT_IPP_PORT;
|
||||
}
|
||||
|
||||
/*
|
||||
* 'cups_set_encryption()' - Set the Encryption value.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_set_encryption(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
if (!_cups_strcasecmp(value, "never"))
|
||||
cc->encryption = HTTP_ENCRYPTION_NEVER;
|
||||
else if (!_cups_strcasecmp(value, "always"))
|
||||
cc->encryption = HTTP_ENCRYPTION_ALWAYS;
|
||||
else if (!_cups_strcasecmp(value, "required"))
|
||||
cc->encryption = HTTP_ENCRYPTION_REQUIRED;
|
||||
else
|
||||
cc->encryption = HTTP_ENCRYPTION_IF_REQUESTED;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_gss_service_name()' - Set the GSSServiceName value.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
static void
|
||||
cups_set_gss_service_name(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
strlcpy(cc->gss_service_name, value, sizeof(cc->gss_service_name));
|
||||
}
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_server_name()' - Set the ServerName value.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_set_server_name(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
strlcpy(cc->server_name, value, sizeof(cc->server_name));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_ssl_options()' - Set the SSLOptions value.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
static void
|
||||
cups_set_ssl_options(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
/*
|
||||
* SSLOptions [AllowRC4] [AllowSSL3] [AllowDH] [DenyTLS1.0] [None]
|
||||
*/
|
||||
|
||||
int options = _HTTP_TLS_NONE; /* SSL/TLS options */
|
||||
char temp[256], /* Copy of value */
|
||||
*start, /* Start of option */
|
||||
*end; /* End of option */
|
||||
|
||||
|
||||
strlcpy(temp, value, sizeof(temp));
|
||||
|
||||
for (start = temp; *start; start = end)
|
||||
{
|
||||
/*
|
||||
* Find end of keyword...
|
||||
*/
|
||||
|
||||
end = start;
|
||||
while (*end && !_cups_isspace(*end))
|
||||
end ++;
|
||||
|
||||
if (*end)
|
||||
*end++ = '\0';
|
||||
|
||||
/*
|
||||
* Compare...
|
||||
*/
|
||||
|
||||
if (!_cups_strcasecmp(start, "AllowRC4"))
|
||||
options |= _HTTP_TLS_ALLOW_RC4;
|
||||
else if (!_cups_strcasecmp(start, "AllowSSL3"))
|
||||
options |= _HTTP_TLS_ALLOW_SSL3;
|
||||
else if (!_cups_strcasecmp(start, "AllowDH"))
|
||||
options |= _HTTP_TLS_ALLOW_DH;
|
||||
else if (!_cups_strcasecmp(start, "DenyTLS1.0"))
|
||||
options |= _HTTP_TLS_DENY_TLS10;
|
||||
else if (!_cups_strcasecmp(start, "None"))
|
||||
options = _HTTP_TLS_NONE;
|
||||
}
|
||||
|
||||
cc->ssl_options = options;
|
||||
|
||||
DEBUG_printf(("4cups_set_ssl_options(cc=%p, value=\"%s\") options=%x", cc, value, options));
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_user()' - Set the User value.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_set_user(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
strlcpy(cc->user, value, sizeof(cc->user));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usersys.c 13030 2016-01-04 14:35:45Z msweet $".
|
||||
*/
|
||||
|
||||
+9
-10
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id: util.c 12073 2014-07-31 00:58:00Z msweet $"
|
||||
* "$Id: util.c 12884 2015-10-07 20:31:46Z msweet $"
|
||||
*
|
||||
* Printing utilities for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -846,10 +846,10 @@ cupsGetPPD3(http_t *http, /* I - HTTP connection or @code CUPS_HTTP_DEFAUL
|
||||
|
||||
snprintf(ppdname, sizeof(ppdname), "%s/ppd/%s.ppd", cg->cups_serverroot,
|
||||
name);
|
||||
if (!stat(ppdname, &ppdinfo))
|
||||
if (!stat(ppdname, &ppdinfo) && !access(ppdname, R_OK))
|
||||
{
|
||||
/*
|
||||
* OK, the file exists, use it!
|
||||
* OK, the file exists and is readable, use it!
|
||||
*/
|
||||
|
||||
if (buffer[0])
|
||||
@@ -1509,7 +1509,7 @@ cups_get_printer_uri(
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requested-attributes", sizeof(requested_attrs) / sizeof(requested_attrs[0]), NULL, requested_attrs);
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", sizeof(requested_attrs) / sizeof(requested_attrs[0]), NULL, requested_attrs);
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
@@ -1528,10 +1528,9 @@ cups_get_printer_uri(
|
||||
}
|
||||
|
||||
if (device_uri &&
|
||||
(!strncmp(device_uri, "ipp://", 6) ||
|
||||
!strncmp(device_uri, "ipps://", 7) ||
|
||||
((strstr(device_uri, "._ipp.") != NULL ||
|
||||
strstr(device_uri, "._ipps.") != NULL) &&
|
||||
(((!strncmp(device_uri, "ipp://", 6) || !strncmp(device_uri, "ipps://", 7)) &&
|
||||
(strstr(device_uri, "/printers/") != NULL || strstr(device_uri, "/classes/") != NULL)) ||
|
||||
((strstr(device_uri, "._ipp.") != NULL || strstr(device_uri, "._ipps.") != NULL) &&
|
||||
!strcmp(device_uri + strlen(device_uri) - 5, "/cups"))))
|
||||
{
|
||||
/*
|
||||
@@ -1655,5 +1654,5 @@ cups_get_printer_uri(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: util.c 12073 2014-07-31 00:58:00Z msweet $".
|
||||
* End of "$Id: util.c 12884 2015-10-07 20:31:46Z msweet $".
|
||||
*/
|
||||
|
||||
+6
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id: versioning.h 11232 2013-08-12 19:33:47Z msweet $"
|
||||
* "$Id: versioning.h 12418 2015-01-22 15:49:23Z msweet $"
|
||||
*
|
||||
* API versioning definitions for CUPS.
|
||||
*
|
||||
@@ -53,6 +53,9 @@
|
||||
# ifndef AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
|
||||
# define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER __attribute__((unavailable))
|
||||
# endif /* !AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER */
|
||||
# ifndef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
|
||||
# define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER __attribute__((unavailable))
|
||||
# endif /* !AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER */
|
||||
# define _CUPS_API_1_1_19 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
# define _CUPS_API_1_1_20 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
# define _CUPS_API_1_1_21 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
@@ -62,7 +65,7 @@
|
||||
# define _CUPS_API_1_5 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
# define _CUPS_API_1_6 AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
|
||||
# define _CUPS_API_1_7 AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER
|
||||
# define _CUPS_API_2_0
|
||||
# define _CUPS_API_2_0 AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER
|
||||
# else
|
||||
# define _CUPS_API_1_1_19
|
||||
# define _CUPS_API_1_1_20
|
||||
@@ -159,5 +162,5 @@
|
||||
#endif /* !_CUPS_VERSIONING_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id: versioning.h 11232 2013-08-12 19:33:47Z msweet $".
|
||||
* End of "$Id: versioning.h 12418 2015-01-22 15:49:23Z msweet $".
|
||||
*/
|
||||
|
||||
+3
-26
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
# "$Id: Makefile 12278 2014-12-01 13:53:56Z msweet $"
|
||||
#
|
||||
# Datafile makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 1993-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -19,17 +19,6 @@ include ../Makedefs
|
||||
# Data files...
|
||||
#
|
||||
|
||||
BANNERS = \
|
||||
classified \
|
||||
confidential \
|
||||
secret \
|
||||
standard \
|
||||
topsecret \
|
||||
unclassified
|
||||
|
||||
DATAFILES = \
|
||||
testprint
|
||||
|
||||
PPDCFILES = \
|
||||
epson.h \
|
||||
font.defs \
|
||||
@@ -87,13 +76,7 @@ install: all install-data install-headers install-libs install-exec
|
||||
|
||||
install-data:
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/banners
|
||||
for file in $(BANNERS); do \
|
||||
$(INSTALL_DATA) $$file $(DATADIR)/banners; \
|
||||
done
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/data
|
||||
for file in $(DATAFILES); do \
|
||||
$(INSTALL_DATA) $$file $(DATADIR)/data; \
|
||||
done
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/model
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/ppdc
|
||||
for file in $(PPDCFILES); do \
|
||||
@@ -128,12 +111,6 @@ install-libs:
|
||||
#
|
||||
|
||||
uninstall:
|
||||
for file in $(BANNERS); do \
|
||||
$(RM) $(DATADIR)/banners/$$file; \
|
||||
done
|
||||
for file in $(DATAFILES); do \
|
||||
$(RM) $(DATADIR)/data/$$file; \
|
||||
done
|
||||
for file in $(PPDCFILES); do \
|
||||
$(RM) $(DATADIR)/ppdc/$$file; \
|
||||
done
|
||||
@@ -146,5 +123,5 @@ uninstall:
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
# End of "$Id: Makefile 12278 2014-12-01 13:53:56Z msweet $".
|
||||
#
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#CUPS-BANNER
|
||||
Show job-id job-name job-originating-user-name job-originating-host-name job-billing
|
||||
Header Classified
|
||||
Footer Classified
|
||||
Image images/cups.png
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#CUPS-BANNER
|
||||
Show job-id job-name job-originating-user-name job-originating-host-name job-billing
|
||||
Header Confidential
|
||||
Footer Confidential
|
||||
Image images/cups.png
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#CUPS-BANNER
|
||||
Show job-id job-name job-originating-user-name job-originating-host-name job-billing
|
||||
Header Secret
|
||||
Footer Secret
|
||||
Image images/cups.png
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#CUPS-BANNER
|
||||
Show job-id job-name job-originating-user-name job-originating-host-name job-billing
|
||||
Header Cover Page
|
||||
Footer Cover Page
|
||||
Image images/cups.png
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#CUPS-BANNER
|
||||
Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area
|
||||
Header Printer Test Page
|
||||
Footer Printer Test Page
|
||||
Notice CUPS @CUPS_VERSION@.
|
||||
Image images/cups.png
|
||||
Image images/color-wheel.png
|
||||
@@ -1,6 +0,0 @@
|
||||
#CUPS-BANNER
|
||||
Show job-id job-name job-originating-user-name job-originating-host-name job-billing
|
||||
Header Top Secret
|
||||
Footer Top Secret
|
||||
Image images/cups.png
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#CUPS-BANNER
|
||||
Show job-id job-name job-originating-user-name job-originating-host-name job-billing
|
||||
Header Unclassified
|
||||
Footer Unclassified
|
||||
Image images/cups.png
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="/cups.css" type="text/css">
|
||||
<link rel="shortcut icon" href="/apple-touch-icon.png" type="image/png">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>Home - CUPS @CUPS_VERSION@@CUPS_REVISION@</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<ul>
|
||||
<li><a href="http://www.cups.org/" target="_blank">CUPS.org</a></li>
|
||||
<li><a class="active" href="/">Home</a></li>
|
||||
<li><a href="/admin">Verwaltung</a></li>
|
||||
<li><a href="/classes/">Klassen</a></li>
|
||||
<li><a href="/help/">Hilfe</a></li>
|
||||
<li><a href="/jobs/">Aufträge</a></li>
|
||||
<li><a href="/printers/">Drucker</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="row">
|
||||
<h1>CUPS 2.0.2</h1>
|
||||
<p>CUPS basiert auf Standards, Open Source Drucksystem entwickelt durch <a href="http://www.apple.com/">Apple Inc.</a> für OS X<sup>®</sup> und andere UNIX<sup>®</sup>-artige Betriebssysteme.</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="thirds">
|
||||
<h2>CUPS für Benutzer</h2>
|
||||
<p><a href="help/overview.html">Überblick über CUPS</a></p>
|
||||
<p><a href="help/options.html">Befehlszeilen-Druck und Optionen</a></p>
|
||||
<p><a href="http://www.cups.org/lists.php?LIST=cups">Benutzerforum</a></p>
|
||||
</div>
|
||||
<div class="thirds">
|
||||
<h2>CUPS für Administratoren</h2>
|
||||
<p><a href="admin">Drucker und Klassen hinzufügen</a></p>
|
||||
<p><a href="help/policies.html">Betriebs-Richtlinie festlegen</a></p>
|
||||
<p><a href="help/network.html">Benutzung von Netzwerk-Druckern</a></p>
|
||||
<p><a href="help/man-cupsd.conf.html">cupsd.conf Referenz</a></p>
|
||||
</div>
|
||||
<div class="thirds">
|
||||
<h2>CUPS für Entwickler</h2>
|
||||
<p><a href="help/api-overview.html">Einführung in die CUPS Programmierung</a></p>
|
||||
<p><a href="help/api-cups.html">CUPS API</a></p>
|
||||
<p><a href="help/api-filter.html">Filter und Backend Programmierung</a></p>
|
||||
<p><a href="help/api-httpipp.html">HTTP und IPP APIs</a></p>
|
||||
<p><a href="http://www.cups.org/lists.php?LIST=cups-devel">Entwicklerforum</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">CUPS und das CUPS Logo sind Warenzeichen der <a href="http://www.apple.com">Apple Inc.</a> Copyright © 2007-2015 Apple Inc. Alle Rechte vorbehalten.</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="/cups.css" type="text/css">
|
||||
<link rel="shortcut icon" href="/apple-touch-icon.png" type="image/png">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>Inicio - CUPS @CUPS_VERSION@@CUPS_REVISION@</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<ul>
|
||||
<li><a href="http://www.cups.org/" target="_blank">CUPS.org</a></li>
|
||||
<li><a class="active" href="/">Inicio</a></li>
|
||||
<li><a href="/admin">Administración</a></li>
|
||||
<li><a href="/classes/">Clases</a></li>
|
||||
<li><a href="/help/">Ayuda</a></li>
|
||||
<li><a href="/jobs/">Trabajos</a></li>
|
||||
<li><a href="/printers/">Impresoras</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="row">
|
||||
<h1>CUPS @CUPS_VERSION@</h1>
|
||||
<p>CUPS es el sistema de impresión de código abierto basado en estándares desarrollado por <a href="http://www.apple.com/">Apple Inc.</a> para OS X<sup>®</sup> y otros sistemas operativos tipo UNIX<sup>®</sup>.</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="thirds">
|
||||
<h2>CUPS para usuarios</h2>
|
||||
<p><a href="help/overview.html">Descripción de CUPS</a></p>
|
||||
<p><a href="help/options.html">Impresión desde la línea de comandos y opciones</a></p>
|
||||
<p><a href="http://www.cups.org/lists.php?LIST=cups">Foro de usuarios</a></p>
|
||||
</div>
|
||||
<div class="thirds">
|
||||
<h2>CUPS para administradores</h2>
|
||||
<p><a href="admin">Añadiendo impresoras y clases</a></p>
|
||||
<p><a href="help/policies.html">Gestionando políticas de funcionamiento</a></p>
|
||||
<p><a href="help/network.html">Usando impresoras de red</a></p>
|
||||
<p><a href="help/man-cupsd.conf.html">Referencia de cupsd.conf</a></p>
|
||||
</div>
|
||||
<div class="thirds">
|
||||
<h2>CUPS para desarrolladores</h2>
|
||||
<p><a href="help/api-overview.html">Introducción a la programación de CUPS</a></p>
|
||||
<p><a href="help/api-cups.html">La API de CUPS</a></p>
|
||||
<p><a href="help/api-filter.html">Programación de filtros y programas de conexión</a></p>
|
||||
<p><a href="help/api-httpipp.html">Las APIs HTTP e IPP</a></p>
|
||||
<p><a href="http://www.cups.org/lists.php?LIST=cups-devel">Foro de desarrollo</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">CUPS y el logo de CUPS son marcas registradas de <a href="http://www.apple.com">Apple Inc.</a> Derechos de autor © 2007-2015 Apple Inc. Todos los derechos reservados.</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -10,8 +10,7 @@
|
||||
|
||||
<P>CUPS supports a variety of printer accounting schemes. Aside from the
|
||||
built-in <A HREF="#QUOTAS">quota</A> and <A HREF="#PAGELOG">page logging</A>
|
||||
support, there are several third-party solutions that can be found on
|
||||
<A HREF="http://www.cups.org/">www.cups.org</A>.</P>
|
||||
support, there are several third-party solutions that can be found online.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="QUOTAS">Quota Support</A></H2>
|
||||
@@ -27,7 +26,7 @@ options determine whether and how quotas are enforced for a printer.
|
||||
The <CODE>job-quota-period</CODE> option determines the time interval for
|
||||
quota tracking. The interval is expressed in seconds, so a day is
|
||||
86,400, a week is 604,800, and a month is 2,592,000 seconds. The
|
||||
<CODE>job-k-limit</CODE> option specifies the job size limit in killobytes. The
|
||||
<CODE>job-k-limit</CODE> option specifies the job size limit in kilobytes. The
|
||||
<CODE>job-page-limit</CODE> option specifies the number of pages limit.</P>
|
||||
|
||||
<P>For quotas to be enforced, the period and at least one of the limits
|
||||
@@ -50,13 +49,7 @@ can be used to easily determine that information.</P>
|
||||
|
||||
<H2 CLASS="title"><A NAME="PAGELOG">Page Logging</A></H2>
|
||||
|
||||
<P>CUPS logs every page that is printed on a system to the
|
||||
<VAR><A HREF="ref-page_log.html">page_log</A></VAR> file. Page logging
|
||||
is only available for drivers that provide page accounting information,
|
||||
typically all PostScript and CUPS raster devices. Raw queues and queues
|
||||
using third-party solutions such as Foomatic generally do not have
|
||||
useful page accounting information available.</P>
|
||||
|
||||
<P>CUPS can log every page that is printed on a system to the <VAR><A HREF="man-cupsd-logs.html">page_log</A></VAR> file. Page logging must be enabled by setting the <CODE>PageLogFormat</CODE> directive in the <VAR><A HREF="man-cupsd.conf.html">cupsd.conf</A></VAR> file and is only available for drivers that provide page accounting information, typically all PostScript and CUPS raster devices. Raw queues and queues using third-party solutions such as Foomatic generally do not have useful page accounting information available.</P>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -2097,7 +2097,7 @@ example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the defaul
|
||||
borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS X 10.10 </span><a name="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
|
||||
<p class="description">Get a destination associated with a URI.</p>
|
||||
<p class="code">
|
||||
<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI (<br>
|
||||
@@ -2525,7 +2525,7 @@ cups_lang_t *cupsLangGet (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Language data</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS X 10.10 </span><a name="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
|
||||
<p class="description">Get the localized string for a destination media
|
||||
size.</p>
|
||||
<p class="code">
|
||||
@@ -3675,6 +3675,8 @@ locale ID.</p>
|
||||
constants</p>
|
||||
<h4 class="constants">Constants</h4>
|
||||
<dl>
|
||||
<dt>CUPS_PRINTER_3D <span class="info"> CUPS 2.1 </span></dt>
|
||||
<dd class="description">3D Printing </dd>
|
||||
<dt>CUPS_PRINTER_AUTHENTICATED <span class="info"> CUPS 1.2/OS X 10.5 </span></dt>
|
||||
<dd class="description">Printer requires authentication
|
||||
</dd>
|
||||
|
||||
@@ -408,6 +408,7 @@ div.contents ul.subcontents li {
|
||||
<li><a href="#COMMUNICATING_FILTER">Communicating with Filters</a></li>
|
||||
<li><a href="#SNMP">Doing SNMP Queries with Network Printers</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#SANDBOXING">Sandboxing on OS X</a></li>
|
||||
<li><a href="#FUNCTIONS">Functions</a><ul class="code">
|
||||
<li><a href="#cupsBackChannelRead" title="Read data from the backchannel.">cupsBackChannelRead</a></li>
|
||||
<li><a href="#cupsBackChannelWrite" title="Write data to the backchannel.">cupsBackChannelWrite</a></li>
|
||||
@@ -442,7 +443,7 @@ div.contents ul.subcontents li {
|
||||
|
||||
Filter and backend programming introduction for CUPS.
|
||||
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
Copyright 2007-2014 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
@@ -520,7 +521,7 @@ directory to write to.</p>
|
||||
|
||||
<p>In addition, some operating systems provide additional security mechanisms
|
||||
that further limit file system access, even for backends running as root. On
|
||||
OS X, for example, no backend may write to a user's home directory.</p>
|
||||
OS X, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on OS X</a> section for more information.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3><a name="SIGNALS">Canceled Jobs and Signal Handling</a></h3>
|
||||
@@ -1291,6 +1292,28 @@ void *my_data;
|
||||
|
||||
<a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
|
||||
</pre>
|
||||
|
||||
<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
|
||||
|
||||
<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
|
||||
|
||||
<ol>
|
||||
|
||||
<li>Reading of files: pursuant to normal UNIX file permissions, filters and backends can read files for the current job from the <var>/private/var/spool/cups</var> directory and other files on mounted filesystems <em>except</em> for user home directories under <var>/Users</var>.</li>
|
||||
|
||||
<li>Writing of files: pursuant to normal UNIX file permissions, filters and backends can read/write files to the cache directory specified by the <code>CUPS_CACHEDIR</code> environment variable, to the state directory specified by the <code>CUPS_STATEDIR</code> environment variable, to the temporary directory specified by the <code>TMPDIR</code> environment variable, and under the <var>/private/var/db</var>, <var>/private/var/folders</var>, <var>/private/var/lib</var>, <var>/private/var/mysql</var>, <var>/private/var/run</var>, <var>/private/var/spool</var> (except <var>/private/var/spool/cups</var>), <var>/Library/Application Support</var>, <var>/Library/Caches</var>, <var>/Library/Logs</var>, <var>/Library/Preferences</var>, <var>/Library/WebServer</var>, and <var>/Users/Shared</var> directories.</li>
|
||||
|
||||
<li>Execution of programs: pursuant to normal UNIX file permissions, filters and backends can execute any program not located under the <var>/Users</var> directory. Child processes inherit the sandbox and are subject to the same restrictions as the parent.</li>
|
||||
|
||||
<li>Bluetooth and USB: backends can access Bluetooth and USB printers through IOKit. <em>Filters cannot access Bluetooth and USB printers directly.</em></li>
|
||||
|
||||
<li>Network: filters and backends can access UNIX domain sockets under the <var>/private/tmp</var>, <var>/private/var/run</var>, and <var>/private/var/tmp</var> directories. Backends can also create IPv4 and IPv6 TCP (outgoing) and UDP (incoming and outgoing) socket, and bind to local source ports. <em>Filters cannot directly create IPv4 and IPv6 TCP or UDP sockets.</em></li>
|
||||
|
||||
<li>Notifications: filters and backends can send notifications via the Darwin <code>notify_post()</code> API.</li>
|
||||
|
||||
</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>
|
||||
<h2 class="title"><a name="FUNCTIONS">Functions</a></h2>
|
||||
<h3 class="function"><span class="info"> CUPS 1.2/OS X 10.5 </span><a name="cupsBackChannelRead">cupsBackChannelRead</a></h3>
|
||||
<p class="description">Read data from the backchannel.</p>
|
||||
|
||||
+96
-22
@@ -1490,7 +1490,7 @@ int httpAddrAny (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">1 if "any", 0 otherwise</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpAddrClose">httpAddrClose</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpAddrClose">httpAddrClose</a></h3>
|
||||
<p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
|
||||
<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
|
||||
<p class="code">
|
||||
@@ -1820,7 +1820,7 @@ void httpClose (<br>
|
||||
<dt>http</dt>
|
||||
<dd class="description">HTTP connection</dd>
|
||||
</dl>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpCompareCredentials">httpCompareCredentials</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpCompareCredentials">httpCompareCredentials</a></h3>
|
||||
<p class="description">Compare two sets of X.509 credentials.</p>
|
||||
<p class="code">
|
||||
int httpCompareCredentials (<br>
|
||||
@@ -2107,7 +2107,7 @@ int httpGet (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Status of call (0 = success)</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpGetActivity">httpGetActivity</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpGetActivity">httpGetActivity</a></h3>
|
||||
<p class="description">Get the most recent activity for a connection.</p>
|
||||
<p class="code">
|
||||
time_t httpGetActivity (<br>
|
||||
@@ -2124,7 +2124,7 @@ time_t httpGetActivity (<br>
|
||||
<p class="discussion">The return value is the UNIX time of the last read or write.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpGetAddress">httpGetAddress</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpGetAddress">httpGetAddress</a></h3>
|
||||
<p class="description">Get the address of the connected peer of a connection.</p>
|
||||
<p class="code">
|
||||
<a href="#http_addr_t">http_addr_t</a> *httpGetAddress (<br>
|
||||
@@ -2206,7 +2206,7 @@ const char *httpGetCookie (<br>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<dl>
|
||||
<dt>http</dt>
|
||||
<dd class="description">HTTP connecion</dd>
|
||||
<dd class="description">HTTP connection</dd>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Cookie data or NULL</p>
|
||||
@@ -2255,7 +2255,7 @@ time_t httpGetDateTime (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">UNIX time</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpGetEncryption">httpGetEncryption</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpGetEncryption">httpGetEncryption</a></h3>
|
||||
<p class="description">Get the current encryption mode of a connection.</p>
|
||||
<p class="code">
|
||||
<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption (<br>
|
||||
@@ -2362,7 +2362,7 @@ Otherwise, return the FQDN for the local system using both gethostname()
|
||||
and gethostbyname() to get the local hostname with domain.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpGetKeepAlive">httpGetKeepAlive</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpGetKeepAlive">httpGetKeepAlive</a></h3>
|
||||
<p class="description">Get the current Keep-Alive state of the connection.</p>
|
||||
<p class="code">
|
||||
<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive (<br>
|
||||
@@ -2413,7 +2413,7 @@ off_t httpGetLength2 (<br>
|
||||
content larger than 2^31 - 1.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpGetPending">httpGetPending</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpGetPending">httpGetPending</a></h3>
|
||||
<p class="description">Get the number of bytes that are buffered for writing.</p>
|
||||
<p class="code">
|
||||
size_t httpGetPending (<br>
|
||||
@@ -2426,7 +2426,7 @@ size_t httpGetPending (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Number of bytes buffered</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpGetReady">httpGetReady</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpGetReady">httpGetReady</a></h3>
|
||||
<p class="description">Get the number of bytes that can be read without blocking.</p>
|
||||
<p class="code">
|
||||
size_t httpGetReady (<br>
|
||||
@@ -2439,7 +2439,7 @@ size_t httpGetReady (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Number of bytes available</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpGetRemaining">httpGetRemaining</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpGetRemaining">httpGetRemaining</a></h3>
|
||||
<p class="description">Get the number of remaining bytes in the message
|
||||
body or current chunk.</p>
|
||||
<p class="code">
|
||||
@@ -2584,7 +2584,7 @@ int httpHead (<br>
|
||||
default HTTP proxy (if any).</p>
|
||||
<p class="code">
|
||||
void httpInitialize (void);</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpIsChunked">httpIsChunked</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpIsChunked">httpIsChunked</a></h3>
|
||||
<p class="description">Report whether a message body is chunked.</p>
|
||||
<p class="code">
|
||||
int httpIsChunked (<br>
|
||||
@@ -2602,7 +2602,7 @@ int httpIsChunked (<br>
|
||||
variable-length chunks.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpIsEncrypted">httpIsEncrypted</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpIsEncrypted">httpIsEncrypted</a></h3>
|
||||
<p class="description">Report whether a connection is encrypted.</p>
|
||||
<p class="code">
|
||||
int httpIsEncrypted (<br>
|
||||
@@ -2856,7 +2856,7 @@ int httpReconnect2 (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, non-zero on failure</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpResolveHostname">httpResolveHostname</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpResolveHostname">httpResolveHostname</a></h3>
|
||||
<p class="description">Resolve the hostname of the HTTP connection
|
||||
address.</p>
|
||||
<p class="code">
|
||||
@@ -3109,7 +3109,7 @@ void httpSetField (<br>
|
||||
<dt>value</dt>
|
||||
<dd class="description">Value</dd>
|
||||
</dl>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpSetKeepAlive">httpSetKeepAlive</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpSetKeepAlive">httpSetKeepAlive</a></h3>
|
||||
<p class="description">Set the current Keep-Alive state of a connection.</p>
|
||||
<p class="code">
|
||||
void httpSetKeepAlive (<br>
|
||||
@@ -3163,7 +3163,7 @@ must be greater than 0</dd>
|
||||
data pointer and must return 1 to continue or 0 to error (time) out.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpShutdown">httpShutdown</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpShutdown">httpShutdown</a></h3>
|
||||
<p class="description">Shutdown one side of an HTTP connection.</p>
|
||||
<p class="code">
|
||||
void httpShutdown (<br>
|
||||
@@ -3174,7 +3174,7 @@ void httpShutdown (<br>
|
||||
<dt>http</dt>
|
||||
<dd class="description">HTTP connection</dd>
|
||||
</dl>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpStateString">httpStateString</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpStateString">httpStateString</a></h3>
|
||||
<p class="description">Return the string describing a HTTP state value.</p>
|
||||
<p class="code">
|
||||
const char *httpStateString (<br>
|
||||
@@ -3219,7 +3219,7 @@ int httpTrace (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Status of call (0 = success)</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="httpURIStatusString">httpURIStatusString</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="httpURIStatusString">httpURIStatusString</a></h3>
|
||||
<p class="description">Return a string describing a URI status code.</p>
|
||||
<p class="code">
|
||||
const char *httpURIStatusString (<br>
|
||||
@@ -4140,7 +4140,7 @@ int ippCopyAttributes (<br>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">1 on success, 0 on error</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">Zero or more attributes are copied from the source IPP message, @code@ src, to the
|
||||
<p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
|
||||
destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a "shallow"
|
||||
reference copy of the attribute is created - this should only be done as long as the
|
||||
original source IPP message will not be freed for the life of the destination.<br>
|
||||
@@ -5393,7 +5393,7 @@ the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ip
|
||||
The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0 </span><a name="ippStateString">ippStateString</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="ippStateString">ippStateString</a></h3>
|
||||
<p class="description">Return the name corresponding to a state value.</p>
|
||||
<p class="code">
|
||||
const char *ippStateString (<br>
|
||||
@@ -5616,7 +5616,7 @@ typedef struct _http_s http_t;
|
||||
<p class="code">
|
||||
typedef int (*http_timeout_cb_t)(<a href="#http_t">http_t</a> *http, void *user_data);
|
||||
</p>
|
||||
<h3 class="typedef"><span class="info"> CUPS 2.0 </span><a name="http_trust_t">http_trust_t</a></h3>
|
||||
<h3 class="typedef"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="http_trust_t">http_trust_t</a></h3>
|
||||
<p class="description">Level of trust for credentials </p>
|
||||
<p class="code">
|
||||
typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
|
||||
@@ -5984,7 +5984,7 @@ are server-oriented...</p>
|
||||
<dt>HTTP_STATUS_OK </dt>
|
||||
<dd class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</dd>
|
||||
<dt>HTTP_STATUS_PARTIAL_CONTENT </dt>
|
||||
<dd class="description">Only a partial file was recieved/sent</dd>
|
||||
<dd class="description">Only a partial file was received/sent</dd>
|
||||
<dt>HTTP_STATUS_PAYMENT_REQUIRED </dt>
|
||||
<dd class="description">Payment required</dd>
|
||||
<dt>HTTP_STATUS_PRECONDITION </dt>
|
||||
@@ -6018,7 +6018,7 @@ are server-oriented...</p>
|
||||
<dt>HTTP_STATUS_USE_PROXY </dt>
|
||||
<dd class="description">Must use a proxy to access this URI</dd>
|
||||
</dl>
|
||||
<h3 class="enumeration"><span class="info"> CUPS 2.0 </span><a name="http_trust_e">http_trust_e</a></h3>
|
||||
<h3 class="enumeration"><span class="info"> CUPS 2.0/OS 10.10 </span><a name="http_trust_e">http_trust_e</a></h3>
|
||||
<p class="description">Level of trust for credentials </p>
|
||||
<h4 class="constants">Constants</h4>
|
||||
<dl>
|
||||
@@ -6331,6 +6331,18 @@ are server-oriented...</p>
|
||||
<p class="description">IPP operations</p>
|
||||
<h4 class="constants">Constants</h4>
|
||||
<dl>
|
||||
<dt>IPP_OP_ACKNOWLEDGE_DOCUMENT </dt>
|
||||
<dd class="description">Acknowledge-Document</dd>
|
||||
<dt>IPP_OP_ACKNOWLEDGE_IDENTIFY_PRINTER </dt>
|
||||
<dd class="description">Acknowledge-Identify-Printer</dd>
|
||||
<dt>IPP_OP_ACKNOWLEDGE_JOB </dt>
|
||||
<dd class="description">Acknowledge-Job</dd>
|
||||
<dt>IPP_OP_ACTIVATE_PRINTER </dt>
|
||||
<dd class="description">Start a printer</dd>
|
||||
<dt>IPP_OP_CANCEL_CURRENT_JOB </dt>
|
||||
<dd class="description">Cancel the current job</dd>
|
||||
<dt>IPP_OP_CANCEL_DOCUMENT </dt>
|
||||
<dd class="description">Cancel-Document</dd>
|
||||
<dt>IPP_OP_CANCEL_JOB </dt>
|
||||
<dd class="description">Cancel a job</dd>
|
||||
<dt>IPP_OP_CANCEL_JOBS </dt>
|
||||
@@ -6381,16 +6393,34 @@ are server-oriented...</p>
|
||||
<dd class="description">Reject new jobs on a printer</dd>
|
||||
<dt>IPP_OP_CUPS_SET_DEFAULT </dt>
|
||||
<dd class="description">Set the default printer</dd>
|
||||
<dt>IPP_OP_DEACTIVATE_PRINTER </dt>
|
||||
<dd class="description">Stop a printer</dd>
|
||||
<dt>IPP_OP_DELETE_DOCUMENT </dt>
|
||||
<dd class="description">Delete-Document</dd>
|
||||
<dt>IPP_OP_DEREGISTER_OUTPUT_DEVICE </dt>
|
||||
<dd class="description">Deregister-Output-Device</dd>
|
||||
<dt>IPP_OP_DISABLE_PRINTER </dt>
|
||||
<dd class="description">Stop a printer</dd>
|
||||
<dt>IPP_OP_ENABLE_PRINTER </dt>
|
||||
<dd class="description">Start a printer</dd>
|
||||
<dt>IPP_OP_FETCH_DOCUMENT </dt>
|
||||
<dd class="description">Fetch-Document</dd>
|
||||
<dt>IPP_OP_FETCH_JOB </dt>
|
||||
<dd class="description">Fetch-Job</dd>
|
||||
<dt>IPP_OP_GET_DOCUMENTS </dt>
|
||||
<dd class="description">Get-Documents</dd>
|
||||
<dt>IPP_OP_GET_DOCUMENT_ATTRIBUTES </dt>
|
||||
<dd class="description">Get-Document-Attributes</dd>
|
||||
<dt>IPP_OP_GET_JOBS </dt>
|
||||
<dd class="description">Get a list of jobs</dd>
|
||||
<dt>IPP_OP_GET_JOB_ATTRIBUTES </dt>
|
||||
<dd class="description">Get job attributes</dd>
|
||||
<dt>IPP_OP_GET_NEXT_DOCUMENT_DATA </dt>
|
||||
<dd class="description">Get-Next-Document-Data</dd>
|
||||
<dt>IPP_OP_GET_NOTIFICATIONS <span class="info"> CUPS 1.2/OS X 10.5 </span></dt>
|
||||
<dd class="description">Get notification events </dd>
|
||||
<dt>IPP_OP_GET_OUTPUT_DEVICE_ATTRIBUTES </dt>
|
||||
<dd class="description">Get-Output-Device-Attributes</dd>
|
||||
<dt>IPP_OP_GET_PRINTER_ATTRIBUTES </dt>
|
||||
<dd class="description">Get printer attributes</dd>
|
||||
<dt>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </dt>
|
||||
@@ -6401,26 +6431,70 @@ are server-oriented...</p>
|
||||
<dd class="description">Get subscription attributes </dd>
|
||||
<dt>IPP_OP_HOLD_JOB </dt>
|
||||
<dd class="description">Hold a job for printing</dd>
|
||||
<dt>IPP_OP_HOLD_NEW_JOBS </dt>
|
||||
<dd class="description">Hold new jobs</dd>
|
||||
<dt>IPP_OP_IDENTIFY_PRINTER </dt>
|
||||
<dd class="description">Identify-Printer</dd>
|
||||
<dt>IPP_OP_PAUSE_PRINTER </dt>
|
||||
<dd class="description">Stop a printer</dd>
|
||||
<dt>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </dt>
|
||||
<dd class="description">Stop printer after the current job</dd>
|
||||
<dt>IPP_OP_PRINT_JOB </dt>
|
||||
<dd class="description">Print a single file</dd>
|
||||
<dt>IPP_OP_PRINT_URI </dt>
|
||||
<dd class="description">Print a single URL</dd>
|
||||
<dt>IPP_OP_PROMOTE_JOB </dt>
|
||||
<dd class="description">Promote a job to print sooner</dd>
|
||||
<dt>IPP_OP_PURGE_JOBS </dt>
|
||||
<dd class="description">Cancel all jobs</dd>
|
||||
<dt>IPP_OP_RELEASE_HELD_NEW_JOBS </dt>
|
||||
<dd class="description">Release new jobs</dd>
|
||||
<dt>IPP_OP_RELEASE_JOB </dt>
|
||||
<dd class="description">Release a job for printing</dd>
|
||||
<dt>IPP_OP_RENEW_SUBSCRIPTION <span class="info"> CUPS 1.2/OS X 10.5 </span></dt>
|
||||
<dd class="description">Renew a printer subscription </dd>
|
||||
<dt>IPP_OP_REPROCESS_JOB </dt>
|
||||
<dd class="description">Reprint a job</dd>
|
||||
<dt>IPP_OP_RESTART_JOB </dt>
|
||||
<dd class="description">Reprint a job</dd>
|
||||
<dt>IPP_OP_RESTART_PRINTER </dt>
|
||||
<dd class="description">Restart a printer</dd>
|
||||
<dt>IPP_OP_RESUBMIT_JOB </dt>
|
||||
<dd class="description">Resubmit-Job</dd>
|
||||
<dt>IPP_OP_RESUME_JOB </dt>
|
||||
<dd class="description">Resume the current job</dd>
|
||||
<dt>IPP_OP_RESUME_PRINTER </dt>
|
||||
<dd class="description">Start a printer</dd>
|
||||
<dt>IPP_OP_SCHEDULE_JOB_AFTER </dt>
|
||||
<dd class="description">Schedule a job to print after another</dd>
|
||||
<dt>IPP_OP_SEND_DOCUMENT </dt>
|
||||
<dd class="description">Add a file to a job</dd>
|
||||
<dt>IPP_OP_SEND_HARDCOPY_DOCUMENT </dt>
|
||||
<dd class="description">Send-Hardcopy-Document</dd>
|
||||
<dt>IPP_OP_SEND_URI </dt>
|
||||
<dd class="description">Add a URL to a job</dd>
|
||||
<dt>IPP_OP_SET_DOCUMENT_ATTRIBUTES </dt>
|
||||
<dd class="description">Set-Document-Attributes</dd>
|
||||
<dt>IPP_OP_SET_JOB_ATTRIBUTES </dt>
|
||||
<dd class="description">Set job attributes</dd>
|
||||
<dt>IPP_OP_SET_PRINTER_ATTRIBUTES </dt>
|
||||
<dd class="description">Set printer attributes</dd>
|
||||
<dt>IPP_OP_SHUTDOWN_PRINTER </dt>
|
||||
<dd class="description">Turn a printer off</dd>
|
||||
<dt>IPP_OP_STARTUP_PRINTER </dt>
|
||||
<dd class="description">Turn a printer on</dd>
|
||||
<dt>IPP_OP_SUSPEND_CURRENT_JOB </dt>
|
||||
<dd class="description">Suspend the current job</dd>
|
||||
<dt>IPP_OP_UPDATE_ACTIVE_JOBS </dt>
|
||||
<dd class="description">Update-Active-Jobs</dd>
|
||||
<dt>IPP_OP_UPDATE_DOCUMENT_STATUS </dt>
|
||||
<dd class="description">Update-Document-Status</dd>
|
||||
<dt>IPP_OP_UPDATE_JOB_STATUS </dt>
|
||||
<dd class="description">Update-Job-Status</dd>
|
||||
<dt>IPP_OP_UPDATE_OUTPUT_DEVICE_ATTRIBUTES </dt>
|
||||
<dd class="description">Update-Output-Device-Attributes</dd>
|
||||
<dt>IPP_OP_VALIDATE_DOCUMENT </dt>
|
||||
<dd class="description">Validate-Document</dd>
|
||||
<dt>IPP_OP_VALIDATE_JOB </dt>
|
||||
<dd class="description">Validate job options</dd>
|
||||
</dl>
|
||||
|
||||
@@ -416,7 +416,7 @@ marked option choices.">ppdConflicts</a></li>
|
||||
<li><a href="#ppdEmitJCL" title="Emit code for JCL options to a file.">ppdEmitJCL</a></li>
|
||||
<li><a href="#ppdEmitJCLEnd" title="Emit JCLEnd code to a file.">ppdEmitJCLEnd</a></li>
|
||||
<li><a href="#ppdEmitString" title="Get a string containing the code for marked options.">ppdEmitString</a></li>
|
||||
<li><a href="#ppdErrorString" title="Returns the text assocated with a status.">ppdErrorString</a></li>
|
||||
<li><a href="#ppdErrorString" title="Returns the text associated with a status.">ppdErrorString</a></li>
|
||||
<li><a href="#ppdFindAttr" title="Find the first matching attribute.">ppdFindAttr</a></li>
|
||||
<li><a href="#ppdFindChoice" title="Return a pointer to an option choice.">ppdFindChoice</a></li>
|
||||
<li><a href="#ppdFindCustomOption" title="Find a custom option.">ppdFindCustomOption</a></li>
|
||||
@@ -1051,7 +1051,7 @@ The return string is allocated on the heap and should be freed using
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 1.1.19/OS X 10.3 </span><a name="ppdErrorString">ppdErrorString</a></h3>
|
||||
<p class="description">Returns the text assocated with a status.</p>
|
||||
<p class="description">Returns the text associated with a status.</p>
|
||||
<p class="code">
|
||||
const char *ppdErrorString (<br>
|
||||
<a href="#ppd_status_t">ppd_status_t</a> status<br>
|
||||
|
||||
+2
-6
@@ -63,8 +63,7 @@ application/x-httpd-php php
|
||||
application/x-httpd-python py
|
||||
</PRE>
|
||||
|
||||
<P>CGI scripts/programs (application/x-httpd-cgi) also must have execution
|
||||
permissions to be treated as a CGI script or program.</P>
|
||||
<P>CGI scripts/programs (application/x-httpd-cgi) also must be owned by root, have execution permissions, and not have world or group write permissions to be treated as a CGI script or program.</P>
|
||||
|
||||
<H2><A NAME="LIMITS">Limitations</A></H2>
|
||||
|
||||
@@ -75,10 +74,7 @@ following exceptions:</P>
|
||||
|
||||
<LI>No PATH_INFO or PATH_TRANSLATED support</LI>
|
||||
|
||||
<LI>Limited HTTP field support; only the Content-Length
|
||||
(CONTENT_LENGTH), Cookie (HTTP_COOKIE), and User-Agent
|
||||
(HTTP_USER_AGENT) fields are placed in environment
|
||||
variables at this time</LI>
|
||||
<LI>Limited HTTP field support; only the Content-Length (CONTENT_LENGTH), Content-Type (CONTENT_TYPE), Cookie (HTTP_COOKIE), Referrer (HTTP_REFERRER), and User-Agent (HTTP_USER_AGENT) fields are placed in environment variables at this time</LI>
|
||||
|
||||
</UL>
|
||||
|
||||
|
||||
@@ -66,9 +66,6 @@
|
||||
|
||||
<DL>
|
||||
|
||||
<DT>HP-GL
|
||||
<DD>Hewlett-Packard Graphics Language
|
||||
|
||||
<DT>HP-PCL
|
||||
<DD>Hewlett-Packard Page Control Language
|
||||
|
||||
@@ -161,6 +158,9 @@
|
||||
<DT>PPD
|
||||
<DD>PostScript Printer Description
|
||||
|
||||
<DT>PWG
|
||||
<DD>Printer Working Group
|
||||
|
||||
</DL>
|
||||
|
||||
|
||||
@@ -168,9 +168,6 @@
|
||||
|
||||
<DL>
|
||||
|
||||
<DT>SCSI
|
||||
<DD>Small Computer Systems Interface
|
||||
|
||||
<DT>serial
|
||||
<DD>Sending or receiving data 1 bit at a time
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ DNS server(s).</li>
|
||||
server(s).</li>
|
||||
</ol></li>
|
||||
|
||||
<li>A "host" Service Granting Ticket (SGT) for every CUPS server</li>
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
@@ -62,7 +60,7 @@ DNS server(s).</li>
|
||||
|
||||
<H2 CLASS="title"><A NAME="CUPS">Configuring CUPS to Use Kerberos</A></H2>
|
||||
|
||||
<P>Once youhave configured Kerberos on your system(s), you can then enable Kerberos authentication by selecting the <tt>Negotiate</tt> authentication type. The simplest way to do this is using the <tt>cupsctl(8)</tt> command on your server(s):</P>
|
||||
<P>Once you have configured Kerberos on your system(s), you can then enable Kerberos authentication by selecting the <tt>Negotiate</tt> authentication type. The simplest way to do this is using the <tt>cupsctl(8)</tt> command on your server(s):</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
<KBD>cupsctl DefaultAuthType=Negotiate</KBD>
|
||||
@@ -83,7 +81,7 @@ http://server.example.com:631/admin
|
||||
|
||||
<P>When doing printing tasks that require authentication, CUPS requests single-use "tickets" from your login session to authenticate who you are. These tickets give CUPS a username of the form "user@REALM", which is then converted to just "user" for purposes of user and group checks.</P>
|
||||
|
||||
<P>In order to support printing to a shared printer, CUPS runs the IPP backend as the owner of the print job so it can obtain the necessary credentials.</P>
|
||||
<P>In order to support printing to a shared printer, CUPS runs the IPP backend as the owner of the print job so it can obtain the necessary credentials when the job is de-spooled to the server.</P>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário