mirror of
https://github.com/darlinghq/darling-cups.git
synced 2024-11-23 04:19:48 +00:00
Update Source To cups-494.1
This commit is contained in:
parent
3842d8ac51
commit
45c7ff55c0
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
/*.html
|
||||
/cups.roots
|
||||
|
||||
*.log
|
35
Makefile
35
Makefile
@ -17,13 +17,15 @@ include $(MAKEFILEPATH)/CoreOS/ReleaseControl/GNUSource.make
|
||||
ifeq ($(RC_MACOS),YES)
|
||||
CUPS_Components=all
|
||||
GSSAPI_Options=--enable-gssapi
|
||||
CUPS_StaticLibrary=NO
|
||||
else
|
||||
CUPS_Components=libcupslite
|
||||
GSSAPI_Options=--disable-gssapi
|
||||
CUPS_StaticLibrary=YES
|
||||
endif
|
||||
|
||||
Configure_Flags = `$(SRCROOT)/gettargetflags.sh host` \
|
||||
--with-cups-build="cups-483.2" \
|
||||
--with-cups-build="cups-494.1" \
|
||||
--with-adminkey="system.print.admin" \
|
||||
--with-operkey="system.print.operator" \
|
||||
--with-pam-module=opendirectory \
|
||||
@ -32,6 +34,10 @@ Configure_Flags = `$(SRCROOT)/gettargetflags.sh host` \
|
||||
$(GSSAPI_Options) \
|
||||
$(Extra_Configure_Flags)
|
||||
|
||||
ifeq ($(CUPS_StaticLibrary),YES)
|
||||
Configure_Flags += --enable-static --disable-shared --prefix=/usr/local/
|
||||
endif
|
||||
|
||||
# Add "--enable-debug-guards" during OS development, remove for production...
|
||||
# --enable-debug-guards \
|
||||
|
||||
@ -39,13 +45,16 @@ Configure_Flags = `$(SRCROOT)/gettargetflags.sh host` \
|
||||
# compiler flags in make, just in configure...
|
||||
Environment = CC=`/usr/bin/xcrun --find clang` \
|
||||
CXX=`/usr/bin/xcrun --find clang++` \
|
||||
CFLAGS="`$(SRCROOT)/gettargetflags.sh cflags`" \
|
||||
CFLAGS="-g `$(SRCROOT)/gettargetflags.sh cflags`" \
|
||||
CPPFLAGS="`$(SRCROOT)/gettargetflags.sh cppflags`" \
|
||||
CXXFLAGS="`$(SRCROOT)/gettargetflags.sh cxxflags`" \
|
||||
DSOFLAGS="`$(SRCROOT)/gettargetflags.sh dsoflags` -dynamiclib -single_module -lc" \
|
||||
LDFLAGS="`$(SRCROOT)/gettargetflags.sh ldflags`" \
|
||||
CODE_SIGN="/usr/bin/true"
|
||||
|
||||
ifneq ($(CUPS_StaticLibrary),YES)
|
||||
Environment += DSOFLAGS="`$(SRCROOT)/gettargetflags.sh dsoflags` -dynamiclib -single_module -lc"
|
||||
endif
|
||||
|
||||
# The default target installs programs and data files...
|
||||
Install_Target = install-data install-exec
|
||||
Install_Flags = -j`sysctl -n hw.activecpu`
|
||||
@ -93,6 +102,7 @@ install-all: configure
|
||||
# Install the libraries and headers.
|
||||
install-libs: configure
|
||||
$(_v) umask $(Install_Mask) ; $(MAKE) -C $(BuildDirectory) $(Environment) $(Install_Flags) install-headers install-libs
|
||||
$(_v) /usr/bin/codesign --force --sign - --entitlements $(SRCROOT)/usb-darwin.entitlements $(DSTROOT)/usr/libexec/cups/backend/usb
|
||||
|
||||
|
||||
# The plist keeps track of the open source version we ship...
|
||||
@ -107,7 +117,10 @@ install-plist:
|
||||
|
||||
|
||||
# InstallAPI stuff...
|
||||
# Doesn't apply when building libcups for ios
|
||||
ifneq ($(CUPS_StaticLibrary),YES)
|
||||
SUPPORTS_TEXT_BASED_API ?= YES
|
||||
|
||||
$(info SUPPORTS_TEXT_BASED_API=$(SUPPORTS_TEXT_BASED_API))
|
||||
|
||||
ifeq ($(SUPPORTS_TEXT_BASED_API),YES)
|
||||
@ -126,6 +139,7 @@ TAPI_COMMON_OPTS = `$(SRCROOT)/gettargetflags.sh tapi` \
|
||||
TAPI_VERIFY_OPTS = $(TAPI_COMMON_OPTS) \
|
||||
--verify-mode=Pedantic \
|
||||
--verify-against=$(TAPI_LIBRARY_PATH)/libcups.2.dylib
|
||||
endif
|
||||
|
||||
installapi: configure
|
||||
@echo
|
||||
@ -134,20 +148,15 @@ installapi: configure
|
||||
@echo ++++++++++++++++++++++
|
||||
@echo
|
||||
$(_v) umask $(Install_Mask) ; $(MAKE) -C $(BuildDirectory) $(Environment) $(Install_Flags) libs install-headers
|
||||
|
||||
@if [ "$(SUPPORTS_TEXT_BASED_API)" != "YES" ]; then \
|
||||
echo "installapi was requested, but SUPPORTS_TEXT_BASED_API has been disabled."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
ifneq ($(CUPS_StaticLibrary),YES)
|
||||
xcrun --sdk $(SDKROOT) tapi installapi $(TAPI_COMMON_OPTS) $(TAPI_INSTALL_PREFIX)
|
||||
$(_v) umask $(Install_Mask) ; $(MAKE) $(Environment) $(Install_Flags) install-tbds
|
||||
endif
|
||||
|
||||
install-tbds:
|
||||
if test -f $(OBJROOT)/cups/libcupsimage.2.dylib; then \
|
||||
xcrun --sdk $(SDKROOT) tapi stubify --set-installapi-flag $(OBJROOT)/cups/libcupsimage.2.dylib; \
|
||||
fi
|
||||
|
||||
$(_v) umask $(Install_Mask) ; $(MAKE) $(Environment) $(Install_Flags) install-tbds
|
||||
|
||||
install-tbds:
|
||||
$(INSTALL) -d -m 0755 $(TAPI_LIBRARY_PATH)
|
||||
$(INSTALL) -c -m 0755 $(OBJROOT)/cups/libcups.2.tbd $(TAPI_LIBRARY_PATH)
|
||||
ln -s libcups.2.tbd $(TAPI_LIBRARY_PATH)/libcups.tbd
|
||||
|
@ -4,7 +4,7 @@
|
||||
<array>
|
||||
<dict>
|
||||
<key>OpenSourceImportDate</key>
|
||||
<string>2019-07-16</string>
|
||||
<string>2020-04-29</string>
|
||||
<key>OpenSourceLicense</key>
|
||||
<string>ASL2</string>
|
||||
<key>OpenSourceLicenseFile</key>
|
||||
@ -19,9 +19,9 @@
|
||||
<key>OpenSourceURL</key>
|
||||
<string>https://github.com/apple/cups/releases</string>
|
||||
<key>OpenSourceVersion</key>
|
||||
<string>2.3.0</string>
|
||||
<string>2.3.3</string>
|
||||
<key>OpenSourceRevision</key>
|
||||
<string>6647894889968030cfe8f567fb3a9ab410d8f1ea</string>
|
||||
<string>82e3ee0e3230287b76a76fb8f16b92ca6e50b444</string>
|
||||
<key>OpenSourceWebsiteURL</key>
|
||||
<string>https://www.cups.org/</string>
|
||||
</dict>
|
||||
|
5
cups/.gitattributes
vendored
5
cups/.gitattributes
vendored
@ -1,5 +0,0 @@
|
||||
.git* export-ignore
|
||||
.mailmap export-ignore
|
||||
examples/testfile.pcl -text
|
||||
exampels/testfile.txt -text
|
||||
scripts export-ignore
|
163
cups/.gitignore
vendored
163
cups/.gitignore
vendored
@ -1,163 +0,0 @@
|
||||
*.a
|
||||
*.bck
|
||||
*.cgi
|
||||
*.o
|
||||
autom4te.cache
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
cups-config
|
||||
Makedefs
|
||||
backend/dnssd
|
||||
backend/http
|
||||
backend/https
|
||||
backend/ipp
|
||||
backend/ipps
|
||||
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/libcups.dylib
|
||||
cups/libcups.2.dylib
|
||||
cups/libcups.so
|
||||
cups/libcups.so.2
|
||||
cups/libcupsimage.dylib
|
||||
cups/libcupsimage.2.dylib
|
||||
cups/libcupsimage.so
|
||||
cups/libcupsimage.so.2
|
||||
cups/locale/
|
||||
cups/rasterbench
|
||||
cups/test.pwg
|
||||
cups/test.raster
|
||||
cups/testadmin
|
||||
cups/testarray
|
||||
cups/testcache
|
||||
cups/testclient
|
||||
cups/testconflicts
|
||||
cups/testcreds
|
||||
cups/testcups
|
||||
cups/testdest
|
||||
cups/testfile
|
||||
cups/testgetdests
|
||||
cups/testhttp
|
||||
cups/testi18n
|
||||
cups/testipp
|
||||
cups/testlang
|
||||
cups/testoptions
|
||||
cups/testppd
|
||||
cups/testpwg
|
||||
cups/testraster
|
||||
cups/testsnmp
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
doc/*/index.html
|
||||
filter/commandtops
|
||||
filter/gziptoany
|
||||
filter/pstops
|
||||
filter/rastertoepson
|
||||
filter/rastertohp
|
||||
filter/rastertolabel
|
||||
filter/rastertopwg
|
||||
locale/checkpo
|
||||
locale/po2strings
|
||||
locale/strings2po
|
||||
man/client.conf.man
|
||||
man/cups-files.conf.man
|
||||
man/cups-lpd.man
|
||||
man/cups-snmp.man
|
||||
man/cupsaddsmb.man
|
||||
man/cupsd.conf.man
|
||||
man/cupsd.man
|
||||
man/lpoptions.man
|
||||
man/mantohtml
|
||||
monitor/bcp
|
||||
monitor/tbcp
|
||||
notifier/dbus
|
||||
notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
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/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
|
||||
templates/header.tmpl
|
||||
templates/*/header.tmpl
|
||||
test/cups-str-*.html
|
||||
test/*_log-*
|
||||
tools/ippevepcl
|
||||
tools/ippeveprinter
|
||||
tools/ippeveprinter-static
|
||||
tools/ippeveps
|
||||
tools/ippfind
|
||||
tools/ippfind-static
|
||||
tools/ipptool
|
||||
tools/ipptool-static
|
||||
vcnet/.vs
|
||||
vcnet/packages
|
||||
vcnet/Win32
|
||||
vcnet/x64
|
||||
xcode/CUPS.xcodeproj/project.xcworkspace/
|
||||
xcode/CUPS.xcodeproj/xcuserdata/
|
||||
|
4
cups/.lgtm.yml
Normal file
4
cups/.lgtm.yml
Normal file
@ -0,0 +1,4 @@
|
||||
queries:
|
||||
- exclude: cpp/integer-multiplication-cast-to-long
|
||||
- exclude: cpp/missing-header-guard
|
||||
- exclude: cpp/short-global-name
|
@ -1,11 +1,73 @@
|
||||
CHANGES - 2.3.0 - 2019-07-16
|
||||
CHANGES - 2.3.4 - 2020-04-24 (IN PROGRESS)
|
||||
============================
|
||||
|
||||
Changes in CUPS v2.3.4
|
||||
----------------------
|
||||
|
||||
- CVE-20XX-YYYY: TODO rdar://61415567 embargo
|
||||
|
||||
Changes in CUPS v2.3.3
|
||||
----------------------
|
||||
|
||||
- CVE-2020-3898: The `ppdOpen` function did not handle invalid UI
|
||||
constraint. `ppdcSource::get_resolution` function did not handle
|
||||
invalid resolution strings.
|
||||
- CVE-2019-8842: The `ippReadIO` function may under-read an extension
|
||||
field.
|
||||
- Fixed WARNING_OPTIONS support for GCC 9.x
|
||||
|
||||
Changes in CUPS v2.3.2
|
||||
----------------------
|
||||
|
||||
- Localization updates.
|
||||
|
||||
|
||||
Changes in CUPS v2.3.1
|
||||
----------------------
|
||||
|
||||
- Documentation updates (Issue #5661, #5674, #5682)
|
||||
- CVE-2019-2228: The `ippSetValuetag` function did not validate the default
|
||||
language value.
|
||||
- Fixed a crash bug in the web interface (Issue #5621)
|
||||
- The PPD cache code now looks up page sizes using their dimensions
|
||||
(Issue #5633)
|
||||
- PPD files containing "custom" option keywords did not work (Issue #5639)
|
||||
- Added a workaround for the scheduler's systemd support (Issue #5640)
|
||||
- On Windows, TLS certificates generated on February 29 would likely fail
|
||||
(Issue #5643)
|
||||
- Added a DigestOptions directive for the `client.conf` file to control whether
|
||||
MD5-based Digest authentication is allowed (Issue #5647)
|
||||
- Fixed a bug in the handling of printer resource files (Issue #5652)
|
||||
- The libusb-based USB backend now reports an error when the distribution
|
||||
permissions are wrong (Issue #5658)
|
||||
- Added paint can labels to Dymo driver (Issue #5662)
|
||||
- The `ippeveprinter` program now supports authentication (Issue #5665)
|
||||
- The `ippeveprinter` program now advertises DNS-SD services on the correct
|
||||
interfaces, and provides a way to turn them off (Issue #5666)
|
||||
- The `--with-dbusdir` option was ignored by the configure script (Issue #5671)
|
||||
- Sandboxed applications were not able to get the default printer (Issue #5676)
|
||||
- Log file access controls were not preserved by `cupsctl` (Issue #5677)
|
||||
- Default printers set with `lpoptions` did not work in all cases (Issue #5681,
|
||||
Issue #5683, Issue #5684)
|
||||
- Fixed an error in the jobs web interface template (Issue #5694)
|
||||
- Fixed an off-by-one error in `ippEnumString` (Issue #5695)
|
||||
- Fixed some new compiler warnings (Issue #5700)
|
||||
- Fixed a few issues with the Apple Raster support (rdar://55301114)
|
||||
- The IPP backend did not detect all cases where a job should be retried using
|
||||
a raster format (rdar://56021091)
|
||||
- Fixed spelling of "fold-accordion".
|
||||
- Fixed the default common name for TLS certificates used by `ippeveprinter`.
|
||||
- Fixed the option names used for IPP Everywhere finishing options.
|
||||
- Added support for the second roll of the DYMO Twin/DUO label printers.
|
||||
|
||||
|
||||
Changes in CUPS v2.3.0
|
||||
----------------------
|
||||
|
||||
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
|
||||
- Added a GPL2/LGPL2 exception to the new CUPS license terms.
|
||||
- Documentation updates (Issue #5604)
|
||||
- Localization updates (Issue #5637)
|
||||
- Fixed a bug in the scheduler job cleanup code (Issue #5588)
|
||||
- Fixed builds when there is no TLS library (Issue #5590)
|
||||
- Eliminated some new GCC compiler warnings (Issue #5591)
|
||||
@ -14,6 +76,7 @@ Changes in CUPS v2.3.0
|
||||
- Fixed potential excess logging from the scheduler when removing job files
|
||||
(Issue #5597)
|
||||
- Fixed a NULL pointer dereference bug in `httpGetSubField2` (Issue #5598)
|
||||
- Added FIPS-140 workarounds for GNU TLS (Issue #5601, Issue #5622)
|
||||
- The scheduler no longer provides a default value for the description
|
||||
(Issue #5603)
|
||||
- The scheduler now logs jobs held for authentication using the error level so
|
||||
@ -23,12 +86,23 @@ Changes in CUPS v2.3.0
|
||||
- The scheduler now uses both the group's membership list as well as the
|
||||
various OS-specific membership functions to determine whether a user belongs
|
||||
to a named group (Issue #5613)
|
||||
- Added USB quirks rule for HP LaserJet 1015 (Issue #5617)
|
||||
- Fixed some PPD parser issues (Issue #5623, Issue #5624)
|
||||
- The IPP parser no longer allows invalid member attributes in collections
|
||||
(Issue #5630)
|
||||
- The configure script now treats the "wheel" group as a potential system
|
||||
group (Issue #5638)
|
||||
- Fixed a USB printing issue on macOS (rdar://31433931)
|
||||
- Fixed IPP buffer overflow (rdar://50035411)
|
||||
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
|
||||
- Fixed DoS issues in the scheduler (rdar://51373929)
|
||||
- Fixed an issue with unsupported "sides" values in the IPP backend
|
||||
(rdar://51775322)
|
||||
- The scheduler would restart continuously when idle and printers were not
|
||||
shared (rdar://52561199)
|
||||
- Fixed an issue with `EXPECT !name WITH-VALUE ...` tests.
|
||||
- Fixed a command ordering issue in the Zebra ZPL driver.
|
||||
- Fixed a memory leak in `ppdOpen`.
|
||||
|
||||
|
||||
Changes in CUPS v2.3rc1
|
||||
|
@ -2,13 +2,14 @@ Contributing to CUPS
|
||||
====================
|
||||
|
||||
CUPS is developed by Apple Inc. and distributed as open source software under
|
||||
the Apache License, Version 2.0. Significant contributions to CUPS must be
|
||||
licensed to Apple using the Apple Contributor Agreement:
|
||||
the Apache License, Version 2.0 with exceptions to allow linking to GPL2/LGPL2
|
||||
code. Significant contributions to CUPS must be licensed to Apple using the
|
||||
Apple Contributor Agreement:
|
||||
|
||||
https://www.cups.org/AppleContributorAgreement_2011-03-10.pdf
|
||||
|
||||
Contributions should be submitted as attachments to bug reports on the CUPS web
|
||||
site. Changes to existing source files should be submitted as unified diffs
|
||||
(both Subversion and Git produce this format by default) while new source files
|
||||
Contributions should be submitted as attachments to bug reports on the
|
||||
[CUPS Github project](https://github.com/apple/cups). Changes to existing
|
||||
source files should be submitted as unified diffs while new source files
|
||||
should be provided as-is or in an archive. Github pull requests can also be
|
||||
used to submit changes.
|
||||
|
@ -1,4 +1,4 @@
|
||||
CREDITS - 2017-05-01
|
||||
CREDITS - 2019-08-21
|
||||
====================
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd like
|
||||
|
@ -63,7 +63,9 @@ major, minor, and patch release numbers. Major release numbers indicate large
|
||||
design changes or backwards-incompatible changes to the CUPS API or CUPS
|
||||
Imaging API. Minor release numbers indicate new features and other smaller
|
||||
changes which are backwards-compatible with previous CUPS releases. Patch
|
||||
numbers indicate bug fixes to the previous feature or patch release.
|
||||
numbers indicate bug fixes to the previous feature or patch release. This
|
||||
version numbering scheme is consistent with the
|
||||
[Semantic Versioning](http://semver.org) specification.
|
||||
|
||||
> Note:
|
||||
>
|
||||
@ -114,6 +116,10 @@ Contributed source code must follow the guidelines below. While the examples
|
||||
are for C and C++ source files, source code for other languages should conform
|
||||
to the same guidelines as allowed by the language.
|
||||
|
||||
Source code comments provide the reference portion of the CUPS Programming
|
||||
Manual, which is generated using the [codedoc](https://www.msweet.org/codedoc)
|
||||
software.
|
||||
|
||||
|
||||
### Source Files
|
||||
|
||||
@ -270,15 +276,17 @@ Return/output values are indicated using an "O" prefix, input values are
|
||||
indicated using the "I" prefix, and values that are both input and output use
|
||||
the "IO" prefix for the corresponding in-line comment.
|
||||
|
||||
The Mini-XML documentation generator also understands the following special
|
||||
text in the function description comment:
|
||||
The [codedoc](https://www.msweet.org/codedoc) documentation generator also
|
||||
understands the following special text in the function description comment:
|
||||
|
||||
@deprecated@ - Marks the function as deprecated (not recommended
|
||||
for new development and scheduled for removal)
|
||||
@deprecated@ - Marks the function as deprecated: not recommended
|
||||
for new development and scheduled for removal.
|
||||
@link name@ - Provides a hyperlink to the corresponding function
|
||||
or type definition.
|
||||
@since CUPS version@ - Marks the function as new in the specified version
|
||||
of CUPS.
|
||||
@private@ - Marks the function as private (same as starting the
|
||||
function name with an underscore)
|
||||
@private@ - Marks the function as private so it will not be
|
||||
included in the documentation.
|
||||
|
||||
|
||||
### Variables
|
||||
|
@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v2.3.0 - 2019-05-24
|
||||
INSTALL - CUPS v2.3.4 - 2020-04-24 (IN PROGRESS)
|
||||
==================================
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
|
275
cups/Makedefs
275
cups/Makedefs
@ -1,275 +0,0 @@
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
#
|
||||
# CUPS version...
|
||||
#
|
||||
|
||||
CUPS_VERSION = 2.3.0
|
||||
|
||||
|
||||
#
|
||||
# Programs...
|
||||
#
|
||||
|
||||
AR = /usr/bin/ar
|
||||
AWK = awk
|
||||
CC = /Users/ariel/private-bin/clang
|
||||
CHMOD = /bin/chmod
|
||||
CXX = /Users/ariel/private-bin/clang++
|
||||
DSO = $(CC)
|
||||
DSOXX = $(CXX)
|
||||
GZIPPROG = /usr/bin/gzip
|
||||
INSTALL = /Users/ariel/git/darling/src/external/cups/cups/install-sh
|
||||
LD = /Users/ariel/private-bin/ld
|
||||
LD_CC = $(CC)
|
||||
LD_CXX = $(CXX)
|
||||
LIBTOOL =
|
||||
LN = /bin/ln -sf
|
||||
MKDIR = /bin/mkdir -p
|
||||
MV = /bin/mv
|
||||
RANLIB = ranlib
|
||||
RM = /bin/rm -f
|
||||
RMDIR = /bin/rmdir
|
||||
SED = /usr/bin/sed
|
||||
SHELL = /bin/sh
|
||||
|
||||
#
|
||||
# Installation programs...
|
||||
#
|
||||
|
||||
INSTALL_BIN = $(INSTALL) -c -m 555 -s
|
||||
INSTALL_COMPDATA = $(INSTALL) -c -m 444 -z
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m 644
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
INSTALL_LIB = $(INSTALL) -c -m 555 -s
|
||||
INSTALL_MAN = $(INSTALL) -c -m 444
|
||||
INSTALL_SCRIPT = $(INSTALL) -c -m 555
|
||||
|
||||
#
|
||||
# Default user, group, and system groups for the scheduler...
|
||||
#
|
||||
|
||||
CUPS_USER = _lp
|
||||
CUPS_GROUP = _lp
|
||||
CUPS_SYSTEM_GROUPS = admin
|
||||
CUPS_PRIMARY_SYSTEM_GROUP = admin
|
||||
|
||||
#
|
||||
# Default permissions...
|
||||
#
|
||||
|
||||
CUPS_CONFIG_FILE_PERM = 644
|
||||
CUPS_CUPSD_FILE_PERM = 500
|
||||
CUPS_LOG_FILE_PERM = 644
|
||||
|
||||
#
|
||||
# Languages to install...
|
||||
#
|
||||
|
||||
LANGUAGES =
|
||||
INSTALL_LANGUAGES = install-langbundle
|
||||
UNINSTALL_LANGUAGES = uninstall-langbundle
|
||||
|
||||
#
|
||||
# Cross-compilation support: "local" target is used for any tools that are
|
||||
# built and run locally.
|
||||
#
|
||||
|
||||
LOCALTARGET = local
|
||||
|
||||
|
||||
#
|
||||
# Libraries...
|
||||
#
|
||||
|
||||
LIBCUPS = libcups.2.dylib
|
||||
LIBCUPSIMAGE = libcupsimage.2.dylib
|
||||
LIBCUPSOBJS = $(COREOBJS) $(DRIVEROBJS)
|
||||
LIBCUPSSTATIC = libcups.a
|
||||
LIBGSSAPI = -weak_framework Kerberos -weak_framework GSS
|
||||
LIBHEADERS = $(COREHEADERS) $(DRIVERHEADERS)
|
||||
LIBHEADERSPRIV = $(COREHEADERSPRIV) $(DRIVERHEADERSPRIV)
|
||||
LIBMALLOC =
|
||||
LIBPAPER =
|
||||
LIBUSB =
|
||||
LIBWRAP =
|
||||
LIBZ = -lz
|
||||
|
||||
#
|
||||
# Install static libraries?
|
||||
#
|
||||
|
||||
INSTALLSTATIC =
|
||||
|
||||
#
|
||||
# IPP backend aliases...
|
||||
#
|
||||
|
||||
IPPALIASES = http https ipps
|
||||
|
||||
|
||||
#
|
||||
# ippeveprinter commands...
|
||||
#
|
||||
|
||||
IPPEVECOMMANDS = ippevepcl ippeveps
|
||||
|
||||
|
||||
#
|
||||
# Install XPC backends?
|
||||
#
|
||||
|
||||
INSTALLXPC = install-xpc
|
||||
|
||||
#
|
||||
# Code signing...
|
||||
#
|
||||
|
||||
CODE_SIGN = /usr/bin/true
|
||||
CODE_SIGN_IDENTITY = -
|
||||
|
||||
#
|
||||
# Program options...
|
||||
#
|
||||
# ARCHFLAGS Defines the default architecture build options.
|
||||
# OPTIM Defines the common compiler optimization/debugging options
|
||||
# for all architectures.
|
||||
# OPTIONS Defines other compile-time options (currently only -DDEBUG
|
||||
# for extra debug info)
|
||||
#
|
||||
|
||||
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) \
|
||||
$(SSLFLAGS) -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT \
|
||||
$(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) \
|
||||
$(SSLFLAGS) -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT \
|
||||
$(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ALL_DSOFLAGS = -L../cups $(DSOFLAGS) $(OPTIM)
|
||||
ALL_LDFLAGS = -L../cups $(LDFLAGS) \
|
||||
-fPIE -Wl,-pie $(OPTIM)
|
||||
ARCHFLAGS =
|
||||
ARFLAGS = -rcv
|
||||
BACKLIBS = -framework IOKit
|
||||
BUILDDIRS = tools filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates
|
||||
CFLAGS = -arch x86_64 -arch i386 -isystem/Users/ariel/git/darling/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -isystem/Users/ariel/arch/build/darling/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -isystem/Users/ariel/git/darling/framework-include -DDARLING -D_FORTIFY_SOURCE=2
|
||||
COMMONLIBS = -lpthread -lresolv -framework SystemConfiguration -framework CoreFoundation -framework Security -liconv -lz
|
||||
CXXFLAGS = -arch x86_64 -arch i386 -isystem/Users/ariel/git/darling/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -isystem/Users/ariel/arch/build/darling/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -isystem/Users/ariel/git/darling/framework-include -DDARLING -D_FORTIFY_SOURCE=2
|
||||
CXXLIBS =
|
||||
DBUS_NOTIFIER =
|
||||
DBUS_NOTIFIERLIBS =
|
||||
DNSSD_BACKEND = dnssd
|
||||
DSOFLAGS = -dynamiclib -single_module -lc -Wl,-no_warn_inits -dynamiclib -single_module -lc
|
||||
DNSSDLIBS =
|
||||
IPPFIND_BIN = ippfind
|
||||
IPPFIND_MAN = ippfind.1
|
||||
LDFLAGS =
|
||||
LINKCUPS = -L../cups -lcups
|
||||
LINKCUPSSTATIC = ../cups/$(LIBCUPSSTATIC) $(LIBS)
|
||||
LIBS = $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ) $(COMMONLIBS)
|
||||
ONDEMANDFLAGS =
|
||||
ONDEMANDLIBS =
|
||||
OPTIM = -fPIC -Os -g -fstack-protector
|
||||
OPTIONS = -Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion
|
||||
PAMLIBS = -lpam -ldl
|
||||
SERVERLIBS = -framework IOKit -weak_framework ApplicationServices
|
||||
SSLFLAGS =
|
||||
SSLLIBS =
|
||||
UNITTESTS =
|
||||
|
||||
|
||||
#
|
||||
# Directories...
|
||||
#
|
||||
# The first section uses the GNU names (which are *extremely*
|
||||
# difficult to find in a makefile because they are lowercase...)
|
||||
# We have to define these first because autoconf uses ${prefix}
|
||||
# and ${exec_prefix} for most of the other directories...
|
||||
#
|
||||
# The "datarootdir" variable may not get defined if you are using
|
||||
# a version of autoconf prior to 2.60.
|
||||
#
|
||||
# This is immediately followed by definition in ALL CAPS for the
|
||||
# needed directories...
|
||||
#
|
||||
|
||||
bindir = /usr/bin
|
||||
datadir = /usr/share
|
||||
datarootdir = /usr/share
|
||||
exec_prefix = /usr
|
||||
includedir = /usr/include
|
||||
infodir = ${datarootdir}/info
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localstatedir = /private/var
|
||||
mandir = /usr/share/man
|
||||
oldincludedir = /usr/include
|
||||
prefix = /
|
||||
privateinclude = /usr/local/include
|
||||
sbindir = /usr/sbin
|
||||
sharedstatedir = /usr/com
|
||||
srcdir = .
|
||||
sysconfdir = /private/etc
|
||||
top_srcdir = .
|
||||
|
||||
BUILDROOT = $(DSTROOT)$(DESTDIR)
|
||||
|
||||
BINDIR = $(BUILDROOT)/usr/bin
|
||||
BUNDLEDIR = /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A
|
||||
CACHEDIR = $(BUILDROOT)/private/var/spool/cups/cache
|
||||
DATADIR = $(BUILDROOT)/usr/share/cups
|
||||
DOCDIR = $(BUILDROOT)/usr/share/doc/cups
|
||||
ICONDIR =
|
||||
INCLUDEDIR = $(BUILDROOT)$(includedir)
|
||||
LIBDIR = $(BUILDROOT)$(libdir)
|
||||
LOCALEDIR = $(BUILDROOT)/usr/share/locale
|
||||
LOGDIR = $(BUILDROOT)/private/var/log/cups
|
||||
MANDIR = $(BUILDROOT)/usr/share/man
|
||||
MENUDIR =
|
||||
PRIVATEINCLUDE = $(BUILDROOT)/usr/local/include/cups
|
||||
RCLEVELS = 2 3 5
|
||||
RCSTART = 99
|
||||
RCSTOP = 00
|
||||
REQUESTS = $(BUILDROOT)/private/var/spool/cups
|
||||
RESOURCEDIR = /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/en.lproj
|
||||
SBINDIR = $(BUILDROOT)/usr/sbin
|
||||
SERVERBIN = $(BUILDROOT)/usr/libexec/cups
|
||||
SERVERROOT = $(BUILDROOT)/private/etc/cups
|
||||
STATEDIR = $(BUILDROOT)/private/etc/cups
|
||||
|
||||
PAMDIR = /private/etc/pam.d
|
||||
PAMFILE = pam.opendirectory
|
||||
|
||||
DBUSDIR =
|
||||
INITDIR =
|
||||
INITDDIR =
|
||||
LAUNCHD_DIR = /System/Library/LaunchDaemons
|
||||
SMFMANIFESTDIR =
|
||||
SYSTEMD_DIR =
|
||||
XINETD =
|
||||
|
||||
USBQUIRKS =
|
||||
|
||||
|
||||
#
|
||||
# Rules...
|
||||
#
|
||||
|
||||
.SILENT:
|
||||
.SUFFIXES: .a .c .cxx .h .o
|
||||
|
||||
.c.o:
|
||||
echo Compiling $<...
|
||||
$(CC) $(ARCHFLAGS) $(OPTIM) $(ALL_CFLAGS) -c -o $@ $<
|
||||
|
||||
.cxx.o:
|
||||
echo Compiling $<...
|
||||
$(CXX) $(ARCHFLAGS) $(OPTIM) $(ALL_CXXFLAGS) -c -o $@ $<
|
19
cups/NOTICE
19
cups/NOTICE
@ -1,6 +1,6 @@
|
||||
CUPS
|
||||
|
||||
Copyright © 2007-2018 by Apple Inc.
|
||||
Copyright © 2007-2019 by Apple Inc.
|
||||
Copyright © 1997-2007 by Easy Software Products.
|
||||
|
||||
CUPS and the CUPS logo are trademarks of Apple Inc.
|
||||
@ -32,3 +32,20 @@ the following restrictions:
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
-- CUPS Exceptions to the Apache 2.0 License --
|
||||
|
||||
As an exception, if, as a result of your compiling your source code, portions
|
||||
of this Software are embedded into an Object form of such source code, you
|
||||
may redistribute such embedded portions in such Object form without complying
|
||||
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
||||
|
||||
In addition, if you combine or link compiled forms of this Software with
|
||||
software that is licensed under the GPLv2 ("Combined Software") and if a
|
||||
court of competent jurisdiction determines that the patent provision (Section
|
||||
3), the indemnity provision (Section 9) or other Section of the License
|
||||
conflicts with the conditions of the GPLv2, you may retroactively and
|
||||
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
||||
the License, but only in their entirety and only with respect to the Combined
|
||||
Software.
|
||||
|
@ -1,13 +1,9 @@
|
||||
README - CUPS v2.3.0 - 2019-05-24
|
||||
README - CUPS v2.3.4 - 2020-04-24 (IN PROGRESS)
|
||||
=================================
|
||||
|
||||
Looking for compile instructions? Read the file `INSTALL.md` instead...
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
|
||||
CUPS is a standards-based, open source printing system developed by Apple Inc.
|
||||
for macOS® and other UNIX®-like operating systems. CUPS uses the Internet
|
||||
Printing Protocol ("IPP") and provides System V and Berkeley command-line
|
||||
@ -29,8 +25,21 @@ CUPS is licensed under the Apache License Version 2.0. See the file
|
||||
READING THE DOCUMENTATION
|
||||
-------------------------
|
||||
|
||||
Initial documentation to get you started is provided in the root directory of
|
||||
the CUPS sources:
|
||||
|
||||
- `CHANGES.md`: A list of changes in the current major release of CUPS.
|
||||
- `CONTRIBUTING.md`: Guidelines for contributing to the CUPS project.
|
||||
- `CREDITS.md`: A list of past contributors to the CUPS project.
|
||||
- `DEVELOPING.md`: Guidelines for developing code for the CUPS project.
|
||||
- `INSTALL.md`: Instructions for building and installing CUPS.
|
||||
- `LICENSE`: The CUPS license agreement (Apache 2.0).
|
||||
- `NOTICE`: Copyright notices and exceptions to the CUPS license agreement.
|
||||
- `README.md`: This file.
|
||||
|
||||
Once you have installed the software you can access the documentation (and a
|
||||
bunch of other stuff) online at <http://localhost:631/>.
|
||||
bunch of other stuff) online at <http://localhost:631/> and using the `man`
|
||||
command, for example `man cups`.
|
||||
|
||||
If you're having trouble getting that far, the documentation is located under
|
||||
the `doc/help` and `man` directories.
|
||||
@ -56,11 +65,11 @@ in your browser to access the printer administration tools:
|
||||
|
||||
*Do not* use the hostname for your machine - it will not work with the default
|
||||
CUPS configuration. To enable administration access on other addresses, check
|
||||
the `Allow Remote Administration` box and click on the `Change Settings button.
|
||||
the `Allow Remote Administration` box and click on the `Change Settings` button.
|
||||
|
||||
You will be asked for the administration password (root or any other user in the
|
||||
sys/system/root/admin/lpadmin group on your system) when performing any
|
||||
administrative function.
|
||||
"sys", "system", "root", "admin", or "lpadmin" group on your system) when
|
||||
performing any administrative function.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
@ -70,28 +79,28 @@ CUPS currently uses PPD (PostScript Printer Description) files that describe
|
||||
printer capabilities and driver programs needed for each printer. The
|
||||
`everywhere` PPD is used for nearly all modern networks printers sold since
|
||||
about 2009. For example, the following command creates a print queue for a
|
||||
printer at address 11.22.33.44:
|
||||
printer at address "11.22.33.44":
|
||||
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
|
||||
CUPS also includes several sample PPD files you can use for "legacy" printers:
|
||||
|
||||
Driver PPD Name
|
||||
----------------------------- ------------------------------
|
||||
Dymo Label Printers drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
|
||||
Driver | PPD Name
|
||||
----------------------------- | ------------------------------
|
||||
Dymo Label Printers | drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar | drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series | drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series | drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer | drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer | drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series | drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series | drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series | drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series | drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer | drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer | drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer | drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer | drv:///sample.drv/zebra.ppd
|
||||
|
||||
You can run the `lpinfo -m` command to list all of the available drivers:
|
||||
|
||||
@ -148,12 +157,12 @@ This will prevent the filters from misinterpreting your print file.
|
||||
LEGAL STUFF
|
||||
-----------
|
||||
|
||||
Copyright © 2007-2019 by Apple Inc.
|
||||
Copyright © 2007-2020 by Apple Inc.
|
||||
Copyright © 1997-2007 by Easy Software Products.
|
||||
|
||||
CUPS is provided under the terms of the Apache License, Version 2.0. A copy of
|
||||
this license can be found in the file `LICENSE`. Additional legal information
|
||||
is provided in the file `NOTICE`.
|
||||
CUPS is provided under the terms of the Apache License, Version 2.0 with
|
||||
exceptions for GPL2/LGPL2 software. A copy of this license can be found in the
|
||||
file `LICENSE`. Additional legal information is provided in the file `NOTICE`.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
|
@ -233,7 +233,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
int waitjob, /* Wait for job complete? */
|
||||
waitjob_tries = 0, /* Number of times we've waited */
|
||||
waitprinter; /* Wait for printer ready? */
|
||||
time_t waittime; /* Wait time for held jobs */
|
||||
_cups_monitor_t monitor; /* Monitoring data */
|
||||
ipp_attribute_t *job_id_attr; /* job-id attribute */
|
||||
int job_id; /* job-id value */
|
||||
@ -1450,6 +1449,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
monitor.printer_state = IPP_PSTATE_IDLE;
|
||||
monitor.retryable = argc == 6 && document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf");
|
||||
|
||||
fprintf(stderr, "DEBUG: retryable=%d\n", monitor.retryable);
|
||||
|
||||
if (create_job)
|
||||
{
|
||||
monitor.job_name = argv[3];
|
||||
@ -1867,21 +1868,29 @@ main(int argc, /* I - Number of command-line args */
|
||||
response = cupsGetResponse(http, resource);
|
||||
ippDelete(request);
|
||||
|
||||
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n", ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
ippDelete(response);
|
||||
|
||||
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING && !job_canceled)
|
||||
{
|
||||
ipp_attribute_t *reasons = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD);
|
||||
/* job-state-reasons values */
|
||||
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to add document to print job."));
|
||||
if (ippContainsString(reasons, "document-format-error"))
|
||||
ipp_status = IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR;
|
||||
else if (ippContainsString(reasons, "document-unprintable"))
|
||||
ipp_status = IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE;
|
||||
|
||||
ippDelete(response);
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to add document to print job."));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
ippDelete(response);
|
||||
|
||||
password_tries = 0;
|
||||
|
||||
if (num_files == 0 || fd < 0)
|
||||
@ -1898,7 +1907,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
copies_remaining --;
|
||||
}
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
|
||||
argc == 6 &&
|
||||
document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
|
||||
{
|
||||
@ -1999,7 +2008,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
|
||||
|
||||
for (delay = _cupsNextDelay(0, &prev_delay), waittime = time(NULL) + 30; !job_canceled;)
|
||||
for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;)
|
||||
{
|
||||
/*
|
||||
* Check for side-channel requests...
|
||||
@ -2114,11 +2123,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
job_sheets->values[0].integer);
|
||||
|
||||
/*
|
||||
* Stop polling if the job is finished or pending-held for 30 seconds...
|
||||
* Stop polling if the job is finished or pending-held...
|
||||
*/
|
||||
|
||||
if (job_state->values[0].integer > IPP_JSTATE_STOPPED ||
|
||||
(job_state->values[0].integer == IPP_JSTATE_HELD && time(NULL) > waittime))
|
||||
if (job_state->values[0].integer > IPP_JSTATE_STOPPED || job_state->values[0].integer == IPP_JSTATE_HELD)
|
||||
{
|
||||
ippDelete(response);
|
||||
break;
|
||||
|
@ -71,7 +71,11 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
|
||||
*/
|
||||
|
||||
static int cups_rresvport(int *port, int family);
|
||||
static int lpd_command(int lpd_fd, char *format, ...);
|
||||
static int lpd_command(int lpd_fd, char *format, ...)
|
||||
# ifdef __GNUC__
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)))
|
||||
# endif /* __GNUC__ */
|
||||
;
|
||||
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist, const char *printer, int print_fd, int snmp_fd, int mode, const char *user, const char *title, int copies, int banner, int format, int order, int reserve, int manual_copies, int timeout, int contimeout, const char *orighost) _CUPS_NONNULL((1,2,3,7,8,17));
|
||||
static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length);
|
||||
static void sigterm_handler(int sig);
|
||||
@ -1042,7 +1046,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
@ -1092,7 +1096,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the print file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03.3d%.15s\n",
|
||||
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03d%.15s\n",
|
||||
CUPS_LLCAST filestats.st_size, (int)getpid() % 1000,
|
||||
localhost))
|
||||
{
|
||||
@ -1175,7 +1179,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
|
@ -242,6 +242,9 @@
|
||||
# All Intermec devices (Issue #4553)
|
||||
0x067e no-reattach
|
||||
|
||||
# HP LaserJet 1015 (Issue #5617)
|
||||
0x03f0 0x0e17 delay-close
|
||||
|
||||
# HP LaserJet 1150 (Issue #4549)
|
||||
0x03f0 0x0f17 delay-close
|
||||
|
||||
|
@ -288,11 +288,11 @@ static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
|
||||
#define IS_64BIT 1
|
||||
#define IS_NOT_64BIT 0
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#if defined(__arm64e__)
|
||||
static pid_t child_pid; /* Child PID */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a ppc executable */
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
static void sigterm_handler(int sig); /* SIGTERM handler */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a x86_64 executable */
|
||||
static void sigterm_handler(int sig); /* SIGTERM handler */
|
||||
#endif /* __arm64e__ */
|
||||
static void sigquit_handler(int sig, siginfo_t *si, void *unused) _CUPS_NORETURN;
|
||||
|
||||
#ifdef PARSE_PS_ERRORS
|
||||
@ -436,18 +436,18 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
status = registry_open(&driverBundlePath);
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#if defined(__arm64e__)
|
||||
/*
|
||||
* If we were unable to load the class drivers for this printer it's
|
||||
* probably because they're ppc or i386. In this case try to run this
|
||||
* backend as i386 or ppc executables so we can use them...
|
||||
* probably because they're x86_64 (or older). In this case try to run this
|
||||
* backend as x86_64 so we can use them...
|
||||
*/
|
||||
if (status == -2)
|
||||
{
|
||||
run_legacy_backend(argc, argv, print_fd);
|
||||
/* Never returns here */
|
||||
}
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
#endif /* __arm64e__ */
|
||||
|
||||
if (status == -2)
|
||||
{
|
||||
@ -1280,6 +1280,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
|
||||
(*printerIntf)->GetInterfaceNumber(printerIntf, &intfNumber);
|
||||
(*printerIntf)->GetLocationID(printerIntf, &intfLocation);
|
||||
|
||||
if (intfProtocol == kUSBPrintingProtocolIPP)
|
||||
return keepLooking;
|
||||
|
||||
if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
|
||||
{
|
||||
if (serial != NULL && CFStringCompare(serial, g.serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
@ -1287,12 +1290,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
|
||||
g.interfaceProtocol = intfProtocol;
|
||||
g.location = intfLocation;
|
||||
g.alternateSetting = intfAltSetting;
|
||||
if (intfProtocol != kUSBPrintingProtocolIPP)
|
||||
{
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
}
|
||||
keepLooking = (intfProtocol == kUSBPrintingProtocolIPP);
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
keepLooking = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1300,14 +1300,14 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
|
||||
if (g.printer_obj != 0)
|
||||
IOObjectRelease(g.printer_obj);
|
||||
|
||||
if (g.location == 0 || g.location == intfLocation)
|
||||
keepLooking = false;
|
||||
|
||||
g.location = intfLocation;
|
||||
g.alternateSetting = intfAltSetting;
|
||||
g.interfaceProtocol = intfProtocol;
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
|
||||
if (g.location == 0 || g.location == intfLocation)
|
||||
keepLooking = false;
|
||||
}
|
||||
|
||||
if (!keepLooking)
|
||||
@ -2053,11 +2053,11 @@ static void setup_cfLanguage(void)
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#if defined(__arm64e__)
|
||||
/*!
|
||||
* @function run_legacy_backend
|
||||
*
|
||||
* @abstract Starts child backend process running as a ppc or i386 executable.
|
||||
* @abstract Starts child backend process running as a x86_64 executable.
|
||||
*
|
||||
* @result Never returns; always calls exit().
|
||||
*
|
||||
@ -2076,18 +2076,14 @@ static void run_legacy_backend(int argc,
|
||||
|
||||
|
||||
/*
|
||||
* If we're running as x86_64 or i386 and couldn't load the class driver
|
||||
* (because it's ppc or i386), then try to re-exec ourselves in ppc or i386
|
||||
* mode to try again. If we don't have a ppc or i386 architecture we may be
|
||||
* If we're running as ARM and couldn't load the class driver
|
||||
* (because it's x86_64, i386 or ppc), then try to re-exec ourselves in x86_64
|
||||
* mode to try again. If we don't have that architecture we may be
|
||||
* running with the same architecture again so guard against this by setting
|
||||
* and testing an environment variable...
|
||||
*/
|
||||
|
||||
# ifdef __x86_64__
|
||||
usb_legacy_status = getenv("USB_I386_STATUS");
|
||||
# else
|
||||
usb_legacy_status = getenv("USB_PPC_STATUS");
|
||||
# endif /* __x86_64__ */
|
||||
usb_legacy_status = getenv("USB_LEGACY_STATUS");
|
||||
|
||||
if (!usb_legacy_status)
|
||||
{
|
||||
@ -2116,21 +2112,13 @@ static void run_legacy_backend(int argc,
|
||||
* Set the environment variable...
|
||||
*/
|
||||
|
||||
# ifdef __x86_64__
|
||||
setenv("USB_I386_STATUS", "1", false);
|
||||
# else
|
||||
setenv("USB_PPC_STATUS", "1", false);
|
||||
# endif /* __x86_64__ */
|
||||
setenv("USB_LEGACY_STATUS", "1", false);
|
||||
|
||||
/*
|
||||
* Tell the kernel to use the specified CPU architecture...
|
||||
*/
|
||||
|
||||
# ifdef __x86_64__
|
||||
cpu_type_t cpu = CPU_TYPE_I386;
|
||||
# else
|
||||
cpu_type_t cpu = CPU_TYPE_POWERPC;
|
||||
# endif /* __x86_64__ */
|
||||
cpu_type_t cpu = CPU_TYPE_X86_64;
|
||||
size_t ocount = 1;
|
||||
posix_spawnattr_t attrs;
|
||||
|
||||
@ -2139,11 +2127,7 @@ static void run_legacy_backend(int argc,
|
||||
posix_spawnattr_setsigdefault(&attrs, &oldmask);
|
||||
if (posix_spawnattr_setbinpref_np(&attrs, 1, &cpu, &ocount) || ocount != 1)
|
||||
{
|
||||
# ifdef __x86_64__
|
||||
perror("DEBUG: Unable to set binary preference to i386");
|
||||
# else
|
||||
perror("DEBUG: Unable to set binary preference to ppc");
|
||||
# endif /* __x86_64__ */
|
||||
perror("DEBUG: Unable to set binary preference to X86_64");
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to use legacy USB class driver."));
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
@ -2217,8 +2201,6 @@ static void run_legacy_backend(int argc,
|
||||
|
||||
exit(exitstatus);
|
||||
}
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
|
||||
|
||||
/*
|
||||
* 'sigterm_handler()' - SIGTERM handler.
|
||||
@ -2227,7 +2209,6 @@ static void run_legacy_backend(int argc,
|
||||
static void
|
||||
sigterm_handler(int sig) /* I - Signal */
|
||||
{
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
/*
|
||||
* If we started a child process pass the signal on to it...
|
||||
*/
|
||||
@ -2253,8 +2234,8 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
_exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
}
|
||||
#endif /* __arm64e__ */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* LIBUSB interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
* Copyright 2007-2020 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@ -826,8 +826,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
err = libusb_init(NULL);
|
||||
if (err)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
|
||||
"libusb error %i\n", (int)err);
|
||||
fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)err, libusb_strerror((int)err));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -879,7 +878,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
protocol = 0;
|
||||
|
||||
for (altset = 0, altptr = ifaceptr->altsetting;
|
||||
altset < ifaceptr->num_altsetting;
|
||||
altset < ifaceptr->num_altsetting; // lgtm [cpp/comparison-with-wider-type]
|
||||
altset ++, altptr ++)
|
||||
{
|
||||
/*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "lpr" command for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -445,9 +445,9 @@ usage(void)
|
||||
" Specify 2-sided portrait printing"));
|
||||
_cupsLangPuts(stdout, _("-o sides=two-sided-short-edge\n"
|
||||
" Specify 2-sided landscape printing"));
|
||||
_cupsLangPuts(stdout, _("-P destination Specify the destination"));
|
||||
_cupsLangPuts(stdout, _("-q Specify the job should be held for printing"));
|
||||
_cupsLangPuts(stdout, _("-r Remove the file(s) after submission"));
|
||||
_cupsLangPuts(stdout, _("-P destination Specify the destination"));
|
||||
_cupsLangPuts(stdout, _("-T title Specify the job title"));
|
||||
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
|
||||
|
||||
|
@ -2929,6 +2929,9 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_POINTS :
|
||||
if (!_cups_strncasecmp(option->defchoice, "Custom.", 7))
|
||||
{
|
||||
@ -3528,6 +3531,9 @@ get_option_value(
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@ -3606,6 +3612,9 @@ get_option_value(
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* CGI form variable and array functions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2007-2020 by Apple Inc.
|
||||
* Copyright © 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -170,6 +170,9 @@ cgiGetArray(const char *name, /* I - Name of array variable */
|
||||
if (element < 0 || element >= var->nvalues)
|
||||
return (NULL);
|
||||
|
||||
if (var->values[element] == NULL)
|
||||
return (NULL);
|
||||
|
||||
return (strdup(var->values[element]));
|
||||
}
|
||||
|
||||
@ -980,7 +983,7 @@ cgi_initialize_post(void)
|
||||
*/
|
||||
|
||||
length = (size_t)strtol(content_length, NULL, 10);
|
||||
data = malloc(length + 1);
|
||||
data = malloc(length + 1); // lgtm [cpp/uncontrolled-allocation-size]
|
||||
|
||||
if (data == NULL)
|
||||
return (0);
|
||||
|
@ -1,93 +0,0 @@
|
||||
#
|
||||
# File/directory/user/group configuration file for the CUPS scheduler.
|
||||
# See "man cups-files.conf" for a complete description of this file.
|
||||
#
|
||||
|
||||
# List of events that are considered fatal errors for the scheduler...
|
||||
#FatalErrors config
|
||||
|
||||
# Do we call fsync() after writing configuration or status files?
|
||||
#SyncOnClose No
|
||||
|
||||
# Default user and group for filters/backends/helper programs; this cannot be
|
||||
# any user or group that resolves to ID 0 for security reasons...
|
||||
#User _lp
|
||||
#Group _lp
|
||||
|
||||
# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
|
||||
# This cannot contain the Group value for security reasons...
|
||||
SystemGroup admin
|
||||
SystemGroupAuthKey system.print.admin
|
||||
|
||||
# User that is substituted for unauthenticated (remote) root accesses...
|
||||
#RemoteRoot remroot
|
||||
|
||||
# Do we allow file: device URIs other than to /dev/null?
|
||||
#FileDevice No
|
||||
|
||||
# Permissions for configuration and log files...
|
||||
#ConfigFilePerm 0644
|
||||
#LogFilePerm 0644
|
||||
|
||||
# Location of the file logging all access to the scheduler; may be the name
|
||||
# "syslog". If not an absolute path, the value of ServerRoot is used as the
|
||||
# root directory. Also see the "AccessLogLevel" directive in cupsd.conf.
|
||||
AccessLog /private/var/log/cups/access_log
|
||||
|
||||
# Location of cache files used by the scheduler...
|
||||
#CacheDir /private/var/spool/cups/cache
|
||||
|
||||
# Location of data files used by the scheduler...
|
||||
#DataDir /usr/share/cups
|
||||
|
||||
# Location of the static web content served by the scheduler...
|
||||
#DocumentRoot /usr/share/doc/cups
|
||||
|
||||
# Location of the file logging all messages produced by the scheduler and any
|
||||
# helper programs; may be the name "syslog". If not an absolute path, the value
|
||||
# of ServerRoot is used as the root directory. Also see the "LogLevel"
|
||||
# directive in cupsd.conf.
|
||||
ErrorLog /private/var/log/cups/error_log
|
||||
|
||||
# Location of fonts used by older print filters...
|
||||
#FontPath /usr/share/cups/fonts
|
||||
|
||||
# Location of LPD configuration
|
||||
#LPDConfigFile launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist
|
||||
|
||||
# Location of the file logging all pages printed by the scheduler and any
|
||||
# helper programs; may be the name "syslog". If not an absolute path, the value
|
||||
# of ServerRoot is used as the root directory. Also see the "PageLogFormat"
|
||||
# directive in cupsd.conf.
|
||||
PageLog /private/var/log/cups/page_log
|
||||
|
||||
# Location of the file listing all of the local printers...
|
||||
#Printcap /Library/Preferences/org.cups.printers.plist
|
||||
|
||||
# Format of the Printcap file...
|
||||
#PrintcapFormat bsd
|
||||
#PrintcapFormat plist
|
||||
#PrintcapFormat solaris
|
||||
|
||||
# Location of all spool files...
|
||||
#RequestRoot /private/var/spool/cups
|
||||
|
||||
# Location of helper programs...
|
||||
#ServerBin /usr/libexec/cups
|
||||
|
||||
# SSL/TLS keychain for the scheduler...
|
||||
#ServerKeychain /Library/Keychains/System.keychain
|
||||
|
||||
# Location of other configuration files...
|
||||
#ServerRoot /private/etc/cups
|
||||
|
||||
# Location of Samba configuration file...
|
||||
#SMBConfigFile
|
||||
|
||||
# Location of scheduler state files...
|
||||
#StateDir /private/etc/cups
|
||||
|
||||
# Location of scheduler/helper temporary files. This directory is emptied on
|
||||
# scheduler startup and cannot be one of the standard (public) temporary
|
||||
# directory locations for security reasons...
|
||||
#TempDir /private/var/spool/cups/tmp
|
@ -1,182 +0,0 @@
|
||||
#
|
||||
# Configuration file for the CUPS scheduler. See "man cupsd.conf" for a
|
||||
# complete description of this file.
|
||||
#
|
||||
|
||||
# Log general information in error_log - change "warn" to "debug"
|
||||
# for troubleshooting...
|
||||
LogLevel warn
|
||||
PageLogFormat
|
||||
|
||||
# Only listen for connections from the local machine.
|
||||
Listen localhost:631
|
||||
Listen /private/var/run/cupsd
|
||||
|
||||
# Show shared printers on the local network.
|
||||
Browsing On
|
||||
BrowseLocalProtocols dnssd
|
||||
|
||||
# Default authentication type, when authentication is required...
|
||||
DefaultAuthType Basic
|
||||
|
||||
# Web interface setting...
|
||||
WebInterface No
|
||||
|
||||
# Restrict access to the server...
|
||||
<Location />
|
||||
Order allow,deny
|
||||
</Location>
|
||||
|
||||
# Restrict access to the admin pages...
|
||||
<Location /admin>
|
||||
Order allow,deny
|
||||
</Location>
|
||||
|
||||
# Restrict access to configuration files...
|
||||
<Location /admin/conf>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
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...
|
||||
JobPrivateAccess default
|
||||
JobPrivateValues default
|
||||
SubscriptionPrivateAccess default
|
||||
SubscriptionPrivateValues default
|
||||
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
<Limit Create-Job Print-Job Print-URI Validate-Job>
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All administration operations require an administrator to authenticate...
|
||||
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @AUTHKEY(system.print.operator) @admin @lpadmin
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# Only the owner or an administrator can cancel or authenticate a job...
|
||||
<Limit Cancel-Job CUPS-Authenticate-Job>
|
||||
Require user @OWNER @AUTHKEY(system.print.operator) @admin @lpadmin
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit All>
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
# Set the authenticated printer/job policies...
|
||||
<Policy authenticated>
|
||||
# Job/subscription privacy...
|
||||
JobPrivateAccess default
|
||||
JobPrivateValues default
|
||||
SubscriptionPrivateAccess default
|
||||
SubscriptionPrivateValues default
|
||||
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
<Limit Create-Job Print-Job Print-URI Validate-Job>
|
||||
AuthType Default
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
AuthType Default
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All administration operations require an administrator to authenticate...
|
||||
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @AUTHKEY(system.print.operator) @admin @lpadmin
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# Only the owner or an administrator can cancel or authenticate a job...
|
||||
<Limit Cancel-Job CUPS-Authenticate-Job>
|
||||
AuthType Default
|
||||
Require user @OWNER @AUTHKEY(system.print.operator) @admin @lpadmin
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit All>
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
# Set the kerberized printer/job policies...
|
||||
<Policy kerberos>
|
||||
# Job/subscription privacy...
|
||||
JobPrivateAccess default
|
||||
JobPrivateValues default
|
||||
SubscriptionPrivateAccess default
|
||||
SubscriptionPrivateValues default
|
||||
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
<Limit Create-Job Print-Job Print-URI Validate-Job>
|
||||
AuthType Negotiate
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
AuthType Negotiate
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All administration operations require an administrator to authenticate...
|
||||
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @AUTHKEY(system.print.operator) @admin @lpadmin
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# Only the owner or an administrator can cancel or authenticate a job...
|
||||
<Limit Cancel-Job CUPS-Authenticate-Job>
|
||||
AuthType Negotiate
|
||||
Require user @OWNER @AUTHKEY(system.print.operator) @admin @lpadmin
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit All>
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
@ -1,55 +0,0 @@
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Base MIME conversions file for CUPS.
|
||||
#
|
||||
# Copyright © 2007-2016 by Apple Inc.
|
||||
# Copyright © 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Format of Lines:
|
||||
#
|
||||
# source/type destination/type cost filter
|
||||
#
|
||||
# General Notes:
|
||||
#
|
||||
# The "cost" field is used to find the least costly filters to run
|
||||
# when converting a job file to a printable format.
|
||||
#
|
||||
# All filters *must* accept the standard command-line arguments
|
||||
# (job-id, user, title, copies, options, [filename or stdin]) to
|
||||
# work with CUPS.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# PostScript filters
|
||||
#
|
||||
|
||||
application/postscript application/vnd.cups-postscript 66 pstops
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Raster filters...
|
||||
#
|
||||
|
||||
# PWG Raster filter for IPP Everywhere...
|
||||
application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
application/vnd.cups-raster image/urf 100 rastertopwg
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Raw filter...
|
||||
#
|
||||
# Uncomment the following filter to allow printing of arbitrary files
|
||||
# without the -oraw option.
|
||||
#
|
||||
|
||||
application/octet-stream application/vnd.cups-raw 0 -
|
@ -1,2 +0,0 @@
|
||||
auth required pam_unknown.so
|
||||
account required pam_unknown.so
|
@ -1,7 +0,0 @@
|
||||
#
|
||||
# SNMP configuration file for CUPS. See "man cups-snmp.conf" for a complete
|
||||
# description of this file.
|
||||
#
|
||||
|
||||
|
||||
Community public
|
@ -293,14 +293,14 @@ fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for DBUS support
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
@ -317,7 +317,7 @@ if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdar
|
||||
AC_CHECK_FUNC(dbus_threads_init,
|
||||
AC_DEFINE(HAVE_DBUS_THREADS_INIT))
|
||||
LIBS="$SAVELIBS"
|
||||
if test -d /etc/dbus-1; then
|
||||
if test -d /etc/dbus-1 -a "x$DBUSDIR" = x; then
|
||||
DBUSDIR="/etc/dbus-1"
|
||||
fi
|
||||
else
|
||||
|
@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2018 by Apple Inc.
|
||||
dnl Copyright 2007-2020 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
@ -175,7 +175,7 @@ if test -n "$GCC"; then
|
||||
# doesn't trigger...
|
||||
gccversion=`$CC --version | head -1 | awk '{print $NF}'`
|
||||
case "$gccversion" in
|
||||
7.* | 8.*)
|
||||
7.* | 8.* | 9.*)
|
||||
WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-tautological-compare"
|
||||
;;
|
||||
esac
|
||||
|
@ -245,7 +245,7 @@ AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups
|
||||
AC_MSG_CHECKING(for default system groups)
|
||||
if test -f /etc/group; then
|
||||
CUPS_SYSTEM_GROUPS=""
|
||||
GROUP_LIST="lpadmin sys system root"
|
||||
GROUP_LIST="lpadmin sys system root wheel"
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
if test "x$CUPS_SYSTEM_GROUPS" = x; then
|
||||
|
@ -1,91 +0,0 @@
|
||||
dnl
|
||||
dnl Scripting configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Do we have Java?
|
||||
AC_ARG_WITH(java, [ --with-java set Java interpreter for web interfaces ],
|
||||
CUPS_JAVA="$withval",
|
||||
CUPS_JAVA="auto")
|
||||
|
||||
if test "x$CUPS_JAVA" = xauto; then
|
||||
AC_PATH_PROG(JAVA,java)
|
||||
CUPS_JAVA="$JAVA"
|
||||
elif test "x$CUPS_JAVA" = xno; then
|
||||
CUPS_JAVA=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_JAVA, "$CUPS_JAVA")
|
||||
|
||||
if test "x$CUPS_JAVA" != x; then
|
||||
AC_DEFINE(HAVE_JAVA)
|
||||
fi
|
||||
|
||||
dnl Do we have Perl?
|
||||
AC_ARG_WITH(perl, [ --with-perl set Perl interpreter for web interfaces ],
|
||||
CUPS_PERL="$withval",
|
||||
CUPS_PERL="auto")
|
||||
|
||||
if test "x$CUPS_PERL" = xauto; then
|
||||
AC_PATH_PROG(PERL,perl)
|
||||
CUPS_PERL="$PERL"
|
||||
elif test "x$CUPS_PERL" = xno; then
|
||||
CUPS_PERL=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PERL, "$CUPS_PERL")
|
||||
|
||||
if test "x$CUPS_PERL" != x; then
|
||||
AC_DEFINE(HAVE_PERL)
|
||||
fi
|
||||
|
||||
dnl Do we have PHP?
|
||||
AC_ARG_WITH(php, [ --with-php set PHP interpreter for web interfaces ],
|
||||
CUPS_PHP="$withval",
|
||||
CUPS_PHP="auto")
|
||||
|
||||
if test "x$CUPS_PHP" = xauto; then
|
||||
AC_PATH_PROG(PHPCGI,php-cgi)
|
||||
if test "x$PHPCGI" = x; then
|
||||
AC_PATH_PROG(PHP,php)
|
||||
CUPS_PHP="$PHP"
|
||||
else
|
||||
CUPS_PHP="$PHPCGI"
|
||||
fi
|
||||
elif test "x$CUPS_PHP" = xno; then
|
||||
CUPS_PHP=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PHP, "$CUPS_PHP")
|
||||
|
||||
if test "x$CUPS_PHP" = x; then
|
||||
CUPS_PHP="no"
|
||||
else
|
||||
AC_DEFINE(HAVE_PHP)
|
||||
fi
|
||||
|
||||
dnl Do we have Python?
|
||||
AC_ARG_WITH(python, [ --with-python set Python interpreter for web interfaces ],
|
||||
CUPS_PYTHON="$withval",
|
||||
CUPS_PYTHON="auto")
|
||||
|
||||
if test "x$CUPS_PYTHON" = xauto; then
|
||||
AC_PATH_PROG(PYTHON,python)
|
||||
CUPS_PYTHON="$PYTHON"
|
||||
elif test "x$CUPS_PYTHON" = xno; then
|
||||
CUPS_PYTHON=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PYTHON, "$CUPS_PYTHON")
|
||||
|
||||
if test "x$CUPS_PYTHON" != x; then
|
||||
AC_DEFINE(HAVE_PYTHON)
|
||||
fi
|
36
cups/configure
vendored
36
cups/configure
vendored
@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for CUPS 2.3.0.
|
||||
# Generated by GNU Autoconf 2.69 for CUPS 2.3.4.
|
||||
#
|
||||
# Report bugs to <https://github.com/apple/cups/issues>.
|
||||
#
|
||||
@ -580,8 +580,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='CUPS'
|
||||
PACKAGE_TARNAME='cups'
|
||||
PACKAGE_VERSION='2.3.0'
|
||||
PACKAGE_STRING='CUPS 2.3.0'
|
||||
PACKAGE_VERSION='2.3.4'
|
||||
PACKAGE_STRING='CUPS 2.3.4'
|
||||
PACKAGE_BUGREPORT='https://github.com/apple/cups/issues'
|
||||
PACKAGE_URL='https://www.cups.org/'
|
||||
|
||||
@ -1467,7 +1467,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures CUPS 2.3.0 to adapt to many kinds of systems.
|
||||
\`configure' configures CUPS 2.3.4 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@ -1532,7 +1532,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of CUPS 2.3.0:";;
|
||||
short | recursive ) echo "Configuration of CUPS 2.3.4:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@ -1713,7 +1713,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
CUPS configure 2.3.0
|
||||
CUPS configure 2.3.4
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@ -2177,7 +2177,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by CUPS $as_me 2.3.0, which was
|
||||
It was created by CUPS $as_me 2.3.4, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@ -2694,7 +2694,7 @@ done
|
||||
ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
CUPS_VERSION="2.3.0"
|
||||
CUPS_VERSION="2.3.4"
|
||||
CUPS_REVISION=""
|
||||
CUPS_BUILD="cups-$CUPS_VERSION"
|
||||
|
||||
@ -5775,6 +5775,10 @@ fi
|
||||
fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
# Check whether --enable-dbus was given.
|
||||
if test "${enable_dbus+set}" = set; then :
|
||||
enableval=$enable_dbus;
|
||||
@ -5787,10 +5791,6 @@ if test "${with_dbusdir+set}" = set; then :
|
||||
fi
|
||||
|
||||
|
||||
DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5
|
||||
$as_echo_n "checking for DBUS... " >&6; }
|
||||
@ -5818,7 +5818,7 @@ if test "x$ac_cv_func_dbus_threads_init" = xyes; then :
|
||||
fi
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
if test -d /etc/dbus-1; then
|
||||
if test -d /etc/dbus-1 -a "x$DBUSDIR" = x; then
|
||||
DBUSDIR="/etc/dbus-1"
|
||||
fi
|
||||
else
|
||||
@ -6911,8 +6911,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
# doesn't trigger...
|
||||
gccversion=`$CC --version | head -1 | awk '{print $NF}'`
|
||||
case "$gccversion" in
|
||||
7.* | 8.*)
|
||||
WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-tautological-compare"
|
||||
7.* | 8.* | 9.*)
|
||||
WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-format-overflow -Wno-tautological-compare"
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -9593,7 +9593,7 @@ else
|
||||
$as_echo_n "checking for default system groups... " >&6; }
|
||||
if test -f /etc/group; then
|
||||
CUPS_SYSTEM_GROUPS=""
|
||||
GROUP_LIST="lpadmin sys system root"
|
||||
GROUP_LIST="lpadmin sys system root wheel"
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
if test "x$CUPS_SYSTEM_GROUPS" = x; then
|
||||
@ -10385,7 +10385,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by CUPS $as_me 2.3.0, which was
|
||||
This file was extended by CUPS $as_me 2.3.4, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@ -10448,7 +10448,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
CUPS config.status 2.3.0
|
||||
CUPS config.status 2.3.4
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright © 2007-2019 by Apple Inc.
|
||||
dnl Copyright © 2007-2020 by Apple Inc.
|
||||
dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -12,7 +12,7 @@ dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Package name and version...
|
||||
AC_INIT([CUPS], [2.3.0], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
AC_INIT([CUPS], [2.3.4], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
|
128
cups/cups-config
128
cups/cups-config
@ -1,128 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# CUPS configuration utility.
|
||||
#
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 2001-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
VERSION="2.3.0"
|
||||
APIVERSION="2.3"
|
||||
BUILD="cups-483.2"
|
||||
|
||||
prefix=/
|
||||
exec_prefix=/usr
|
||||
bindir=/usr/bin
|
||||
includedir=/usr/include
|
||||
libdir=${exec_prefix}/lib
|
||||
datarootdir=/usr/share
|
||||
datadir=/usr/share
|
||||
sysconfdir=/private/etc
|
||||
cups_datadir=/usr/share/cups
|
||||
cups_serverbin=/usr/libexec/cups
|
||||
cups_serverroot=/private/etc/cups
|
||||
INSTALLSTATIC=
|
||||
|
||||
# flags for compiler and linker...
|
||||
CFLAGS=""
|
||||
LDFLAGS=""
|
||||
LIBS="-weak_framework Kerberos -weak_framework GSS -lz -lpthread -lresolv -framework SystemConfiguration -framework CoreFoundation -framework Security -liconv -lz"
|
||||
|
||||
# Check for local invocation...
|
||||
selfdir=`dirname $0`
|
||||
|
||||
if test -f "$selfdir/cups/cups.h"; then
|
||||
CFLAGS="-I$selfdir"
|
||||
LDFLAGS="-L$selfdir/cups $LDFLAGS"
|
||||
libdir="$selfdir/cups"
|
||||
else
|
||||
if test $includedir != /usr/include; then
|
||||
CFLAGS="$CFLAGS -I$includedir"
|
||||
fi
|
||||
|
||||
if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
|
||||
LDFLAGS="$LDFLAGS -L$libdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
usage ()
|
||||
{
|
||||
echo "Usage: cups-config --api-version"
|
||||
echo " cups-config --build"
|
||||
echo " cups-config --cflags"
|
||||
echo " cups-config --datadir"
|
||||
echo " cups-config --help"
|
||||
echo " cups-config --ldflags"
|
||||
echo " cups-config [--image] [--static] --libs"
|
||||
echo " cups-config --serverbin"
|
||||
echo " cups-config --serverroot"
|
||||
echo " cups-config --version"
|
||||
|
||||
exit $1
|
||||
}
|
||||
|
||||
if test $# -eq 0; then
|
||||
usage 1
|
||||
fi
|
||||
|
||||
# Parse command line options
|
||||
static=no
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--api-version)
|
||||
echo $APIVERSION
|
||||
;;
|
||||
--build)
|
||||
echo $BUILD
|
||||
;;
|
||||
--cflags)
|
||||
echo $CFLAGS
|
||||
;;
|
||||
--datadir)
|
||||
echo $cups_datadir
|
||||
;;
|
||||
--help)
|
||||
usage 0
|
||||
;;
|
||||
--image)
|
||||
# Do nothing
|
||||
;;
|
||||
--ldflags)
|
||||
echo $LDFLAGS
|
||||
;;
|
||||
--libs)
|
||||
if test $static = no; then
|
||||
libs="-lcups";
|
||||
else
|
||||
libs="$libdir/libcups.a $LIBS";
|
||||
fi
|
||||
echo $libs
|
||||
;;
|
||||
--serverbin)
|
||||
echo $cups_serverbin
|
||||
;;
|
||||
--serverroot)
|
||||
echo $cups_serverroot
|
||||
;;
|
||||
--static)
|
||||
if test -z "$INSTALLSTATIC"; then
|
||||
echo "WARNING: Static libraries not installed." >&2
|
||||
else
|
||||
static=yes
|
||||
fi
|
||||
;;
|
||||
--version)
|
||||
echo $VERSION
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
@ -188,7 +188,7 @@ tls.o: tls.c cups-private.h string-private.h ../config.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h tls-darwin.c
|
||||
debug-internal.h debug-private.h tls-darwin.c tls-darwin.h
|
||||
transcode.o: transcode.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
@ -214,7 +214,7 @@ adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h ppd.h cups.h raster.h adminutil.h
|
||||
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h
|
||||
array.h language.h pwg.h sidechannel.h
|
||||
backend.o: backend.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
@ -401,6 +401,9 @@ testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
snmp-private.h
|
||||
testthreads.o: testthreads.c ../cups/cups.h file.h versioning.h ipp.h \
|
||||
http.h array.h language.h pwg.h ../cups/thread-private.h ../config.h \
|
||||
../cups/versioning.h
|
||||
tlscheck.o: tlscheck.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
|
@ -106,6 +106,7 @@ TESTOBJS = \
|
||||
testpwg.o \
|
||||
testraster.o \
|
||||
testsnmp.o \
|
||||
testthreads.o \
|
||||
tlscheck.o
|
||||
OBJS = \
|
||||
$(LIBOBJS) \
|
||||
@ -191,6 +192,7 @@ UNITTARGETS = \
|
||||
testpwg \
|
||||
testraster \
|
||||
testsnmp \
|
||||
testthreads \
|
||||
tlscheck
|
||||
|
||||
TARGETS = \
|
||||
@ -700,6 +702,16 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# testthreads (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testthreads: testthreads.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testthreads.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# tlscheck (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -738,13 +738,9 @@ cupsAdminSetServerSettings(
|
||||
{
|
||||
if (!wrote_browsing)
|
||||
{
|
||||
int new_share_printers = (share_printers > 0 ||
|
||||
(share_printers == -1 &&
|
||||
old_share_printers > 0));
|
||||
|
||||
wrote_browsing = 1;
|
||||
|
||||
if (new_share_printers)
|
||||
if (share_printers)
|
||||
{
|
||||
const char *localp = cupsGetOption("BrowseLocalProtocols",
|
||||
num_settings, settings);
|
||||
@ -989,7 +985,7 @@ cupsAdminSetServerSettings(
|
||||
|
||||
in_cancel_job = 0;
|
||||
}
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location) &&
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location || in_log_location) &&
|
||||
(remote_admin >= 0 || remote_any >= 0)) ||
|
||||
(in_root_location && share_printers >= 0)) &&
|
||||
(!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") ||
|
||||
|
@ -289,7 +289,7 @@ cupsDoAuthentication(
|
||||
|
||||
if (_httpSetDigestAuthString(http, nonce, method, resource))
|
||||
{
|
||||
DEBUG_puts("2cupsDoAuthentication: Using Basic.");
|
||||
DEBUG_puts("2cupsDoAuthentication: Using Digest.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,12 @@ typedef struct _cups_raster_error_s /**** Error buffer structure ****/
|
||||
*end; /* End of buffer */
|
||||
} _cups_raster_error_t;
|
||||
|
||||
typedef enum _cups_digestoptions_e /**** Digest Options values */
|
||||
{
|
||||
_CUPS_DIGESTOPTIONS_NONE, /* No Digest authentication options */
|
||||
_CUPS_DIGESTOPTIONS_DENYMD5 /* Do not use MD5 hashes for digest */
|
||||
} _cups_digestoptions_t;
|
||||
|
||||
typedef enum _cups_uatokens_e /**** UserAgentTokens values */
|
||||
{
|
||||
_CUPS_UATOKENS_NONE, /* Do not send User-Agent */
|
||||
@ -76,6 +82,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
*cups_serverroot,
|
||||
/* CUPS_SERVERROOT environment var */
|
||||
*cups_statedir, /* CUPS_STATEDIR environment var */
|
||||
*home, /* HOME environment var */
|
||||
*localedir; /* LOCALDIR environment var */
|
||||
|
||||
/* adminutil.c */
|
||||
@ -157,6 +164,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
char tempfile[1024]; /* cupsTempFd/File buffer */
|
||||
|
||||
/* usersys.c */
|
||||
_cups_digestoptions_t digestoptions; /* DigestOptions setting */
|
||||
_cups_uatokens_t uatokens; /* UserAgentTokens setting */
|
||||
http_encryption_t encryption; /* Encryption setting */
|
||||
char user[65], /* User name */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* API definitions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2007-2020 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -42,10 +42,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 2.0300
|
||||
# define CUPS_VERSION 2.0304
|
||||
# define CUPS_VERSION_MAJOR 2
|
||||
# define CUPS_VERSION_MINOR 3
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
# define CUPS_VERSION_PATCH 4
|
||||
|
||||
# define CUPS_BC_FD 3
|
||||
/* Back-channel file descriptor for
|
||||
|
@ -1,8 +1,8 @@
|
||||
---
|
||||
title: CUPS Programming Manual
|
||||
author: Michael R Sweet
|
||||
copyright: Copyright © 2007-2019 by Apple Inc. All Rights Reserved.
|
||||
version: 2.3.0
|
||||
copyright: Copyright © 2007-2020 by Apple Inc. All Rights Reserved.
|
||||
version: 2.3.4
|
||||
...
|
||||
|
||||
> Please [file issues on Github](https://github.com/apple/cups/issues) to
|
||||
@ -108,7 +108,7 @@ to the file. Build and run (CMD+R) to see the list of destinations.
|
||||
|
||||
### Compiling with GCC
|
||||
|
||||
From the command-line, create a file called `sample.c` using your favorite
|
||||
From the command-line, create a file called `simple.c` using your favorite
|
||||
editor, copy the example to this file, and save. Then run the following command
|
||||
to compile it with GCC and run it:
|
||||
|
||||
|
@ -59,7 +59,7 @@ static void cups_update_ready(http_t *http, cups_dinfo_t *dinfo);
|
||||
/*
|
||||
* 'cupsAddDestMediaOptions()' - Add the option corresponding to the specified media size.
|
||||
*
|
||||
* @since CUPS 2.3@
|
||||
* @since CUPS 2.3/macOS 10.14@
|
||||
*/
|
||||
|
||||
int /* O - New number of options */
|
||||
|
@ -1748,7 +1748,6 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
cups_dest_t *dest; /* Destination */
|
||||
char filename[1024], /* Path to lpoptions */
|
||||
defname[256]; /* Default printer name */
|
||||
const char *home = getenv("HOME"); /* Home directory */
|
||||
int set_as_default = 0; /* Set returned destination as default */
|
||||
ipp_op_t op = IPP_OP_GET_PRINTER_ATTRIBUTES;
|
||||
/* IPP operation to get server ops */
|
||||
@ -1780,13 +1779,13 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
else
|
||||
instance = NULL;
|
||||
}
|
||||
else if (home)
|
||||
else if (cg->home)
|
||||
{
|
||||
/*
|
||||
* No default in the environment, try the user's lpoptions files...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
|
||||
dest_name = cups_get_default(filename, defname, sizeof(defname), &instance);
|
||||
|
||||
@ -1892,9 +1891,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
|
||||
|
||||
if (home)
|
||||
if (cg->home)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
|
||||
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
|
||||
}
|
||||
@ -2032,9 +2031,6 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
cups_option_t *option; /* Current option */
|
||||
_ipp_option_t *match; /* Matching attribute for option */
|
||||
FILE *fp; /* File pointer */
|
||||
#ifndef _WIN32
|
||||
const char *home; /* HOME environment variable */
|
||||
#endif /* _WIN32 */
|
||||
char filename[1024]; /* lpoptions file */
|
||||
int num_temps; /* Number of temporary destinations */
|
||||
cups_dest_t *temps = NULL, /* Temporary destinations */
|
||||
@ -2068,27 +2064,18 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
|
||||
#ifndef _WIN32
|
||||
if (getuid())
|
||||
if (cg->home)
|
||||
{
|
||||
/*
|
||||
* Point to user defaults...
|
||||
* Create ~/.cups subdirectory...
|
||||
*/
|
||||
|
||||
if ((home = getenv("HOME")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Create ~/.cups subdirectory...
|
||||
*/
|
||||
snprintf(filename, sizeof(filename), "%s/.cups", cg->home);
|
||||
if (access(filename, 0))
|
||||
mkdir(filename, 0700);
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups", home);
|
||||
if (access(filename, 0))
|
||||
mkdir(filename, 0700);
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
}
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
}
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
/*
|
||||
* Try to open the file...
|
||||
@ -2269,7 +2256,7 @@ _cupsUserDefault(char *name, /* I - Name buffer */
|
||||
* system preferences...
|
||||
*/
|
||||
|
||||
if ((locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
|
||||
if (!getenv("CUPS_NO_APPLE_DEFAULT") && (locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
|
||||
{
|
||||
CFStringGetCString(locprinter, name, (CFIndex)namesize, kCFStringEncodingUTF8);
|
||||
CFRelease(locprinter);
|
||||
@ -3392,10 +3379,9 @@ cups_enum_dests(
|
||||
int i, j, /* Looping vars */
|
||||
num_dests; /* Number of destinations */
|
||||
cups_dest_t *dests = NULL, /* Destinations */
|
||||
*dest, /* Current destination */
|
||||
*user_dest; /* User destination */
|
||||
*dest; /* Current destination */
|
||||
cups_option_t *option; /* Current option */
|
||||
char *user_default; /* User default printer */
|
||||
const char *user_default; /* Default printer from environment */
|
||||
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
int count, /* Number of queries started */
|
||||
completed, /* Number of completed queries */
|
||||
@ -3426,7 +3412,6 @@ cups_enum_dests(
|
||||
#else
|
||||
_cups_getdata_t data; /* Data for callback */
|
||||
#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
const char *home; /* HOME environment variable */
|
||||
char filename[1024]; /* Local lpoptions file */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
@ -3451,13 +3436,35 @@ cups_enum_dests(
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
if ((user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name))) == NULL)
|
||||
{
|
||||
const char *defprinter = cupsGetDefault2(http);
|
||||
/* Server default, if any */
|
||||
user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name));
|
||||
|
||||
if (defprinter)
|
||||
strlcpy(data.def_name, defprinter, sizeof(data.def_name));
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
|
||||
|
||||
if (cg->home)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
|
||||
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
|
||||
}
|
||||
|
||||
if (!user_default && (dest = cupsGetDest(NULL, NULL, data.num_dests, data.dests)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Use an lpoptions default printer...
|
||||
*/
|
||||
|
||||
if (dest->instance)
|
||||
snprintf(data.def_name, sizeof(data.def_name), "%s/%s", dest->name, dest->instance);
|
||||
else
|
||||
strlcpy(data.def_name, dest->name, sizeof(data.def_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *default_printer; /* Server default printer */
|
||||
|
||||
if ((default_printer = cupsGetDefault2(http)) != NULL)
|
||||
strlcpy(data.def_name, default_printer, sizeof(data.def_name));
|
||||
}
|
||||
|
||||
if (data.def_name[0])
|
||||
@ -3472,16 +3479,6 @@ cups_enum_dests(
|
||||
|
||||
DEBUG_printf(("1cups_enum_dests: def_name=\"%s\", def_instance=\"%s\"", data.def_name, data.def_instance));
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
|
||||
|
||||
if ((home = getenv("HOME")) != NULL)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
|
||||
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get ready to enumerate...
|
||||
*/
|
||||
@ -3519,8 +3516,9 @@ cups_enum_dests(
|
||||
i > 0 && (!cancel || !*cancel);
|
||||
i --, dest ++)
|
||||
{
|
||||
cups_dest_t *user_dest; /* Destination from lpoptions */
|
||||
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
const char *device_uri; /* Device URI */
|
||||
const char *device_uri; /* Device URI */
|
||||
#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
|
||||
@ -3789,6 +3787,8 @@ cups_enum_dests(
|
||||
|
||||
if ((device->type & mask) == type)
|
||||
{
|
||||
cups_dest_t *user_dest; /* Destination from lpoptions */
|
||||
|
||||
dest = &device->dest;
|
||||
|
||||
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Option encoding routines for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -523,7 +523,7 @@ _cupsEncodeOption(
|
||||
|
||||
quote = *sep;
|
||||
}
|
||||
else if (*sep == ',' && count > 1)
|
||||
else if (*sep == ',')
|
||||
break;
|
||||
else if (*sep == '\\' && sep[1])
|
||||
{
|
||||
@ -673,7 +673,7 @@ _cupsEncodeOption(
|
||||
/*
|
||||
* 'cupsEncodeOption()' - Encode a single option into an IPP attribute.
|
||||
*
|
||||
* @since CUPS 2.3@
|
||||
* @since CUPS 2.3/macOS 10.14@
|
||||
*/
|
||||
|
||||
ipp_attribute_t * /* O - New attribute or @code NULL@ on error */
|
||||
|
@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Global variable access routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -12,6 +13,9 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#ifndef _WIN32
|
||||
# include <pwd.h>
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@ -269,6 +273,8 @@ cups_globals_alloc(void)
|
||||
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
|
||||
cg->localedir = localedir;
|
||||
|
||||
cg->home = getenv("HOME");
|
||||
|
||||
#else
|
||||
# ifdef HAVE_GETEUID
|
||||
if ((geteuid() != getuid() && getuid()) || getegid() != getgid())
|
||||
@ -307,6 +313,21 @@ cups_globals_alloc(void)
|
||||
|
||||
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
|
||||
cg->localedir = CUPS_LOCALEDIR;
|
||||
|
||||
cg->home = getenv("HOME");
|
||||
|
||||
# ifdef __APPLE__ /* Sandboxing now exposes the container as the home directory */
|
||||
if (cg->home && strstr(cg->home, "/Library/Containers/"))
|
||||
cg->home = NULL;
|
||||
# endif /* !__APPLE__ */
|
||||
}
|
||||
|
||||
if (!cg->home)
|
||||
{
|
||||
struct passwd *pw; /* User info */
|
||||
|
||||
if ((pw = getpwuid(getuid())) != NULL)
|
||||
cg->home = _cupsStrAlloc(pw->pw_dir);
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
#elif defined(HAVE_GNUTLS)
|
||||
# include <gnutls/crypto.h>
|
||||
# include "md5-internal.h"
|
||||
#else
|
||||
# include "md5-internal.h"
|
||||
#endif /* __APPLE__ */
|
||||
@ -185,8 +186,24 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
|
||||
unsigned char temp[64]; /* Temporary hash buffer */
|
||||
size_t tempsize = 0; /* Truncate to this size? */
|
||||
|
||||
|
||||
if (!strcmp(algorithm, "md5"))
|
||||
alg = GNUTLS_DIG_MD5;
|
||||
{
|
||||
/*
|
||||
* Some versions of GNU TLS disable MD5 without warning...
|
||||
*/
|
||||
|
||||
_cups_md5_state_t state; /* MD5 state info */
|
||||
|
||||
if (hashsize < 16)
|
||||
goto too_small;
|
||||
|
||||
_cupsMD5Init(&state);
|
||||
_cupsMD5Append(&state, data, datalen);
|
||||
_cupsMD5Finish(&state, hash);
|
||||
|
||||
return (16);
|
||||
}
|
||||
else if (!strcmp(algorithm, "sha"))
|
||||
alg = GNUTLS_DIG_SHA1;
|
||||
else if (!strcmp(algorithm, "sha2-224"))
|
||||
@ -242,6 +259,9 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
|
||||
{
|
||||
_cups_md5_state_t state; /* MD5 state info */
|
||||
|
||||
if (hashsize < 16)
|
||||
goto too_small;
|
||||
|
||||
_cupsMD5Init(&state);
|
||||
_cupsMD5Append(&state, data, datalen);
|
||||
_cupsMD5Finish(&state, hash);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* HTTP support routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -799,14 +799,12 @@ httpGetDateString2(time_t t, /* I - Time in seconds */
|
||||
char *s, /* I - String buffer */
|
||||
int slen) /* I - Size of string buffer */
|
||||
{
|
||||
struct tm *tdate; /* UNIX date/time data */
|
||||
struct tm tdate; /* UNIX date/time data */
|
||||
|
||||
|
||||
tdate = gmtime(&t);
|
||||
if (tdate)
|
||||
snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate->tm_wday], tdate->tm_mday, http_months[tdate->tm_mon], tdate->tm_year + 1900, tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
|
||||
else
|
||||
s[0] = '\0';
|
||||
gmtime_r(&t, &tdate);
|
||||
|
||||
snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate.tm_wday], tdate.tm_mday, http_months[tdate.tm_mon], tdate.tm_year + 1900, tdate.tm_hour, tdate.tm_min, tdate.tm_sec);
|
||||
|
||||
return (s);
|
||||
}
|
||||
@ -1321,6 +1319,7 @@ _httpSetDigestAuthString(
|
||||
digest[1024]; /* Digest auth data */
|
||||
unsigned char hash[32]; /* Hash buffer */
|
||||
size_t hashsize; /* Size of hash */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
|
||||
|
||||
|
||||
DEBUG_printf(("2_httpSetDigestAuthString(http=%p, nonce=\"%s\", method=\"%s\", resource=\"%s\")", (void *)http, nonce, method, resource));
|
||||
@ -1363,6 +1362,12 @@ _httpSetDigestAuthString(
|
||||
* RFC 2617 Digest with MD5
|
||||
*/
|
||||
|
||||
if (cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5)
|
||||
{
|
||||
DEBUG_puts("3_httpSetDigestAuthString: MD5 Digest is disabled.");
|
||||
return (0);
|
||||
}
|
||||
|
||||
hashalg = "md5";
|
||||
}
|
||||
else if (!_cups_strcasecmp(http->algorithm, "SHA-256"))
|
||||
|
@ -1733,7 +1733,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (http->used > 0 && ((z_stream *)http->stream)->avail_in < HTTP_MAX_BUFFER)
|
||||
{
|
||||
size_t buflen = buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
|
||||
size_t buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
|
||||
/* Number of bytes to copy */
|
||||
|
||||
if (((z_stream *)http->stream)->avail_in > 0 &&
|
||||
|
@ -460,7 +460,7 @@ static const char * const ipp_document_states[] =
|
||||
"punch-multiple-top", /* IPP Finishings 2.1/Canon */
|
||||
"punch-multiple-right",/* IPP Finishings 2.1/Canon */
|
||||
"punch-multiple-bottom",/* IPP Finishings 2.1/Canon */
|
||||
"fold-accordian", /* IPP Finishings 2.0 */
|
||||
"fold-accordion", /* IPP Finishings 2.0 */
|
||||
"fold-double-gate", /* IPP Finishings 2.0 */
|
||||
"fold-gate", /* IPP Finishings 2.0 */
|
||||
"fold-half", /* IPP Finishings 2.0 */
|
||||
@ -571,7 +571,7 @@ static const char * const ipp_document_states[] =
|
||||
"0x40000057",
|
||||
"0x40000058",
|
||||
"0x40000059",
|
||||
"cups-fold-accordian",
|
||||
"cups-fold-accordion",
|
||||
"cups-fold-double-gate",
|
||||
"cups-fold-gate",
|
||||
"cups-fold-half",
|
||||
@ -2093,7 +2093,7 @@ ippEnumString(const char *attrname, /* I - Attribute name */
|
||||
{
|
||||
if (enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
|
||||
return (ipp_finishings[enumvalue - 3]);
|
||||
else if (enumvalue >= 0x40000000 && enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0]))))
|
||||
else if (enumvalue >= 0x40000000 && enumvalue < (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0]))))
|
||||
return (ipp_finishings_vendor[enumvalue - 0x40000000]);
|
||||
}
|
||||
else if ((!strcmp(attrname, "job-collation-type") || !strcmp(attrname, "job-collation-type-actual")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) / sizeof(ipp_job_collation_types[0]))))
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Internet Printing Protocol functions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2007-2020 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -2866,7 +2866,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
unsigned char *buffer, /* Data buffer */
|
||||
string[IPP_MAX_TEXT],
|
||||
/* Small string buffer */
|
||||
*bufptr; /* Pointer into buffer */
|
||||
*bufptr, /* Pointer into buffer */
|
||||
*bufptrEnd; /* Pointer after valid buffer range */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
ipp_tag_t tag; /* Current tag */
|
||||
ipp_tag_t value_tag; /* Current value tag */
|
||||
@ -3040,8 +3041,13 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
DEBUG_printf(("2ippReadIO: name length=%d", n));
|
||||
|
||||
if (n == 0 && tag != IPP_TAG_MEMBERNAME &&
|
||||
tag != IPP_TAG_END_COLLECTION)
|
||||
if (n && parent)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid named IPP attribute in collection."), 1);
|
||||
DEBUG_puts("1ippReadIO: bad attribute name in collection.");
|
||||
return (IPP_STATE_ERROR);
|
||||
}
|
||||
else if (n == 0 && tag != IPP_TAG_MEMBERNAME && tag != IPP_TAG_END_COLLECTION)
|
||||
{
|
||||
/*
|
||||
* More values for current attribute...
|
||||
@ -3436,6 +3442,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
}
|
||||
|
||||
bufptr = buffer;
|
||||
bufptrEnd = &buffer[n];
|
||||
|
||||
|
||||
/*
|
||||
* text-with-language and name-with-language are composite
|
||||
@ -3449,7 +3457,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
n = (bufptr[0] << 8) | bufptr[1];
|
||||
|
||||
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) || n >= (int)sizeof(string))
|
||||
if ((bufptr + 2 + n) > bufptrEnd || n >= (int)sizeof(string))
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL,
|
||||
_("IPP language length overflows value."), 1);
|
||||
@ -3476,7 +3484,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
bufptr += 2 + n;
|
||||
n = (bufptr[0] << 8) | bufptr[1];
|
||||
|
||||
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
|
||||
if ((bufptr + 2 + n) > bufptrEnd)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL,
|
||||
_("IPP string length overflows value."), 1);
|
||||
@ -4654,7 +4662,7 @@ ippSetVersion(ipp_t *ipp, /* I - IPP message */
|
||||
const ipp_uchar_t * /* O - RFC-2579 date/time data */
|
||||
ippTimeToDate(time_t t) /* I - Time in seconds */
|
||||
{
|
||||
struct tm *unixdate; /* UNIX unixdate/time info */
|
||||
struct tm unixdate; /* UNIX unixdate/time info */
|
||||
ipp_uchar_t *date = _cupsGlobals()->ipp_date;
|
||||
/* RFC-2579 date/time data */
|
||||
|
||||
@ -4676,16 +4684,16 @@ ippTimeToDate(time_t t) /* I - Time in seconds */
|
||||
* 10 UTC minutes (0 to 59)
|
||||
*/
|
||||
|
||||
unixdate = gmtime(&t);
|
||||
unixdate->tm_year += 1900;
|
||||
gmtime_r(&t, &unixdate);
|
||||
unixdate.tm_year += 1900;
|
||||
|
||||
date[0] = (ipp_uchar_t)(unixdate->tm_year >> 8);
|
||||
date[1] = (ipp_uchar_t)(unixdate->tm_year);
|
||||
date[2] = (ipp_uchar_t)(unixdate->tm_mon + 1);
|
||||
date[3] = (ipp_uchar_t)unixdate->tm_mday;
|
||||
date[4] = (ipp_uchar_t)unixdate->tm_hour;
|
||||
date[5] = (ipp_uchar_t)unixdate->tm_min;
|
||||
date[6] = (ipp_uchar_t)unixdate->tm_sec;
|
||||
date[0] = (ipp_uchar_t)(unixdate.tm_year >> 8);
|
||||
date[1] = (ipp_uchar_t)(unixdate.tm_year);
|
||||
date[2] = (ipp_uchar_t)(unixdate.tm_mon + 1);
|
||||
date[3] = (ipp_uchar_t)unixdate.tm_mday;
|
||||
date[4] = (ipp_uchar_t)unixdate.tm_hour;
|
||||
date[5] = (ipp_uchar_t)unixdate.tm_min;
|
||||
date[6] = (ipp_uchar_t)unixdate.tm_sec;
|
||||
date[7] = 0;
|
||||
date[8] = '+';
|
||||
date[9] = 0;
|
||||
|
@ -145,11 +145,11 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
|
||||
IPP_FINISHINGS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge */
|
||||
IPP_FINISHINGS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side */
|
||||
IPP_FINISHINGS_PUNCH_QUAD_BOTTOM, /* Punch 4 holes bottom edge */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT, /* Pucnh multiple holes left side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_TOP, /* Pucnh multiple holes top edge */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT, /* Pucnh multiple holes right side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM, /* Pucnh multiple holes bottom edge */
|
||||
IPP_FINISHINGS_FOLD_ACCORDIAN = 90, /* Accordian-fold the paper vertically into four sections */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT, /* Punch multiple holes left side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_TOP, /* Punch multiple holes top edge */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT, /* Punch multiple holes right side */
|
||||
IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM, /* Punch multiple holes bottom edge */
|
||||
IPP_FINISHINGS_FOLD_ACCORDION = 90, /* Accordion-fold the paper vertically into four sections */
|
||||
IPP_FINISHINGS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */
|
||||
IPP_FINISHINGS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline */
|
||||
IPP_FINISHINGS_FOLD_HALF, /* Fold the paper in half vertically */
|
||||
@ -184,8 +184,8 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
|
||||
IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM,/* Punch 4 holes bottom edge @exclude all@ */
|
||||
|
||||
IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN = 0x4000005A,
|
||||
/* Accordian-fold the paper vertically into four sections @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_ACCORDION = 0x4000005A,
|
||||
/* Accordion-fold the paper vertically into four sections @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline @exclude all@ */
|
||||
IPP_FINISHINGS_CUPS_FOLD_HALF, /* Fold the paper in half vertically @exclude all@ */
|
||||
@ -198,8 +198,10 @@ typedef enum ipp_finishings_e /**** Finishings values ****/
|
||||
IPP_FINISHINGS_CUPS_FOLD_Z /* Fold the paper vertically into three sections, forming a Z @exclude all@ */
|
||||
} ipp_finishings_t;
|
||||
# ifndef _CUPS_NO_DEPRECATED
|
||||
# define IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN IPP_FINISHINGS_CUPS_FOLD_ACCORDION
|
||||
# define IPP_FINISHINGS_FOLD_ACCORDIAN IPP_FINISHINGS_FOLD_ACCORDION
|
||||
# define IPP_FINISHINGS_JOB_OFFSET IPP_FINISHINGS_JOG_OFFSET
|
||||
/* Long-time misspelling... */
|
||||
/* Long-time misspellings... */
|
||||
typedef enum ipp_finishings_e ipp_finish_t;
|
||||
# endif /* !_CUPS_NO_DEPRECATED */
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "md5-internal.h"
|
||||
#include "string-private.h"
|
||||
|
||||
#if !defined(__APPLE__) && !defined(HAVE_GNUTLS)
|
||||
#if !defined(__APPLE__)
|
||||
# define T1 0xd76aa478
|
||||
# define T2 0xe8c7b756
|
||||
# define T3 0x242070db
|
||||
@ -338,4 +338,4 @@ _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16])
|
||||
for (i = 0; i < 16; ++i)
|
||||
digest[i] = (unsigned char)(pms->abcd[i >> 2] >> ((i & 3) << 3));
|
||||
}
|
||||
#endif /* !__APPLE__ && !HAVE_GNUTLS */
|
||||
#endif /* !__APPLE__ */
|
||||
|
@ -1075,7 +1075,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
* Convert the PPD size name to the corresponding PWG keyword name.
|
||||
*/
|
||||
|
||||
if ((pwg_media = pwgMediaForPPD(ppd_size->name)) != NULL)
|
||||
if ((pwg_media = pwgMediaForSize(PWG_FROM_POINTS(ppd_size->width), PWG_FROM_POINTS(ppd_size->length))) != NULL)
|
||||
{
|
||||
/*
|
||||
* Standard name, do we have conflicts?
|
||||
@ -3983,7 +3983,25 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((attr = ippFindAttribute(response, "finishings-supported", IPP_TAG_ENUM)) != NULL)
|
||||
{
|
||||
int value; /* Enum value */
|
||||
const char *ppd_keyword; /* PPD keyword for enum */
|
||||
cups_array_t *names; /* Names we've added */
|
||||
static const char * const base_keywords[] =
|
||||
{ /* Base STD 92 keywords */
|
||||
NULL, /* none */
|
||||
"SingleAuto", /* staple */
|
||||
"SingleAuto", /* punch */
|
||||
NULL, /* cover */
|
||||
"BindAuto", /* bind */
|
||||
"SaddleStitch", /* saddle-stitch */
|
||||
"EdgeStitchAuto", /* edge-stitch */
|
||||
"Auto", /* fold */
|
||||
NULL, /* trim */
|
||||
NULL, /* bale */
|
||||
NULL, /* booklet-maker */
|
||||
NULL, /* jog-offset */
|
||||
NULL, /* coat */
|
||||
NULL /* laminate */
|
||||
};
|
||||
|
||||
count = ippGetCount(attr);
|
||||
names = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0, (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
|
||||
@ -4004,6 +4022,33 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const staple_keywords[] =
|
||||
{ /* StapleLocation keywords */
|
||||
"SinglePortrait",
|
||||
"SingleRevLandscape",
|
||||
"SingleLandscape",
|
||||
"SingleRevPortrait",
|
||||
"EdgeStitchPortrait",
|
||||
"EdgeStitchLandscape",
|
||||
"EdgeStitchRevPortrait",
|
||||
"EdgeStitchRevLandscape",
|
||||
"DualPortrait",
|
||||
"DualLandscape",
|
||||
"DualRevPortrait",
|
||||
"DualRevLandscape",
|
||||
"TriplePortrait",
|
||||
"TripleLandscape",
|
||||
"TripleRevPortrait",
|
||||
"TripleRevLandscape"
|
||||
};
|
||||
static const char * const bind_keywords[] =
|
||||
{ /* StapleLocation binding keywords */
|
||||
"BindPortrait",
|
||||
"BindLandscape",
|
||||
"BindRevPortrait",
|
||||
"BindRevLandscape"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*StapleLocation");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *StapleLocation: PickOne\n");
|
||||
@ -4031,9 +4076,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", keyword);
|
||||
cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, keyword);
|
||||
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
|
||||
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
|
||||
else if (value >= IPP_FINISHINGS_STAPLE_TOP_LEFT && value <= IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM)
|
||||
ppd_keyword = staple_keywords[value - IPP_FINISHINGS_STAPLE_TOP_LEFT];
|
||||
else if (value >= IPP_FINISHINGS_BIND_LEFT && value <= IPP_FINISHINGS_BIND_BOTTOM)
|
||||
ppd_keyword = bind_keywords[value - IPP_FINISHINGS_BIND_LEFT];
|
||||
else
|
||||
ppd_keyword = NULL;
|
||||
|
||||
if (!ppd_keyword)
|
||||
continue;
|
||||
|
||||
cupsFilePrintf(fp, "*StapleLocation %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.StapleLocation %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*StapleLocation %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *StapleLocation\n");
|
||||
@ -4048,12 +4105,28 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (!strncmp(keyword, "fold-", 5))
|
||||
if (!strncmp(keyword, "cups-fold-", 10) || !strcmp(keyword, "fold") || !strncmp(keyword, "fold-", 5))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const fold_keywords[] =
|
||||
{ /* FoldType keywords */
|
||||
"Accordion",
|
||||
"DoubleGate",
|
||||
"Gate",
|
||||
"Half",
|
||||
"HalfZ",
|
||||
"LeftGate",
|
||||
"Letter",
|
||||
"Parallel",
|
||||
"XFold",
|
||||
"RightGate",
|
||||
"ZFold",
|
||||
"EngineeringZ"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*FoldType");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *FoldType: PickOne\n");
|
||||
@ -4068,7 +4141,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (strncmp(keyword, "fold-", 5))
|
||||
if (!strncmp(keyword, "cups-fold-", 10))
|
||||
keyword += 5;
|
||||
else if (strcmp(keyword, "fold") && strncmp(keyword, "fold-", 5))
|
||||
continue;
|
||||
|
||||
if (cupsArrayFind(names, (char *)keyword))
|
||||
@ -4081,9 +4156,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
cupsFilePrintf(fp, "*FoldType %s: \"\"\n", keyword);
|
||||
cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, keyword);
|
||||
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
|
||||
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
|
||||
else if (value >= IPP_FINISHINGS_FOLD_ACCORDION && value <= IPP_FINISHINGS_FOLD_ENGINEERING_Z)
|
||||
ppd_keyword = fold_keywords[value - IPP_FINISHINGS_FOLD_ACCORDION];
|
||||
else if (value >= IPP_FINISHINGS_CUPS_FOLD_ACCORDION && value <= IPP_FINISHINGS_CUPS_FOLD_Z)
|
||||
ppd_keyword = fold_keywords[value - IPP_FINISHINGS_CUPS_FOLD_ACCORDION];
|
||||
else
|
||||
ppd_keyword = NULL;
|
||||
|
||||
if (!ppd_keyword)
|
||||
continue;
|
||||
|
||||
cupsFilePrintf(fp, "*FoldType %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.FoldType %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*FoldType %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *FoldType\n");
|
||||
@ -4098,12 +4185,36 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (!strncmp(keyword, "punch-", 6))
|
||||
if (!strncmp(keyword, "cups-punch-", 11) || !strncmp(keyword, "punch-", 6))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const punch_keywords[] =
|
||||
{ /* PunchMedia keywords */
|
||||
"SinglePortrait",
|
||||
"SingleRevLandscape",
|
||||
"SingleLandscape",
|
||||
"SingleRevPortrait",
|
||||
"DualPortrait",
|
||||
"DualLandscape",
|
||||
"DualRevPortrait",
|
||||
"DualRevLandscape",
|
||||
"TriplePortrait",
|
||||
"TripleLandscape",
|
||||
"TripleRevPortrait",
|
||||
"TripleRevLandscape",
|
||||
"QuadPortrait",
|
||||
"QuadLandscape",
|
||||
"QuadRevPortrait",
|
||||
"QuadRevLandscape",
|
||||
"MultiplePortrait",
|
||||
"MultipleLandscape",
|
||||
"MultipleRevPortrait",
|
||||
"MultipleRevLandscape"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*PunchMedia");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *PunchMedia: PickOne\n");
|
||||
@ -4118,7 +4229,9 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (strncmp(keyword, "punch-", 6))
|
||||
if (!strncmp(keyword, "cups-punch-", 11))
|
||||
keyword += 5;
|
||||
else if (strncmp(keyword, "punch-", 6))
|
||||
continue;
|
||||
|
||||
if (cupsArrayFind(names, (char *)keyword))
|
||||
@ -4131,9 +4244,21 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", keyword);
|
||||
cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, keyword);
|
||||
if (value >= IPP_FINISHINGS_NONE && value <= IPP_FINISHINGS_LAMINATE)
|
||||
ppd_keyword = base_keywords[value - IPP_FINISHINGS_NONE];
|
||||
else if (value >= IPP_FINISHINGS_PUNCH_TOP_LEFT && value <= IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM)
|
||||
ppd_keyword = punch_keywords[value - IPP_FINISHINGS_PUNCH_TOP_LEFT];
|
||||
else if (value >= IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT && value <= IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM)
|
||||
ppd_keyword = punch_keywords[value - IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT];
|
||||
else
|
||||
ppd_keyword = NULL;
|
||||
|
||||
if (!ppd_keyword)
|
||||
continue;
|
||||
|
||||
cupsFilePrintf(fp, "*PunchMedia %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.PunchMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*PunchMedia %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *PunchMedia\n");
|
||||
@ -4157,6 +4282,69 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
cupsFilePuts(fp, "*CloseUI: *Booklet\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* CutMedia
|
||||
*/
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (!strcmp(keyword, "trim") || !strncmp(keyword, "trim-", 5))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
static const char * const trim_keywords[] =
|
||||
{ /* CutMedia keywords */
|
||||
"EndOfPage",
|
||||
"EndOfDoc",
|
||||
"EndOfSet",
|
||||
"EndOfJob"
|
||||
};
|
||||
|
||||
cupsArrayAdd(fin_options, "*CutMedia");
|
||||
|
||||
cupsFilePuts(fp, "*OpenUI *CutMedia: PickOne\n");
|
||||
cupsFilePuts(fp, "*OrderDependency: 10 AnySetup *CutMedia\n");
|
||||
cupsFilePrintf(fp, "*%s.Translation CutMedia/%s: \"\"\n", lang->language, _cupsLangString(lang, _("Cut")));
|
||||
cupsFilePuts(fp, "*DefaultCutMedia: None\n");
|
||||
cupsFilePuts(fp, "*CutMedia None: \"\"\n");
|
||||
cupsFilePrintf(fp, "*%s.CutMedia None/%s: \"\"\n", lang->language, _cupsLangString(lang, _("None")));
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
value = ippGetInteger(attr, i);
|
||||
keyword = ippEnumString("finishings", value);
|
||||
|
||||
if (strcmp(keyword, "trim") && strncmp(keyword, "trim-", 5))
|
||||
continue;
|
||||
|
||||
if (cupsArrayFind(names, (char *)keyword))
|
||||
continue; /* Already did this finishing template */
|
||||
|
||||
cupsArrayAdd(names, (char *)keyword);
|
||||
|
||||
snprintf(msgid, sizeof(msgid), "finishings.%d", value);
|
||||
if ((msgstr = _cupsLangString(lang, msgid)) == msgid || !strcmp(msgid, msgstr))
|
||||
if ((msgstr = _cupsMessageLookup(strings, msgid)) == msgid)
|
||||
msgstr = keyword;
|
||||
|
||||
if (value == IPP_FINISHINGS_TRIM)
|
||||
ppd_keyword = "Auto";
|
||||
else
|
||||
ppd_keyword = trim_keywords[value - IPP_FINISHINGS_TRIM_AFTER_PAGES];
|
||||
|
||||
cupsFilePrintf(fp, "*CutMedia %s: \"\"\n", ppd_keyword);
|
||||
cupsFilePrintf(fp, "*%s.CutMedia %s/%s: \"\"\n", lang->language, ppd_keyword, msgstr);
|
||||
cupsFilePrintf(fp, "*cupsIPPFinishings %d/%s: \"*CutMedia %s\"\n", value, keyword, ppd_keyword);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "*CloseUI: *CutMedia\n");
|
||||
}
|
||||
|
||||
cupsArrayDelete(names);
|
||||
}
|
||||
|
||||
@ -4184,7 +4372,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
|
||||
if (!keyword || cupsArrayFind(templates, (void *)keyword))
|
||||
continue;
|
||||
|
||||
if (strncmp(keyword, "fold-", 5) && (strstr(keyword, "-bottom") || strstr(keyword, "-left") || strstr(keyword, "-right") || strstr(keyword, "-top")))
|
||||
if (!strcmp(keyword, "none"))
|
||||
continue;
|
||||
|
||||
cupsArrayAdd(templates, (void *)keyword);
|
||||
|
@ -664,6 +664,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@ -710,6 +713,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@ -805,6 +811,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
@ -1007,6 +1016,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_POINTS :
|
||||
|
@ -851,6 +851,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@ -928,6 +931,9 @@ ppd_mark_option(ppd_file_t *ppd, /* I - PPD file */
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
|
@ -705,6 +705,8 @@ _ppdOpen(
|
||||
strncmp(ll, keyword, ll_len)))
|
||||
{
|
||||
DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
|
||||
free(string);
|
||||
string = NULL;
|
||||
continue;
|
||||
}
|
||||
else if (localization == _PPD_LOCALIZATION_ICC_PROFILES)
|
||||
@ -724,6 +726,8 @@ _ppdOpen(
|
||||
if (i >= (int)(sizeof(color_keywords) / sizeof(color_keywords[0])))
|
||||
{
|
||||
DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
|
||||
free(string);
|
||||
string = NULL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -988,6 +992,13 @@ _ppdOpen(
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (cparam->type != PPD_CUSTOM_UNKNOWN)
|
||||
{
|
||||
pg->ppd_status = PPD_BAD_CUSTOM_PARAM;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the parameter data...
|
||||
*/
|
||||
@ -1708,8 +1719,7 @@ _ppdOpen(
|
||||
constraint->choice1, constraint->option2,
|
||||
constraint->choice2))
|
||||
{
|
||||
case 0 : /* Error */
|
||||
case 1 : /* Error */
|
||||
default : /* Error */
|
||||
pg->ppd_status = PPD_BAD_UI_CONSTRAINTS;
|
||||
goto error;
|
||||
|
||||
@ -1861,6 +1871,13 @@ _ppdOpen(
|
||||
}
|
||||
else if (!strcmp(keyword, "PaperDimension"))
|
||||
{
|
||||
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
||||
{
|
||||
char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
||||
snprintf(cname, sizeof(cname), "_%s", name);
|
||||
strlcpy(name, cname, sizeof(name));
|
||||
}
|
||||
|
||||
if ((size = ppdPageSize(ppd, name)) == NULL)
|
||||
size = ppd_add_size(ppd, name);
|
||||
|
||||
@ -1883,6 +1900,13 @@ _ppdOpen(
|
||||
}
|
||||
else if (!strcmp(keyword, "ImageableArea"))
|
||||
{
|
||||
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
||||
{
|
||||
char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
||||
snprintf(cname, sizeof(cname), "_%s", name);
|
||||
strlcpy(name, cname, sizeof(name));
|
||||
}
|
||||
|
||||
if ((size = ppdPageSize(ppd, name)) == NULL)
|
||||
size = ppd_add_size(ppd, name);
|
||||
|
||||
@ -1912,6 +1936,13 @@ _ppdOpen(
|
||||
{
|
||||
DEBUG_printf(("2_ppdOpen: group=%p, subgroup=%p", group, subgroup));
|
||||
|
||||
if (!_cups_strcasecmp(name, "custom") || !_cups_strncasecmp(name, "custom.", 7))
|
||||
{
|
||||
char cname[PPD_MAX_NAME]; /* Rewrite with a leading underscore */
|
||||
snprintf(cname, sizeof(cname), "_%s", name);
|
||||
strlcpy(name, cname, sizeof(name));
|
||||
}
|
||||
|
||||
if (!strcmp(keyword, "PageSize"))
|
||||
{
|
||||
/*
|
||||
@ -2304,8 +2335,16 @@ ppd_add_attr(ppd_file_t *ppd, /* I - PPD file data */
|
||||
* Copy data over...
|
||||
*/
|
||||
|
||||
if (!_cups_strcasecmp(spec, "custom") || !_cups_strncasecmp(spec, "custom.", 7))
|
||||
{
|
||||
temp->spec[0] = '_';
|
||||
strlcpy(temp->spec + 1, spec, sizeof(temp->spec) - 1);
|
||||
}
|
||||
else {
|
||||
strlcpy(temp->spec, spec, sizeof(temp->spec));
|
||||
}
|
||||
|
||||
strlcpy(temp->name, name, sizeof(temp->name));
|
||||
strlcpy(temp->spec, spec, sizeof(temp->spec));
|
||||
strlcpy(temp->text, text, sizeof(temp->text));
|
||||
temp->value = (char *)value;
|
||||
|
||||
@ -2636,6 +2675,7 @@ ppd_get_cparam(ppd_coption_t *opt, /* I - PPD file */
|
||||
if ((cparam = calloc(1, sizeof(ppd_cparam_t))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
cparam->type = PPD_CUSTOM_UNKNOWN;
|
||||
strlcpy(cparam->name, param, sizeof(cparam->name));
|
||||
strlcpy(cparam->text, text[0] ? text : param, sizeof(cparam->text));
|
||||
|
||||
|
@ -226,6 +226,7 @@ typedef struct ppd_profile_s /**** sRGB Color Profiles @deprecated@ ****/
|
||||
/**** New in CUPS 1.2/macOS 10.5 ****/
|
||||
typedef enum ppd_cptype_e /**** Custom Parameter Type @deprecated@ ****/
|
||||
{
|
||||
PPD_CUSTOM_UNKNOWN = -1, /* Unknown type (error) */
|
||||
PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */
|
||||
PPD_CUSTOM_INT, /* Integer number value */
|
||||
PPD_CUSTOM_INVCURVE, /* Curve value for f(x) = x^(1/value) */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Raster file routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* This file is part of the CUPS Imaging library.
|
||||
@ -32,6 +32,24 @@ typedef void (*_cups_copyfunc_t)(void *dst, const void *src, size_t bytes);
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static const char * const apple_media_types[] =
|
||||
{ /* media-type values for Apple Raster */
|
||||
"auto",
|
||||
"stationery",
|
||||
"transparency",
|
||||
"envelope",
|
||||
"cardstock",
|
||||
"labels",
|
||||
"stationery-letterhead",
|
||||
"disc",
|
||||
"photographic-matte",
|
||||
"photographic-satin",
|
||||
"photographic-semi-gloss",
|
||||
"photographic-glossy",
|
||||
"photographic-high-gloss",
|
||||
"other"
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
static const char * const cups_modes[] =
|
||||
{ /* Open modes */
|
||||
@ -638,7 +656,7 @@ _cupsRasterReadHeader(
|
||||
{
|
||||
CUPS_CSPACE_SW,
|
||||
CUPS_CSPACE_SRGB,
|
||||
CUPS_CSPACE_RGBW,
|
||||
CUPS_CSPACE_CIELab,
|
||||
CUPS_CSPACE_ADOBERGB,
|
||||
CUPS_CSPACE_W,
|
||||
CUPS_CSPACE_RGB,
|
||||
@ -648,7 +666,7 @@ _cupsRasterReadHeader(
|
||||
{
|
||||
1,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
1,
|
||||
3,
|
||||
@ -681,8 +699,21 @@ _cupsRasterReadHeader(
|
||||
r->header.cupsPageSize[1] = (float)(r->header.cupsHeight * 72.0 / r->header.HWResolution[1]);
|
||||
}
|
||||
|
||||
r->header.cupsInteger[0] = r->apple_page_count;
|
||||
r->header.cupsInteger[7] = 0xffffff;
|
||||
r->header.cupsInteger[CUPS_RASTER_PWG_TotalPageCount] = r->apple_page_count;
|
||||
r->header.cupsInteger[CUPS_RASTER_PWG_AlternatePrimary] = 0xffffff;
|
||||
r->header.cupsInteger[CUPS_RASTER_PWG_PrintQuality] = appleheader[3];
|
||||
|
||||
if (appleheader[2] >= 2)
|
||||
r->header.Duplex = 1;
|
||||
if (appleheader[2] == 2)
|
||||
r->header.Tumble = 1;
|
||||
|
||||
r->header.MediaPosition = appleheader[5];
|
||||
|
||||
if (appleheader[4] < (int)(sizeof(apple_media_types) / sizeof(apple_media_types[0])))
|
||||
strlcpy(r->header.MediaType, apple_media_types[appleheader[4]], sizeof(r->header.MediaType));
|
||||
else
|
||||
strlcpy(r->header.MediaType, "other", sizeof(r->header.MediaType));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1072,8 +1103,9 @@ _cupsRasterWriteHeader(
|
||||
* zeroed.
|
||||
*/
|
||||
|
||||
unsigned char appleheader[32]; /* Raw page header */
|
||||
unsigned height = r->header.cupsHeight * r->rowheight;
|
||||
int i; /* Looping var */
|
||||
unsigned char appleheader[32];/* Raw page header */
|
||||
unsigned height = r->header.cupsHeight * r->rowheight;
|
||||
/* Computed page height */
|
||||
|
||||
if (r->apple_page_count == 0xffffffffU)
|
||||
@ -1101,11 +1133,14 @@ _cupsRasterWriteHeader(
|
||||
|
||||
appleheader[0] = (unsigned char)r->header.cupsBitsPerPixel;
|
||||
appleheader[1] = r->header.cupsColorSpace == CUPS_CSPACE_SRGB ? 1 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_RGBW ? 2 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_CIELab ? 2 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_ADOBERGB ? 3 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_W ? 4 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_RGB ? 5 :
|
||||
r->header.cupsColorSpace == CUPS_CSPACE_CMYK ? 6 : 0;
|
||||
appleheader[2] = r->header.Duplex ? (r->header.Tumble ? 2 : 3) : 1;
|
||||
appleheader[3] = (unsigned char)(r->header.cupsInteger[CUPS_RASTER_PWG_PrintQuality]);
|
||||
appleheader[5] = (unsigned char)(r->header.MediaPosition);
|
||||
appleheader[12] = (unsigned char)(r->header.cupsWidth >> 24);
|
||||
appleheader[13] = (unsigned char)(r->header.cupsWidth >> 16);
|
||||
appleheader[14] = (unsigned char)(r->header.cupsWidth >> 8);
|
||||
@ -1119,6 +1154,15 @@ _cupsRasterWriteHeader(
|
||||
appleheader[22] = (unsigned char)(r->header.HWResolution[0] >> 8);
|
||||
appleheader[23] = (unsigned char)(r->header.HWResolution[0]);
|
||||
|
||||
for (i = 0; i < (int)(sizeof(apple_media_types) / sizeof(apple_media_types[0])); i ++)
|
||||
{
|
||||
if (!strcmp(r->header.MediaType, apple_media_types[i]))
|
||||
{
|
||||
appleheader[4] = (unsigned char)i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (cups_raster_io(r, appleheader, sizeof(appleheader)) == sizeof(appleheader));
|
||||
}
|
||||
else
|
||||
|
@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Side-channel API code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -589,8 +590,8 @@ cupsSideChannelWrite(
|
||||
if ((buffer = _cupsBufferGet((size_t)datalen + 4)) == NULL)
|
||||
return (-1);
|
||||
|
||||
buffer[0] = command;
|
||||
buffer[1] = status;
|
||||
buffer[0] = (char)command;
|
||||
buffer[1] = (char)status;
|
||||
buffer[2] = (char)(datalen >> 8);
|
||||
buffer[3] = (char)(datalen & 255);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* SNMP functions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2014 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -1167,7 +1167,7 @@ asn1_encode_snmp(unsigned char *buffer, /* I - Buffer */
|
||||
memcpy(bufptr, packet->community, commlen);
|
||||
bufptr += commlen;
|
||||
|
||||
*bufptr++ = packet->request_type; /* Get-Request-PDU/Get-Next-Request-PDU */
|
||||
*bufptr++ = (unsigned char)packet->request_type; /* Get-Request-PDU/Get-Next-Request-PDU */
|
||||
asn1_set_length(&bufptr, reqlen);
|
||||
|
||||
asn1_set_integer(&bufptr, (int)packet->request_id);
|
||||
|
@ -146,7 +146,7 @@ _cupsStrDate(char *buf, /* I - Buffer */
|
||||
size_t bufsize, /* I - Size of buffer */
|
||||
time_t timeval) /* I - Time value */
|
||||
{
|
||||
struct tm *dateval; /* Local date/time */
|
||||
struct tm date; /* Local date/time */
|
||||
char temp[1024]; /* Temporary buffer */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
|
||||
|
||||
@ -154,15 +154,15 @@ _cupsStrDate(char *buf, /* I - Buffer */
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
dateval = localtime(&timeval);
|
||||
localtime_r(&timeval, &date);
|
||||
|
||||
if (cg->lang_default->encoding != CUPS_UTF8)
|
||||
{
|
||||
strftime(temp, sizeof(temp), "%c", dateval);
|
||||
strftime(temp, sizeof(temp), "%c", &date);
|
||||
cupsCharsetToUTF8((cups_utf8_t *)buf, temp, (int)bufsize, cg->lang_default->encoding);
|
||||
}
|
||||
else
|
||||
strftime(buf, bufsize, "%c", dateval);
|
||||
strftime(buf, bufsize, "%c", &date);
|
||||
|
||||
return (buf);
|
||||
}
|
||||
|
@ -1,10 +1,11 @@
|
||||
/*
|
||||
* IPP test program for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -44,7 +45,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
@ -74,7 +75,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
|
||||
0x00, 0x00, /* No value */
|
||||
@ -83,11 +84,11 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@ -96,7 +97,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x54, 0x56,
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@ -105,7 +106,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x6d, 0x24,
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
@ -126,12 +127,12 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'p', 'l', 'a', 'i', 'n',
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
@ -139,11 +140,11 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@ -152,7 +153,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x52, 0x08,
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
@ -161,7 +162,7 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x74, 0x04,
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
@ -182,7 +183,72 @@ static ipp_uchar_t collection[] = /* Collection buffer */
|
||||
0x00, 0x06, /* Value length + value */
|
||||
'g', 'l', 'o', 's', 's', 'y',
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_END /* end tag */
|
||||
};
|
||||
static ipp_uchar_t bad_collection[] = /* Collection buffer (bad encoding) */
|
||||
{
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
IPP_TAG_CHARSET,
|
||||
0x00, 0x12, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'c','h','a','r','s','e','t',
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'u','t','f','-','8',
|
||||
|
||||
IPP_TAG_LANGUAGE,
|
||||
0x00, 0x1b, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'n','a','t','u','r','a','l','-','l','a','n',
|
||||
'g','u','a','g','e',
|
||||
0x00, 0x02, /* Value length + value */
|
||||
'e','n',
|
||||
|
||||
IPP_TAG_URI,
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'p','r','i','n','t','e','r','-','u','r','i',
|
||||
0x00, 0x1c, /* Value length + value */
|
||||
'i','p','p',':','/','/','l','o','c','a','l',
|
||||
'h','o','s','t','/','p','r','i','n','t','e',
|
||||
'r','s','/','f','o','o',
|
||||
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x0a, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x54, 0x56,
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x6d, 0x24,
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
@ -194,7 +260,7 @@ static ipp_uchar_t mixed[] = /* Mixed value buffer */
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
@ -223,6 +289,7 @@ static ipp_uchar_t mixed[] = /* Mixed value buffer */
|
||||
void hex_dump(const char *title, ipp_uchar_t *buffer, size_t bytes);
|
||||
void print_attributes(ipp_t *ipp, int indent);
|
||||
ssize_t read_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t read_hex(cups_file_t *fp, ipp_uchar_t *buffer, size_t bytes);
|
||||
int token_cb(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *token);
|
||||
ssize_t write_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
|
||||
@ -584,12 +651,33 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
/*
|
||||
* Read the bad collection data and confirm we get an error...
|
||||
*/
|
||||
|
||||
fputs("Read Bad Collection from Memory: ", stdout);
|
||||
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
data.wused = sizeof(bad_collection);
|
||||
data.wsize = sizeof(bad_collection);
|
||||
data.wbuffer = bad_collection;
|
||||
|
||||
while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL, request)) != IPP_STATE_DATA)
|
||||
if (state == IPP_STATE_ERROR)
|
||||
break;
|
||||
|
||||
if (state != IPP_STATE_ERROR)
|
||||
puts("FAIL (read successful)");
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
/*
|
||||
* Read the mixed data and confirm we converted everything to rangeOfInteger
|
||||
* values...
|
||||
*/
|
||||
|
||||
printf("Read Mixed integer/rangeOfInteger from Memory: ");
|
||||
fputs("Read Mixed integer/rangeOfInteger from Memory: ", stdout);
|
||||
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
@ -719,6 +807,33 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
request = _ippFileParse(&v, argv[i], NULL);
|
||||
_ippVarsDeinit(&v);
|
||||
}
|
||||
else if (strlen(argv[i]) > 4 && !strcmp(argv[i] + strlen(argv[i]) - 4, ".hex"))
|
||||
{
|
||||
/*
|
||||
* Read a hex-encoded IPP message...
|
||||
*/
|
||||
|
||||
if ((fp = cupsFileOpen(argv[i], "r")) == NULL)
|
||||
{
|
||||
printf("Unable to open \"%s\" - %s\n", argv[i], strerror(errno));
|
||||
status = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
request = ippNew();
|
||||
while ((state = ippReadIO(fp, (ipp_iocb_t)read_hex, 1, NULL, request)) == IPP_STATE_ATTRIBUTE);
|
||||
|
||||
if (state != IPP_STATE_DATA)
|
||||
{
|
||||
printf("Error reading IPP message from \"%s\": %s\n", argv[i], cupsLastErrorString());
|
||||
status = 1;
|
||||
|
||||
ippDelete(request);
|
||||
request = NULL;
|
||||
}
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
@ -886,6 +1001,48 @@ read_cb(_ippdata_t *data, /* I - Data */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'read_hex()' - Read a hex dump of an IPP request.
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes read */
|
||||
read_hex(cups_file_t *fp, /* I - File to read from */
|
||||
ipp_uchar_t *buffer, /* I - Buffer to read */
|
||||
size_t bytes) /* I - Number of bytes to read */
|
||||
{
|
||||
size_t total = 0; /* Total bytes read */
|
||||
static char hex[256] = ""; /* Line from file */
|
||||
static char *hexptr = NULL; /* Pointer in line */
|
||||
|
||||
|
||||
while (total < bytes)
|
||||
{
|
||||
if (!hexptr || (isspace(hexptr[0] & 255) && isspace(hexptr[1] & 255)))
|
||||
{
|
||||
if (!cupsFileGets(fp, hex, sizeof(hex)))
|
||||
break;
|
||||
|
||||
hexptr = hex;
|
||||
while (isxdigit(*hexptr & 255))
|
||||
hexptr ++;
|
||||
while (isspace(*hexptr & 255))
|
||||
hexptr ++;
|
||||
|
||||
if (!isxdigit(*hexptr & 255))
|
||||
{
|
||||
hexptr = NULL;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
*buffer++ = (ipp_uchar_t)strtol(hexptr, &hexptr, 16);
|
||||
total ++;
|
||||
}
|
||||
|
||||
return (total == 0 ? -1 : (ssize_t)total);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'token_cb()' - Token callback for ASCII IPP data file parser.
|
||||
*/
|
||||
|
@ -1245,6 +1245,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
printf(" %s(%s): PPD_CUSTOM_UNKNOWN (error)\n", cparam->name, cparam->text);
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
printf(" %s(%s): PPD_CUSTOM_CURVE (%g to %g)\n",
|
||||
cparam->name, cparam->text,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Raster test program routines for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@ -22,8 +22,7 @@
|
||||
|
||||
static int do_ras_file(const char *filename);
|
||||
static int do_raster_tests(cups_mode_t mode);
|
||||
static void print_changes(cups_page_header2_t *header,
|
||||
cups_page_header2_t *expected);
|
||||
static void print_changes(cups_page_header2_t *header, cups_page_header2_t *expected);
|
||||
|
||||
|
||||
/*
|
||||
@ -174,6 +173,8 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
|
||||
header.cupsPageSize[0] = 288.0f;
|
||||
header.cupsPageSize[1] = 288.0f;
|
||||
|
||||
strlcpy(header.MediaType, "auto", sizeof(header.MediaType));
|
||||
|
||||
if (page & 1)
|
||||
{
|
||||
header.cupsBytesPerLine *= 4;
|
||||
@ -308,6 +309,8 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
|
||||
expected.PageSize[0] = 288;
|
||||
expected.PageSize[1] = 288;
|
||||
|
||||
strlcpy(expected.MediaType, "auto", sizeof(expected.MediaType));
|
||||
|
||||
if (mode != CUPS_RASTER_WRITE_PWG)
|
||||
{
|
||||
expected.cupsPageSize[0] = 288.0f;
|
||||
|
268
cups/cups/testthreads.c
Normal file
268
cups/cups/testthreads.c
Normal file
@ -0,0 +1,268 @@
|
||||
/*
|
||||
* Threaded test program for CUPS.
|
||||
*
|
||||
* Copyright © 2012-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/thread-private.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int enum_dests_cb(void *_name, unsigned flags, cups_dest_t *dest);
|
||||
static void *run_query(cups_dest_t *dest);
|
||||
static void show_supported(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, const char *option, const char *value);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
/*
|
||||
* Go through all the available destinations to find the requested one...
|
||||
*/
|
||||
|
||||
(void)argc;
|
||||
|
||||
cupsEnumDests(CUPS_DEST_FLAGS_NONE, -1, NULL, 0, 0, enum_dests_cb, argv[1]);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'enum_dests_cb()' - Destination enumeration function...
|
||||
*/
|
||||
|
||||
static int /* O - 1 to continue, 0 to stop */
|
||||
enum_dests_cb(void *_name, /* I - Printer name, if any */
|
||||
unsigned flags, /* I - Enumeration flags */
|
||||
cups_dest_t *dest) /* I - Found destination */
|
||||
{
|
||||
const char *name = (const char *)_name;
|
||||
/* Printer name */
|
||||
cups_dest_t *cdest; /* Copied destination */
|
||||
|
||||
|
||||
(void)flags;
|
||||
|
||||
/*
|
||||
* If a name was specified, compare it...
|
||||
*/
|
||||
|
||||
if (name && strcasecmp(name, dest->name))
|
||||
return (1); /* Continue */
|
||||
|
||||
/*
|
||||
* Copy the destination and run the query on a separate thread...
|
||||
*/
|
||||
|
||||
cupsCopyDest(dest, 0, &cdest);
|
||||
_cupsThreadWait(_cupsThreadCreate((_cups_thread_func_t)run_query, cdest));
|
||||
|
||||
cupsFreeDests(1, cdest);
|
||||
|
||||
/*
|
||||
* Continue if no name was specified or the name matches...
|
||||
*/
|
||||
|
||||
return (!name || !strcasecmp(name, dest->name));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'run_query()' - Query printer capabilities on a separate thread.
|
||||
*/
|
||||
|
||||
static void * /* O - Return value (not used) */
|
||||
run_query(cups_dest_t *dest) /* I - Destination to query */
|
||||
{
|
||||
http_t *http; /* Connection to destination */
|
||||
cups_dinfo_t *dinfo; /* Destination info */
|
||||
unsigned dflags = CUPS_DEST_FLAGS_NONE;
|
||||
/* Destination flags */
|
||||
|
||||
|
||||
if ((http = cupsConnectDest(dest, dflags, 300, NULL, NULL, 0, NULL, NULL)) == NULL)
|
||||
{
|
||||
printf("testthreads: Unable to connect to destination \"%s\": %s\n", dest->name, cupsLastErrorString());
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if ((dinfo = cupsCopyDestInfo(http, dest)) == NULL)
|
||||
{
|
||||
printf("testdest: Unable to get information for destination \"%s\": %s\n", dest->name, cupsLastErrorString());
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
printf("\n%s:\n", dest->name);
|
||||
|
||||
show_supported(http, dest, dinfo, NULL, NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 'show_supported()' - Show supported options, values, etc.
|
||||
*/
|
||||
|
||||
static void
|
||||
show_supported(http_t *http, /* I - Connection to destination */
|
||||
cups_dest_t *dest, /* I - Destination */
|
||||
cups_dinfo_t *dinfo, /* I - Destination information */
|
||||
const char *option, /* I - Option, if any */
|
||||
const char *value) /* I - Value, if any */
|
||||
{
|
||||
ipp_attribute_t *attr; /* Attribute */
|
||||
int i, /* Looping var */
|
||||
count; /* Number of values */
|
||||
|
||||
|
||||
if (!option)
|
||||
{
|
||||
attr = cupsFindDestSupported(http, dest, dinfo, "job-creation-attributes");
|
||||
if (attr)
|
||||
{
|
||||
count = ippGetCount(attr);
|
||||
for (i = 0; i < count; i ++)
|
||||
show_supported(http, dest, dinfo, ippGetString(attr, i, NULL), NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
static const char * const options[] =
|
||||
{ /* List of standard options */
|
||||
CUPS_COPIES,
|
||||
CUPS_FINISHINGS,
|
||||
CUPS_MEDIA,
|
||||
CUPS_NUMBER_UP,
|
||||
CUPS_ORIENTATION,
|
||||
CUPS_PRINT_COLOR_MODE,
|
||||
CUPS_PRINT_QUALITY,
|
||||
CUPS_SIDES
|
||||
};
|
||||
|
||||
puts(" No job-creation-attributes-supported attribute, probing instead.");
|
||||
|
||||
for (i = 0; i < (int)(sizeof(options) / sizeof(options[0])); i ++)
|
||||
if (cupsCheckDestSupported(http, dest, dinfo, options[i], NULL))
|
||||
show_supported(http, dest, dinfo, options[i], NULL);
|
||||
}
|
||||
}
|
||||
else if (!value)
|
||||
{
|
||||
printf(" %s (%s - %s)\n", option, cupsLocalizeDestOption(http, dest, dinfo, option), cupsCheckDestSupported(http, dest, dinfo, option, NULL) ? "supported" : "not-supported");
|
||||
|
||||
if ((attr = cupsFindDestSupported(http, dest, dinfo, option)) != NULL)
|
||||
{
|
||||
count = ippGetCount(attr);
|
||||
|
||||
switch (ippGetValueTag(attr))
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %d\n", ippGetInteger(attr, i));
|
||||
break;
|
||||
|
||||
case IPP_TAG_ENUM :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int val = ippGetInteger(attr, i);
|
||||
char valstr[256];
|
||||
|
||||
snprintf(valstr, sizeof(valstr), "%d", val);
|
||||
printf(" %s (%s)\n", ippEnumString(option, ippGetInteger(attr, i)), cupsLocalizeDestValue(http, dest, dinfo, option, valstr));
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int upper, lower = ippGetRange(attr, i, &upper);
|
||||
|
||||
printf(" %d-%d\n", lower, upper);
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int xres, yres;
|
||||
ipp_res_t units;
|
||||
xres = ippGetResolution(attr, i, &yres, &units);
|
||||
|
||||
if (xres == yres)
|
||||
printf(" %d%s\n", xres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
else
|
||||
printf(" %dx%d%s\n", xres, yres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_KEYWORD :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %s (%s)\n", ippGetString(attr, i, NULL), cupsLocalizeDestValue(http, dest, dinfo, option, ippGetString(attr, i, NULL)));
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXTLANG :
|
||||
case IPP_TAG_NAMELANG :
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
for (i = 0; i < count; i ++)
|
||||
printf(" %s\n", ippGetString(attr, i, NULL));
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
int j, len;
|
||||
unsigned char *data = ippGetOctetString(attr, i, &len);
|
||||
|
||||
fputs(" ", stdout);
|
||||
for (j = 0; j < len; j ++)
|
||||
{
|
||||
if (data[j] < ' ' || data[j] >= 0x7f)
|
||||
printf("<%02X>", data[j]);
|
||||
else
|
||||
putchar(data[j]);
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
break;
|
||||
|
||||
default :
|
||||
printf(" %s\n", ippTagString(ippGetValueTag(attr)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (cupsCheckDestSupported(http, dest, dinfo, option, value))
|
||||
puts("YES");
|
||||
else
|
||||
puts("NO");
|
||||
}
|
@ -15,32 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <spawn.h>
|
||||
|
||||
extern char **environ;
|
||||
|
||||
|
||||
#ifndef _SECURITY_VERSION_GREATER_THAN_57610_
|
||||
typedef CF_OPTIONS(uint32_t, SecKeyUsage) {
|
||||
kSecKeyUsageAll = 0x7FFFFFFF
|
||||
};
|
||||
#endif /* !_SECURITY_VERSION_GREATER_THAN_57610_ */
|
||||
extern const void * kSecCSRChallengePassword;
|
||||
extern const void * kSecSubjectAltName;
|
||||
extern const void * kSecCertificateKeyUsage;
|
||||
extern const void * kSecCSRBasicContraintsPathLen;
|
||||
extern const void * kSecCertificateExtensions;
|
||||
extern const void * kSecCertificateExtensionsEncoded;
|
||||
extern const void * kSecOidCommonName;
|
||||
extern const void * kSecOidCountryName;
|
||||
extern const void * kSecOidStateProvinceName;
|
||||
extern const void * kSecOidLocalityName;
|
||||
extern const void * kSecOidOrganization;
|
||||
extern const void * kSecOidOrganizationalUnit;
|
||||
extern bool SecCertificateIsValid(SecCertificateRef certificate, CFAbsoluteTime verifyTime);
|
||||
extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate);
|
||||
extern SecCertificateRef SecGenerateSelfSignedCertificate(CFArrayRef subject, CFDictionaryRef parameters, SecKeyRef publicKey, SecKeyRef privateKey);
|
||||
extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificateRef certificate, SecKeyRef privateKey);
|
||||
|
||||
#include "tls-darwin.h"
|
||||
|
||||
/*
|
||||
* Constants, very secure stuff...
|
||||
@ -2027,7 +2002,8 @@ static const char * /* O - Keychain path */
|
||||
http_cdsa_default_path(char *buffer, /* I - Path buffer */
|
||||
size_t bufsize) /* I - Size of buffer */
|
||||
{
|
||||
const char *home = getenv("HOME"); /* HOME environment variable */
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Pointer to library globals */
|
||||
|
||||
|
||||
/*
|
||||
@ -2036,8 +2012,8 @@ http_cdsa_default_path(char *buffer, /* I - Path buffer */
|
||||
* 10.11.4 (!), so we need to create our own keychain just for CUPS.
|
||||
*/
|
||||
|
||||
if (getuid() && home)
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", home);
|
||||
if (cg->home)
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl.keychain", cg->home);
|
||||
else
|
||||
strlcpy(buffer, "/etc/cups/ssl.keychain", bufsize);
|
||||
|
||||
|
35
cups/cups/tls-darwin.h
Normal file
35
cups/cups/tls-darwin.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* TLS support header for CUPS on macOS.
|
||||
*
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/**** This file is included from tls-darwin.c ****/
|
||||
|
||||
extern char **environ;
|
||||
|
||||
#ifndef _SECURITY_VERSION_GREATER_THAN_57610_
|
||||
typedef CF_OPTIONS(uint32_t, SecKeyUsage) {
|
||||
kSecKeyUsageAll = 0x7FFFFFFF
|
||||
};
|
||||
#endif /* !_SECURITY_VERSION_GREATER_THAN_57610_ */
|
||||
extern const void * kSecCSRChallengePassword;
|
||||
extern const void * kSecSubjectAltName;
|
||||
extern const void * kSecCertificateKeyUsage;
|
||||
extern const void * kSecCSRBasicContraintsPathLen;
|
||||
extern const void * kSecCertificateExtensions;
|
||||
extern const void * kSecCertificateExtensionsEncoded;
|
||||
extern const void * kSecOidCommonName;
|
||||
extern const void * kSecOidCountryName;
|
||||
extern const void * kSecOidStateProvinceName;
|
||||
extern const void * kSecOidLocalityName;
|
||||
extern const void * kSecOidOrganization;
|
||||
extern const void * kSecOidOrganizationalUnit;
|
||||
extern bool SecCertificateIsValid(SecCertificateRef certificate, CFAbsoluteTime verifyTime);
|
||||
extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate);
|
||||
extern SecCertificateRef SecGenerateSelfSignedCertificate(CFArrayRef subject, CFDictionaryRef parameters, SecKeyRef publicKey, SecKeyRef privateKey);
|
||||
extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificateRef certificate, SecKeyRef privateKey);
|
@ -935,12 +935,13 @@ static const char * /* O - Path or NULL on error */
|
||||
http_gnutls_default_path(char *buffer,/* I - Path buffer */
|
||||
size_t bufsize)/* I - Size of path buffer */
|
||||
{
|
||||
const char *home = getenv("HOME"); /* HOME environment variable */
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Pointer to library globals */
|
||||
|
||||
|
||||
if (getuid() && home)
|
||||
if (cg->home)
|
||||
{
|
||||
snprintf(buffer, bufsize, "%s/.cups", home);
|
||||
snprintf(buffer, bufsize, "%s/.cups", cg->home);
|
||||
if (access(buffer, 0))
|
||||
{
|
||||
DEBUG_printf(("1http_gnutls_default_path: Making directory \"%s\".", buffer));
|
||||
@ -951,7 +952,7 @@ http_gnutls_default_path(char *buffer,/* I - Path buffer */
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl", home);
|
||||
snprintf(buffer, bufsize, "%s/.cups/ssl", cg->home);
|
||||
if (access(buffer, 0))
|
||||
{
|
||||
DEBUG_printf(("1http_gnutls_default_path: Making directory \"%s\".", buffer));
|
||||
|
@ -1967,6 +1967,8 @@ http_sspi_make_credentials(
|
||||
|
||||
GetSystemTime(&et);
|
||||
et.wYear += years;
|
||||
if (et.wMonth == 2 && et.wDay == 29)
|
||||
et.wDay = 28; /* Avoid Feb 29th due to leap years */
|
||||
|
||||
ZeroMemory(&exts, sizeof(exts));
|
||||
|
||||
|
@ -40,6 +40,8 @@
|
||||
# define kCUPSPrintingPrefs CFSTR(".GlobalPreferences")
|
||||
# define kPREFIX "AirPrint"
|
||||
# endif /* TARGET_OS_OSX */
|
||||
# define kDigestOptionsKey CFSTR(kPREFIX "DigestOptions")
|
||||
# define kUserKey CFSTR(kPREFIX "User")
|
||||
# define kUserAgentTokensKey CFSTR(kPREFIX "UserAgentTokens")
|
||||
# define kAllowAnyRootKey CFSTR(kPREFIX "AllowAnyRoot")
|
||||
# define kAllowExpiredCertsKey CFSTR(kPREFIX "AllowExpiredCerts")
|
||||
@ -63,6 +65,7 @@
|
||||
|
||||
typedef struct _cups_client_conf_s /**** client.conf config data ****/
|
||||
{
|
||||
_cups_digestoptions_t digestoptions; /* DigestOptions values */
|
||||
_cups_uatokens_t uatokens; /* UserAgentTokens values */
|
||||
#ifdef HAVE_SSL
|
||||
int ssl_options, /* SSLOptions values */
|
||||
@ -97,6 +100,7 @@ static void cups_finalize_client_conf(_cups_client_conf_t *cc);
|
||||
static void cups_init_client_conf(_cups_client_conf_t *cc);
|
||||
static void cups_read_client_conf(cups_file_t *fp, _cups_client_conf_t *cc);
|
||||
static void cups_set_default_ipp_port(_cups_globals_t *cg);
|
||||
static void cups_set_digestoptions(_cups_client_conf_t *cc, const char *value);
|
||||
static void cups_set_encryption(_cups_client_conf_t *cc, const char *value);
|
||||
#ifdef HAVE_GSSAPI
|
||||
static void cups_set_gss_service_name(_cups_client_conf_t *cc, const char *value);
|
||||
@ -967,7 +971,6 @@ void
|
||||
_cupsSetDefaults(void)
|
||||
{
|
||||
cups_file_t *fp; /* File */
|
||||
const char *home; /* Home directory of user */
|
||||
char filename[1024]; /* Filename */
|
||||
_cups_client_conf_t cc; /* client.conf values */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
@ -993,19 +996,13 @@ _cupsSetDefaults(void)
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
# ifdef HAVE_GETEUID
|
||||
if ((geteuid() == getuid() || !getuid()) && getegid() == getgid() && (home = getenv("HOME")) != NULL)
|
||||
# elif !defined(_WIN32)
|
||||
if (getuid() && (home = getenv("HOME")) != NULL)
|
||||
# else
|
||||
if ((home = getenv("HOME")) != NULL)
|
||||
# endif /* HAVE_GETEUID */
|
||||
if (cg->home)
|
||||
{
|
||||
/*
|
||||
* Look for ~/.cups/client.conf...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/client.conf", cg->home);
|
||||
if ((fp = cupsFileOpen(filename, "r")) != NULL)
|
||||
{
|
||||
cups_read_client_conf(fp, &cc);
|
||||
@ -1324,10 +1321,14 @@ cups_init_client_conf(
|
||||
cc->validate_certs = bval;
|
||||
# endif /* HAVE_SSL */
|
||||
|
||||
if (cups_apple_get_string(kDigestOptionsKey, sval, sizeof(sval)))
|
||||
cups_set_digestoptions(cc, sval);
|
||||
|
||||
if (cups_apple_get_string(kUserKey, sval, sizeof(sval)))
|
||||
strlcpy(cc->user, sval, sizeof(cc->user));
|
||||
|
||||
if (cups_apple_get_string(kUserAgentTokensKey, sval, sizeof(sval)))
|
||||
{
|
||||
cups_set_uatokens(cc, sval);
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
}
|
||||
|
||||
@ -1353,7 +1354,9 @@ cups_read_client_conf(
|
||||
linenum = 0;
|
||||
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if (!_cups_strcasecmp(line, "Encryption") && value)
|
||||
if (!_cups_strcasecmp(line, "DigestOptions") && value)
|
||||
cups_set_digestoptions(cc, value);
|
||||
else if (!_cups_strcasecmp(line, "Encryption") && value)
|
||||
cups_set_encryption(cc, value);
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
@ -1408,6 +1411,23 @@ cups_set_default_ipp_port(
|
||||
cg->ipp_port = CUPS_DEFAULT_IPP_PORT;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_digestoptions()' - Set the DigestOptions value.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_set_digestoptions(
|
||||
_cups_client_conf_t *cc, /* I - client.conf values */
|
||||
const char *value) /* I - Value */
|
||||
{
|
||||
if (!_cups_strcasecmp(value, "DenyMD5"))
|
||||
cc->digestoptions = _CUPS_DIGESTOPTIONS_DENYMD5;
|
||||
else if (!_cups_strcasecmp(value, "None"))
|
||||
cc->digestoptions = _CUPS_DIGESTOPTIONS_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_set_encryption()' - Set the Encryption value.
|
||||
*/
|
||||
|
@ -116,9 +116,9 @@
|
||||
# define _CUPS_API_1_7 API_AVAILABLE(macos(10.9), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_0 API_AVAILABLE(macos(10.10), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2 API_AVAILABLE(macos(10.12), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_4 API_AVAILABLE(macos(10.13), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_7 API_AVAILABLE(macos(10.14), ios(11.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_3 _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_4 API_AVAILABLE(macos(10.13), ios(12.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_2_7 API_AVAILABLE(macos(10.14), ios(13.0)) _CUPS_PUBLIC
|
||||
# define _CUPS_API_2_3 API_AVAILABLE(macos(10.14), ios(13.0)) _CUPS_PUBLIC
|
||||
# else
|
||||
# define _CUPS_API_1_1_19 _CUPS_PUBLIC
|
||||
# define _CUPS_API_1_1_20 _CUPS_PUBLIC
|
||||
|
@ -1,67 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Categories=System;Printing;HardwareSettings;X-Red-Hat-Base;
|
||||
Exec=htmlview http://localhost:631/
|
||||
Icon=cups
|
||||
StartupNotify=false
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Name=Manage Printing
|
||||
Comment=CUPS Web Interface
|
||||
Name[af]=bestuur Printing
|
||||
Comment[af]=CUPS Web Interface
|
||||
Name[ar]=إدارة الطباعة
|
||||
Comment[ar]=الكؤوس واجهة الويب
|
||||
Name[az]=Çap idarə
|
||||
Comment[az]=CUPS Web Interface
|
||||
Name[bn-IN]=মুদ্রণ পরিচালনা
|
||||
Comment[bn-IN]=CUPS ওয়েব ইন্টারফেস
|
||||
Name[ca]=Gestor d'impressió
|
||||
Comment[ca]=Interfície web de CUPS
|
||||
Name[cs]=Správa tisku CUPS
|
||||
Comment[cs]=Webové rozhraní CUPS
|
||||
Name[da]=Håndter udskrivning
|
||||
Comment[da]=CUPS-webgrænseflade
|
||||
Name[de]=Druckerverwaltung
|
||||
Comment[de]=CUPS Webinterface
|
||||
Name[en_US]=Manage Printing
|
||||
Comment[en_US]=CUPS Web Interface
|
||||
Name[es]=Administrar impresión
|
||||
Comment[es]=Interfaz Web de CUPS
|
||||
Name[et]=Trükkimise haldur
|
||||
Comment[et]=CUPS-i veebiliides
|
||||
Name[eu]=Kudeatu inprimaketak
|
||||
Comment[eu]=CUPSen web interfazea
|
||||
Name[fr]=Gestionnaire d'impression
|
||||
Comment[fr]=Interface Web de CUPS
|
||||
Name[he]=נהל הדפסות
|
||||
Comment[he]=ממשק דפדפן של CUPS
|
||||
Name[id]=Manajemen Pencetakan
|
||||
Comment[id]=Antarmuka Web CUPS
|
||||
Name[it]=Gestione stampa
|
||||
Comment[it]=Interfaccia web di CUPS
|
||||
Name[ja]=印刷の管理
|
||||
Comment[ja]=CUPS Web インタフェース
|
||||
Name[ko]=인쇄 관리
|
||||
Comment[ko]=CUPS 웹 인터페이스
|
||||
Name[pl]=Zarządzanie drukowaniem
|
||||
Comment[pl]=Interfejs WWW CUPS
|
||||
Name[pt_BR]=Gerenciador de impressão
|
||||
Comment[pt_BR]=Interface web do CUPS
|
||||
Name[pt-PT]=Gerenciador de impressão
|
||||
Comment[pt-PT]=Interface sítio do CUPS
|
||||
Name[ru]=Настройка печати
|
||||
Comment[ru]=Настройка CUPS
|
||||
Name[sv]=Hantera skrivare
|
||||
Comment[sv]=CUPS webb-gränssnitt
|
||||
Name[sq]=Menaxho Printime
|
||||
Comment[sq]=CUPS Web Interface
|
||||
Name[th]=จัดการการพิมพ์
|
||||
Comment[th]=CUPS เว็บอินเตอร์เฟส
|
||||
Name[tr]=Yazıcıları Yönet
|
||||
Comment[tr]=CUPS Web Arayüzü
|
||||
Name[uz]=chop boshqarish
|
||||
Comment[uz]=CUPS veb interfeysi
|
||||
Name[zh]=打印机管理
|
||||
Comment[zh]=CUPS网页界面
|
||||
Name[zh_TW]=印表管理
|
||||
Comment[zh_TW]=CUPS 網頁介面
|
@ -2125,6 +2125,7 @@ typedef enum <a href="#ppd_ui_e">ppd_ui_e</a> ppd_ui_t;
|
||||
<tr><th>PPD_CUSTOM_POINTS </th> <td class="description">Measurement value in points</td></tr>
|
||||
<tr><th>PPD_CUSTOM_REAL </th> <td class="description">Real number value</td></tr>
|
||||
<tr><th>PPD_CUSTOM_STRING </th> <td class="description">String of characters</td></tr>
|
||||
<tr><th>PPD_CUSTOM_UNKNOWN </th> <td class="description">Unknown type (error)</td></tr>
|
||||
</tbody></table>
|
||||
<h3 class="enumeration"><a id="ppd_cs_e"><span class="info"> DEPRECATED </span>ppd_cs_e</a></h3>
|
||||
<p class="description">Colorspaces </p>
|
||||
|
Binary file not shown.
@ -7,8 +7,8 @@
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<meta name="creator" content="codedoc v3.1">
|
||||
<meta name="author" content="Michael R Sweet">
|
||||
<meta name="copyright" content="Copyright © 2007-2019 by Apple Inc. All Rights Reserved.">
|
||||
<meta name="version" content="2.3.0">
|
||||
<meta name="copyright" content="Copyright © 2007-2020 by Apple Inc. All Rights Reserved.">
|
||||
<meta name="version" content="2.3.4">
|
||||
<style type="text/css"><!--
|
||||
body, p, h1, h2, h3, h4 {
|
||||
font-family: sans-serif;
|
||||
@ -174,7 +174,7 @@ h3.title {
|
||||
<body>
|
||||
<h1 class="title">CUPS Programming Manual</h1>
|
||||
<p>Michael R Sweet</p>
|
||||
<p>Copyright © 2007-2019 by Apple Inc. All Rights Reserved.</p>
|
||||
<p>Copyright © 2007-2020 by Apple Inc. All Rights Reserved.</p>
|
||||
<div class="contents">
|
||||
<h2 class="title">Contents</h2>
|
||||
<ul class="contents">
|
||||
@ -197,7 +197,6 @@ h3.title {
|
||||
<li><a href="#authentication">Authentication</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
|
||||
<li><a href="#CF_OPTIONS">CF_OPTIONS</a></li>
|
||||
<li><a href="#cupsAddDest">cupsAddDest</a></li>
|
||||
<li><a href="#cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></li>
|
||||
<li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
|
||||
@ -487,9 +486,6 @@ h3.title {
|
||||
<li><a href="#cups_option_s">cups_option_s</a></li>
|
||||
<li><a href="#cups_size_s">cups_size_s</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#VARIABLES">Variables</a><ul class="subcontents">
|
||||
<li><a href="#kSecOidOrganizationalUnit">kSecOidOrganizationalUnit</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
|
||||
<li><a href="#cups_ptype_e">cups_ptype_e</a></li>
|
||||
<li><a href="#http_encoding_e">http_encoding_e</a></li>
|
||||
@ -567,7 +563,7 @@ int main(void)
|
||||
<p>In the project window, click on the <em>Build</em> <em>Phases</em> group and expand the <em>Link</em> <em>Binary</em> <em>with</em> <em>Libraries</em> section. Click <em>+</em>, type "libcups" to show the library, and then double-click on <code>libcups.tbd</code>.</p>
|
||||
<p>Finally, click on the <code>main.c</code> file in the sidebar and copy the example program to the file. Build and run (CMD+R) to see the list of destinations.</p>
|
||||
<h4><a id="compiling-with-gcc">Compiling with GCC</a></h4>
|
||||
<p>From the command-line, create a file called <code>sample.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p>
|
||||
<p>From the command-line, create a file called <code>simple.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p>
|
||||
<pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
|
||||
./simple
|
||||
</code></pre>
|
||||
@ -1159,19 +1155,6 @@ cups_password_cb2(const char *prompt, http_t *http,
|
||||
<p>The <code>resource</code> argument specifies the path used for the request.</p>
|
||||
<p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p>
|
||||
<h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
|
||||
<h3 class="function"><a id="CF_OPTIONS">CF_OPTIONS</a></h3>
|
||||
<p class="description"></p>
|
||||
<p class="code">
|
||||
typedef CF_OPTIONS(uint32_t, SecKeyUsage);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>uint32_t</th>
|
||||
</tr>
|
||||
<tr><th>SecKeyUsage</th>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description"></p>
|
||||
<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
|
||||
<p class="description">Add a destination to the list of destinations.</p>
|
||||
<p class="code">
|
||||
@ -1200,7 +1183,7 @@ a copy of that destination's options.<br>
|
||||
<br>
|
||||
Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
|
||||
destinations to the user's lpoptions file.</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.3 </span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.3/macOS 10.14 </span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3>
|
||||
<p class="description">Add the option corresponding to the specified media size.</p>
|
||||
<p class="code">
|
||||
int cupsAddDestMediaOptions(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
|
||||
@ -1511,7 +1494,7 @@ int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method,
|
||||
status, prior to resubmitting your request.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> CUPS 2.3 </span><a id="cupsEncodeOption">cupsEncodeOption</a></h3>
|
||||
<h3 class="function"><span class="info"> CUPS 2.3/macOS 10.14 </span><a id="cupsEncodeOption">cupsEncodeOption</a></h3>
|
||||
<p class="description">Encode a single option into an IPP attribute.</p>
|
||||
<p class="code">
|
||||
<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsEncodeOption(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group_tag, const char *name, const char *value);</p>
|
||||
@ -6071,10 +6054,6 @@ typedef struct _ipp_s ipp_t;
|
||||
<td class="description">Top margin in hundredths of
|
||||
millimeters</td></tr>
|
||||
</tbody></table>
|
||||
<h2 class="title"><a id="VARIABLES">Variables</a></h2>
|
||||
<h3 class="variable"><a id="kSecOidOrganizationalUnit">kSecOidOrganizationalUnit</a></h3>
|
||||
<p class="description">Constants, very secure stuff...</p>
|
||||
<p class="code">extern const void *kSecOidOrganizationalUnit;</p>
|
||||
<h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
|
||||
<h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
|
||||
<p class="description">Printer type/capability bit
|
||||
@ -6304,7 +6283,7 @@ are server-oriented...</p>
|
||||
<tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_FOLD_ACCORDION </th> <td class="description">Accordion-fold the paper vertically into four sections</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_FOLD_DOUBLE_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_FOLD_ENGINEERING_Z </th> <td class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
|
||||
@ -6326,10 +6305,10 @@ are server-oriented...</p>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Punch multiple holes bottom edge</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Punch multiple holes left side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Punch multiple holes right side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Punch multiple holes top edge</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
|
||||
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
|
||||
|
@ -187,5 +187,21 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
</pre>
|
||||
|
||||
<h2>CUPS Exceptions to the Apache 2.0 License</h2>
|
||||
|
||||
<p>As an exception, if, as a result of your compiling your source code, portions
|
||||
of this Software are embedded into an Object form of such source code, you
|
||||
may redistribute such embedded portions in such Object form without complying
|
||||
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.</p>
|
||||
|
||||
<p>In addition, if you combine or link compiled forms of this Software with
|
||||
software that is licensed under the GPLv2 ("Combined Software") and if a
|
||||
court of competent jurisdiction determines that the patent provision (Section
|
||||
3), the indemnity provision (Section 9) or other Section of the License
|
||||
conflicts with the conditions of the GPLv2, you may retroactively and
|
||||
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
||||
the License, but only in their entirety and only with respect to the Combined
|
||||
Software.</p>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
@ -19,28 +19,32 @@ See the NOTES section below for more information.
|
||||
<h3><a name="DIRECTIVES">Directives</a></h3>
|
||||
The following directives are understood by the client. Consult the online help for detailed descriptions:
|
||||
<dl class="man">
|
||||
<dt><b>AllowAnyRoot Yes</b>
|
||||
<dt><a name="AllowAnyRoot"></a><b>AllowAnyRoot Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>AllowAnyRoot No</b>
|
||||
<dd style="margin-left: 5.0em">Specifies whether to allow TLS with certificates that have not been signed by a trusted Certificate Authority.
|
||||
The default is "Yes".
|
||||
<dt><b>AllowExpiredCerts Yes</b>
|
||||
<dt><a name="AllowExpiredCerts"></a><b>AllowExpiredCerts Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>AllowExpiredCerts No</b>
|
||||
<dd style="margin-left: 5.0em">Specifies whether to allow TLS with expired certificates.
|
||||
The default is "No".
|
||||
<dt><b>Encryption IfRequested</b>
|
||||
<dt><a name="DigestOptions"></a><b>DigestOptions DenyMD5</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>DigestOptions None</b>
|
||||
<dd style="margin-left: 5.0em">Specifies HTTP Digest authentication options.
|
||||
<b>DenyMD5</b> disables support for the original MD5 hash algorithm.
|
||||
<dt><a name="Encryption"></a><b>Encryption IfRequested</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>Encryption Never</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>Encryption Required</b>
|
||||
<dd style="margin-left: 5.0em">Specifies the level of encryption that should be used.
|
||||
<dt><b>GSSServiceName </b><i>name</i>
|
||||
<dt><a name="GSSServiceName"></a><b>GSSServiceName </b><i>name</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the Kerberos service name that is used for authentication, typically "host", "http", or "ipp".
|
||||
CUPS adds the remote hostname ("name@server.example.com") for you. The default name is "http".
|
||||
<dt><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]
|
||||
<dt><a name="ServerName"></a><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]
|
||||
<dd style="margin-left: 5.0em"><dt><b>ServerName </b><i>/domain/socket</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the address and optionally the port to use when connecting to the server.
|
||||
<b>Note: This directive is not supported on macOS 10.7 or later.</b>
|
||||
<dt><b>ServerName </b><i>hostname-or-ip-address</i>[<i>:port</i>]<b>/version=1.1</b>
|
||||
<dd style="margin-left: 5.0em">Specifies the address and optionally the port to use when connecting to a server running CUPS 1.3.12 and earlier.
|
||||
<dt><b>SSLOptions </b>[<i>AllowDH</i>] [<i>AllowRC4</i>] [<i>AllowSSL3</i>] [<i>DenyCBC</i>] [<i>DenyTLS1.0</i>] [<i>MaxTLS1.0</i>] [<i>MaxTLS1.1</i>] [<i>MaxTLS1.2</i>] [<i>MaxTLS1.3</i>] [<i>MinTLS1.0</i>] [<i>MinTLS1.1</i>] [<i>MinTLS1.2</i>] [<i>MinTLS1.3</i>]
|
||||
<dt><a name="SSLOptions"></a><b>SSLOptions </b>[<i>AllowDH</i>] [<i>AllowRC4</i>] [<i>AllowSSL3</i>] [<i>DenyCBC</i>] [<i>DenyTLS1.0</i>] [<i>MaxTLS1.0</i>] [<i>MaxTLS1.1</i>] [<i>MaxTLS1.2</i>] [<i>MaxTLS1.3</i>] [<i>MinTLS1.0</i>] [<i>MinTLS1.1</i>] [<i>MinTLS1.2</i>] [<i>MinTLS1.3</i>]
|
||||
<dd style="margin-left: 5.0em"><dt><b>SSLOptions None</b>
|
||||
<dd style="margin-left: 5.0em">Sets encryption options (only in /etc/cups/client.conf).
|
||||
By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites.
|
||||
@ -54,11 +58,11 @@ The <i>DenyTLS1.0</i> option disables TLS v1.0 support - this sets the minimum p
|
||||
The <i>MinTLS</i> options set the minimum TLS version to support.
|
||||
The <i>MaxTLS</i> options set the maximum TLS version to support.
|
||||
Not all operating systems support TLS 1.3 at this time.
|
||||
<dt><b>TrustOnFirstUse Yes</b>
|
||||
<dt><a name="TrustOnFirstUse"></a><b>TrustOnFirstUse Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>TrustOnFirstUse No</b>
|
||||
<dd style="margin-left: 5.0em">Specifies whether to trust new TLS certificates by default.
|
||||
The default is "Yes".
|
||||
<dt><b>User </b><i>name</i>
|
||||
<dt><a name="User"></a><b>User </b><i>name</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the default user name to use for requests.
|
||||
<dt><a name="UserAgentTokens"></a><b>UserAgentTokens None</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>UserAgentTokens ProductOnly</b>
|
||||
@ -76,7 +80,7 @@ The default is "Yes".
|
||||
"OS" reports "CUPS/major.minor.path (osname osversion) IPP/2.1".
|
||||
"Full" reports "CUPS/major.minor.path (osname osversion; architecture) IPP/2.1".
|
||||
The default is "Minimal".
|
||||
<dt><b>ValidateCerts Yes</b>
|
||||
<dt><a name="ValidateCerts"></a><b>ValidateCerts Yes</b>
|
||||
<dd style="margin-left: 5.0em"><dt><b>ValidateCerts No</b>
|
||||
<dd style="margin-left: 5.0em">Specifies whether to only allow TLS with certificates whose common name matches the hostname.
|
||||
The default is "No".
|
||||
|
@ -16,10 +16,15 @@ ippeveprinter - an ipp everywhere printer application for cups
|
||||
] [
|
||||
<b>--no-web-forms</b>
|
||||
] [
|
||||
<b>--pam-service</b>
|
||||
<i>service</i>
|
||||
] [
|
||||
<b>--version</b>
|
||||
] [
|
||||
<b>-2</b>
|
||||
] [
|
||||
<b>-A</b>
|
||||
] [
|
||||
<b>-D</b>
|
||||
<i>device-uri</i>
|
||||
] [
|
||||
@ -87,10 +92,17 @@ The following options are recognized by
|
||||
<dd style="margin-left: 5.0em">Show program usage.
|
||||
<dt><b>--no-web-forms</b>
|
||||
<dd style="margin-left: 5.0em">Disable the web interface forms used to update the media and supply levels.
|
||||
<dt><b>--pam-service </b><i>service</i>
|
||||
<dd style="margin-left: 5.0em">Set the PAM service name.
|
||||
The default service is "cups".
|
||||
<dt><b>--version</b>
|
||||
<dd style="margin-left: 5.0em">Show the CUPS version.
|
||||
<dt><b>-2</b>
|
||||
<dd style="margin-left: 5.0em">Report support for two-sided (duplex) printing.
|
||||
<dt><b>-A</b>
|
||||
<dd style="margin-left: 5.0em">Enable authentication for the created printer.
|
||||
<b>ippeveprinter</b>
|
||||
uses PAM to authenticate HTTP Basic credentials.
|
||||
<dt><b>-D </b><i>device-uri</i>
|
||||
<dd style="margin-left: 5.0em">Set the device URI for print output.
|
||||
The URI can be a filename, directory, or a network socket URI of the form "socket://ADDRESS[:PORT]" (where the default port number is 9100).
|
||||
@ -149,6 +161,8 @@ command.
|
||||
<dt><b>-p </b><i>port</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the port number to listen on.
|
||||
The default is a user-specific number from 8000 to 8999.
|
||||
<dt><b>-r</b><b>off</b>
|
||||
<dd style="margin-left: 5.0em">Turns off DNS-SD service advertisements entirely.
|
||||
<dt><b>-r </b><i>subtype[,subtype]</i>
|
||||
<dd style="margin-left: 5.0em">Specifies the DNS-SD subtype(s) to advertise.
|
||||
Separate multiple subtypes with a comma.
|
||||
|
@ -143,7 +143,7 @@ The following directives are understood within a <i>test</i>:
|
||||
<dd style="margin-left: 5.0em"><dt><b>ATTR </b><i>tag attribute-name value(s)</i>
|
||||
<dd style="margin-left: 5.0em">Adds an attribute to the test request.
|
||||
Out-of-band tags (admin-define, delete-attribute, no-value, not-settable, unknown, unsupported) have no value.
|
||||
Values for other tags are separated by the comma (",") character - escape commas using the "" character.
|
||||
Values for other tags are delimited by the comma (",") character - escape commas using the "\" character.
|
||||
Common attributes and values are listed in the IANA IPP registry - see references below.
|
||||
<dt><b>ATTR collection </b><i>attribute-name </i><b>{ MEMBER </b><i>tag member-name value(s) ... </i><b>}</b> [ <i>... </i><b>,{ </b><i>... </i><b>} </b>]
|
||||
<dd style="margin-left: 5.0em">Adds a collection attribute to the test request.
|
||||
@ -230,7 +230,7 @@ The following predicates are understood following the <b>EXPECT</b> test directi
|
||||
<dd style="margin-left: 5.0em">Makes the <b>EXPECT</b> conditions apply only if the specified variable is not defined.
|
||||
<dt><b>IN-GROUP </b><i>tag</i>
|
||||
<dd style="margin-left: 5.0em">Requires the <b>EXPECT</b> attribute to be in the specified group tag.
|
||||
<dt><b>OF-TYPE </b><i>tag[,tag,...]</i>
|
||||
<dt><b>OF-TYPE </b><i>tag[|tag,...]</i>
|
||||
<dd style="margin-left: 5.0em">Requires the <b>EXPECT</b> attribute to use one of the specified value tag(s).
|
||||
<dt><b>REPEAT-LIMIT </b><i>number</i>
|
||||
<dd style="margin-left: 5.0em"><br>
|
||||
|
@ -35,7 +35,11 @@
|
||||
|
||||
<li><a href="http://ftp.pwg.org/pub/pwg/candidates/cs-ipptrans10-20131108-5100.16.pdf">PWG 5100.16: IPP Transaction-Based Printing Extensions</a></li>
|
||||
|
||||
<li><a href="http://tools.ietf.org/html/rfc3998">RFC 3998: IPP Job and Printer Administrative Operations</a> (Disable-Printer, Enable-Printer, Hold-New-Jobs, and Release-Held-New-Jobs operations)</li>
|
||||
<li><a href="http://tools.ietf.org/html/rfc3995">RFC 3995: IPP: Event Notifications and Subscriptions</a></li>
|
||||
|
||||
<li><a href="http://tools.ietf.org/html/rfc3996">RFC 3996: IPP: The 'ippget' Delivery Method for Event Notifications</li>
|
||||
|
||||
<li><a href="http://tools.ietf.org/html/rfc3998">RFC 3998: IPP: Job and Printer Administrative Operations</a> (Disable-Printer, Enable-Printer, Hold-New-Jobs, and Release-Held-New-Jobs operations)</li>
|
||||
|
||||
<li><a href="http://tools.ietf.org/html/rfc7472">RFC 7472: IPP over HTTPS Transport Binding and 'ipps' URI Scheme</a></li>
|
||||
|
||||
@ -1614,11 +1618,13 @@ CUPS-Get-PPDs Response:
|
||||
|
||||
<li>'domain': A domain name is required.</li>
|
||||
|
||||
<li>'negotiate': Kerberos is required - this keyword can only appear by itself and causes cupsd to collect the UID of the printing user.</li>
|
||||
|
||||
<li>'none': No authentication is required - this keyword can only appear by itself.</li>
|
||||
|
||||
<li>'password': A password is required.</li>
|
||||
|
||||
<li>'username': A username is required.</li>
|
||||
<li>'username': A username is required. Some protocols (like SMB) prefix the username with the domain, for example "DOMAIN\user".</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
@ -496,7 +496,7 @@ h3.title {
|
||||
<li><a href="#cupsUIResolver">cupsUIResolver</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#I18N">Globalized PPD Support</a></li>
|
||||
<li><a href="#OPTIONS">Custom Options</a></li>
|
||||
<li><a href="#OPTIONS"><span class="info">CUPS 1.3/macOS 10.6</span>Custom Options</a></li>
|
||||
<li><a href="#RASTERPS">Writing PostScript Option Commands for Raster Drivers</a></li>
|
||||
<li><a href="#MEDIA">Media Keywords</a><ul class="subcontents">
|
||||
<li><a href="#cupsMediaQualifier2">cupsMediaQualifier2</a></li>
|
||||
|
@ -1,54 +0,0 @@
|
||||
<!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 2.3.0</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">Administration</a></li>
|
||||
<li><a href="/classes/">Classes</a></li>
|
||||
<li><a href="/help/">Help</a></li>
|
||||
<li><a href="/jobs/">Jobs</a></li>
|
||||
<li><a href="/printers/">Printers</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="row">
|
||||
<h1>CUPS 2.3.0</h1>
|
||||
<p>CUPS is the standards-based, open source printing system developed by <a href="http://www.apple.com/">Apple Inc.</a> for macOS<sup>®</sup> and other UNIX<sup>®</sup>-like operating systems.</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="thirds">
|
||||
<h2>CUPS for Users</h2>
|
||||
<p><a href="help/overview.html">Overview of CUPS</a></p>
|
||||
<p><a href="help/options.html">Command-Line Printing and Options</a></p>
|
||||
<p><a href="http://www.cups.org/lists.php?LIST=cups">User Forum</a></p>
|
||||
</div>
|
||||
<div class="thirds">
|
||||
<h2>CUPS for Administrators</h2>
|
||||
<p><a href="help/admin.html">Adding Printers and Classes</a></p>
|
||||
<p><a href="help/policies.html">Managing Operation Policies</a></p>
|
||||
<p><a href="help/network.html">Using Network Printers</a></p>
|
||||
<p><a href="help/firewalls.html">Firewalls</a></p>
|
||||
<p><a href="help/man-cupsd.conf.html">cupsd.conf Reference</a></p>
|
||||
</div>
|
||||
<div class="thirds">
|
||||
<h2>CUPS for Developers</h2>
|
||||
<p><a href="help/cupspm.html">CUPS Programming Manual</a></p>
|
||||
<p><a href="help/api-filter.html">Filter and Backend Programming</a></p>
|
||||
<p><a href="http://www.cups.org/lists.php?LIST=cups-devel">Developer Forum</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">CUPS and the CUPS logo are trademarks of <a href="http://www.apple.com">Apple Inc.</a> Copyright © 2007-2019 Apple Inc. All rights reserved.</div>
|
||||
</body>
|
||||
</html>
|
@ -1,14 +0,0 @@
|
||||
LIBRARY libcupsimage2
|
||||
VERSION 2.3
|
||||
EXPORTS
|
||||
cupsRasterClose
|
||||
cupsRasterErrorString
|
||||
cupsRasterInterpretPPD
|
||||
cupsRasterOpen
|
||||
cupsRasterOpenIO
|
||||
cupsRasterReadHeader
|
||||
cupsRasterReadHeader2
|
||||
cupsRasterReadPixels
|
||||
cupsRasterWriteHeader
|
||||
cupsRasterWriteHeader2
|
||||
cupsRasterWritePixels
|
@ -1,16 +0,0 @@
|
||||
_cupsImagePutCol
|
||||
_cupsImagePutRow
|
||||
_cupsImageReadBMP
|
||||
_cupsImageReadGIF
|
||||
_cupsImageReadJPEG
|
||||
_cupsImageReadPIX
|
||||
_cupsImageReadPNG
|
||||
_cupsImageReadPNM
|
||||
_cupsImageReadPhotoCD
|
||||
_cupsImageReadSGI
|
||||
_cupsImageReadSunRaster
|
||||
_cupsImageReadTIFF
|
||||
_cupsImageZoomDelete
|
||||
_cupsImageZoomFill
|
||||
_cupsImageZoomNew
|
||||
_cupsRasterExecPS
|
@ -23,12 +23,12 @@
|
||||
|
||||
|
||||
/*
|
||||
* This driver filter currently supports Dymo, Intellitech, and Zebra
|
||||
* This driver filter currently supports DYMO, Intellitech, and Zebra
|
||||
* label printers.
|
||||
*
|
||||
* The Dymo portion of the driver has been tested with the 300, 330,
|
||||
* and 330 Turbo label printers; it may also work with other models.
|
||||
* The Dymo printers support printing at 136, 203, and 300 DPI.
|
||||
* The DYMO portion of the driver has been tested with the 300, 330,
|
||||
* 330 Turbo, and 450 Twin Turbo label printers; it may also work with other
|
||||
* models. The DYMO printers support printing at 136, 203, and 300 DPI.
|
||||
*
|
||||
* The Intellitech portion of the driver has been tested with the
|
||||
* Intellibar 408, 412, and 808 and supports their PCL variant.
|
||||
@ -43,7 +43,7 @@
|
||||
* Model number constants...
|
||||
*/
|
||||
|
||||
#define DYMO_3x0 0 /* Dymo Labelwriter 300/330/330 Turbo */
|
||||
#define DYMO_3x0 0 /* DYMO Labelwriter 300/330/330 Turbo */
|
||||
|
||||
#define ZEBRA_EPL_LINE 0x10 /* Zebra EPL line mode printers */
|
||||
#define ZEBRA_EPL_PAGE 0x11 /* Zebra EPL page mode printers */
|
||||
@ -191,6 +191,7 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */
|
||||
printf("\033D%c", header->cupsBytesPerLine);
|
||||
|
||||
printf("\033%c", header->cupsCompression + 'c'); /* Darkness */
|
||||
printf("\033q%d", header->MediaPosition + 1); /* Roll Select */
|
||||
break;
|
||||
|
||||
case ZEBRA_EPL_LINE :
|
||||
|
File diff suppressed because it is too large
Load Diff
6768
cups/locale/cups.pot
6768
cups/locale/cups.pot
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user