Comparar commits

..

12 Commits

Autor SHA1 Mensagem Data
Michael Sweet d3331249b0 Import CUPS v2.1.2 2016-03-15 10:43:30 -04:00
Michael Sweet bc05464ada Import CUPS v2.1.1 2016-03-15 10:43:26 -04:00
Michael Sweet 348ce78265 Import CUPS v2.1.0 2016-03-15 10:43:24 -04:00
Michael Sweet be91b849f0 Import CUPS v2.1rc1 2016-03-15 10:43:21 -04:00
Michael Sweet c8d724e6bb Import CUPS v2.1b1 2016-03-15 10:43:16 -04:00
Michael Sweet 00d0ae86f6 Import CUPS v2.0.4 2016-03-15 10:40:47 -04:00
Michael Sweet a215cf8413 Import CUPS v2.0.3 2016-03-15 10:40:44 -04:00
Michael Sweet 4ef75dec45 Import CUPS v2.0.2 2016-03-15 10:40:41 -04:00
Michael Sweet 86243a7551 Import CUPS v2.0.1 2016-03-15 10:40:34 -04:00
Michael Sweet b93671244e Import CUPS v2.0.0 2016-03-15 10:40:30 -04:00
Michael Sweet 5d2cc5d32d Import CUPS v2.0rc1 2016-03-15 10:40:26 -04:00
Michael Sweet 1a18c85cd1 Import CUPS v2.0b1 2016-03-15 10:40:21 -04:00
1130 arquivos alterados com 81422 adições e 67660 exclusões
+250
Ver Arquivo
@@ -0,0 +1,250 @@
CHANGES-1.7.txt
---------------
CHANGES IN CUPS V1.7.5
- Security: Addressed some more situations where symlinked files would
be served by the web interface (STR #4455)
- The LPD backend did not work with some versions of glibc (STR #4452)
- CGI scripts did not work (STR #4454)
- The cupsd.conf man page did not list the ErrorPolicy directive
(STR #4457)
- Updated the Brazilian Portuguese translation (STR #4456)
CHANGES IN CUPS V1.7.4
- Security: The web interface incorrectly served symlinked files and
files that were not world-readable, potentially leading to a
disclosure of information (STR #4450)
- The CUPS headers incorrectly needed libdispatch for blocks support
(STR #4397)
- CUPS did not compile when Avahi or mDNSResponder was not present
(STR #4402, STR #4424)
- The "snmp" option did not work with the network backends (STR #4422)
- The User directive in client.conf did not override the USER
environment variable (STR #4426)
- The web interface now properly shows a "Go" button for all text-based
browsers (STR #4425)
- The MaxJobTime directive now properly supports time values (STR #4434)
- The RPM spec file did not work due to the new Brazilian Portuguese
localization (STR #4436)
- Fixed an "IPP read error" issue (STR #4440)
- Fixed the --disable-libusb configure option (STR #4439)
- Fixed the debug output from the DNS-SD backend when using Avahi
(STR #4444)
- Fixed a bug in the CUPS_SC_GET_DEVICE_ID handling by the network
backends (STR #4447)
- Added USB quirk rule for Lexmark E230 (STR #4448)
CHANGES IN CUPS V1.7.3
- Added Brazilian Portuguese translation (STR #4409)
- Fixed mapping of OutputBin values such as "Tray1"
(<rdar://problem/16685606>)
- Several ippGet* functions incorrectly returned -1 instead of 0 on
error.
- The cupsGetResponse function did not work properly with
CUPS_HTTP_DEFAULT (<rdar://problem/16762593>)
- The IPP backend did not abort a job when the printer did not validate
the supplied options (<rdar://problem/16836752>)
- Fixed an authentication race condition in cupsSendRequest (STR #4403)
- The scheduler did not add the "job-hold-until-specified" reason when
holding a job using the lp command (STR #4405)
- The configure script incorrectly added libgcrypt as a GNU TLS
dependency (STR #4399)
- cupsGetDestMediaCount did not work for CUPS_MEDIA_FLAGS DEFAULT
(STR #4414)
- Auto-typing of PWG Raster files did not work (STR #4417)
- IPP queues using hardcoded credentials would ask for credentials
(STR #4371)
- Dates in non-UTF-8 locales did not display correctly (STR #4388)
- The RPM spec file now looks for libusb-devel 1.0 or later.
- Fixed the "create-printer-subscription.test" file for IPPTOOL
(STR #4420)
CHANGES IN CUPS V1.7.2
- Security: The scheduler now blocks URLs containing embedded HTML
(STR #4356)
- Documentation fixes (STR #3259, STR #4346, STR #4355)
- Fixed the Japanese localization (STR #4385)
- Added a German localization (STR #4363)
- The cupsfilter command incorrectly read the cupsd.conf file; it now
reads the cups-files.conf file instead.
- Fixed OS X builds with Xcode 5.x (<rdar://problem/15914959>)
- Fixed SSL support on Windows (STR #4358)
- Fixed documentation and naming of Create-Job/Printer-Subscriptions
operations (STR #4389)
- Phone numbers in fax jobs were not properly filtered for IPP FaxOut
(<rdar://problem/16351701>)
- Updated Linux "relro" support (STR #4349)
- Fixed a memory leak in the label printer driver (STR #4393)
- cupsEnumDests did not set the "is_default" field (STR #4332)
- cupsDoIORequest could miss the server status, causing failed lpadmin
and other administrative commands (STR #4386)
- cupsEnumDests didn't always call the callback function (STR #4380)
- "lp -i job-id -H hold" did not work (STR #nnn)
- CUPS didn't compile on older platforms (STR #4338)
- Several libcups files did not have the Apple license exception
notice (STR #4361)
- Fixed a D-BUS threading issue that caused the scheduler to crash
(STR #4347)
- The scheduler now automatically reconnects to Avahi as needed
(STR #4370, STR #4373)
- The scheduler did not handle GET requests for the log files properly
(STR #3265)
- The dnssd backend did not always report all discovered printers using
Avahi (STR #4365)
- The Zebra printer driver did not properly handle negative "label top"
values (STR #4354)
- The scheduler did not always update the MakeModel value in
printers.conf after updating the driver (STR #4264)
- The LPD mini daemon did not support print jobs larger than 2GB
(STR #4351)
- Fixed a bug in the status reading code when sending a compressed data
stream to an IPP printer/server (<rdar://problem/16019623>)
- The IPP backend might not include all job attributes in Validate-Job
operations (<rdar://problem/16025435>)
- Fixed some clang-reported issues (<rdar://problem/15936066>)
CHANGES IN CUPS V1.7.1
- Security: the lppasswd program incorrectly used settings from
~/.cups/client.conf (STR #4319)
- Auto debug logging was broken in 1.7.0 (<rdar://problem/15331639>)
- Some gzip'd PPD files could not be used (<rdar://problem/15386424>)
- Cleaned up some job logging in the scheduler
(<rdar://problem/15332672>)
- ATTR messages could cause string pool memory corruption in the
scheduler (<rdar://problem/15382819>)
- The RPM spec file did not list the build requirements; this was on
purpose, but now we are listing the Red Hat package names
(<rdar://problem/15375760>, STR #4322)
- Printing to a raw queue could result in corrupt output due to
opportunistic compression (<rdar://problem/15008524>)
- The GNU TLS support code triggered many compiler warnings due to the
use of old GNU TLS compatibility type names
(<rdar://problem/15392966>)
- The "make check" test suite did not work on Linux without the
cups-filters package installed (<rdar://problem/14292998>)
- Japanese PPDs using with the Shift-JIS encoding did not work
(<rdar://problem/15427759>)
- "tel:" URIs incorrectly had slashes (<rdar://problem/15418463>)
- The libusb-based USB backend incorrectly used write timeouts
(<rdar://problem/15564888>)
- Shared printers could become inaccessible after a few days on OS X
(<rdar://problem/15426838>)
- The IPP backend did not wait for a busy printer to become available
before attempting to print (<rdar://problem/15465667>)
- CUPS did not support "auto-monochrome" or "process-monochrome" for the
"print-color-mode" option (<rdar://problem/15482520>)
- Using "@IF(name)" in an Allow or Deny rule did not work (STR #4328)
- lpq and lpstat did not list jobs in the correct order when priorities
were specified (STR #4326)
- The D-BUS notifier did not remove its lockfile (STR #4314)
- CUPS incorrectly used the USER environment variable when the name did
not match the user ID (STR #4327)
CHANGES IN CUPS V1.7.0
- Updated the Japanese localization.
- The lpadmin command did not send the PPD name from the "-m" option
(<rdar://problem/15264697>)
- Network backends now use the prtMarkerSuppliesClass property to
determine the direction of supply level values
(<rdar://problem/14302628>)
- The scheduler did not remove backup PPD files when a printer was
deleted (<rdar://problem/15065555>)
- The scheduler incorrectly responded to HEAD requests when the web
interface was disabled (<rdar://problem/15090332>)
- The scheduler did not respond using the hostname specified by the
client (<rdar://problem/14583574>)
- Fax queues did not work when shared via Bonjour
(<rdar://problem/14498310>)
- Error messages from the scheduler were not localized using the
language specified in the client's IPP request
(<rdar://problem/14128011>)
- Added an Italian localization (<rdar://problem/14481578>)
- Fixed a couple memory leaks in ippfind that were reported by Clang.
- Fixed a compile issue on 64-bit Linux with Clang - need to use the
-pie option instead of -Wl,-pie now (<rdar://problem/14480938>)
- The ippfind utility reported the wrong port numbers when compiled
against Avahi (<rdar://problem/14508324>)
- httpGetFd, httpGetFile, httpPutFd, and httpPutFile did not
automatically reconnect if the server closed the connecion after the
previous response.
- Fixed a compile error in libcups (<rdar://problem/14467141>)
- The scheduler incorrectly did not pass a FINAL_CONTENT_TYPE
environment variable to the filters or backend
(<rdar://problem/14355011>)
- The cups-exec helper program could fail randomly on OS X due to
sandbox violations when closing excess file descriptors
(<rdar://problem/14421943>)
- The scheduler incorrectly did not use the kqueue interface on OS X.
CHANGES IN CUPS V1.7rc1
- Printer xxx-default values were not reported by Get-Printer-Attributes
or lpoptions (<rdar://problem/14401795>)
- Fixed deprecation warnings for many functions on OS X so they are tied
to the deployment version when building (<rdar://problem/14210079>)
- Fixed a build issue on ARM-based Linux systems - unable to validate
va_list arguments.
- Added a new ippfind tool for finding IPP printers and other Bonjour
services (<rdar://problem/13876199>)
- Fixed some issues with conversion of PWG media size names to
hundredths of millimeters (<rdar://problem/14065748>)
- The IPP backend could crash on OS X when printing to a Kerberized
printer (<rdar://problem/14040186>)
- The ipptool program now automatically extends timeouts when the
output buffer is filled (<rdar://problem/14016099>)
- The ipptool program now supports the --help and --version options.
- The ipptool program did not continue past include file errors by
default (<rdar://problem/13875803>)
- The ipptool program now supports FILE-ID and TEST-ID directives and
includes their values in its XML output (<rdar://problem/13876038>)
- The ipptool program now supports WITH-HOSTNAME, WITH-RESOURCE, and
WITH-SCHEME expect predicates to compare the corresponding URI
components (<rdar://problem/13876091>)
CHANGES IN CUPS V1.7b1
- The configure script now supports a --with-rundir option to change
the transient run-time state directory from the default to other
locations like /run/cups (STR #4306)
- The scheduler now supports PPD lookups for classes (STR #4296)
- The cupsfilter program did not set the FINAL_CONTENT_TYPE
environment variable for filters.
- Added a new "-x" option to the cancel command (STR #4103)
- Made the PWG media handling APIs public (STR #4267)
- Implemented ready media support for the cupsGetDestMediaXxx APIs
(STR #4289)
- Added new cupsFindDestDefault, cupsFindDestReady, and
cupsFindDestSupported APIs (STR #4289)
- Added new cupsGetDestMediaByIndex, cupsGetDestMediaCount, and
cupsGetDestMediaDefault APIs (STR #4289)
- Added new ippGet/SetOctetString APIs for getting and setting an
octetString value (STR #4289)
- Added new ippCreateRequestedArray API for generating a array of
attributes from the requested-attributes attribute.
- The ipptool utility now supports compression, conditional tests based
on the presence of files, and new DEFINE predicates for STATUS.
- Added new IPP APIs for checking values (STR #4167)
- Added new IPP APis for adding and setting formatted strings.
- Added new HTTP APIs to support basic server functionality via libcups.
- The dnssd backend now generates a 1284 device ID as needed (STR #3702)
- CUPS now supports compressing and decompressing streamed data
(STR #4168)
- CUPS now supports higher-level PIN printing, external accounting
systems, and "print here" printing environments (STR #4169)
- IRIX is no longer a supported operating system (STR #4092)
- The PPD compiler now supports JCL options properly (STR #4115)
- The web interface now checks whether the web browser has cookies
enabled and displays a suitable error message (STR #4141)
+215
Ver Arquivo
@@ -0,0 +1,215 @@
CHANGES-2.0.txt
---------------
CHANGES IN CUPS V2.0.4
- Fixed a bug in cupsRasterWritePixels (STR #4650)
- Fixed redirection in the web interface (STR #4538)
- The IPP backend did not respond to side-channel requests (STR #4645)
- The scheduler did not start all pending jobs at once (STR #4646)
- The web search incorrectly searched time-at-xxx values (STR #4652)
- Fixed an RPM spec file issue (STR #4657)
- The scheduler incorrectly started jobs while canceling multiple jobs
(STR #4648)
- Fixed processing of server overrides without port numbers (STR #4675)
- Documentation changes (STR #4651, STR #4674)
CHANGES IN CUPS V2.0.3
- Security: Fixed CERT VU #810572 exploiting the dynamic linker
(STR #4609)
- Security: The scheduler could hang with malformed gzip data
(STR #4602)
- Restored missing generic printer icon file (STR #4587)
- Fixed logging of configuration errors to show up as errors (STR #4582)
- Fixed potential buffer overflows in raster code and filters
(STR #4598, STR #4599, STR #4600, STR #4601)
- Fixed a gzip processing bug (#4602)
- Fixed <Limit> inside <Location> (STR #4575)
- Fixed lpadmin when both -m and -o are used (STR #4578)
- The web interface always showed support for 2-sided printing
(STR #4595)
- cupsRasterReadHeader did not fully validate the raster header
(STR #4596)
- The rastertopwg filter did not check for truncated input (STR #4597)
- The cups-lpd mini-daemon did not check for request parameters
(STR #4603)
- The scheduler could get caught in a busy loop (STR #4605)
- The sample Epson driver could crash (STR #4616)
- The IPP backend now correctly monitors jobs
(<rdar://problem/20495955>)
- The ppdhtml and ppdpo utilities crashed when the -D option was used
before a driver information file (STR #4627)
- ippfind incorrectly substituted "=port" for service_port.
- The IPP/1.1 test file did not handle the initial print job
completing early (STR #4576)
- Fixed a memory leak in cupsConnectDest (STR #4634)
- PWG Raster Format output contained invalid ImageBox values
(<rdar://problem/21144309>)
- Added Russian translation (STR #4577)
- Added German translation (STR #4635)
CHANGES IN CUPS V2.0.2
- Security: cupsRasterReadPixels buffer overflow with invalid page
header and compressed raster data (STR #4551)
- Command-line programs were not localized on Mac OS X
(<rdar://problem/14546232>)
- The scheduler incorrectly cleared the MakeModel string in the
printers.conf file after a restart (<rdar://problem/16827518>)
- CUPS did not compile with older versions of GNU TLS (STR #4527)
- CUPS did not compile without Avahi or mDNSResponder (STR #4523)
- ippLength() did not return the correct length for IPP_TAG_CONST
string values.
- The scheduler incorrectly aborted jobs after a job was restarted
(<rdar://problem/19129387>)
- The cups-files.conf file contained the old ServerCertificate/Key
directives instead of ServerKeychain.
- Fixed builds when no SSL/TLS library is available, or when explicitly
disabled (STR #4531)
- Fixed an OpenBSD charset transcoding issue.
- Fixed USB printing on OpenBSD (STR #4525)
- The --without-xinetd configure option did not work (STR #4542)
- Backends needing to load OS X kernel extensions did not work
(<rdar://problem/19015679>)
- Mapping of PPD keywords to IPP keywords did not work if the PPD
keyword was already an IPP keyword (<rdar://problem/19121005>)
- cupsGetPPD* sent bad requests (STR #4567)
- ippserver used the wrong temporary directory on Windows (STR #4547)
- ippserver did not handle Bonjour registrations properly (STR #4548)
- The scheduler could crash during shutdown if Avahi was shutdown
first (STR #4550)
- Added a USB quirk rule for Intermec printers (STR #4553)
- The scheduler did not always log which configuration file had the
error (STR #4559)
- The ippfind and ipptool programs now correctly match hostnames with
trailing dots (STR #4563)
- The ipptool timeout option did not work (STR #4515)
- Fixed several issues with client.conf, CUPS_SERVER, and the "-h"
option of most commands (STR #4528)
- Another change for OpenBSD (STR #4526)
- Added Japanese localization (STR #4524)
- Documentation changes (STR #4569)
CHANGES IN CUPS V2.0.1
- Security: SSLv3 is now disabled by default to protect against the
POODLE attack (STR #4476)
- Printer sharing did not work when systemd was being used (STR #4497)
- cupsGetPPD* would return a symlink to the PPD in /etc/cups/ppd even if
it was not readable by the user (STR #4500)
- The web interface now protects against frame "click-jacking" attacks
(STR #4492)
- Fixed a crash in ippAttributeString (<rdar://problem/17903871>)
- Fixed a crash in the scheduler on Linux/*BSD if colord was not running
(STR #4496)
- Fixed a random crash in the scheduler when not using systemd
(STR #4484)
- Added systemd support for cups-lpd (STR #4493)
- The scheduler did not honor the FatalErrors directive for mis-
configured Group and SystemGroup values (STR #4495)
- The network backends no longer report waste-receptacle conditions when
using SNMP (STR #4499)
- The IPP backend did not work with some configurations of Windows
(STR #4503)
- RPMs did not build (STR #4490)
- Added a USB quirk rule for the Brother HL-1250 (STR #4519)
- Fixed compiles on unsupported platforms (STR #4510)
- "cancel -a" did not cancel all jobs on all destinations (STR #4513)
- The web interface did not work on OpenBSD (STR #4496)
CHANGES IN CUPS V2.0.0
- The scheduler did not preserve listener sockets from launchd or
systemd after a restart (<rdar://problem/18112848>)
- Added some USB quirk rules for the libusb-based USB backend
(STR #4482)
- Spanish localization update (STR #4487)
- Updated documentation for 2.0.0 release.
CHANGES IN CUPS V2.0rc1
- Documentation updates (STR #4464)
- The scheduler now monitors the AC power status on OS X, allowing for
"sleep printing" when sharing printers (<rdar://problem/17325852>)
- The scheduler incorrectly called launch_activate_socket multiple times
on OS X (<rdar://problem/17523218>)
- The ippserver test program now passes the IPP Everywhere self-
certification tests (STR #4101)
- Relaxed the new OS X filter sandbox slightly (STR #4471,
<rdar://problem/17483959>)
- Dropped the old Epson Stylus Color/Photo sample drivers since they
don't work with any current printers and there are free alternatives
that produce much better output (<rdar://problem/18036889>)
- Log and configuration files that are not world-readable are again
accessible via the web interface (STR #4461)
- PPD files are now created using the permissions specified by the
ConfigFilePerm directive.
- Fixed RPM build issues (STR #4459)
- Fixed the spinner image and restart page when reconfiguring the
scheduler through the web interface (STR #4475)
CHANGES IN CUPS V2.0b1
- Added a "--list-filters" option to the cupsfilter command (STR #4325)
- Added systemd support (STR #3917)
- Added support for re-sending a job as a raster file if a higher-level
format such as PDF fails (<rdar://problem/15583721>)
- Added support for regular expression matching in the MIME type rules
(<rdar://problem/11131245>)
- Added support for TLS certificate validation and policy enforcement
(STR #1616)
- Added support for simultaneous XML and test output from ipptool.
- Added support for PAUSE directive in ipptool test files.
- Added support for auto-typing of TIFF files by ipptool (STR #4418)
- The scheduler now returns completed jobs in the correct newest-to-
oldest order (STR #4396)
- The configure script now supports target-specific tools for pkg-config
and others (STR #4423)
- The ipptool program now supports EXPECT statements for collection
member attributes (<rdar://problem/15355218>)
- The ipptool program now supports collection attributes with multiple
values (<rdar://problem/15355124>)
- The sample drivers now include all of the installed localizations by
default (<rdar://problem/14756625>)
- Adopted Linux man page conventions and updated all man pages
(STR #4372, STR #4329)
- The scheduler now supports the "first-index" operation attribute for
the Get-Jobs operation (STR #2913)
- Changed the default AccessLogLevel and PageLogFormat to disable the
access_log and page_log files by default (<rdar://problem/16495000>)
- cupsRasterInterpretPPD now supports the Orientation header in order to
support long-edge feed raster printers (<rdar://problem/15837926>)
- The scheduler now allows run-as-root backends to have group read and
execute permissions (STR #2935)
- The ippFindAttribute and ippFindNextAttribute functions now support
hierarchical searches (STR #4395)
- Dropped OpenSSL support in favor of GNU TLS.
- Dropped "dark wake" support on OS X, which was preventing portables
from going to sleep when there was a stuck job. We now use a variation
of the CUPS 1.4 sleep support to do a cleaner sleep
(<rdar://problem/14323704>)
- Dropped support for AIX, HP-UX, and OSF/1 (aka Digital UNIX)
- Dropped lppasswd and support for Digest authentication in in the
scheduler (STR #4321)
- The cupsGetClasses, cupsGetPrinters, and cupsTempFile functions are no
longer supported.
- The scheduler now caches more job history data and limits the number
of completed jobs returned by Get-Jobs as needed in order to prevent a
denial-of-service on busy servers (STR #2913)
- The filter/backend sandbox on OS X now defaults to a more strict
whitelist (<rdar://problem/15939788>)
- Increased the default idle exit timeout to 60 seconds on OS X
(<rdar://problem/16041820>)
- Printer classes were not accessible on OS X
(<rdar://problem/16385643>)
- The scheduler now uses </DefaultPrinter> to close the default printer
definition in printers.conf (STR #4153)
- Canceling all jobs in the web interface now just cancels the jobs
(STR #1914)
+5 -4
Ver Arquivo
@@ -1,12 +1,13 @@
CHANGES-IPPTOOL.txt - 2014-03-28
CHANGES-IPPTOOL.txt - 2015-05-15
--------------------------------
This file provides a list of changes to the ipptool binary distribution posted
on cups.org.
on CUPS.org.
2014-03-28
2014-05-15
- Fixed SSL support on Windows (STR #4358)
- Added support for simultaneous XML and test output from ipptool.
- Added support for PAUSE directive in ipptool test files.
2013-07-15
+97 -234
Ver Arquivo
@@ -1,250 +1,113 @@
CHANGES.txt - 1.7.5 - 2014-07-30
CHANGES.txt - 2.1.2 - 2015-12-02
--------------------------------
CHANGES IN CUPS V1.7.5
CHANGES IN CUPS V2.1.2
- Security: Addressed some more situations where symlinked files would
be served by the web interface (STR #4455)
- The LPD backend did not work with some versions of glibc (STR #4452)
- CGI scripts did not work (STR #4454)
- The cupsd.conf man page did not list the ErrorPolicy directive
(STR #4457)
- Updated the Brazilian Portuguese translation (STR #4456)
- Re-release of CUPS 2.1.1 as CUPS 2.1.2 due to error in tagging of the
2.1.1 release (pulled content from the 2.2.x tree instead)
CHANGES IN CUPS V1.7.4
CHANGES IN CUPS V2.1.1
- Security: The web interface incorrectly served symlinked files and
files that were not world-readable, potentially leading to a
disclosure of information (STR #4450)
- The CUPS headers incorrectly needed libdispatch for blocks support
(STR #4397)
- CUPS did not compile when Avahi or mDNSResponder was not present
(STR #4402, STR #4424)
- The "snmp" option did not work with the network backends (STR #4422)
- The User directive in client.conf did not override the USER
environment variable (STR #4426)
- The web interface now properly shows a "Go" button for all text-based
browsers (STR #4425)
- The MaxJobTime directive now properly supports time values (STR #4434)
- The RPM spec file did not work due to the new Brazilian Portuguese
localization (STR #4436)
- Fixed an "IPP read error" issue (STR #4440)
- Fixed the --disable-libusb configure option (STR #4439)
- Fixed the debug output from the DNS-SD backend when using Avahi
(STR #4444)
- Fixed a bug in the CUPS_SC_GET_DEVICE_ID handling by the network
backends (STR #4447)
- Added USB quirk rule for Lexmark E230 (STR #4448)
- Security hardening fixes (<rdar://problem/23131948>,
<rdar://problem/23132108>, <rdar://problem/23132353>,
<rdar://problem/23132803>, <rdar://problem/23133230>,
<rdar://problem/23133393>, <rdar://problem/23133466>,
<rdar://problem/23133833>, <rdar://problem/23133998>,
<rdar://problem/23134228>, <rdar://problem/23134299>,
<rdar://problem/23134356>, <rdar://problem/23134415>,
<rdar://problem/23134506>, <rdar://problem/23135066>,
<rdar://problem/23135122>, <rdar://problem/23135207>,
<rdar://problem/23144290>, <rdar://problem/23144358>,
<rdar://problem/23144461>)
- The cupsGetPPD* functions did not work with IPP printers (STR #4725)
- Some older HP LaserJet printers need a delayed close when printing
using the libusb-based USB backend (STR #4549)
- The libusb-based USB backend did not unload the kernel usblp module
if it was preventing the backend from accessing the printer
(STR #4707)
- Current Primera printers were incorrectly reported as Fargo printers
(STR #4708)
- The IPP backend did not always handle jobs getting canceled at the
printer (<rdar://problem/22716820>)
- Scheduler logging change (STR #4728)
- Added USB quirk for Canon MP530 (STR #4730)
- The scheduler did not deliver job notifications for jobs submitted to
classes (STR #4733)
- Changing the printer-is-shared value for a remote queue did not
produce an error (STR #4738)
- The IPP backend incorrectly included the job-password attribute in
Validate-Job requests (<rdar://problem/23531939>)
- Updated localizations (STR #4709)
CHANGES IN CUPS V1.7.3
CHANGES IN CUPS V2.1.0
- Added Brazilian Portuguese translation (STR #4409)
- Fixed mapping of OutputBin values such as "Tray1"
(<rdar://problem/16685606>)
- Several ippGet* functions incorrectly returned -1 instead of 0 on
error.
- The cupsGetResponse function did not work properly with
CUPS_HTTP_DEFAULT (<rdar://problem/16762593>)
- The IPP backend did not abort a job when the printer did not validate
the supplied options (<rdar://problem/16836752>)
- Fixed an authentication race condition in cupsSendRequest (STR #4403)
- The scheduler did not add the "job-hold-until-specified" reason when
holding a job using the lp command (STR #4405)
- The configure script incorrectly added libgcrypt as a GNU TLS
dependency (STR #4399)
- cupsGetDestMediaCount did not work for CUPS_MEDIA_FLAGS DEFAULT
(STR #4414)
- Auto-typing of PWG Raster files did not work (STR #4417)
- IPP queues using hardcoded credentials would ask for credentials
(STR #4371)
- Dates in non-UTF-8 locales did not display correctly (STR #4388)
- The RPM spec file now looks for libusb-devel 1.0 or later.
- Fixed the "create-printer-subscription.test" file for IPPTOOL
(STR #4420)
- Fixed more scheduler crash bugs in the new logging code (STR #4687,
STR #4690)
- The scheduler did not use the ConfigFilePerm setting when copying PPD
files or interface scripts attached to a request (STR #4703)
- Now support new Chinese locale IDs and their correct fallback locales
(<rdar://problem/22086642>, <rdar://problem/22130168>)
- "make check" incorrectly reported an expectation of 18 warning
messages when 8 were expected (STR #4684)
- The new PDF file type rule did not work (STR #4692)
- The scheduler did not update the jobs.cache file when job files were
expired (STR #4706)
- Fixed some configure script issues (STR #4694, STR #4695, STR #4698)
- Documentation updates (STR #4691, STR #4693)
CHANGES IN CUPS V1.7.2
CHANGES IN CUPS V2.1rc1
- Security: The scheduler now blocks URLs containing embedded HTML
(STR #4356)
- Documentation fixes (STR #3259, STR #4346, STR #4355)
- Fixed the Japanese localization (STR #4385)
- Added a German localization (STR #4363)
- The cupsfilter command incorrectly read the cupsd.conf file; it now
reads the cups-files.conf file instead.
- Fixed OS X builds with Xcode 5.x (<rdar://problem/15914959>)
- Fixed SSL support on Windows (STR #4358)
- Fixed documentation and naming of Create-Job/Printer-Subscriptions
operations (STR #4389)
- Phone numbers in fax jobs were not properly filtered for IPP FaxOut
(<rdar://problem/16351701>)
- Fixed a memory leak in the label printer driver (STR #4393)
- Updated Linux "relro" support (STR #4349)
- cupsEnumDests did not set the "is_default" field (STR #4332)
- cupsDoIORequest could miss the server status, causing failed lpadmin
and other administrative commands (STR #4386)
- cupsEnumDests didn't always call the callback function (STR #4380)
- "lp -i job-id -H hold" did not work (STR #4401)
- CUPS didn't compile on older platforms (STR #4338)
- Several libcups files did not have the Apple license exception
notice (STR #4361)
- Fixed a D-BUS threading issue that caused the scheduler to crash
(STR #4347)
- The scheduler now automatically reconnects to Avahi as needed
(STR #4370, STR #4373)
- The scheduler did not handle GET requests for the log files properly
(STR #3265)
- The dnssd backend did not always report all discovered printers using
Avahi (STR #4365)
- The Zebra printer driver did not properly handle negative "label top"
values (STR #4354)
- The scheduler did not always update the MakeModel value in
printers.conf after updating the driver (STR #4264)
- The LPD mini daemon did not support print jobs larger than 2GB
(STR #4351)
- Fixed a bug in the status reading code when sending a compressed data
stream to an IPP printer/server (<rdar://problem/16019623>)
- The IPP backend might not include all job attributes in Validate-Job
operations (<rdar://problem/16025435>)
- Fixed some clang-reported issues (<rdar://problem/15936066>)
- Added support for 3D printers (basic types only, no built-in filters)
based on PWG white paper.
- Fixed bugs in the new journald support (STR #4655, STR #4658,
STR #4661)
- Fixed domain socket support on Linux (STR #4679)
- Fixed signal handlers in the dnssd and usb backends (STR #4671)
- <Limit All> in <Policy> sections now applies to all operations when
used by itself (STR #4659)
- Configure script changes for systemd support (STR #4669)
- Updated autoconf sources to use newer form of AC_INIT (STR #4664)
CHANGES IN CUPS V1.7.1
CHANGES IN CUPS V2.1b1
- Security: the lppasswd program incorrectly used settings from
~/.cups/client.conf (STR #4319)
- Auto debug logging was broken in 1.7.0 (<rdar://problem/15331639>)
- Some gzip'd PPD files could not be used (<rdar://problem/15386424>)
- Cleaned up some job logging in the scheduler
(<rdar://problem/15332672>)
- ATTR messages could cause string pool memory corruption in the
scheduler (<rdar://problem/15382819>)
- The RPM spec file did not list the build requirements; this was on
purpose, but now we are listing the Red Hat package names
(<rdar://problem/15375760>, STR #4322)
- Printing to a raw queue could result in corrupt output due to
opportunistic compression (<rdar://problem/15008524>)
- The GNU TLS support code triggered many compiler warnings due to the
use of old GNU TLS compatibility type names
(<rdar://problem/15392966>)
- The "make check" test suite did not work on Linux without the
cups-filters package installed (<rdar://problem/14292998>)
- Japanese PPDs using with the Shift-JIS encoding did not work
(<rdar://problem/15427759>)
- "tel:" URIs incorrectly had slashes (<rdar://problem/15418463>)
- The libusb-based USB backend incorrectly used write timeouts
(<rdar://problem/15564888>)
- Shared printers could become inaccessible after a few days on OS X
(<rdar://problem/15426838>)
- The IPP backend did not wait for a busy printer to become available
before attempting to print (<rdar://problem/15465667>)
- CUPS did not support "auto-monochrome" or "process-monochrome" for the
"print-color-mode" option (<rdar://problem/15482520>)
- Using "@IF(name)" in an Allow or Deny rule did not work (STR #4328)
- lpq and lpstat did not list jobs in the correct order when priorities
were specified (STR #4326)
- The D-BUS notifier did not remove its lockfile (STR #4314)
- CUPS incorrectly used the USER environment variable when the name did
not match the user ID (STR #4327)
- Improved speed of ppdMarkDefaults for complex/large PPDs
(<rdar://problem/15146999>)
- The IPP backend now stops sending print data if the printer indicates
the job has been aborted or canceled (<rdar://problem/17837631>)
- The IPP backend now sends the job-pages-per-set attribute when
printing multiple copy jobs with finishings
(<rdar://problem/16792757>)
- The IPP backend now updates the cupsMandatory values when the printer
configuration changes (<rdar://problem/18126570>)
- No longer install banner files since third-party banner filters now
supply their own (STR #4518)
- Added support for EXPECT-ALL directive in ipptool test files
(STR #4469)
- Added support for WITH-VALUE-FROM predicate in ipptool test files
(STR #4470)
- The scheduler no longer listens on the loopback interface unless the
web interface or printer sharing are enabled
(<rdar://problem/9136448>)
- Added a PPD generator for IPP Everywhere printers (STR #4258)
- Now install "default" versions of more configuration files
(<rdar://problem/19024491>)
- The cupstestppd program did not handle "maxsize(nnn)" entries in
cupsFilter/cupsFilter2 values (<rdar://problem/18974858>)
- The scheduler now checks the return value of rename() calls
(STR #4589)
- The scheduler now validates ErrorPolicy values in config files
(STR #4591)
- Long cookies caused the web interface to stop working (STR #4619)
- Added SSLOptions values to allow Diffie-Hellman key exchange and
disable TLS/1.0 support.
- Updated the scheduler to support more IPP Everywhere attributes
(STR #4630)
- The scheduler now supports advanced ASL and journald logging when
"syslog" output is configured (STR #4474)
- The scheduler now supports logging to stderr when running in the
foreground (STR #4505)
CHANGES IN CUPS V1.7.0
- Updated Japanese localization.
- The lpadmin command did not send the PPD name from the "-m" option
(<rdar://problem/15264697>)
- Network backends now use the prtMarkerSuppliesClass property to
determine the direction of supply level values
(<rdar://problem/14302628>)
- The scheduler did not remove backup PPD files when a printer was
deleted (<rdar://problem/15065555>)
- The scheduler incorrectly responded to HEAD requests when the web
interface was disabled (<rdar://problem/15090332>)
- The scheduler did not respond using the hostname specified by the
client (<rdar://problem/14583574>)
- Fax queues did not work when shared via Bonjour
(<rdar://problem/14498310>)
- Error messages from the scheduler were not localized using the
language specified in the client's IPP request
(<rdar://problem/14128011>)
- Added an Italian localization (<rdar://problem/14481578>)
- Fixed a couple memory leaks in ippfind that were reported by Clang.
- Fixed a compile issue on 64-bit Linux with Clang - need to use the
-pie option instead of -Wl,-pie now (<rdar://problem/14480938>)
- The ippfind utility reported the wrong port numbers when compiled
against Avahi (<rdar://problem/14508324>)
- httpGetFd, httpGetFile, httpPutFd, and httpPutFile did not
automatically reconnect if the server closed the connecion after the
previous response.
- Fixed a compile error in libcups (<rdar://problem/14467141>)
- The scheduler incorrectly did not pass a FINAL_CONTENT_TYPE
environment variable to the filters or backend
(<rdar://problem/14355011>)
- The cups-exec helper program could fail randomly on OS X due to
sandbox violations when closing excess file descriptors
(<rdar://problem/14421943>)
- The scheduler incorrectly did not use the kqueue interface on OS X.
CHANGES IN CUPS V1.7rc1
- Printer xxx-default values were not reported by Get-Printer-Attributes
or lpoptions (<rdar://problem/14401795>)
- Fixed deprecation warnings for many functions on OS X so they are tied
to the deployment version when building (<rdar://problem/14210079>)
- Fixed a build issue on ARM-based Linux systems - unable to validate
va_list arguments.
- Added a new ippfind tool for finding IPP printers and other Bonjour
services (<rdar://problem/13876199>)
- Fixed some issues with conversion of PWG media size names to
hundredths of millimeters (<rdar://problem/14065748>)
- The IPP backend could crash on OS X when printing to a Kerberized
printer (<rdar://problem/14040186>)
- The ipptool program now automatically extends timeouts when the
output buffer is filled (<rdar://problem/14016099>)
- The ipptool program now supports the --help and --version options.
- The ipptool program did not continue past include file errors by
default (<rdar://problem/13875803>)
- The ipptool program now supports FILE-ID and TEST-ID directives and
includes their values in its XML output (<rdar://problem/13876038>)
- The ipptool program now supports WITH-HOSTNAME, WITH-RESOURCE, and
WITH-SCHEME expect predicates to compare the corresponding URI
components (<rdar://problem/13876091>)
CHANGES IN CUPS V1.7b1
- The configure script now supports a --with-rundir option to change
the transient run-time state directory from the default to other
locations like /run/cups (STR #4306)
- The scheduler now supports PPD lookups for classes (STR #4296)
- The cupsfilter program did not set the FINAL_CONTENT_TYPE
environment variable for filters.
- Added a new "-x" option to the cancel command (STR #4103)
- Made the PWG media handling APIs public (STR #4267)
- Implemented ready media support for the cupsGetDestMediaXxx APIs
(STR #4289)
- Added new cupsFindDestDefault, cupsFindDestReady, and
cupsFindDestSupported APIs (STR #4289)
- Added new cupsGetDestMediaByIndex, cupsGetDestMediaCount, and
cupsGetDestMediaDefault APIs (STR #4289)
- Added new ippGet/SetOctetString APIs for getting and setting an
octetString value (STR #4289)
- Added new ippCreateRequestedArray API for generating a array of
attributes from the requested-attributes attribute.
- The ipptool utility now supports compression, conditional tests based
on the presence of files, and new DEFINE predicates for STATUS.
- Added new IPP APIs for checking values (STR #4167)
- Added new IPP APis for adding and setting formatted strings.
- Added new HTTP APIs to support basic server functionality via libcups.
- The dnssd backend now generates a 1284 device ID as needed (STR #3702)
- CUPS now supports compressing and decompressing streamed data
(STR #4168)
- CUPS now supports higher-level PIN printing, external accounting
systems, and "print here" printing environments (STR #4169)
- IRIX is no longer a supported operating system (STR #4092)
- The PPD compiler now supports JCL options properly (STR #4115)
- The web interface now checks whether the web browser has cookies
enabled and displays a suitable error message (STR #4141)
+10 -7
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.7.5 - 2014-07-30
INSTALL - CUPS v2.1.2 - 2015-12-02
----------------------------------
This file describes how to compile and install CUPS from source code. For more
@@ -98,6 +98,11 @@ CONFIGURATION
and diagnose a variety of common problems - use the "--enable-unit-tests"
configure option to run them at build time.
On OS X, use the "--with-archflags" option to build with the correct set of
architectures:
./configure --with-archflags="-arch i386 -arch x86_64" ...
Once you have configured things, just type:
make ENTER
@@ -136,6 +141,10 @@ INSTALLING THE SOFTWARE
gmake install ENTER
Use the BUILDROOT variable to install to an alternate root directory:
make BUILDROOT=/some/other/root/directory install ENTER
You can also build binary packages that can be installed on other machines
using the RPM spec file ("packaging/cups.spec") or EPM list file
("packaging/cups.list"). The latter also supports building of binary RPMs,
@@ -165,17 +174,11 @@ CREATING BINARY DISTRIBUTIONS WITH EPM
following:
epm - Builds a script + tarfile package
aix - Builds an AIX package
bsd - Builds a *BSD package
deb - Builds a Debian package
depot - Builds a HP-UX package (also swinstall)
inst - Builds an IRIX package (also tardist)
pkg - Builds a Solaris package
rpm - Builds a RPM package
setld - Build a Tru64 UNIX package
slackware - Build a Slackware package
swinstall - Build a HP-UX package (also depot)
tardist - Builds an IRIX package (also inst)
GETTING DEBUG LOGGING FROM CUPS
+2 -2
Ver Arquivo
@@ -1,4 +1,4 @@
IPPTOOL.txt - 2014-04-10
IPPTOOL.txt - 2013-07-15
------------------------
See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
@@ -220,7 +220,7 @@ REPORTING BUGS
LEGAL STUFF
CUPS is Copyright 2007-2014 by Apple Inc. CUPS and the CUPS logo are
CUPS is Copyright 2007-2013 by Apple Inc. CUPS and the CUPS logo are
trademarks of Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
+7 -13
Ver Arquivo
@@ -1,6 +1,6 @@
CUPS License Agreement
Copyright 2007-2012 by Apple Inc.
Copyright 2007-2013 by Apple Inc.
1 Infinite Loop
Cupertino, CA 95014 USA
@@ -10,9 +10,9 @@
INTRODUCTION
CUPS(tm) is provided under the GNU General Public License ("GPL")
and GNU Library General Public License ("LGPL"), Version 2, with
exceptions for Apple operating systems and the OpenSSL toolkit. A
copy of the exceptions and licenses follow this introduction.
and GNU Library General Public License ("LGPL"), Version 2, with an
exception for Apple operating systems. A copy of the exception and
licenses follow this introduction.
The GNU LGPL applies to the CUPS and CUPS Imaging libraries
located in the "cups" and "filter" subdirectories of the CUPS
@@ -45,7 +45,7 @@ application, driver, or filter.
LICENSE EXCEPTIONS
In addition, as the copyright holder of CUPS, Apple Inc. grants
the following special exceptions:
the following special exception:
1. Apple Operating System Development License Exception;
@@ -86,14 +86,8 @@ the following special exceptions:
This file is subject to the Apple OS-Developed
Software exception.
2. OpenSSL Toolkit License Exception;
a. Apple Inc. explicitly allows the compilation and
distribution of the CUPS software with the OpenSSL
Toolkit.
No developer is required to provide these exceptions in a
derived work.
No developer is required to provide this exception in a derived
work.
KERBEROS SUPPORT CODE
+23 -20
Ver Arquivo
@@ -1,16 +1,16 @@
#
# "$Id: Makedefs.in 11154 2013-07-17 15:21:18Z msweet $"
# "$Id: Makedefs.in 12519 2015-02-17 13:10:19Z msweet $"
#
# Common makefile definitions for CUPS.
# Common makefile definitions for CUPS.
#
# Copyright 2007-2013 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
# Copyright 2007-2014 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
#
#
@@ -121,9 +121,9 @@ INSTALLXPC = @INSTALLXPC@
#
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) $(SSLFLAGS) \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) $(SSLFLAGS) \
@LARGEFILE@ @PTHREAD_FLAGS@ $(OPTIONS)
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
ARCHFLAGS = @ARCHFLAGS@
ARFLAGS = @ARFLAGS@
BACKLIBS = @BACKLIBS@
@@ -140,13 +140,14 @@ DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
DNSSDLIBS = @DNSSDLIBS@
IPPFIND_BIN = @IPPFIND_BIN@
IPPFIND_MAN = @IPPFIND_MAN@
LAUNCHDLIBS = @LAUNCHDLIBS@
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
-L../scheduler @LDARCHFLAGS@ \
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ)
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
LIBS = $(LINKCUPS) $(COMMONLIBS)
ONDEMANDFLAGS = @ONDEMANDFLAGS@
ONDEMANDLIBS = @ONDEMANDLIBS@
OPTIM = @OPTIM@
OPTIONS =
PAMLIBS = @PAMLIBS@
@@ -200,8 +201,6 @@ DATADIR = $(BUILDROOT)@CUPS_DATADIR@
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
ICONDIR = @ICONDIR@
INCLUDEDIR = $(BUILDROOT)$(includedir)
INITDIR = @INITDIR@
INITDDIR = @INITDDIR@
LIBDIR = $(BUILDROOT)$(libdir)
LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
@@ -216,10 +215,7 @@ REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
SBINDIR = $(BUILDROOT)@sbindir@
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
SMFMANIFESTDIR = @SMFMANIFESTDIR@
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
USBQUIRKS = @USBQUIRKS@
XINETD = @XINETD@
MAN1EXT = @MAN1EXT@
MAN5EXT = @MAN5EXT@
@@ -230,8 +226,15 @@ MAN8DIR = @MAN8DIR@
PAMDIR = @PAMDIR@
PAMFILE = @PAMFILE@
DEFAULT_LAUNCHD_CONF = @DEFAULT_LAUNCHD_CONF@
DBUSDIR = @DBUSDIR@
INITDIR = @INITDIR@
INITDDIR = @INITDDIR@
LAUNCHD_DIR = @LAUNCHD_DIR@
SMFMANIFESTDIR = @SMFMANIFESTDIR@
SYSTEMD_DIR = @SYSTEMD_DIR@
XINETD = @XINETD@
USBQUIRKS = @USBQUIRKS@
#
@@ -261,5 +264,5 @@ DBUSDIR = @DBUSDIR@
#
# End of "$Id: Makedefs.in 11154 2013-07-17 15:21:18Z msweet $"
# End of "$Id: Makedefs.in 12519 2015-02-17 13:10:19Z msweet $"
#
+19 -23
Ver Arquivo
@@ -1,16 +1,16 @@
#
# "$Id: Makefile 11370 2013-10-30 15:08:29Z msweet $"
# "$Id: Makefile 12414 2015-01-21 00:02:04Z msweet $"
#
# Top-level Makefile for CUPS.
# Top-level Makefile for CUPS.
#
# Copyright 2007-2013 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
# Copyright 2007-2014 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
#
include Makedefs
@@ -98,22 +98,18 @@ clean:
distclean: clean
$(RM) Makedefs config.h config.log config.status
$(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
$(RM) cups-config
$(RM) conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
$(RM) doc/help/ref-cupsd-conf.html doc/help/standard.html doc/index.html
$(RM) man/client.conf.man
$(RM) man/cups-deviced.man man/cups-driverd.man
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
$(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man
$(RM) packaging/cups.list
$(RM) packaging/cups-desc.plist packaging/cups-info.plist
$(RM) templates/header.tmpl
$(RM) data/testprint
$(RM) desktop/cups.desktop
$(RM) scheduler/cups.sh scheduler/cups-lpd.xinetd
$(RM) scheduler/org.cups.cups-lpd.plist scheduler/cups.xml
$(RM) doc/index.html
$(RM) man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man
$(RM) packaging/cups.list
$(RM) scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket
$(RM) templates/header.tmpl
-$(RM) doc/*/index.html
-$(RM) templates/*/header.tmpl
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
#
@@ -323,7 +319,7 @@ sloc:
EPMFLAGS = -v --output-dir dist $(EPMARCH)
aix bsd deb depot inst pkg setld slackware swinstall tardist:
bsd deb pkg slackware:
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
epm:
@@ -352,5 +348,5 @@ dist: all
#
# End of "$Id: Makefile 11370 2013-10-30 15:08:29Z msweet $".
# End of "$Id: Makefile 12414 2015-01-21 00:02:04Z msweet $".
#
+9 -20
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.7.5 - 2014-07-30
README - CUPS v2.1.2 - 2015-12-02
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt" instead...
@@ -41,10 +41,10 @@ READING THE DOCUMENTATION
GETTING SUPPORT AND OTHER RESOURCES
If you have problems, READ THE DOCUMENTATION FIRST! We also provide many
discussion forums which are available at:
If you have problems, READ THE DOCUMENTATION FIRST! We also provide two
mailing lists which are available at:
http://www.cups.org/newsgroups.php
http://www.cups.org/lists.php
See the CUPS web site at "http://www.cups.org/" for other resources.
@@ -78,10 +78,6 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
----------------------------- ------------------------------
Dymo Label Printers drv:///sample.drv/dymo.ppd
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
EPSON Stylus Color Series drv:///sample.drv/stcolor.ppd
EPSON Stylus Photo Series drv:///sample.drv/stphoto.ppd
EPSON Stylus New Color Series drv:///sample.drv/stcolor2.ppd
EPSON Stylus New Photo Series drv:///sample.drv/stphoto2.ppd
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
@@ -113,11 +109,7 @@ SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
lpadmin -p printername -E -v lpd://11.22.33.44/ -m ppd-name
The sample drivers provide basic printing capabilities, but generally do not
exercise the full potential of the printers or CUPS. The CUPS web site
provides links and drivers:
http://www.cups.org/ppd.php PPD files
http://www.cups.org/links.php Links to other drivers
exercise the full potential of the printers or CUPS.
PRINTING FILES
@@ -134,8 +126,8 @@ PRINTING FILES
lpr -o media=A4 -o resolution=600dpi filename
CUPS recognizes many types of images files as well as PDF, PostScript,
HP-GL/2, and text files, so you can print those files directly rather than
through an application.
and text files, so you can print those files directly rather than through
an application.
If you have an application that generates output specifically for your
printer then you need to use the "-oraw" or "-l" options:
@@ -143,19 +135,16 @@ PRINTING FILES
lp -o raw filename
lpr -l filename
This will prevent the filters from misinterpreting your print
file.
This will prevent the filters from misinterpreting your print file.
LEGAL STUFF
CUPS is Copyright 2007-2014 by Apple Inc. CUPS and the CUPS logo are
CUPS is Copyright 2007-2015 by Apple Inc. CUPS and the CUPS logo are
trademarks of Apple Inc.
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
This software is based in part on the work of the Independent JPEG Group.
CUPS is provided under the terms of version 2 of the GNU General Public
License and GNU Library General Public License. This program is distributed
in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+62 -55
Ver Arquivo
@@ -1,70 +1,77 @@
ipp.o: ipp.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
../cups/array-private.h
lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/http.h \
../cups/versioning.h ../cups/array.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/ipp.h backend-private.h \
../cups/cups-private.h ../cups/string-private.h \
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \
../cups/array.h ../cups/versioning.h ../cups/http.h \
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
../cups/debug-private.h ../cups/array-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
dnssd.o: dnssd.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
snmp.o: snmp.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/http.h \
../cups/versioning.h ../cups/array.h ../cups/md5-private.h \
../cups/ipp-private.h ../cups/ipp.h backend-private.h \
../cups/cups-private.h ../cups/string-private.h \
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/language.h \
../cups/array.h ../cups/versioning.h ../cups/http.h \
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
../cups/debug-private.h ../cups/array-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
backend-private.h ../cups/cups-private.h ../cups/debug-private.h \
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
testbackend.o: testbackend.c ../cups/string-private.h ../config.h \
../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/language.h \
../cups/http.h ../cups/array.h ../cups/language.h ../cups/pwg.h \
../cups/sidechannel.h
testsupplies.o: testsupplies.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h
usb.o: usb.c backend-private.h ../cups/cups-private.h \
../cups/string-private.h ../config.h ../cups/debug-private.h \
../cups/versioning.h ../cups/ipp-private.h ../cups/ipp.h \
../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h \
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
usb-darwin.c ../cups/file-private.h
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h ../cups/snmp-private.h \
../cups/backend.h ../cups/sidechannel.h usb-darwin.c \
../cups/file-private.h
+23 -9
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id: Makefile 11154 2013-07-17 15:21:18Z msweet $"
# "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $"
#
# Backend makefile for CUPS.
#
# Copyright 2007-2013 by Apple Inc.
# Copyright 2007-2014 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -23,8 +23,8 @@ include ../Makedefs
# RBACKENDS are installed mode 0700 so cupsd will run them as root...
#
# UBACKENDS are installed mode 0755 so cupsd will run them as an unprivileged
# user...
# UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as
# an unprivileged user...
#
# See http://www.cups.org/documentation.php/api-filter.html for more info...
RBACKENDS = \
@@ -33,7 +33,8 @@ RBACKENDS = \
$(DNSSD_BACKEND)
UBACKENDS = \
snmp \
socket \
socket
ULBACKENDS = \
usb
UNITTESTS = \
test1284 \
@@ -42,7 +43,8 @@ UNITTESTS = \
TARGETS = \
libbackend.a \
$(RBACKENDS) \
$(UBACKENDS)
$(UBACKENDS) \
$(ULBACKENDS)
LIBOBJS = \
ieee1284.o \
network.o \
@@ -71,7 +73,7 @@ all: $(TARGETS)
# Make library targets...
#
libs:
libs: $(ULBACKENDS)
#
@@ -167,6 +169,18 @@ install-headers:
#
install-libs:
echo Installing backends in $(SERVERBIN)/backend
$(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
for file in $(ULBACKENDS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
done
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(ULBACKENDS); do \
cp $$file $(SYMROOT); \
dsymutil $(SYMROOT)/$$file; \
done \
fi
#
@@ -179,7 +193,7 @@ uninstall:
$(RM) $(SERVERBIN)/apple/$$file; \
done
-$(RMDIR) $(SERVERBIN)/apple
for file in $(RBACKENDS) $(UBACKENDS); do \
for file in $(RBACKENDS) $(UBACKENDS) $(ULBACKENDS); do \
$(RM) $(SERVERBIN)/backend/$$file; \
done
for file in $(IPPALIASES); do \
@@ -301,5 +315,5 @@ include Dependencies
#
# End of "$Id: Makefile 11154 2013-07-17 15:21:18Z msweet $".
# End of "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $".
#
+12 -12
Ver Arquivo
@@ -1,18 +1,18 @@
/*
* "$Id: backend-private.h 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: backend-private.h 11558 2014-02-06 18:33:34Z msweet $"
*
* Backend support definitions for CUPS.
* Backend support definitions for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_BACKEND_PRIVATE_H_
@@ -313,7 +313,7 @@ extern int backendGetDeviceID(int fd, char *device_id,
int uri_size);
extern int backendGetMakeModel(const char *device_id,
char *make_model,
int make_model_size);
size_t make_model_size);
extern int backendNetworkSideCB(int print_fd, int device_fd,
int snmp_fd, http_addr_t *addr,
int use_bc);
@@ -334,5 +334,5 @@ extern int backendWaitLoop(int snmp_fd, http_addr_t *addr,
/*
* End of "$Id: backend-private.h 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: backend-private.h 11558 2014-02-06 18:33:34Z msweet $".
*/
+38 -32
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: dnssd.c 11971 2014-07-01 14:38:29Z msweet $"
* "$Id: dnssd.c 12970 2015-11-13 20:02:51Z msweet $"
*
* DNS-SD discovery backend for CUPS.
*
* Copyright 2008-2014 by Apple Inc.
* Copyright 2008-2015 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -61,7 +61,8 @@ typedef struct
*domain, /* Domain name */
*fullName, /* Full name */
*make_and_model, /* Make and model from TXT record */
*device_id; /* 1284 device ID from TXT record */
*device_id, /* 1284 device ID from TXT record */
*uuid; /* UUID from TXT record */
cups_devtype_t type; /* Device registration type */
int priority, /* Priority associated with type */
cups_shared, /* CUPS shared printer? */
@@ -122,7 +123,7 @@ static void client_callback(AvahiClient *client,
#endif /* HAVE_AVAHI */
static int compare_devices(cups_device_t *a, cups_device_t *b);
static void exec_backend(char **argv);
static void exec_backend(char **argv) __attribute__((noreturn));
static cups_device_t *get_device(cups_array_t *devices,
const char *serviceName,
const char *regtype,
@@ -317,7 +318,7 @@ main(int argc, /* I - Number of command-line args */
if ((simple_poll = avahi_simple_poll_new()) == NULL)
{
fputs("DEBUG: Unable to create Avahi simple poll object.\n", stderr);
return (1);
return (0);
}
avahi_simple_poll_set_func(simple_poll, poll_callback, NULL);
@@ -327,7 +328,7 @@ main(int argc, /* I - Number of command-line args */
if (!client)
{
fputs("DEBUG: Unable to create Avahi client.\n", stderr);
return (1);
return (0);
}
browsers = 6;
@@ -499,9 +500,15 @@ main(int argc, /* I - Number of command-line args */
{
unquote(uriName, best->fullName, sizeof(uriName));
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
"dnssd", NULL, uriName, 0,
best->cups_shared ? "/cups" : "/");
if (best->uuid)
httpAssembleURIf(HTTP_URI_CODING_ALL, device_uri,
sizeof(device_uri), "dnssd", NULL, uriName, 0,
best->cups_shared ? "/cups?uuid=%s" : "/?uuid=%s",
best->uuid);
else
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri,
sizeof(device_uri), "dnssd", NULL, uriName, 0,
best->cups_shared ? "/cups" : "/");
cupsBackendReport("network", device_uri, best->make_and_model,
best->name, best->device_id, NULL);
@@ -532,9 +539,15 @@ main(int argc, /* I - Number of command-line args */
{
unquote(uriName, best->fullName, sizeof(uriName));
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
"dnssd", NULL, uriName, 0,
best->cups_shared ? "/cups" : "/");
if (best->uuid)
httpAssembleURIf(HTTP_URI_CODING_ALL, device_uri,
sizeof(device_uri), "dnssd", NULL, uriName, 0,
best->cups_shared ? "/cups?uuid=%s" : "/?uuid=%s",
best->uuid);
else
httpAssembleURI(HTTP_URI_CODING_ALL, device_uri,
sizeof(device_uri), "dnssd", NULL, uriName, 0,
best->cups_shared ? "/cups" : "/");
cupsBackendReport("network", device_uri, best->make_and_model,
best->name, best->device_id, NULL);
@@ -817,8 +830,8 @@ exec_backend(char **argv) /* I - Command-line arguments */
* 'device_type()' - Get DNS-SD type enumeration from string.
*/
static int
device_type(const char *regtype)
static cups_devtype_t /* O - Device type */
device_type(const char *regtype) /* I - Service registration type */
{
#ifdef HAVE_AVAHI
if (!strcmp(regtype, "_ipp._tcp"))
@@ -908,12 +921,6 @@ get_device(cups_array_t *devices, /* I - Device array */
* Yes, add the device...
*/
#ifdef HAVE_DNSSD
fprintf(stderr, "DEBUG: Found \"%s.%s%s\"...\n", serviceName, regtype, replyDomain);
#else /* HAVE_AVAHI */
fprintf(stderr, "DEBUG: Found \"%s.%s.%s\"...\n", serviceName, regtype, replyDomain);
#endif /* HAVE_DNSSD */
device = calloc(sizeof(cups_device_t), 1);
device->name = strdup(serviceName);
device->domain = strdup(replyDomain);
@@ -929,8 +936,7 @@ get_device(cups_array_t *devices, /* I - Device array */
#ifdef HAVE_DNSSD
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
#else /* HAVE_AVAHI */
avahi_service_name_join(fullName, kDNSServiceMaxDomainName,
serviceName, regtype, replyDomain);
avahi_service_name_join(fullName, kDNSServiceMaxDomainName, serviceName, regtype, replyDomain);
#endif /* HAVE_DNSSD */
device->fullName = strdup(fullName);
@@ -1098,7 +1104,7 @@ query_callback(
datanext = data + datalen;
for (ptr = key; data < datanext && *data != '='; data ++)
*ptr++ = *data;
*ptr++ = (char)*data;
*ptr = '\0';
if (data < datanext && *data == '=')
@@ -1106,7 +1112,7 @@ query_callback(
data ++;
if (data < datanext)
memcpy(value, data, datanext - data);
memcpy(value, data, (size_t)(datanext - data));
value[datanext - data] = '\0';
fprintf(stderr, "DEBUG2: query_callback: \"%s=%s\".\n",
@@ -1126,8 +1132,7 @@ query_callback(
*/
ptr = device_id + strlen(device_id);
snprintf(ptr, sizeof(device_id) - (ptr - device_id), "%s:%s;",
key + 4, value);
snprintf(ptr, sizeof(device_id) - (size_t)(ptr - device_id), "%s:%s;", key + 4, value);
}
if (!_cups_strcasecmp(key, "usb_MFG") || !_cups_strcasecmp(key, "usb_MANU") ||
@@ -1176,6 +1181,8 @@ query_callback(
if (device->type == CUPS_DEVICE_PRINTER)
device->sent = 1;
}
else if (!_cups_strcasecmp(key, "UUID"))
device->uuid = strdup(value);
}
if (device->device_id)
@@ -1196,7 +1203,7 @@ query_callback(
* Assume the first word is the make...
*/
memcpy(make_and_model, model, ptr - model);
memcpy(make_and_model, model, (size_t)(ptr - model));
make_and_model[ptr - model] = '\0';
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s",
@@ -1231,7 +1238,7 @@ query_callback(
while (isalnum(*ptr & 255) || *ptr == '-' || *ptr == '.')
{
if (isalnum(*ptr & 255) && valptr < (value + sizeof(value) - 1))
*valptr++ = toupper(*ptr++ & 255);
*valptr++ = (char)toupper(*ptr++ & 255);
else
break;
}
@@ -1240,8 +1247,7 @@ query_callback(
}
ptr = device_id + strlen(device_id);
snprintf(ptr, sizeof(device_id) - (ptr - device_id), "CMD:%s;",
value + 1);
snprintf(ptr, sizeof(device_id) - (size_t)(ptr - device_id), "CMD:%s;", value + 1);
}
if (device_id[0])
@@ -1275,7 +1281,7 @@ sigterm_handler(int sig) /* I - Signal number (unused) */
(void)sig;
if (job_canceled)
exit(CUPS_BACKEND_OK);
_exit(CUPS_BACKEND_OK);
else
job_canceled = 1;
}
@@ -1316,5 +1322,5 @@ unquote(char *dst, /* I - Destination buffer */
/*
* End of "$Id: dnssd.c 11971 2014-07-01 14:38:29Z msweet $".
* End of "$Id: dnssd.c 12970 2015-11-13 20:02:51Z msweet $".
*/
+18 -30
Ver Arquivo
@@ -1,24 +1,18 @@
/*
* "$Id: ieee1284.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: ieee1284.c 11594 2014-02-14 20:09:01Z msweet $"
*
* IEEE-1284 support functions for CUPS.
* IEEE-1284 support functions for CUPS.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* backendGetDeviceID() - Get the IEEE-1284 device ID string and
* corresponding URI.
* backendGetMakeModel() - Get the make and model string from the device ID.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -26,7 +20,6 @@
*/
#include "backend-private.h"
#include <cups/cups-private.h>
/*
@@ -148,8 +141,7 @@ backendGetDeviceID(
* Read the 1284 device ID...
*/
if ((length = read(devparportfd, device_id,
device_id_size - 1)) >= 2)
if ((length = read(devparportfd, device_id, (size_t)device_id_size - 1)) >= 2)
{
device_id[length] = '\0';
got_id = 1;
@@ -178,8 +170,7 @@ backendGetDeviceID(
* bytes. The 1284 spec says the length is stored MSB first...
*/
length = (((unsigned)device_id[0] & 255) << 8) +
((unsigned)device_id[1] & 255);
length = (int)((((unsigned)device_id[0] & 255) << 8) + ((unsigned)device_id[1] & 255));
/*
* Check to see if the length is larger than our buffer; first
@@ -188,8 +179,7 @@ backendGetDeviceID(
*/
if (length > device_id_size || length < 14)
length = (((unsigned)device_id[1] & 255) << 8) +
((unsigned)device_id[0] & 255);
length = (int)((((unsigned)device_id[1] & 255) << 8) + ((unsigned)device_id[0] & 255));
if (length > device_id_size)
length = device_id_size;
@@ -221,7 +211,7 @@ backendGetDeviceID(
length -= 2;
memmove(device_id, device_id + 2, length);
memmove(device_id, device_id + 2, (size_t)length);
device_id[length] = '\0';
}
}
@@ -287,7 +277,7 @@ backendGetDeviceID(
*/
if (make_model)
backendGetMakeModel(device_id, make_model, make_model_size);
backendGetMakeModel(device_id, make_model, (size_t)make_model_size);
/*
* Then generate a device URI...
@@ -372,7 +362,7 @@ int /* O - 0 on success, -1 on failure */
backendGetMakeModel(
const char *device_id, /* O - 1284 device ID */
char *make_model, /* O - Make/model */
int make_model_size) /* I - Size of buffer */
size_t make_model_size) /* I - Size of buffer */
{
int num_values; /* Number of keys and values */
cups_option_t *values; /* Keys and values */
@@ -381,9 +371,7 @@ backendGetMakeModel(
*des; /* Description string */
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", "
"make_model=%p, make_model_size=%d)\n", device_id,
make_model, make_model_size));
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", make_model=%p, make_model_size=" CUPS_LLFMT ")\n", device_id, make_model, CUPS_LLCAST make_model_size));
/*
* Range check input...
@@ -487,5 +475,5 @@ backendGetMakeModel(
/*
* End of "$Id: ieee1284.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: ieee1284.c 11594 2014-02-14 20:09:01Z msweet $".
*/
+183 -390
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: ipp.c 11909 2014-06-09 18:58:16Z msweet $"
* "$Id: ipp.c 12896 2015-10-09 13:15:22Z msweet $"
*
* IPP backend for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -64,6 +64,7 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
version, /* IPP version */
job_id, /* Job ID for submitted job */
job_reasons, /* Job state reasons bits */
create_job, /* Support Create-Job? */
get_job_attrs; /* Support Get-Job-Attributes? */
const char *job_name; /* Job name for submitted job */
http_encryption_t encryption; /* Use encryption? */
@@ -79,7 +80,7 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
static const char *auth_info_required;
/* New auth-info-required value */
#if defined(HAVE_GSSAPI) && defined(HAVE_XPC)
static int child_pid = 0; /* Child process ID */
static pid_t child_pid = 0; /* Child process ID */
#endif /* HAVE_GSSAPI && HAVE_XPC */
static const char * const jattrs[] = /* Job attributes we want */
{
@@ -121,6 +122,7 @@ static const char * const pattrs[] = /* Printer attributes we want */
"printer-alert",
"printer-alert-description",
"printer-is-accepting-jobs",
"printer-mandatory-job-attributes",
"printer-state",
"printer-state-message",
"printer-state-reasons"
@@ -144,6 +146,8 @@ static cups_option_t *attr_cache = NULL;
static cups_array_t *state_reasons; /* Array of printe-state-reasons keywords */
static char tmpfilename[1024] = "";
/* Temporary spool file name */
static char mandatory_attrs[1024] = "";
/* cupsMandatory value */
/*
@@ -682,6 +686,44 @@ main(int argc, /* I - Number of command-line args */
0, NULL);
httpSetTimeout(http, 30.0, timeout_cb, NULL);
if (httpIsEncrypted(http))
{
/*
* Validate TLS credentials...
*/
cups_array_t *creds; /* TLS credentials */
cups_array_t *lcreds = NULL; /* Loaded credentials */
http_trust_t trust; /* Trust level */
static const char *trusts[] = { NULL, "+cups-pki-invalid", "+cups-pki-changed", "+cups-pki-expired", NULL, "+cups-pki-unknown" };
/* Trust keywords */
if (!httpCopyCredentials(http, &creds))
{
trust = httpCredentialsGetTrust(creds, hostname);
update_reasons(NULL, "-cups-pki-invalid,cups-pki-changed,cups-pki-expired,cups-pki-unknown");
if (trusts[trust])
{
update_reasons(NULL, trusts[trust]);
return (CUPS_BACKEND_STOP);
}
if (httpLoadCredentials(NULL, &lcreds, hostname))
{
/*
* Could not load the credentials, let's save the ones we have so we
* can detect changes...
*/
httpSaveCredentials(NULL, creds, hostname);
}
httpFreeCredentials(lcreds);
httpFreeCredentials(creds);
}
}
/*
* See if the printer supports SNMP...
*/
@@ -788,7 +830,7 @@ main(int argc, /* I - Number of command-line args */
break;
}
sleep(delay);
sleep((unsigned)delay);
delay = _cupsNextDelay(delay, &prev_delay);
}
@@ -834,15 +876,16 @@ main(int argc, /* I - Number of command-line args */
*/
#ifdef HAVE_LIBZ
compression_sup = NULL;
compression_sup = NULL;
#endif /* HAVE_LIBZ */
copies_sup = NULL;
cups_version = NULL;
format_sup = NULL;
media_col_sup = NULL;
supported = NULL;
operations_sup = NULL;
doc_handling_sup = NULL;
copies_sup = NULL;
cups_version = NULL;
format_sup = NULL;
media_col_sup = NULL;
supported = NULL;
operations_sup = NULL;
doc_handling_sup = NULL;
print_color_mode_sup = NULL;
do
{
@@ -857,9 +900,7 @@ main(int argc, /* I - Number of command-line args */
*/
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
request->request.op.version[0] = version / 10;
request->request.op.version[1] = version % 10;
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
@@ -908,7 +949,7 @@ main(int argc, /* I - Number of command-line args */
report_printer_state(supported);
sleep(delay);
sleep((unsigned)delay);
delay = _cupsNextDelay(delay, &prev_delay);
}
@@ -1022,7 +1063,7 @@ main(int argc, /* I - Number of command-line args */
report_printer_state(supported);
sleep(delay);
sleep((unsigned)delay);
delay = _cupsNextDelay(delay, &prev_delay);
@@ -1257,11 +1298,16 @@ main(int argc, /* I - Number of command-line args */
* Load the PPD file and generate PWG attribute mapping information...
*/
ppd_attr_t *mandatory; /* cupsMandatory value */
ppd = ppdOpenFile(getenv("PPD"));
pc = _ppdCacheCreateWithPPD(ppd);
ppdMarkDefaults(ppd);
cupsMarkOptions(ppd, num_options, options);
if ((mandatory = ppdFindAttr(ppd, "cupsMandatory", NULL)) != NULL)
strlcpy(mandatory_attrs, mandatory->value, sizeof(mandatory_attrs));
}
}
else
@@ -1311,7 +1357,7 @@ main(int argc, /* I - Number of command-line args */
_cupsLangPrintFilter(stderr, "INFO", _("Copying print data."));
if ((compatsize = write(fd, buffer, bytes)) < 0)
if ((compatsize = write(fd, buffer, (size_t)bytes)) < 0)
{
perror("DEBUG: Unable to write temporary file");
return (CUPS_BACKEND_FAILED);
@@ -1359,6 +1405,7 @@ main(int argc, /* I - Number of command-line args */
monitor.port = port;
monitor.version = version;
monitor.job_id = 0;
monitor.create_job = create_job;
monitor.get_job_attrs = get_job_attrs;
monitor.encryption = cupsEncryption();
monitor.job_state = IPP_JOB_PENDING;
@@ -1420,6 +1467,7 @@ main(int argc, /* I - Number of command-line args */
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
goto cleanup;
else if (ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED ||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED)
{
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
@@ -1510,7 +1558,7 @@ main(int argc, /* I - Number of command-line args */
else
{
fd = 0;
http_status = cupsWriteRequestData(http, buffer, bytes);
http_status = cupsWriteRequestData(http, buffer, (size_t)bytes);
}
while (http_status == HTTP_CONTINUE &&
@@ -1523,6 +1571,7 @@ main(int argc, /* I - Number of command-line args */
FD_ZERO(&input);
FD_SET(fd, &input);
FD_SET(snmp_fd, &input);
FD_SET(CUPS_SC_FD, &input);
while (select(fd > snmp_fd ? fd + 1 : snmp_fd + 1, &input, NULL, NULL,
NULL) <= 0 && !job_canceled);
@@ -1536,7 +1585,7 @@ main(int argc, /* I - Number of command-line args */
{
fprintf(stderr, "DEBUG: Read %d bytes...\n", (int)bytes);
if ((http_status = cupsWriteRequestData(http, buffer, bytes))
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
!= HTTP_CONTINUE)
break;
}
@@ -1672,8 +1721,7 @@ main(int argc, /* I - Number of command-line args */
*/
request = ippNewRequest(IPP_SEND_DOCUMENT);
request->request.op.version[0] = version / 10;
request->request.op.version[1] = version % 10;
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
@@ -1706,7 +1754,7 @@ main(int argc, /* I - Number of command-line args */
if (num_files == 0)
{
fd = 0;
http_status = cupsWriteRequestData(http, buffer, bytes);
http_status = cupsWriteRequestData(http, buffer, (size_t)bytes);
}
else
{
@@ -1725,7 +1773,7 @@ main(int argc, /* I - Number of command-line args */
while (!job_canceled && http_status == HTTP_CONTINUE &&
(bytes = read(fd, buffer, sizeof(buffer))) > 0)
{
if ((http_status = cupsWriteRequestData(http, buffer, bytes))
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
!= HTTP_CONTINUE)
break;
else
@@ -1752,7 +1800,7 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
ippErrorString(cupsLastError()), cupsLastErrorString());
if (cupsLastError() > IPP_OK_CONFLICT)
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
{
ipp_status = cupsLastError();
@@ -1770,11 +1818,28 @@ main(int argc, /* I - Number of command-line args */
}
}
if (job_canceled)
break;
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
{
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
copies_remaining --;
}
else if ((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"))
{
/*
* Need to reprocess the job as raster...
*/
fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
if (job_id > 0)
cancel_job(http, uri, job_id, resource, argv[2], version);
goto cleanup;
}
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_NOT_POSSIBLE ||
ipp_status == IPP_PRINTER_BUSY)
@@ -1858,6 +1923,8 @@ main(int argc, /* I - Number of command-line args */
if (!job_id || !waitjob || !get_job_attrs)
continue;
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;)
@@ -1882,8 +1949,7 @@ main(int argc, /* I - Number of command-line args */
*/
request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
request->request.op.version[0] = version / 10;
request->request.op.version[1] = version % 10;
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
@@ -1964,12 +2030,8 @@ main(int argc, /* I - Number of command-line args */
remote_job_states[job_state->values[0].integer -
IPP_JOB_PENDING]);
if ((job_sheets = ippFindAttribute(response,
"job-media-sheets-completed",
IPP_TAG_INTEGER)) == NULL)
job_sheets = ippFindAttribute(response,
"job-impressions-completed",
IPP_TAG_INTEGER);
if ((job_sheets = ippFindAttribute(response, "job-impressions-completed", IPP_TAG_INTEGER)) == NULL)
job_sheets = ippFindAttribute(response, "job-media-sheets-completed", IPP_TAG_INTEGER);
if (job_sheets)
fprintf(stderr, "PAGE: total %d\n",
@@ -2008,7 +2070,7 @@ main(int argc, /* I - Number of command-line args */
* Wait before polling again...
*/
sleep(delay);
sleep((unsigned)delay);
delay = _cupsNextDelay(delay, &prev_delay);
}
@@ -2019,8 +2081,13 @@ main(int argc, /* I - Number of command-line args */
*/
if (job_canceled > 0 && job_id > 0)
{
cancel_job(http, uri, job_id, resource, argv[2], version);
if (cupsLastError() > IPP_OK_CONFLICT)
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
}
/*
* Check the printer state and report it if necessary...
*/
@@ -2142,8 +2209,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
_cupsLangPrintFilter(stderr, "INFO", _("Canceling print job."));
request = ippNewRequest(IPP_CANCEL_JOB);
request->request.op.version[0] = version / 10;
request->request.op.version[1] = version % 10;
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
@@ -2158,9 +2224,6 @@ cancel_job(http_t *http, /* I - HTTP connection */
*/
ippDelete(cupsDoRequest(http, request, resource));
if (cupsLastError() > IPP_OK_CONFLICT)
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
}
@@ -2188,8 +2251,7 @@ check_printer_state(
*/
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
request->request.op.version[0] = version / 10;
request->request.op.version[1] = version % 10;
ippSetVersion(request, version / 10, version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
@@ -2285,6 +2347,15 @@ monitor_printer(
if (cupsLastError() <= IPP_OK_CONFLICT)
password_tries = 0;
if (monitor->job_id == 0 && monitor->create_job)
{
/*
* No job-id yet, so continue...
*/
goto monitor_disconnect;
}
/*
* Check the status of the job itself...
*/
@@ -2292,8 +2363,7 @@ monitor_printer(
job_op = (monitor->job_id > 0 && monitor->get_job_attrs) ?
IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS;
request = ippNewRequest(job_op);
request->request.op.version[0] = monitor->version / 10;
request->request.op.version[1] = monitor->version % 10;
ippSetVersion(request, monitor->version / 10, monitor->version % 10);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, monitor->uri);
@@ -2355,7 +2425,7 @@ monitor_printer(
job_name = attr->values[0].string.text;
else if (!strcmp(attr->name, "job-state") &&
attr->value_tag == IPP_TAG_ENUM)
job_state = attr->values[0].integer;
job_state = (ipp_jstate_t)attr->values[0].integer;
else if (!strcmp(attr->name, "job-originating-user-name") &&
(attr->value_tag == IPP_TAG_NAME ||
attr->value_tag == IPP_TAG_NAMELANG))
@@ -2377,6 +2447,17 @@ monitor_printer(
}
}
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
ippEnumString("job-state", monitor->job_state));
if (!job_canceled &&
(monitor->job_state == IPP_JOB_CANCELED ||
monitor->job_state == IPP_JOB_ABORTED))
{
job_canceled = -1;
fprintf(stderr, "DEBUG: (monitor) job_canceled = -1\n");
}
if ((attr = ippFindAttribute(response, "job-state-reasons",
IPP_TAG_KEYWORD)) != NULL)
{
@@ -2398,6 +2479,9 @@ monitor_printer(
new_reasons |= _CUPS_JSR_JOB_PASSWORD_WAIT;
else if (!strcmp(attr->values[i].string.text, "job-release-wait"))
new_reasons |= _CUPS_JSR_JOB_RELEASE_WAIT;
if (!job_canceled &&
(!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
job_canceled = 1;
}
if (new_reasons != monitor->job_reasons)
@@ -2423,7 +2507,7 @@ monitor_printer(
ippDelete(response);
fprintf(stderr, "DEBUG: (monitor) job-state=%s\n",
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
ippEnumString("job-state", monitor->job_state));
if (!job_canceled &&
@@ -2435,6 +2519,8 @@ monitor_printer(
* Disconnect from the printer - we'll reconnect on the next poll...
*/
monitor_disconnect:
_httpDisconnect(http);
}
@@ -2442,7 +2528,7 @@ monitor_printer(
* Sleep for N seconds...
*/
sleep(delay);
sleep((unsigned)delay);
delay = _cupsNextDelay(delay, &prev_delay);
}
@@ -2452,10 +2538,20 @@ monitor_printer(
*/
if (job_canceled > 0 && monitor->job_id > 0)
{
if (!httpReconnect(http))
{
cancel_job(http, monitor->uri, monitor->job_id, monitor->resource,
monitor->user, monitor->version);
if (cupsLastError() > IPP_OK_CONFLICT)
{
fprintf(stderr, "DEBUG: (monitor) cancel_job() = %s\n", cupsLastErrorString());
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
}
}
}
/*
* Cleanup and return...
*/
@@ -2489,19 +2585,10 @@ new_request(
ipp_attribute_t *print_color_mode_sup)
/* I - Printer supports print-color-mode */
{
int i; /* Looping var */
ipp_t *request; /* Request data */
const char *keyword; /* PWG keyword */
_pwg_size_t *size; /* PWG media size */
ipp_t *media_col, /* media-col value */
*media_size; /* media-size value */
const char *media_source, /* media-source value */
*media_type, /* media-type value */
*collate_str, /* multiple-document-handling value */
*mandatory; /* Mandatory attributes */
ipp_tag_t group; /* Current group */
ipp_attribute_t *attr; /* Current attribute */
const char *color_attr_name; /* Supported color attribute */
char buffer[1024]; /* Value buffer */
@@ -2509,9 +2596,8 @@ new_request(
* Create the IPP request...
*/
request = ippNewRequest(op);
request->request.op.version[0] = version / 10;
request->request.op.version[1] = version % 10;
request = ippNewRequest(op);
ippSetVersion(request, version / 10, version % 10);
fprintf(stderr, "DEBUG: %s IPP/%d.%d\n",
ippOpString(request->request.op.operation_id),
@@ -2522,36 +2608,31 @@ new_request(
* Add standard attributes...
*/
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
fprintf(stderr, "DEBUG: printer-uri=\"%s\"\n", uri);
if (user && *user)
{
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, user);
fprintf(stderr, "DEBUG: requesting-user-name=\"%s\"\n", user);
}
if (title && *title)
{
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
title);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL, title);
fprintf(stderr, "DEBUG: job-name=\"%s\"\n", title);
}
if (format && op != IPP_CREATE_JOB)
{
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
"document-format", NULL, format);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, format);
fprintf(stderr, "DEBUG: document-format=\"%s\"\n", format);
}
#ifdef HAVE_LIBZ
if (compression && op != IPP_OP_CREATE_JOB && op != IPP_OP_VALIDATE_JOB)
{
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"compression", NULL, compression);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "compression", NULL, compression);
fprintf(stderr, "DEBUG: compression=\"%s\"\n", compression);
}
#endif /* HAVE_LIBZ */
@@ -2564,315 +2645,13 @@ new_request(
{
if (pc)
{
int num_finishings = 0, /* Number of finishing values */
finishings[10]; /* Finishing enum values */
ppd_choice_t *choice; /* Marked choice */
/*
* Send standard IPP attributes...
*/
fputs("DEBUG: Adding standard IPP operation/job attributes.\n", stderr);
if (pc->password &&
(keyword = cupsGetOption("job-password", num_options,
options)) != NULL)
{
ippAddOctetString(request, IPP_TAG_OPERATION, "job-password",
keyword, strlen(keyword));
if ((keyword = cupsGetOption("job-password-encryption", num_options,
options)) == NULL)
keyword = "none";
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"job-password-encryption", NULL, keyword);
}
if (pc->account_id)
{
if ((keyword = cupsGetOption("job-account-id", num_options,
options)) == NULL)
keyword = cupsGetOption("job-billing", num_options, options);
if (keyword)
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id",
NULL, keyword);
}
if (pc->accounting_user_id)
{
if ((keyword = cupsGetOption("job-accounting-user-id", num_options,
options)) == NULL)
keyword = user;
if (keyword)
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
"job-accounting-user-id", NULL, keyword);
}
for (mandatory = (char *)cupsArrayFirst(pc->mandatory);
mandatory;
mandatory = (char *)cupsArrayNext(pc->mandatory))
{
if (strcmp(mandatory, "copies") &&
strcmp(mandatory, "destination-uris") &&
strcmp(mandatory, "finishings") &&
strcmp(mandatory, "job-account-id") &&
strcmp(mandatory, "job-accounting-user-id") &&
strcmp(mandatory, "job-password") &&
strcmp(mandatory, "job-password-encryption") &&
strcmp(mandatory, "media") &&
strncmp(mandatory, "media-col", 9) &&
strcmp(mandatory, "multiple-document-handling") &&
strcmp(mandatory, "output-bin") &&
strcmp(mandatory, "print-color-mode") &&
strcmp(mandatory, "print-quality") &&
strcmp(mandatory, "sides") &&
(keyword = cupsGetOption(mandatory, num_options, options)) != NULL)
{
_ipp_option_t *opt = _ippFindOption(mandatory);
/* Option type */
ipp_tag_t value_tag = opt ? opt->value_tag : IPP_TAG_NAME;
/* Value type */
switch (value_tag)
{
case IPP_TAG_INTEGER :
case IPP_TAG_ENUM :
ippAddInteger(request, IPP_TAG_JOB, value_tag, mandatory,
atoi(keyword));
break;
case IPP_TAG_BOOLEAN :
ippAddBoolean(request, IPP_TAG_JOB, mandatory,
!_cups_strcasecmp(keyword, "true"));
break;
case IPP_TAG_RANGE :
{
int lower, upper; /* Range */
if (sscanf(keyword, "%d-%d", &lower, &upper) != 2)
lower = upper = atoi(keyword);
ippAddRange(request, IPP_TAG_JOB, mandatory, lower, upper);
}
break;
case IPP_TAG_STRING :
ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword,
strlen(keyword));
break;
default :
if (!strcmp(mandatory, "print-color-mode") && !strcmp(keyword, "monochrome"))
{
if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
keyword = "auto-monochrome";
else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
keyword = "process-monochrome";
}
ippAddString(request, IPP_TAG_JOB, value_tag, mandatory,
NULL, keyword);
break;
}
}
}
if ((keyword = cupsGetOption("PageSize", num_options, options)) == NULL)
keyword = cupsGetOption("media", num_options, options);
if ((size = _ppdCacheGetSize(pc, keyword)) != NULL)
{
/*
* Add a media-col value...
*/
media_size = ippNew();
ippAddInteger(media_size, IPP_TAG_ZERO, IPP_TAG_INTEGER,
"x-dimension", size->width);
ippAddInteger(media_size, IPP_TAG_ZERO, IPP_TAG_INTEGER,
"y-dimension", size->length);
media_col = ippNew();
ippAddCollection(media_col, IPP_TAG_ZERO, "media-size", media_size);
media_source = _ppdCacheGetSource(pc, cupsGetOption("InputSlot",
num_options,
options));
media_type = _ppdCacheGetType(pc, cupsGetOption("MediaType",
num_options,
options));
for (i = 0; i < media_col_sup->num_values; i ++)
{
if (!strcmp(media_col_sup->values[i].string.text,
"media-left-margin"))
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
"media-left-margin", size->left);
else if (!strcmp(media_col_sup->values[i].string.text,
"media-bottom-margin"))
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
"media-bottom-margin", size->bottom);
else if (!strcmp(media_col_sup->values[i].string.text,
"media-right-margin"))
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
"media-right-margin", size->right);
else if (!strcmp(media_col_sup->values[i].string.text,
"media-top-margin"))
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
"media-top-margin", size->top);
else if (!strcmp(media_col_sup->values[i].string.text,
"media-source") && media_source)
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
"media-source", NULL, media_source);
else if (!strcmp(media_col_sup->values[i].string.text,
"media-type") && media_type)
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
"media-type", NULL, media_type);
}
ippAddCollection(request, IPP_TAG_JOB, "media-col", media_col);
}
if ((keyword = cupsGetOption("output-bin", num_options,
options)) == NULL)
{
if ((choice = ppdFindMarkedChoice(ppd, "OutputBin")) != NULL)
keyword = _ppdCacheGetBin(pc, choice->choice);
}
if (keyword)
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin",
NULL, keyword);
color_attr_name = print_color_mode_sup ? "print-color-mode" : "output-mode";
if ((keyword = cupsGetOption("print-color-mode", num_options,
options)) == NULL)
{
if ((choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL)
{
if (!_cups_strcasecmp(choice->choice, "Gray"))
keyword = "monochrome";
else
keyword = "color";
}
}
if (keyword && !strcmp(keyword, "monochrome"))
{
if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
keyword = "auto-monochrome";
else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
keyword = "process-monochrome";
}
if (keyword)
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, color_attr_name,
NULL, keyword);
if ((keyword = cupsGetOption("print-quality", num_options,
options)) != NULL)
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
atoi(keyword));
else if ((choice = ppdFindMarkedChoice(ppd, "cupsPrintQuality")) != NULL)
{
if (!_cups_strcasecmp(choice->choice, "draft"))
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
IPP_QUALITY_DRAFT);
else if (!_cups_strcasecmp(choice->choice, "normal"))
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
IPP_QUALITY_NORMAL);
else if (!_cups_strcasecmp(choice->choice, "high"))
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality",
IPP_QUALITY_HIGH);
}
if ((keyword = cupsGetOption("sides", num_options, options)) != NULL)
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
NULL, keyword);
else if (pc->sides_option &&
(choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL)
{
if (!_cups_strcasecmp(choice->choice, pc->sides_1sided))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
NULL, "one-sided");
else if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_long))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
NULL, "two-sided-long-edge");
if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_short))
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides",
NULL, "two-sided-short-edge");
}
if ((keyword = cupsGetOption("multiple-document-handling",
num_options, options)) != NULL)
{
if (strstr(keyword, "uncollated"))
keyword = "false";
else
keyword = "true";
}
else if ((keyword = cupsGetOption("collate", num_options,
options)) == NULL)
keyword = "true";
if (format)
{
if (!_cups_strcasecmp(format, "image/gif") ||
!_cups_strcasecmp(format, "image/jp2") ||
!_cups_strcasecmp(format, "image/jpeg") ||
!_cups_strcasecmp(format, "image/png") ||
!_cups_strcasecmp(format, "image/tiff") ||
!_cups_strncasecmp(format, "image/x-", 8))
{
/*
* Collation makes no sense for single page image formats...
*/
keyword = "false";
}
else if (!_cups_strncasecmp(format, "image/", 6) ||
!_cups_strcasecmp(format, "application/vnd.cups-raster"))
{
/*
* Multi-page image formats will have copies applied by the upstream
* filters...
*/
copies = 1;
}
}
if (doc_handling_sup)
{
if (!_cups_strcasecmp(keyword, "true"))
collate_str = "separate-documents-collated-copies";
else
collate_str = "separate-documents-uncollated-copies";
for (i = 0; i < doc_handling_sup->num_values; i ++)
if (!strcmp(doc_handling_sup->values[i].string.text, collate_str))
{
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD,
"multiple-document-handling", NULL, collate_str);
break;
}
if (i >= doc_handling_sup->num_values)
copies = 1;
}
/*
* Map finishing options...
*/
num_finishings = _ppdCacheGetFinishingValues(pc, num_options, options,
(int)(sizeof(finishings) /
sizeof(finishings[0])),
finishings);
if (num_finishings > 0)
ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings",
num_finishings, finishings);
copies = _cupsConvertOptions(request, ppd, pc, media_col_sup, doc_handling_sup, print_color_mode_sup, user, format, copies, num_options, options);
/*
* Map FaxOut options...
@@ -3105,16 +2884,14 @@ report_attr(ipp_attribute_t *attr) /* I - Attribute */
{
case IPP_TAG_INTEGER :
case IPP_TAG_ENUM :
snprintf(valptr, sizeof(value) - (valptr - value), "%d",
attr->values[i].integer);
snprintf(valptr, sizeof(value) - (size_t)(valptr - value), "%d", attr->values[i].integer);
valptr += strlen(valptr);
break;
case IPP_TAG_TEXT :
case IPP_TAG_NAME :
case IPP_TAG_KEYWORD :
quote_string(attr->values[i].string.text, valptr,
value + sizeof(value) - valptr);
quote_string(attr->values[i].string.text, valptr, (size_t)(value + sizeof(value) - valptr));
valptr += strlen(valptr);
break;
@@ -3156,6 +2933,7 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
{
ipp_attribute_t *pa, /* printer-alert */
*pam, /* printer-alert-message */
*pmja, /* printer-mandatory-job-attributes */
*psm, /* printer-state-message */
*reasons, /* printer-state-reasons */
*marker; /* marker-* attributes */
@@ -3176,6 +2954,26 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
IPP_TAG_TEXT)) != NULL)
report_attr(pam);
if ((pmja = ippFindAttribute(ipp, "printer-mandatory-job-attributes", IPP_TAG_KEYWORD)) != NULL)
{
int i, /* Looping var */
count = ippGetCount(pmja); /* Number of values */
for (i = 0, valptr = value; i < count; i ++, valptr += strlen(valptr))
{
if (i)
snprintf(valptr, sizeof(value) - (size_t)(valptr - value), " %s", ippGetString(pmja, i, NULL));
else
strlcpy(value, ippGetString(pmja, i, NULL), sizeof(value));
}
if (strcmp(value, mandatory_attrs))
{
strlcpy(mandatory_attrs, value, sizeof(mandatory_attrs));
fprintf(stderr, "PPD: cupsMandatory=\"%s\"\n", value);
}
}
if ((psm = ippFindAttribute(ipp, "printer-state-message",
IPP_TAG_TEXT)) != NULL)
{
@@ -3365,12 +3163,12 @@ run_as_user(char *argv[], /* I - Command-line arguments */
if (response)
{
child_pid = xpc_dictionary_get_int64(response, "child-pid");
child_pid = (pid_t)xpc_dictionary_get_int64(response, "child-pid");
xpc_release(response);
if (child_pid)
fprintf(stderr, "DEBUG: Child PID=%d.\n", child_pid);
fprintf(stderr, "DEBUG: Child PID=%d.\n", (int)child_pid);
else
{
_cupsLangPrintFilter(stderr, "ERROR",
@@ -3416,7 +3214,7 @@ run_as_user(char *argv[], /* I - Command-line arguments */
if (response)
{
status = xpc_dictionary_get_int64(response, "status");
status = (int)xpc_dictionary_get_int64(response, "status");
if (status == SIGTERM || status == SIGKILL || status == SIGPIPE)
{
@@ -3478,7 +3276,7 @@ sigterm_handler(int sig) /* I - Signal */
* Flag that the job should be canceled...
*/
write(2, "DEBUG: job_canceled = 1.\n", 25);
write(2, "DEBUG: sigterm_handler: job_canceled = 1.\n", 25);
job_canceled = 1;
return;
@@ -3615,8 +3413,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
temp = (char *)cupsArrayNext(state_reasons))
if (!strncmp(temp, "cups-remote-", 12))
{
snprintf(remptr, sizeof(rem) - (remptr - rem), "%s%s", remprefix,
temp);
snprintf(remptr, sizeof(rem) - (size_t)(remptr - rem), "%s%s", remprefix, temp);
remptr += strlen(remptr);
remprefix = ",";
@@ -3629,8 +3426,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
cupsArrayAdd(state_reasons, reason);
snprintf(addptr, sizeof(add) - (addptr - add), "%s%s", addprefix,
reason);
snprintf(addptr, sizeof(add) - (size_t)(addptr - add), "%s%s", addprefix, reason);
addptr += strlen(addptr);
addprefix = ",";
}
@@ -3648,8 +3444,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
{
if (cupsArrayFind(state_reasons, reason))
{
snprintf(remptr, sizeof(rem) - (remptr - rem), "%s%s", remprefix,
reason);
snprintf(remptr, sizeof(rem) - (size_t)(remptr - rem), "%s%s", remprefix, reason);
remptr += strlen(remptr);
remprefix = ",";
@@ -3669,8 +3464,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
{
if (strncmp(reason, "cups-", 5) && !cupsArrayFind(new_reasons, reason))
{
snprintf(remptr, sizeof(rem) - (remptr - rem), "%s%s", remprefix,
reason);
snprintf(remptr, sizeof(rem) - (size_t)(remptr - rem), "%s%s", remprefix, reason);
remptr += strlen(remptr);
remprefix = ",";
@@ -3686,8 +3480,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
{
cupsArrayAdd(state_reasons, reason);
snprintf(addptr, sizeof(add) - (addptr - add), "%s%s", addprefix,
reason);
snprintf(addptr, sizeof(add) - (size_t)(addptr - add), "%s%s", addprefix, reason);
addptr += strlen(addptr);
addprefix = ",";
}
@@ -3709,5 +3502,5 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
}
/*
* End of "$Id: ipp.c 11909 2014-06-09 18:58:16Z msweet $".
* End of "$Id: ipp.c 12896 2015-10-09 13:15:22Z msweet $".
*/
+44 -55
Ver Arquivo
@@ -1,27 +1,18 @@
/*
* "$Id: lpd.c 12025 2014-07-15 13:00:17Z msweet $"
* "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $"
*
* Line Printer Daemon backend for CUPS.
* Line Printer Daemon backend for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Send a file to the printer or server.
* lpd_command() - Send an LPR command sequence and wait for a reply.
* lpd_queue() - Queue a file using the Line Printer Daemon protocol.
* lpd_write() - Write a buffer of data to an LPD server.
* rresvport_af() - A simple implementation of rresvport_af().
* sigterm_handler() - Handle 'terminate' signals that stop the backend.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -93,7 +84,7 @@ static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
int copies, int banner, int format, int order,
int reserve, int manual_copies, int timeout,
int contimeout, const char *orighost);
static int lpd_write(int lpd_fd, char *buffer, int length);
static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length);
#ifndef HAVE_RRESVPORT_AF
static int rresvport_af(int *port, int family);
#endif /* !HAVE_RRESVPORT_AF */
@@ -481,7 +472,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
_cupsLangPrintFilter(stderr, "INFO", _("Copying print data."));
if (bytes > 0)
write(fd, buffer, bytes);
write(fd, buffer, (size_t)bytes);
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
backendNetworkSideCB);
@@ -592,7 +583,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
{
va_list ap; /* Argument pointer */
char buf[1024]; /* Output buffer */
int bytes; /* Number of bytes to output */
ssize_t bytes; /* Number of bytes to output */
char status; /* Status from command */
@@ -617,9 +608,9 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
* Send the command...
*/
fprintf(stderr, "DEBUG: Sending command string (%d bytes)...\n", bytes);
fprintf(stderr, "DEBUG: Sending command string (" CUPS_LLFMT " bytes)...\n", CUPS_LLCAST bytes);
if (lpd_write(fd, buf, bytes) < bytes)
if (lpd_write(fd, buf, (size_t)bytes) < bytes)
{
perror("DEBUG: Unable to send LPD command");
return (-1);
@@ -634,7 +625,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
if (recv(fd, &status, 1, 0) < 1)
{
_cupsLangPrintFilter(stderr, "WARNING", _("The printer did not respond."));
status = errno;
status = (char)errno;
}
fprintf(stderr, "DEBUG: lpd_command returning %d\n", status);
@@ -680,7 +671,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
int have_supplies; /* Printer supports supply levels? */
int copy; /* Copies written */
time_t start_time; /* Time of first connect */
size_t nbytes; /* Number of bytes written */
ssize_t nbytes; /* Number of bytes written */
off_t tbytes; /* Total bytes written */
char buffer[32768]; /* Output buffer */
#ifdef WIN32
@@ -782,7 +773,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
return (CUPS_BACKEND_FAILED);
}
if (!connect(fd, &(addr->addr.addr), httpAddrLength(&(addr->addr))))
if (!connect(fd, &(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr))))
break;
error = errno;
@@ -846,7 +837,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
break;
}
sleep(delay);
sleep((unsigned)delay);
if (delay < 30)
delay += 5;
@@ -967,7 +958,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if (banner)
{
snprintf(cptr, sizeof(control) - (cptr - control),
snprintf(cptr, sizeof(control) - (size_t)(cptr - control),
"C%.31s\n" /* RFC 1179, Section 7.2 - class name <= 31 chars */
"L%s\n",
localhost, user);
@@ -976,13 +967,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
while (copies > 0)
{
snprintf(cptr, sizeof(control) - (cptr - control), "%cdfA%03d%.15s\n",
snprintf(cptr, sizeof(control) - (size_t)(cptr - control), "%cdfA%03d%.15s\n",
format, (int)getpid() % 1000, localhost);
cptr += strlen(cptr);
copies --;
}
snprintf(cptr, sizeof(control) - (cptr - control),
snprintf(cptr, sizeof(control) - (size_t)(cptr - control),
"UdfA%03d%.15s\n"
"N%.131s\n", /* RFC 1179, Section 7.2 - sourcefile name <= 131 chars */
(int)getpid() % 1000, localhost, title);
@@ -1012,9 +1003,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
fprintf(stderr, "DEBUG: Sending control file (%u bytes)\n",
(unsigned)strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
if ((size_t)lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
status = errno;
status = (char)errno;
perror("DEBUG: Unable to write control file");
}
@@ -1024,7 +1015,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
{
_cupsLangPrintFilter(stderr, "WARNING",
_("The printer did not respond."));
status = errno;
status = (char)errno;
}
}
@@ -1074,7 +1065,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
_("Spooling job, %.0f%% complete."),
100.0 * tbytes / filestats.st_size);
if (lpd_write(fd, buffer, nbytes) < nbytes)
if (lpd_write(fd, buffer, (size_t)nbytes) < nbytes)
{
perror("DEBUG: Unable to send print file to printer");
break;
@@ -1087,11 +1078,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
if (mode == MODE_STANDARD)
{
if (tbytes < filestats.st_size)
status = errno;
status = (char)errno;
else if (lpd_write(fd, "", 1) < 1)
{
perror("DEBUG: Unable to send trailing nul to printer");
status = errno;
status = (char)errno;
}
else
{
@@ -1145,9 +1136,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
fprintf(stderr, "DEBUG: Sending control file (%lu bytes)\n",
(unsigned long)strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
if ((size_t)lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
status = errno;
status = (char)errno;
perror("DEBUG: Unable to write control file");
}
else
@@ -1156,7 +1147,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
{
_cupsLangPrintFilter(stderr, "WARNING",
_("The printer did not respond."));
status = errno;
status = (char)errno;
}
}
@@ -1169,6 +1160,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
_("Control file sent successfully."));
}
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
/*
* Collect the final supply levels as needed...
*/
@@ -1204,32 +1197,32 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
* 'lpd_write()' - Write a buffer of data to an LPD server.
*/
static int /* O - Number of bytes written or -1 on error */
lpd_write(int lpd_fd, /* I - LPD socket */
char *buffer, /* I - Buffer to write */
int length) /* I - Number of bytes to write */
static ssize_t /* O - Number of bytes written or -1 on error */
lpd_write(int lpd_fd, /* I - LPD socket */
char *buffer, /* I - Buffer to write */
size_t length) /* I - Number of bytes to write */
{
int bytes, /* Number of bytes written */
total; /* Total number of bytes written */
ssize_t bytes, /* Number of bytes written */
total; /* Total number of bytes written */
if (abort_job)
return (-1);
total = 0;
while ((bytes = send(lpd_fd, buffer, length - total, 0)) >= 0)
while ((bytes = send(lpd_fd, buffer, length - (size_t)total, 0)) >= 0)
{
total += bytes;
buffer += bytes;
if (total == length)
if ((size_t)total == length)
break;
}
if (bytes < 0)
return (-1);
else
return (length);
return (total);
}
@@ -1285,11 +1278,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */
if (errno != EADDRINUSE)
{
# ifdef WIN32
closesocket(fd);
# else
close(fd);
# endif /* WIN32 */
httpAddrClose(NULL, fd);
return (-1);
}
@@ -1331,5 +1320,5 @@ sigterm_handler(int sig) /* I - Signal */
/*
* End of "$Id: lpd.c 12025 2014-07-15 13:00:17Z msweet $".
* End of "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $".
*/
+27 -45
Ver Arquivo
@@ -1,23 +1,18 @@
/*
* "$Id: network.c 11971 2014-07-01 14:38:29Z msweet $"
* "$Id: network.c 12124 2014-08-28 15:37:22Z msweet $"
*
* Common backend network APIs for CUPS.
* Common backend network APIs for CUPS.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* backendCheckSideChannel() - Check the side-channel for pending requests.
* backendNetworkSideCB() - Handle common network side-channel commands.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -26,11 +21,7 @@
#include "backend-private.h"
#include <limits.h>
#ifdef __hpux
# include <sys/time.h>
#else
# include <sys/select.h>
#endif /* __hpux */
#include <sys/select.h>
/*
@@ -100,7 +91,7 @@ backendNetworkSideCB(
case CUPS_SC_CMD_GET_BIDI :
status = CUPS_SC_STATUS_OK;
data[0] = use_bc;
data[0] = (char)use_bc;
datalen = 1;
break;
@@ -139,13 +130,13 @@ backendNetworkSideCB(
for (dataptr = data + strlen(data) + 1;
count > 0 && dataptr < (data + sizeof(data) - 1);
count --, dataptr += strlen(dataptr))
strlcpy(dataptr, snmp_value, sizeof(data) - (dataptr - data));
strlcpy(dataptr, snmp_value, sizeof(data) - (size_t)(dataptr - data));
fprintf(stderr, "DEBUG: Returning %s %s\n", data,
data + strlen(data) + 1);
status = CUPS_SC_STATUS_OK;
datalen = dataptr - data;
datalen = (int)(dataptr - data);
break;
}
@@ -168,7 +159,7 @@ backendNetworkSideCB(
{
if (_cupsSNMPRead(snmp_fd, &packet, 1.0))
{
int i; /* Looping var */
size_t i; /* Looping var */
if (!_cupsSNMPOIDToString(packet.object_name, data, sizeof(data)))
@@ -183,35 +174,31 @@ backendNetworkSideCB(
switch (packet.object_type)
{
case CUPS_ASN1_BOOLEAN :
snprintf(dataptr, sizeof(data) - (dataptr - data), "%d",
packet.object_value.boolean);
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%d", packet.object_value.boolean);
datalen += (int)strlen(dataptr);
break;
case CUPS_ASN1_INTEGER :
snprintf(dataptr, sizeof(data) - (dataptr - data), "%d",
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%d",
packet.object_value.integer);
datalen += (int)strlen(dataptr);
break;
case CUPS_ASN1_BIT_STRING :
case CUPS_ASN1_OCTET_STRING :
if (packet.object_value.string.num_bytes < 0)
i = 0;
else if (packet.object_value.string.num_bytes <
(sizeof(data) - (dataptr - data)))
if (packet.object_value.string.num_bytes < (sizeof(data) - (size_t)(dataptr - data)))
i = packet.object_value.string.num_bytes;
else
i = (int)(sizeof(data) - (dataptr - data));
i = sizeof(data) - (size_t)(dataptr - data);
memcpy(dataptr, packet.object_value.string.bytes, i);
datalen += i;
datalen += (int)i;
break;
case CUPS_ASN1_OID :
_cupsSNMPOIDToString(packet.object_value.oid, dataptr,
sizeof(data) - (dataptr - data));
sizeof(data) - (size_t)(dataptr - data));
datalen += (int)strlen(dataptr);
break;
@@ -220,32 +207,27 @@ backendNetworkSideCB(
i < packet.object_value.string.num_bytes &&
dataptr < (data + sizeof(data) - 3);
i ++, dataptr += 2)
sprintf(dataptr, "%02X",
packet.object_value.string.bytes[i]);
sprintf(dataptr, "%02X", packet.object_value.string.bytes[i]);
datalen += (int)strlen(dataptr);
break;
case CUPS_ASN1_COUNTER :
snprintf(dataptr, sizeof(data) - (dataptr - data), "%d",
packet.object_value.counter);
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.counter);
datalen += (int)strlen(dataptr);
break;
case CUPS_ASN1_GAUGE :
snprintf(dataptr, sizeof(data) - (dataptr - data), "%u",
packet.object_value.gauge);
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.gauge);
datalen += (int)strlen(dataptr);
break;
case CUPS_ASN1_TIMETICKS :
snprintf(dataptr, sizeof(data) - (dataptr - data), "%u",
packet.object_value.timeticks);
snprintf(dataptr, sizeof(data) - (size_t)(dataptr - data), "%u", packet.object_value.timeticks);
datalen += (int)strlen(dataptr);
break;
default :
fprintf(stderr, "DEBUG: Unknown OID value type %02X!\n",
packet.object_type);
fprintf(stderr, "DEBUG: Unknown OID value type %02X.\n", packet.object_type);
case CUPS_ASN1_NULL_VALUE :
dataptr[0] = '\0';
@@ -322,5 +304,5 @@ backendNetworkSideCB(
/*
* End of "$Id: network.c 11971 2014-07-01 14:38:29Z msweet $".
* End of "$Id: network.c 12124 2014-08-28 15:37:22Z msweet $".
*/
+26
Ver Arquivo
@@ -5,6 +5,7 @@
# product ID (omit for all vendor products), and a list of known issues:
#
# blacklist The printer is not functional with the USB backend.
# delay-close Delay close/reset of selected interface
# no-reattach Do no re-attach usblp kernel module after printing.
# soft-reset Do a soft reset after printing for cleanup.
# unidir Only supported unidirectional I/O
@@ -84,6 +85,9 @@
# Canon, Inc. MF4150 Printer, https://bugs.launchpad.net/bugs/1160638
0x04a9 0x26a3 no-reattach
# Brother Industries, Ltd HL-1250 Laser Printer, https://bugs.debian.org/712512
0x04f9 0x0007 no-reattach
# Brother Industries, Ltd HL-1430 Laser Printer, https://bugs.launchpad.net/bugs/1038695
0x04f9 0x001a no-reattach
@@ -215,3 +219,25 @@
# Lexmark E238 (STR #4448)
0x043d 0x009a no-reattach
# Canon MX310 (STR #4482)
0x04a9 0x1728 unidir
# Canon MX320 (STR #4482)
0x04A9 0x1736 unidir
# All Intermec devices (STR #4553)
0x067e no-reattach
# HP LaserJet 1150 (STR #4549)
0x03f0 0x0f17 delay-close
# HP LaserJet 1300 (STR #4549)
0x03f0 0x1017 delay-close
0x03f0 0x1117 delay-close
# HP LaserJet 1320 (STR #4549)
0x03f0 0x1d17 delay-close
# Canon, Inc. MP530 Printer
0x04a9 0x1712 unidir
+15 -26
Ver Arquivo
@@ -1,25 +1,18 @@
/*
* "$Id: runloop.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: runloop.c 11558 2014-02-06 18:33:34Z msweet $"
*
* Common run loop APIs for CUPS backends.
* Common run loop APIs for CUPS backends.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* backendDrainOutput() - Drain pending print data to the device.
* backendRunLoop() - Read and write print and back-channel data.
* backendWaitLoop() - Wait for input from stdin while handling
* side-channel queries.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -28,11 +21,7 @@
#include "backend-private.h"
#include <limits.h>
#ifdef __hpux
# include <sys/time.h>
#else
# include <sys/select.h>
#endif /* __hpux */
#include <sys/select.h>
/*
@@ -113,7 +102,7 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
for (print_ptr = print_buffer; print_bytes > 0;)
{
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
if ((bytes = write(device_fd, print_ptr, (size_t)print_bytes)) < 0)
{
/*
* Write error - bail if we don't see an error we can retry...
@@ -293,7 +282,7 @@ backendRunLoop(
fprintf(stderr,
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data\n",
CUPS_LLCAST bc_bytes);
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
cupsBackChannelWrite(bc_buffer, (size_t)bc_bytes, 1.0);
}
else if (bc_bytes < 0 && errno != EAGAIN && errno != EINTR)
{
@@ -350,7 +339,7 @@ backendRunLoop(
if (print_bytes && FD_ISSET(device_fd, &output))
{
if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
if ((bytes = write(device_fd, print_ptr, (size_t)print_bytes)) < 0)
{
/*
* Write error - bail if we don't see an error we can retry...
@@ -539,5 +528,5 @@ backendWaitLoop(
/*
* End of "$Id: runloop.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: runloop.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+25 -30
Ver Arquivo
@@ -1,24 +1,17 @@
/*
* "$Id: snmp-supplies.c 11319 2013-09-27 16:18:26Z msweet $"
* "$Id: snmp-supplies.c 12227 2014-10-21 13:42:04Z msweet $"
*
* SNMP supplies functions for CUPS.
* SNMP supplies functions for CUPS.
*
* Copyright 2008-2013 by Apple Inc.
* Copyright 2008-2014 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* backendSNMPSupplies() - Get the current supplies for a device.
* backend_init_supplies() - Initialize the supplies list.
* backend_walk_cb() - Interpret the supply value responses.
* utf16_to_utf8() - Convert UTF-16 text to UTF-8.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -304,6 +297,7 @@ backendSNMPSupplies(
else
new_supply_state |= CUPS_OPC_NEAR_EOL;
break;
#if 0 /* Because no two vendors report waste containers the same, disable SNMP reporting of same */
case CUPS_TC_wasteInk :
case CUPS_TC_wastePaper :
case CUPS_TC_wasteToner :
@@ -314,6 +308,7 @@ backendSNMPSupplies(
else
new_supply_state |= CUPS_WASTE_ALMOST_FULL;
break;
#endif /* 0 */
case CUPS_TC_cleanerUnit :
case CUPS_TC_fuserCleaningPad :
if (percent <= 1)
@@ -329,9 +324,9 @@ backendSNMPSupplies(
if ((supplies[i].max_capacity > 0 || (quirks & CUPS_SNMP_CAPACITY)) &&
supplies[i].level >= 0)
snprintf(ptr, sizeof(value) - (ptr - value), "%d", percent);
snprintf(ptr, sizeof(value) - (size_t)(ptr - value), "%d", percent);
else
strlcpy(ptr, "-1", sizeof(value) - (ptr - value));
strlcpy(ptr, "-1", sizeof(value) - (size_t)(ptr - value));
}
fprintf(stderr, "ATTR: marker-levels=%s\n", value);
@@ -585,7 +580,7 @@ backend_init_supplies(
{
if (!strcmp(description, value))
cupsFileRead(cachefile, (char *)supplies,
num_supplies * sizeof(backend_supplies_t));
(size_t)num_supplies * sizeof(backend_supplies_t));
else
{
num_supplies = -1;
@@ -680,7 +675,7 @@ backend_init_supplies(
if (num_supplies > 0)
cupsFileWrite(cachefile, (char *)supplies,
num_supplies * sizeof(backend_supplies_t));
(size_t)num_supplies * sizeof(backend_supplies_t));
cupsFileClose(cachefile);
}
@@ -708,7 +703,7 @@ backend_init_supplies(
if (i)
*ptr++ = ',';
strlcpy(ptr, supplies[i].color, sizeof(value) - (ptr - value));
strlcpy(ptr, supplies[i].color, sizeof(value) - (size_t)(ptr - value));
}
fprintf(stderr, "ATTR: marker-colors=%s\n", value);
@@ -756,9 +751,9 @@ backend_init_supplies(
type = supplies[i].type;
if (type < CUPS_TC_other || type > CUPS_TC_covers)
strlcpy(ptr, "unknown", sizeof(value) - (ptr - value));
strlcpy(ptr, "unknown", sizeof(value) - (size_t)(ptr - value));
else
strlcpy(ptr, types[type - CUPS_TC_other], sizeof(value) - (ptr - value));
strlcpy(ptr, types[type - CUPS_TC_other], sizeof(value) - (size_t)(ptr - value));
}
fprintf(stderr, "ATTR: marker-types=%s\n", value);
@@ -1062,9 +1057,9 @@ utf16_to_utf8(
for (ptr = temp; srcsize >= 2;)
{
if (le)
ch = src[0] | (src[1] << 8);
ch = (cups_utf32_t)(src[0] | (src[1] << 8));
else
ch = (src[0] << 8) | src[1];
ch = (cups_utf32_t)((src[0] << 8) | src[1]);
src += 2;
srcsize -= 2;
@@ -1075,13 +1070,13 @@ utf16_to_utf8(
* Multi-word UTF-16 char...
*/
int lch; /* Lower word */
cups_utf32_t lch; /* Lower word */
if (le)
lch = src[0] | (src[1] << 8);
lch = (cups_utf32_t)(src[0] | (src[1] << 8));
else
lch = (src[0] << 8) | src[1];
lch = (cups_utf32_t)((src[0] << 8) | src[1]);
if (lch >= 0xdc00 && lch <= 0xdfff)
{
@@ -1098,10 +1093,10 @@ utf16_to_utf8(
*ptr = '\0';
cupsUTF32ToUTF8(dst, temp, dstsize);
cupsUTF32ToUTF8(dst, temp, (int)dstsize);
}
/*
* End of "$Id: snmp-supplies.c 11319 2013-09-27 16:18:26Z msweet $".
* End of "$Id: snmp-supplies.c 12227 2014-10-21 13:42:04Z msweet $".
*/
+20 -47
Ver Arquivo
@@ -1,44 +1,18 @@
/*
* "$Id: snmp.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: snmp.c 11594 2014-02-14 20:09:01Z msweet $"
*
* SNMP discovery backend for CUPS.
* SNMP discovery backend for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Discover printers via SNMP.
* add_array() - Add a string to an array.
* add_cache() - Add a cached device...
* add_device_uri() - Add a device URI to the cache.
* alarm_handler() - Handle alarm signals...
* compare_cache() - Compare two cache entries.
* debug_printf() - Display some debugging information.
* fix_make_model() - Fix common problems in the make-and-model
* string.
* free_array() - Free an array of strings.
* free_cache() - Free the array of cached devices.
* get_interface_addresses() - Get the broadcast address(es) associated with
* an interface.
* list_device() - List a device we found...
* password_cb() - Handle authentication requests.
* probe_device() - Probe a device to discover whether it is a
* printer.
* read_snmp_conf() - Read the snmp.conf file.
* read_snmp_response() - Read and parse a SNMP response...
* run_time() - Return the total running time...
* scan_devices() - Scan for devices using SNMP.
* try_connect() - Try connecting on a port...
* update_cache() - Update a cached device...
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -532,17 +506,16 @@ fix_make_model(
make_model[0] = 'H';
make_model[1] = 'P';
make_model[2] = ' ';
strlcpy(make_model + 3, mmptr, make_model_size - 3);
strlcpy(make_model + 3, mmptr, (size_t)make_model_size - 3);
}
else if (!_cups_strncasecmp(old_make_model, "deskjet", 7))
snprintf(make_model, make_model_size, "HP DeskJet%s", old_make_model + 7);
snprintf(make_model, (size_t)make_model_size, "HP DeskJet%s", old_make_model + 7);
else if (!_cups_strncasecmp(old_make_model, "officejet", 9))
snprintf(make_model, make_model_size, "HP OfficeJet%s", old_make_model + 9);
snprintf(make_model, (size_t)make_model_size, "HP OfficeJet%s", old_make_model + 9);
else if (!_cups_strncasecmp(old_make_model, "stylus_pro_", 11))
snprintf(make_model, make_model_size, "EPSON Stylus Pro %s",
old_make_model + 11);
snprintf(make_model, (size_t)make_model_size, "EPSON Stylus Pro %s", old_make_model + 11);
else
strlcpy(make_model, old_make_model, make_model_size);
strlcpy(make_model, old_make_model, (size_t)make_model_size);
if ((mmptr = strstr(make_model, ", Inc.,")) != NULL)
{
@@ -753,7 +726,7 @@ probe_device(snmp_cache_t *device) /* I - Device */
* Insert hostname/address...
*/
strlcpy(uriptr, device->addrname, sizeof(uri) - (uriptr - uri));
strlcpy(uriptr, device->addrname, sizeof(uri) - (size_t)(uriptr - uri));
uriptr += strlen(uriptr);
format += 2;
}
@@ -1233,7 +1206,7 @@ scan_devices(int ipv4, /* I - SNMP IPv4 socket */
for (addr = addrs; addr; addr = addr->next)
{
#ifdef AF_INET6
if (_httpAddrFamily(&(addr->addr)) == AF_INET6)
if (httpAddrFamily(&(addr->addr)) == AF_INET6)
fd = ipv6;
else
#endif /* AF_INET6 */
@@ -1335,7 +1308,7 @@ try_connect(http_addr_t *addr, /* I - Socket address */
debug_printf("DEBUG: %.3f Trying %s://%s:%d...\n", run_time(),
port == 515 ? "lpd" : "socket", addrname, port);
if ((fd = socket(_httpAddrFamily(addr), SOCK_STREAM, 0)) < 0)
if ((fd = socket(httpAddrFamily(addr), SOCK_STREAM, 0)) < 0)
{
fprintf(stderr, "ERROR: Unable to create socket: %s\n",
strerror(errno));
@@ -1346,7 +1319,7 @@ try_connect(http_addr_t *addr, /* I - Socket address */
alarm(1);
status = connect(fd, (void *)addr, httpAddrLength(addr));
status = connect(fd, (void *)addr, (socklen_t)httpAddrLength(addr));
close(fd);
alarm(0);
@@ -1391,5 +1364,5 @@ update_cache(snmp_cache_t *device, /* I - Device */
/*
* End of "$Id: snmp.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: snmp.c 11594 2014-02-14 20:09:01Z msweet $".
*/
+18 -21
Ver Arquivo
@@ -1,23 +1,18 @@
/*
* "$Id: socket.c 11909 2014-06-09 18:58:16Z msweet $"
* "$Id: socket.c 11907 2014-06-09 18:35:32Z msweet $"
*
* AppSocket backend for CUPS.
* AppSocket backend for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Send a file to the printer or server.
* wait_bc() - Wait for back-channel data...
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -46,7 +41,7 @@
* Local functions...
*/
static int wait_bc(int device_fd, int secs);
static ssize_t wait_bc(int device_fd, int secs);
/*
@@ -385,7 +380,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
break;
}
sleep(delay);
sleep((unsigned)delay);
if (delay < 30)
delay += 5;
@@ -415,7 +410,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
tbytes = 0;
if (bytes > 0)
tbytes += write(device_fd, buffer, bytes);
tbytes += write(device_fd, buffer, (size_t)bytes);
while (copies > 0 && tbytes >= 0)
{
@@ -434,6 +429,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
_cupsLangPrintFilter(stderr, "INFO", _("Print file sent."));
}
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
if (waiteof)
{
/*
@@ -479,7 +476,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* 'wait_bc()' - Wait for back-channel data...
*/
static int /* O - # bytes read or -1 on error */
static ssize_t /* O - # bytes read or -1 on error */
wait_bc(int device_fd, /* I - Socket */
int secs) /* I - Seconds to wait */
{
@@ -509,7 +506,7 @@ wait_bc(int device_fd, /* I - Socket */
{
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data\n",
(int)bytes);
cupsBackChannelWrite(buffer, bytes, 1.0);
cupsBackChannelWrite(buffer, (size_t)bytes, 1.0);
}
return (bytes);
@@ -520,5 +517,5 @@ wait_bc(int device_fd, /* I - Socket */
/*
* End of "$Id: socket.c 11909 2014-06-09 18:58:16Z msweet $".
* End of "$Id: socket.c 11907 2014-06-09 18:35:32Z msweet $".
*/
+20 -24
Ver Arquivo
@@ -1,25 +1,18 @@
/*
* "$Id: testbackend.c 4297 2013-05-10 16:04:59Z msweet $"
* "$Id: testbackend.c 11594 2014-02-14 20:09:01Z msweet $"
*
* Backend test program for CUPS.
* Backend test program for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* main() - Run the named backend.
* sigterm_handler() - Flag when we get SIGTERM.
* usage() - Show usage information.
* walk_cb() - Show results of cupsSideChannelSNMPWalk...
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -97,7 +90,7 @@ main(int argc, /* I - Number of command-line args */
if (getcwd(libpath, sizeof(libpath)) &&
(ptr = strrchr(libpath, '/')) != NULL && !strcmp(ptr, "/backend"))
{
strlcpy(ptr, "/cups", sizeof(libpath) - (ptr - libpath));
strlcpy(ptr, "/cups", sizeof(libpath) - (size_t)(ptr - libpath));
if (!access(libpath, 0))
{
#ifdef __APPLE__
@@ -311,7 +304,7 @@ main(int argc, /* I - Number of command-line args */
*/
if ((bytes = cupsBackChannelRead(buffer, sizeof(buffer), 0)) > 0)
write(2, buffer, bytes);
write(2, buffer, (size_t)bytes);
/*
* Throttle output to ~100hz...
@@ -339,7 +332,7 @@ main(int argc, /* I - Number of command-line args */
*/
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer), 5.0)) > 0)
write(2, buffer, bytes);
write(2, buffer, (size_t)bytes);
exit(0);
}
@@ -414,7 +407,7 @@ main(int argc, /* I - Number of command-line args */
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer),
timeout)) > 0)
{
write(2, buffer, bytes);
write(2, buffer, (size_t)bytes);
timeout = 5.0;
}
write(2, "\nDEBUG: END\n", 12);
@@ -668,14 +661,17 @@ walk_cb(const char *oid, /* I - OID */
void *context) /* I - Context (unused) */
{
char temp[80];
if (datalen > (sizeof(temp) - 1))
(void)context;
if ((size_t)datalen > (sizeof(temp) - 1))
{
memcpy(temp, data, sizeof(temp) - 1);
temp[sizeof(temp) - 1] = '\0';
}
else
{
memcpy(temp, data, datalen);
memcpy(temp, data, (size_t)datalen);
temp[datalen] = '\0';
}
@@ -684,5 +680,5 @@ walk_cb(const char *oid, /* I - OID */
/*
* End of "$Id: testbackend.c 4297 2013-05-10 16:04:59Z msweet $".
* End of "$Id: testbackend.c 11594 2014-02-14 20:09:01Z msweet $".
*/
+630 -439
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+41 -41
Ver Arquivo
@@ -1,35 +1,15 @@
/*
* "$Id: usb-libusb.c 11456 2013-12-09 19:26:47Z msweet $"
* "$Id: usb-libusb.c 12881 2015-09-15 21:20:02Z msweet $"
*
* LIBUSB interface code for CUPS.
* LIBUSB interface code for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2007-2015 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* list_devices() - List the available printers.
* print_device() - Print a file to a USB device.
* close_device() - Close the connection to the USB printer.
* compare_quirks() - Compare two quirks entries.
* find_device() - Find or enumerate USB printers.
* find_quirks() - Find the quirks for the given printer, if any.
* get_device_id() - Get the IEEE-1284 device ID for the printer.
* list_cb() - List USB printers for discovery.
* load_quirks() - Load all quirks files in the /usr/share/cups/usb
* directory.
* make_device_uri() - Create a device URI for a USB printer.
* open_device() - Open a connection to the USB printer.
* print_cb() - Find a USB printer for printing.
* read_thread() - Thread to read the backchannel data on.
* sidechannel_thread() - Handle side-channel requests.
* soft_reset() - Send a soft reset to the device.
* soft_reset_printer() - Do the soft reset request specific to printers
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -123,6 +103,7 @@ typedef struct usb_globals_s /* Global USB printer information */
#define USB_QUIRK_USB_INIT 0x0010 /* Needs vendor USB init string */
#define USB_QUIRK_VENDOR_CLASS 0x0020 /* Descriptor uses vendor-specific
Class or SubClass */
#define USB_QUIRK_DELAY_CLOSE 0x0040 /* Delay close */
#define USB_QUIRK_WHITELIST 0x0000 /* no quirks */
@@ -661,6 +642,9 @@ print_device(const char *uri, /* I - Device URI */
* Close the connection and input file and general clean up...
*/
if (g.printer->quirks & USB_QUIRK_DELAY_CLOSE)
sleep(1);
close_device(g.printer);
/*
@@ -920,8 +904,8 @@ find_device(usb_cb_t cb, /* I - Callback function */
fprintf(stderr, "DEBUG: Printer does not report class 7 and/or "
"subclass 1 but works as a printer anyway\n");
read_endp = -1;
write_endp = -1;
read_endp = 0xff;
write_endp = 0xff;
for (endp = 0, endpptr = altptr->endpoint;
endp < altptr->bNumEndpoints;
@@ -935,7 +919,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
write_endp = endp;
}
if (write_endp >= 0)
if (write_endp != 0xff)
{
/*
* Save the best match so far...
@@ -1085,8 +1069,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
* bytes. The 1284 spec says the length is stored MSB first...
*/
length = (((unsigned)buffer[0] & 255) << 8) |
((unsigned)buffer[1] & 255);
length = (int)((((unsigned)buffer[0] & 255) << 8) | ((unsigned)buffer[1] & 255));
/*
* Check to see if the length is larger than our buffer or less than 14 bytes
@@ -1097,8 +1080,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
*/
if (length > bufsize || length < 14)
length = (((unsigned)buffer[1] & 255) << 8) |
((unsigned)buffer[0] & 255);
length = (int)((((unsigned)buffer[1] & 255) << 8) | ((unsigned)buffer[0] & 255));
if (length > bufsize)
length = bufsize;
@@ -1120,7 +1102,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
* nul-terminate.
*/
memmove(buffer, buffer + 2, length);
memmove(buffer, buffer + 2, (size_t)length);
buffer[length] = '\0';
return (0);
@@ -1233,6 +1215,9 @@ load_quirks(void)
if (strstr(line, " blacklist"))
quirk->quirks |= USB_QUIRK_BLACKLIST;
if (strstr(line, " delay-close"))
quirk->quirks |= USB_QUIRK_DELAY_CLOSE;
if (strstr(line, " no-reattach"))
quirk->quirks |= USB_QUIRK_NO_REATTACH;
@@ -1473,9 +1458,14 @@ open_device(usb_printer_t *printer, /* I - Printer */
else
{
printer->usblp_attached = 0;
fprintf(stderr, "DEBUG: Failed to check whether %04x:%04x has the \"usblp\" kernel module attached\n",
devdesc.idVendor, devdesc.idProduct);
goto error;
if (errcode != LIBUSB_ERROR_NOT_SUPPORTED)
{
fprintf(stderr,
"DEBUG: Failed to check whether %04x:%04x has the \"usblp\" "
"kernel module attached\n", devdesc.idVendor, devdesc.idProduct);
goto error;
}
}
/*
@@ -1539,6 +1529,16 @@ open_device(usb_printer_t *printer, /* I - Printer */
goto error;
}
else if ((errcode = libusb_detach_kernel_driver(printer->handle, printer->iface)) < 0)
{
fprintf(stderr,
"DEBUG: Failed to detach \"usblp\" module from %04x:%04x\n",
devdesc.idVendor, devdesc.idProduct);
goto error;
}
sleep (1);
}
/*
@@ -1734,7 +1734,7 @@ static void *read_thread(void *reference)
{
fprintf(stderr, "DEBUG: Read %d bytes of back-channel data...\n",
(int)rbytes);
cupsBackChannelWrite((const char *)readbuffer, rbytes, 1.0);
cupsBackChannelWrite((const char *)readbuffer, (size_t)rbytes, 1.0);
}
else if (readstatus == LIBUSB_ERROR_TIMEOUT)
fputs("DEBUG: Got USB transaction timeout during read.\n", stderr);
@@ -2021,6 +2021,6 @@ soft_reset_printer(
/*
* End of "$Id: usb-libusb.c 11456 2013-12-09 19:26:47Z msweet $".
* End of "$Id: usb-libusb.c 12881 2015-09-15 21:20:02Z msweet $".
*/
+13 -22
Ver Arquivo
@@ -1,27 +1,20 @@
/*
* "$Id: usb-unix.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: usb-unix.c 12124 2014-08-28 15:37:22Z msweet $"
*
* USB port backend for CUPS.
* USB port backend for CUPS.
*
* This file is included from "usb.c" when compiled on UNIX/Linux.
* This file is included from "usb.c" when compiled on UNIX/Linux.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* "LICENSE" which should have been included with this file. If this
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* print_device() - Print a file to a USB device.
* list_devices() - List all USB devices.
* open_device() - Open a USB device...
* side_cb() - Handle side-channel requests...
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -153,7 +146,7 @@ print_device(const char *uri, /* I - Device URI */
tcgetattr(device_fd, &opts);
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
opts.c_lflag &= ~(unsigned)(ICANON | ECHO | ISIG); /* Raw mode */
/**** No options supported yet ****/
@@ -285,8 +278,6 @@ list_devices(void)
close(fd);
}
}
#elif defined(__hpux)
#elif defined(__osf)
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
int i; /* Looping var */
char device[255]; /* Device filename */
@@ -612,5 +603,5 @@ side_cb(int print_fd, /* I - Print file */
/*
* End of "$Id: usb-unix.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: usb-unix.c 12124 2014-08-28 15:37:22Z msweet $".
*/
+22 -19
Ver Arquivo
@@ -1,25 +1,28 @@
lpc.o: lpc.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/ipp-private.h \
../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/ipp-private.h \
../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
../cups/debug-private.h ../cups/versioning.h ../cups/ipp-private.h \
../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/http-private.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/language.h ../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/ppd-private.h \
../cups/ppd.h ../cups/thread-private.h
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
../config.h ../cups/debug-private.h ../cups/versioning.h \
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/http-private.h ../cups/md5-private.h \
../cups/language-private.h ../cups/transcode.h ../cups/language.h \
../cups/pwg-private.h ../cups/cups.h ../cups/file.h \
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
../cups/ipp.h ../cups/http.h ../cups/http-private.h ../cups/language.h \
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/pwg-private.h ../cups/cups.h ../cups/file.h ../cups/pwg.h \
../cups/ppd-private.h ../cups/ppd.h ../cups/thread-private.h
+13 -21
Ver Arquivo
@@ -1,24 +1,16 @@
/*
* "$Id: lpc.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: lpc.c 11558 2014-02-06 18:33:34Z msweet $"
*
* "lpc" command for CUPS.
* "lpc" command for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Parse options and commands.
* compare_strings() - Compare two command-line strings.
* do_command() - Do an lpc command...
* show_help() - Show help messages.
* show_status() - Show printers.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -32,7 +24,7 @@
* Local functions...
*/
static int compare_strings(const char *, const char *, int);
static int compare_strings(const char *, const char *, size_t);
static void do_command(http_t *, const char *, const char *);
static void show_help(const char *);
static void show_status(http_t *, const char *);
@@ -158,9 +150,9 @@ main(int argc, /* I - Number of command-line arguments */
static int /* O - -1 or 1 = no match, 0 = match */
compare_strings(const char *s, /* I - Command-line string */
const char *t, /* I - Option string */
int tmin) /* I - Minimum number of unique chars in option */
size_t tmin) /* I - Minimum number of unique chars in option */
{
int slen; /* Length of command-line string */
size_t slen; /* Length of command-line string */
slen = strlen(s);
@@ -446,5 +438,5 @@ show_status(http_t *http, /* I - HTTP connection to server */
/*
* End of "$Id: lpc.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: lpc.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+11 -49
Ver Arquivo
@@ -1,27 +1,16 @@
/*
* "$Id: lpq.c 11101 2013-07-08 11:20:33Z msweet $"
* "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $"
*
* "lpq" command for CUPS.
* "lpq" command for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Parse options and commands.
* show_jobs() - Show jobs.
* show_printer() - Show printer status.
* usage() - Show program usage.
*/
/*
* Include necessary headers...
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -194,7 +183,6 @@ main(int argc, /* I - Number of command-line arguments */
httpClose(http);
usage();
break;
}
}
else if (isdigit(argv[i][0] & 255))
@@ -262,7 +250,7 @@ main(int argc, /* I - Number of command-line arguments */
if (i && interval)
{
fflush(stdout);
sleep(interval);
sleep((unsigned)interval);
}
else
break;
@@ -323,9 +311,6 @@ show_jobs(const char *command, /* I - Command name */
ipp_jstate_t jobstate; /* job-state */
int jobid, /* job-id */
jobsize, /* job-k-octets */
#ifdef __osf__
jobpriority, /* job-priority */
#endif /* __osf__ */
jobcount, /* Number of jobs */
jobcopies, /* Number of copies */
rank; /* Rank of job */
@@ -448,9 +433,6 @@ show_jobs(const char *command, /* I - Command name */
jobid = 0;
jobsize = 0;
#ifdef __osf__
jobpriority = 50;
#endif /* __osf__ */
jobstate = IPP_JOB_PENDING;
jobname = "unknown";
jobuser = "unknown";
@@ -467,12 +449,6 @@ show_jobs(const char *command, /* I - Command name */
attr->value_tag == IPP_TAG_INTEGER)
jobsize = attr->values[0].integer;
#ifdef __osf__
if (!strcmp(attr->name, "job-priority") &&
attr->value_tag == IPP_TAG_INTEGER)
jobpriority = attr->values[0].integer;
#endif /* __osf__ */
if (!strcmp(attr->name, "job-state") &&
attr->value_tag == IPP_TAG_ENUM)
jobstate = (ipp_jstate_t)attr->values[0].integer;
@@ -510,16 +486,9 @@ show_jobs(const char *command, /* I - Command name */
}
if (!longstatus && jobcount == 0)
#ifdef __osf__
_cupsLangPuts(stdout,
/* TRANSLATORS: Pri is job priority. */
_("Rank Owner Pri Job Files"
" Total Size"));
#else
_cupsLangPuts(stdout,
_("Rank Owner Job File(s)"
" Total Size"));
#endif /* __osf__ */
jobcount ++;
@@ -560,16 +529,9 @@ show_jobs(const char *command, /* I - Command name */
namestr, 1024.0 * jobsize);
}
else
#ifdef __osf__
_cupsLangPrintf(stdout,
_("%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes"),
rankstr, jobuser, jobpriority, jobid, jobname,
1024.0 * jobsize);
#else
_cupsLangPrintf(stdout,
_("%-7s %-7.7s %-7d %-31.31s %.0f bytes"),
rankstr, jobuser, jobid, jobname, 1024.0 * jobsize);
#endif /* __osf */
if (attr == NULL)
break;
@@ -679,5 +641,5 @@ usage(void)
/*
* End of "$Id: lpq.c 11101 2013-07-08 11:20:33Z msweet $".
* End of "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+11 -15
Ver Arquivo
@@ -1,20 +1,16 @@
/*
* "$Id: lpr.c 11101 2013-07-08 11:20:33Z msweet $"
* "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $"
*
* "lpr" command for CUPS.
* "lpr" command for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Parse options and send files for printing.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -406,7 +402,7 @@ main(int argc, /* I - Number of command-line arguments */
while (status == HTTP_CONTINUE &&
(bytes = read(0, buffer, sizeof(buffer))) > 0)
status = cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, bytes);
status = cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, (size_t)bytes);
if (status != HTTP_CONTINUE)
{
@@ -436,5 +432,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
* End of "$Id: lpr.c 11101 2013-07-08 11:20:33Z msweet $".
* End of "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+19 -20
Ver Arquivo
@@ -1,73 +1,72 @@
help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
../cups/array.h ../cups/language.h help-index.h \
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h \
../cups/dir.h
html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h \
../cups/md5-private.h
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h \
../cups/adminutil.h ../cups/ppd.h
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
makedocset.o: makedocset.c cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h
makedocset.o: makedocset.c cgi-private.h cgi.h ../cups/cups.h \
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h ../cups/debug-private.h \
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
../cups/language-private.h ../cups/transcode.h \
../cups/string-private.h ../config.h ../cups/ipp-private.h
testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h
../cups/language.h ../cups/pwg.h help-index.h
testhi.o: testhi.c cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h
../cups/language.h ../cups/pwg.h help-index.h
testtemplate.o: testtemplate.c cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h
websearch.o: websearch.c cgi.h ../cups/cups.h ../cups/file.h \
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
../cups/language.h help-index.h
../cups/language.h ../cups/pwg.h help-index.h
+16 -43
Ver Arquivo
@@ -1,16 +1,16 @@
#
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
# "$Id: Makefile 12519 2015-02-17 13:10:19Z msweet $"
#
# CGI makefile for CUPS.
# CGI makefile for CUPS.
#
# Copyright 2007-2012 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products.
# Copyright 2007-2014 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
#
include ../Makedefs
@@ -32,8 +32,7 @@ OBJS = \
printers.o \
testcgi.o \
testhi.o \
testtemplate.o \
websearch.o
testtemplate.o
CGIS = \
admin.cgi \
classes.cgi \
@@ -42,8 +41,7 @@ CGIS = \
printers.cgi
LIBTARGETS = \
libcupscgi.a \
$(LIBCUPSCGI) \
websearch
$(LIBCUPSCGI)
UNITTARGETS = \
testcgi \
@@ -82,7 +80,7 @@ unittests: $(UNITTARGETS)
clean:
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset
$(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib
$(RM) libcupscgi.so libcupscgi.dylib
#
@@ -144,7 +142,7 @@ install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
if test $(LIBCUPSCGI) = "libcupscgi.so.1" -o $(LIBCUPSCGI) = "libcupscgi.sl.1"; then \
if test $(LIBCUPSCGI) = "libcupscgi.so.1"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
$(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
fi
@@ -177,9 +175,6 @@ uninstall:
$(RM) $(LIBDIR)/libcupscgi.1.dylib
$(RM) $(LIBDIR)/libcupscgi.a
$(RM) $(LIBDIR)/libcupscgi.dylib
$(RM) $(LIBDIR)/libcupscgi_s.a
$(RM) $(LIBDIR)/libcupscgi.sl
$(RM) $(LIBDIR)/libcupscgi.sl.1
$(RM) $(LIBDIR)/libcupscgi.so
$(RM) $(LIBDIR)/libcupscgi.so.1
-$(RMDIR) $(LIBDIR)
@@ -211,10 +206,10 @@ framedhelp:
#
# libcupscgi.so.1, libcupscgi.sl.1
# libcupscgi.so.1
#
libcupscgi.so.1 libcupscgi.sl.1: $(LIBOBJS)
libcupscgi.so.1: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
$(RM) `basename $@ .1`
@@ -237,17 +232,6 @@ libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
$(LN) $@ libcupscgi.dylib
#
# libcupscgi_s.a
#
libcupscgi_s.a: $(LIBOBJS)
echo Creating $@...
$(DSO) $(DSOFLAGS) -o libcupscgi_s.o $(LIBOBJS) $(LIBS)
$(RM) $@
$(AR) $(ARFLAGS) $@ libcupscgi_s.o
#
# libcupscgi.la
#
@@ -361,17 +345,6 @@ testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
$(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
#
# websearch
#
websearch: websearch.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
$(LIBZ) $(LIBGSSAPI)
#
# Dependencies...
#
@@ -380,5 +353,5 @@ include Dependencies
#
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
# End of "$Id: Makefile 12519 2015-02-17 13:10:19Z msweet $".
#
+116 -57
Ver Arquivo
@@ -1,37 +1,16 @@
/*
* "$Id: admin.c 11345 2013-10-18 21:14:52Z msweet $"
* "$Id: admin.c 12516 2015-02-12 20:18:11Z msweet $"
*
* Administration CGI for CUPS.
* Administration CGI for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Main entry for CGI.
* choose_device_cb() - Add a device to the device selection page.
* do_add_rss_subscription() - Add a RSS subscription.
* do_am_class() - Add or modify a class.
* do_am_printer() - Add or modify a printer.
* do_cancel_subscription() - Cancel a subscription.
* do_config_server() - Configure server settings.
* do_delete_class() - Delete a class.
* do_delete_printer() - Delete a printer.
* do_export() - Export printers to Samba.
* do_list_printers() - List available printers.
* do_menu() - Show the main menu.
* do_set_allowed_users() - Set the allowed/denied users for a queue.
* do_set_default() - Set the server default printer/class.
* do_set_options() - Configure the default options for a queue.
* do_set_sharing() - Set printer-is-shared value.
* get_option_value() - Return the value of an option.
* get_points() - Get a value in points.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -39,6 +18,8 @@
*/
#include "cgi-private.h"
#include <cups/http-private.h>
#include <cups/ppd-private.h>
#include <cups/adminutil.h>
#include <cups/ppd.h>
#include <errno.h>
@@ -59,12 +40,7 @@ static int current_device = 0; /* Current device shown */
* Local functions...
*/
static void choose_device_cb(const char *device_class,
const char *device_id, const char *device_info,
const char *device_make_and_model,
const char *device_uri,
const char *device_location,
const char *title);
static void choose_device_cb(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, const char *device_location, const char *title);
static void do_add_rss_subscription(http_t *http);
static void do_am_class(http_t *http, int modify);
static void do_am_printer(http_t *http, int modify);
@@ -82,6 +58,7 @@ static void do_set_sharing(http_t *http);
static char *get_option_value(ppd_file_t *ppd, const char *name,
char *buffer, size_t bufsize);
static double get_points(double number, const char *uval);
static char *get_printer_ppd(const char *uri, char *buffer, size_t bufsize);
/*
@@ -89,8 +66,7 @@ static double get_points(double number, const char *uval);
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
main(void)
{
http_t *http; /* Connection to the server */
const char *op; /* Operation name */
@@ -854,7 +830,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
const cgi_file_t *file; /* Uploaded file, if any */
const char *var; /* CGI variable */
char uri[HTTP_MAX_URI], /* Device or printer URI */
*uriptr; /* Pointer into URI */
*uriptr, /* Pointer into URI */
evefile[1024] = ""; /* IPP Everywhere PPD file */
int maxrate; /* Maximum baud rate */
char baudrate[255]; /* Baud rate string */
const char *name, /* Pointer to class name */
@@ -1172,7 +1149,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
char filename[1024]; /* PPD filename */
ppd_file_t *ppd; /* PPD information */
char buffer[1024]; /* Buffer */
int bytes; /* Number of bytes */
ssize_t bytes; /* Number of bytes */
http_status_t get_status; /* Status of GET */
@@ -1194,7 +1171,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
else if ((fd = cupsTempFd(filename, sizeof(filename))) >= 0)
{
while ((bytes = httpRead2(http, buffer, sizeof(buffer))) > 0)
write(fd, buffer, bytes);
write(fd, buffer, (size_t)bytes);
close(fd);
@@ -1211,8 +1188,10 @@ do_am_printer(http_t *http, /* I - HTTP connection */
}
else
{
int linenum; /* Line number */
fprintf(stderr, "ERROR: Unable to open PPD file %s: %s\n",
filename, ppdErrorString(ppdLastError(&bytes)));
filename, ppdErrorString(ppdLastError(&linenum)));
}
}
else
@@ -1351,7 +1330,9 @@ do_am_printer(http_t *http, /* I - HTTP connection */
if (!file)
{
var = cgiGetVariable("PPD_NAME");
if (strcmp(var, "__no_change__"))
if (!strcmp(var, "everywhere"))
get_printer_ppd(cgiGetVariable("DEVICE_URI"), evefile, sizeof(evefile));
else if (strcmp(var, "__no_change__"))
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
NULL, var);
}
@@ -1380,7 +1361,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
if ((uriptr = strchr(uri, '?')) == NULL)
uriptr = uri + strlen(uri);
snprintf(uriptr, sizeof(uri) - (uriptr - uri),
snprintf(uriptr, sizeof(uri) - (size_t)(uriptr - uri),
"?baud=%s+bits=%s+parity=%s+flow=%s",
cgiGetVariable("BAUDRATE"), cgiGetVariable("BITS"),
cgiGetVariable("PARITY"), cgiGetVariable("FLOW"));
@@ -1404,6 +1385,11 @@ do_am_printer(http_t *http, /* I - HTTP connection */
if (file)
ippDelete(cupsDoFileRequest(http, request, "/admin/", file->tempfile));
else if (evefile[0])
{
ippDelete(cupsDoFileRequest(http, request, "/admin/", evefile));
unlink(evefile);
}
else
ippDelete(cupsDoRequest(http, request, "/admin/"));
@@ -1881,7 +1867,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
if ((end = strstr(start, "\n")) == NULL)
end = start + strlen(start);
cupsFileWrite(temp, start, end - start);
cupsFileWrite(temp, start, (size_t)(end - start));
cupsFilePutChar(temp, '\n');
if (*end == '\r')
@@ -1917,7 +1903,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
}
else
{
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
cgiSetVariable("refresh_page", "5;URL=/admin/");
cgiStartHTML(cgiText(_("Edit Configuration File")));
cgiCopyTemplateLang("restart.tmpl");
@@ -2006,9 +1992,9 @@ do_config_server(http_t *http) /* I - HTTP connection */
* Allocate memory and load the file into a string buffer...
*/
if ((buffer = calloc(1, info.st_size + 1)) != NULL)
if ((buffer = calloc(1, (size_t)info.st_size + 1)) != NULL)
{
cupsFileRead(cupsd, buffer, info.st_size);
cupsFileRead(cupsd, buffer, (size_t)info.st_size);
cgiSetVariable("CUPSDCONF", buffer);
free(buffer);
}
@@ -2025,7 +2011,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
if (!stat(filename, &info) && info.st_size < (1024 * 1024) &&
(cupsd = cupsFileOpen(filename, "r")) != NULL)
{
if ((buffer = calloc(1, 2 * info.st_size + 1)) != NULL)
if ((buffer = calloc(1, 2 * (size_t)info.st_size + 1)) != NULL)
{
bufend = buffer + 2 * info.st_size - 1;
@@ -2035,7 +2021,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
if (ch == '\\' || ch == '\"')
{
*bufptr++ = '\\';
*bufptr++ = ch;
*bufptr++ = (char)ch;
}
else if (ch == '\n')
{
@@ -2048,7 +2034,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
*bufptr++ = 't';
}
else if (ch >= ' ')
*bufptr++ = ch;
*bufptr++ = (char)ch;
}
*bufptr = '\0';
@@ -3882,7 +3868,7 @@ do_set_sharing(http_t *http) /* I - HTTP connection */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddBoolean(request, IPP_TAG_OPERATION, "printer-is-shared", atoi(shared));
ippAddBoolean(request, IPP_TAG_OPERATION, "printer-is-shared", (char)atoi(shared));
/*
* Do the request and get back a response...
@@ -4096,7 +4082,7 @@ get_option_value(
if ((val = cgiGetVariable(keyword)) == NULL)
return (NULL);
snprintf(bufptr, bufend - bufptr, "%s%s=", prefix, cparam->name);
snprintf(bufptr, (size_t)(bufend - bufptr), "%s%s=", prefix, cparam->name);
bufptr += strlen(bufptr);
prefix = " ";
@@ -4110,7 +4096,7 @@ get_option_value(
number > cparam->maximum.custom_real)
return (NULL);
snprintf(bufptr, bufend - bufptr, "%g", number);
snprintf(bufptr, (size_t)(bufend - bufptr), "%g", number);
break;
case PPD_CUSTOM_INT :
@@ -4120,7 +4106,7 @@ get_option_value(
integer > cparam->maximum.custom_int)
return (NULL);
snprintf(bufptr, bufend - bufptr, "%ld", integer);
snprintf(bufptr, (size_t)(bufend - bufptr), "%ld", integer);
break;
case PPD_CUSTOM_POINTS :
@@ -4138,7 +4124,7 @@ get_option_value(
number_points > cparam->maximum.custom_points)
return (NULL);
snprintf(bufptr, bufend - bufptr, "%g%s", number, uval);
snprintf(bufptr, (size_t)(bufend - bufptr), "%g%s", number, uval);
break;
case PPD_CUSTOM_PASSCODE :
@@ -4218,5 +4204,78 @@ get_points(double number, /* I - Original number */
/*
* End of "$Id: admin.c 11345 2013-10-18 21:14:52Z msweet $".
* 'get_printer_ppd()' - Get an IPP Everywhere PPD file for the given URI.
*/
static char * /* O - Filename or NULL */
get_printer_ppd(const char *uri, /* I - Printer URI */
char *buffer, /* I - Filename buffer */
size_t bufsize) /* I - Size of filename buffer */
{
http_t *http; /* Connection to printer */
ipp_t *request, /* Get-Printer-Attributes request */
*response; /* Get-Printer-Attributes response */
char resolved[1024], /* Resolved URI */
scheme[32], /* URI scheme */
userpass[256], /* Username:password */
host[256], /* Hostname */
resource[256]; /* Resource path */
int port; /* Port number */
/*
* Connect to the printer...
*/
if (strstr(uri, "._tcp"))
{
/*
* Resolve URI...
*/
if (!_httpResolveURI(uri, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL))
{
fprintf(stderr, "ERROR: Unable to resolve \"%s\".\n", uri);
return (NULL);
}
uri = resolved;
}
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK)
{
fprintf(stderr, "ERROR: Bad printer URI \"%s\".\n", uri);
return (NULL);
}
http = httpConnect2(host, port, NULL, AF_UNSPEC, !strcmp(scheme, "ipps") ? HTTP_ENCRYPTION_ALWAYS : HTTP_ENCRYPTION_IF_REQUESTED, 1, 30000, NULL);
if (!http)
{
fprintf(stderr, "ERROR: Unable to connect to \"%s:%d\": %s\n", host, port, cupsLastErrorString());
return (NULL);
}
/*
* Send a Get-Printer-Attributes request...
*/
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
response = cupsDoRequest(http, request, resource);
if (!_ppdCreateFromIPP(buffer, bufsize, response))
fprintf(stderr, "ERROR: Unable to create PPD file: %s\n", strerror(errno));
ippDelete(response);
httpClose(http);
if (buffer[0])
return (buffer);
else
return (NULL);
}
/*
* End of "$Id: admin.c 12516 2015-02-12 20:18:11Z msweet $".
*/
+15 -23
Ver Arquivo
@@ -1,23 +1,16 @@
/*
* "$Id: classes.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: classes.c 11928 2014-06-13 00:08:32Z msweet $"
*
* Class status CGI for CUPS.
* Class status CGI for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Main entry for CGI.
* do_class_op() - Do a class operation.
* show_all_classes() - Show all classes...
* show_class() - Show a single class.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -42,8 +35,7 @@ static void show_class(http_t *http, const char *printer);
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
main(void)
{
const char *pclass; /* Class name */
const char *user; /* Username */
@@ -169,8 +161,8 @@ main(int argc, /* I - Number of command-line arguments */
do_class_op(http, pclass, CUPS_ACCEPT_JOBS, cgiText(_("Accept Jobs")));
else if (!strcmp(op, "reject-jobs"))
do_class_op(http, pclass, CUPS_REJECT_JOBS, cgiText(_("Reject Jobs")));
else if (!strcmp(op, "purge-jobs"))
do_class_op(http, pclass, IPP_PURGE_JOBS, cgiText(_("Purge Jobs")));
else if (!strcmp(op, "cancel-jobs"))
do_class_op(http, pclass, IPP_OP_CANCEL_JOBS, cgiText(_("Cancel Jobs")));
else if (!_cups_strcasecmp(op, "print-test-page"))
cgiPrintTestPage(http, pclass);
else if (!_cups_strcasecmp(op, "move-jobs"))
@@ -286,8 +278,8 @@ do_class_op(http_t *http, /* I - HTTP connection */
cgiCopyTemplateLang("printer-accept.tmpl");
else if (op == CUPS_REJECT_JOBS)
cgiCopyTemplateLang("printer-reject.tmpl");
else if (op == IPP_PURGE_JOBS)
cgiCopyTemplateLang("printer-purge.tmpl");
else if (op == IPP_OP_CANCEL_JOBS)
cgiCopyTemplateLang("printer-cancel-jobs.tmpl");
}
cgiEndHTML();
@@ -554,5 +546,5 @@ show_class(http_t *http, /* I - Connection to server */
/*
* End of "$Id: classes.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: classes.c 11928 2014-06-13 00:08:32Z msweet $".
*/
+18 -36
Ver Arquivo
@@ -1,34 +1,16 @@
/*
* "$Id: help-index.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: help-index.c 12644 2015-05-19 21:22:35Z msweet $"
*
* Online help index routines for CUPS.
* Online help index routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* helpDeleteIndex() - Delete an index, freeing all memory used.
* helpFindNode() - Find a node in an index.
* helpLoadIndex() - Load a help index from disk.
* helpSaveIndex() - Save a help index to disk.
* helpSearchIndex() - Search an index.
* help_add_word() - Add a word to a node.
* help_compile_search() - Convert a search string into a regular expression.
* help_delete_node() - Free all memory used by a node.
* help_delete_word() - Free all memory used by a word.
* help_load_directory() - Load a directory of files into an index.
* help_load_file() - Load a HTML files into an index.
* help_new_node() - Create a new node and add it to an index.
* help_sort_nodes_by_name() - Sort nodes by section, filename, and anchor.
* help_sort_nodes_by_score() - Sort nodes by score and text.
* help_sort_words() - Sort words alphabetically.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -346,7 +328,7 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
mtime = strtol(ptr, &ptr, 10);
offset = strtoll(ptr, &ptr, 10);
length = strtoll(ptr, &ptr, 10);
length = (size_t)strtoll(ptr, &ptr, 10);
while (isspace(*ptr & 255))
ptr ++;
@@ -902,7 +884,7 @@ help_load_file(
DEBUG_printf(("2help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", "
"mtime=%ld)", hi, filename, relative, mtime));
"mtime=%ld)", hi, filename, relative, (long)mtime));
if ((fp = cupsFileOpen(filename, "r")) == NULL)
return (-1);
@@ -1019,14 +1001,14 @@ help_load_file(
*ptr++ = ' ';
if (!cupsFileGets(fp, ptr, sizeof(line) - (ptr - line) - 1))
if (!cupsFileGets(fp, ptr, sizeof(line) - (size_t)(ptr - line) - 1))
break;
}
*ptr = '\0';
if (node)
node->length = offset - node->offset;
node->length = (size_t)(offset - node->offset);
if (!*text)
{
@@ -1179,9 +1161,9 @@ help_load_file(
for (text = ptr, ptr ++; *ptr && isalnum(*ptr & 255); ptr ++);
wordlen = ptr - text;
wordlen = (int)(ptr - text);
memcpy(temp, text, wordlen);
memcpy(temp, text, (size_t)wordlen);
temp[wordlen] = '\0';
ptr --;
@@ -1206,7 +1188,7 @@ help_load_file(
cupsFileClose(fp);
if (node)
node->length = offset - node->offset;
node->length = (size_t)(offset - node->offset);
return (0);
}
@@ -1238,7 +1220,7 @@ help_new_node(const char *filename, /* I - Filename */
n->filename = strdup(filename);
n->anchor = anchor ? strdup(anchor) : NULL;
n->section = (section && *section) ? strdup(section) : NULL;
n->section = *section ? strdup(section) : NULL;
n->text = strdup(text);
n->mtime = mtime;
n->offset = offset;
@@ -1324,5 +1306,5 @@ help_sort_words(help_word_t *w1, /* I - Second word */
/*
* End of "$Id: help-index.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: help-index.c 12644 2015-05-19 21:22:35Z msweet $".
*/
+21 -36
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: ipp-var.c 11890 2014-05-22 13:59:21Z msweet $"
* "$Id: ipp-var.c 12768 2015-06-30 16:13:38Z msweet $"
*
* CGI <-> IPP variable routines for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -50,7 +50,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
{
for (i = 0; lang[i] && i < 15; i ++)
if (isalnum(lang[i] & 255))
locale[i] = tolower(lang[i]);
locale[i] = (char)tolower(lang[i]);
else
locale[i] = '_';
@@ -92,7 +92,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
while ((ch = getc(in)) != EOF)
if (ch == '\\')
getc(in);
else if (ch == '{' && num_attrs < (sizeof(attrs) / sizeof(attrs[0])))
else if (ch == '{' && num_attrs < (int)(sizeof(attrs) / sizeof(attrs[0])))
{
/*
* Grab the name...
@@ -108,7 +108,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
if (ch == '_')
*nameptr++ = '-';
else
*nameptr++ = ch;
*nameptr++ = (char)ch;
}
*nameptr = '\0';
@@ -222,6 +222,9 @@ cgiGetIPPObjects(ipp_t *response, /* I - IPP response */
break;
case IPP_TAG_INTEGER :
if (!strncmp(ippGetName(attr), "time-at-", 8))
break; /* Ignore time-at-xxx */
for (i = 0; !add && i < attr->num_values; i ++)
{
char buf[255]; /* Number buffer */
@@ -902,7 +905,7 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
* Make URI relative to the current server...
*/
strlcpy(url, resource, urlsize);
strlcpy(url, resource, (size_t)urlsize);
}
else
{
@@ -911,17 +914,13 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
*/
if (userpass[0])
snprintf(url, urlsize, "%s://%s@%s:%d%s",
ishttps ? "https" : "http",
userpass, hostname, port, resource);
snprintf(url, (size_t)urlsize, "%s://%s@%s:%d%s", ishttps ? "https" : "http", userpass, hostname, port, resource);
else
snprintf(url, urlsize, "%s://%s:%d%s",
ishttps ? "https" : "http",
hostname, port, resource);
snprintf(url, (size_t)urlsize, "%s://%s:%d%s", ishttps ? "https" : "http", hostname, port, resource);
}
}
else
strlcpy(url, uri, urlsize);
strlcpy(url, uri, (size_t)urlsize);
return (url);
}
@@ -1023,7 +1022,7 @@ cgiSetIPPObjectVars(
*valptr++ = ' ';
}
remaining = sizeof(value) - (valptr - value);
remaining = sizeof(value) - (size_t)(valptr - value);
if (!strcmp(attr->values[i].string.text, "printer-stopped"))
strlcpy(valptr, _("Printer Paused"), remaining);
@@ -1161,7 +1160,7 @@ cgiSetIPPObjectVars(
for (i = 0; i < attr->num_values; i ++)
{
if (i)
strlcat(valptr, ", ", sizeof(value) - (valptr - value));
strlcat(valptr, ", ", sizeof(value) - (size_t)(valptr - value));
valptr += strlen(valptr);
@@ -1176,22 +1175,22 @@ cgiSetIPPObjectVars(
break;
case IPP_TAG_BOOLEAN :
snprintf(valptr, sizeof(value) - (valptr - value),
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
"%d", attr->values[i].boolean);
break;
case IPP_TAG_NOVALUE :
strlcat(valptr, "novalue", sizeof(value) - (valptr - value));
strlcat(valptr, "novalue", sizeof(value) - (size_t)(valptr - value));
break;
case IPP_TAG_RANGE :
snprintf(valptr, sizeof(value) - (valptr - value),
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
"%d-%d", attr->values[i].range.lower,
attr->values[i].range.upper);
break;
case IPP_TAG_RESOLUTION :
snprintf(valptr, sizeof(value) - (valptr - value),
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
"%dx%d%s", attr->values[i].resolution.xres,
attr->values[i].resolution.yres,
attr->values[i].resolution.units == IPP_RES_PER_INCH ?
@@ -1206,21 +1205,7 @@ cgiSetIPPObjectVars(
* Rewrite URIs...
*/
if (!strcmp(name, "member_uris"))
{
char url[1024]; /* URL for class member... */
cgiRewriteURL(attr->values[i].string.text, url,
sizeof(url), NULL);
snprintf(valptr, sizeof(value) - (valptr - value),
"<A HREF=\"%s\">%s</A>", url,
strrchr(attr->values[i].string.text, '/') + 1);
}
else
cgiRewriteURL(attr->values[i].string.text, valptr,
sizeof(value) - (valptr - value), NULL);
cgiRewriteURL(attr->values[i].string.text, valptr, (int)(sizeof(value) - (size_t)(valptr - value)), NULL);
break;
}
@@ -1232,7 +1217,7 @@ cgiSetIPPObjectVars(
case IPP_TAG_LANGUAGE :
case IPP_TAG_MIMETYPE :
strlcat(valptr, attr->values[i].string.text,
sizeof(value) - (valptr - value));
sizeof(value) - (size_t)(valptr - value));
break;
case IPP_TAG_BEGIN_COLLECTION :
@@ -1565,5 +1550,5 @@ cgiText(const char *message) /* I - Message */
/*
* End of "$Id: ipp-var.c 11890 2014-05-22 13:59:21Z msweet $".
* End of "$Id: ipp-var.c 12768 2015-06-30 16:13:38Z msweet $".
*/
+11 -17
Ver Arquivo
@@ -1,21 +1,16 @@
/*
* "$Id: jobs.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: jobs.c 11558 2014-02-06 18:33:34Z msweet $"
*
* Job status CGI for CUPS.
* Job status CGI for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Main entry for CGI.
* do_job_op() - Do a job operation.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -37,8 +32,7 @@ static void do_job_op(http_t *http, int job_id, ipp_op_t op);
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
main(void)
{
http_t *http; /* Connection to the server */
const char *op; /* Operation name */
@@ -210,5 +204,5 @@ do_job_op(http_t *http, /* I - HTTP connection */
/*
* End of "$Id: jobs.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: jobs.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+15 -23
Ver Arquivo
@@ -1,23 +1,16 @@
/*
* "$Id: printers.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: printers.c 11928 2014-06-13 00:08:32Z msweet $"
*
* Printer status CGI for CUPS.
* Printer status CGI for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Main entry for CGI.
* do_printer_op() - Do a printer operation.
* show_all_printers() - Show all printers...
* show_printer() - Show a single printer.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -43,8 +36,7 @@ static void show_printer(http_t *http, const char *printer);
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
main(void)
{
const char *printer; /* Printer name */
const char *user; /* Username */
@@ -172,8 +164,8 @@ main(int argc, /* I - Number of command-line arguments */
do_printer_op(http, printer, CUPS_ACCEPT_JOBS, cgiText(_("Accept Jobs")));
else if (!strcmp(op, "reject-jobs"))
do_printer_op(http, printer, CUPS_REJECT_JOBS, cgiText(_("Reject Jobs")));
else if (!strcmp(op, "purge-jobs"))
do_printer_op(http, printer, IPP_PURGE_JOBS, cgiText(_("Purge Jobs")));
else if (!strcmp(op, "cancel-jobs"))
do_printer_op(http, printer, IPP_OP_CANCEL_JOBS, cgiText(_("Cancel Jobs")));
else if (!_cups_strcasecmp(op, "print-self-test-page"))
cgiPrintCommand(http, printer, "PrintSelfTestPage",
cgiText(_("Print Self-Test Page")));
@@ -293,8 +285,8 @@ do_printer_op(http_t *http, /* I - HTTP connection */
cgiCopyTemplateLang("printer-accept.tmpl");
else if (op == CUPS_REJECT_JOBS)
cgiCopyTemplateLang("printer-reject.tmpl");
else if (op == IPP_PURGE_JOBS)
cgiCopyTemplateLang("printer-purge.tmpl");
else if (op == IPP_OP_CANCEL_JOBS)
cgiCopyTemplateLang("printer-cancel-jobs.tmpl");
}
cgiEndHTML();
@@ -574,5 +566,5 @@ show_printer(http_t *http, /* I - Connection to server */
/*
* End of "$Id: printers.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: printers.c 11928 2014-06-13 00:08:32Z msweet $".
*/
+14 -20
Ver Arquivo
@@ -1,22 +1,16 @@
/*
* "$Id: search.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: search.c 11558 2014-02-06 18:33:34Z msweet $"
*
* Search routines for CUPS.
* Search routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* cgiCompileSearch() - Compile a search string.
* cgiDoSearch() - Do a search of some text.
* cgiFreeSearch() - Free a compiled search context.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -38,12 +32,12 @@ cgiCompileSearch(const char *query) /* I - Query string */
char *s, /* Regular expression string */
*sptr, /* Pointer into RE string */
*sword; /* Pointer to start of word */
int slen; /* Allocated size of RE string */
size_t slen; /* Allocated size of RE string */
const char *qptr, /* Pointer into query string */
*qend; /* End of current word */
const char *prefix; /* Prefix to add to next word */
int quoted; /* Word is quoted */
int wlen; /* Word length */
size_t wlen; /* Word length */
char *lword; /* Last word in query */
@@ -139,7 +133,7 @@ cgiCompileSearch(const char *query) /* I - Query string */
for (qend = qptr + 1; *qend && !isspace(*qend); qend ++);
}
wlen = qend - qptr;
wlen = (size_t)(qend - qptr);
/*
* Look for logic words: AND, OR
@@ -174,7 +168,7 @@ cgiCompileSearch(const char *query) /* I - Query string */
* string + RE overhead...
*/
wlen = (sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
wlen = (size_t)(sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
if (lword)
wlen += strlen(lword);
@@ -377,5 +371,5 @@ cgiFreeSearch(void *search) /* I - Search context */
/*
* End of "$Id: search.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: search.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+20 -63
Ver Arquivo
@@ -1,27 +1,16 @@
/*
* "$Id: template.c 11688 2014-03-05 21:11:32Z msweet $"
* "$Id: template.c 12700 2015-06-08 18:32:35Z msweet $"
*
* CGI template function.
* CGI template function.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* cgiCopyTemplateFile() - Copy a template file and replace all the
* '{variable}' strings with the variable value.
* cgiCopyTemplateLang() - Copy a template file using a language...
* cgiGetTemplateDir() - Get the templates directory...
* cgiSetServerVersion() - Set the server name and CUPS version...
* cgi_copy() - Copy the template file, substituting as needed...
* cgi_puts() - Put a string to the output file, quoting as
* needed...
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
#include "cgi-private.h"
@@ -266,7 +255,7 @@ cgi_copy(FILE *out, /* I - Output file */
else if (s > name && ch == '?')
break;
else if (s < (name + sizeof(name) - 1))
*s++ = ch;
*s++ = (char)ch;
*s = '\0';
@@ -443,7 +432,7 @@ cgi_copy(FILE *out, /* I - Output file */
* {name~refex?true:false} Regex match
*/
op = ch;
op = (char)ch;
if (ch == '?')
{
@@ -486,7 +475,7 @@ cgi_copy(FILE *out, /* I - Output file */
innerptr = innername;
while ((ch = getc(in)) != EOF && ch != '}')
if (innerptr < (innername + sizeof(innername) - 1))
*innerptr++ = ch;
*innerptr++ = (char)ch;
*innerptr = '\0';
if (innername[0] == '#')
@@ -498,26 +487,26 @@ cgi_copy(FILE *out, /* I - Output file */
if ((innerval = cgiGetArray(innername, atoi(innerptr) - 1)) == NULL)
*s = '\0';
else
strlcpy(s, innerval, sizeof(compare) - (s - compare));
strlcpy(s, innerval, sizeof(compare) - (size_t)(s - compare));
}
else if (innername[0] == '?')
{
if ((innerval = cgiGetArray(innername + 1, element)) == NULL)
*s = '\0';
else
strlcpy(s, innerval, sizeof(compare) - (s - compare));
strlcpy(s, innerval, sizeof(compare) - (size_t)(s - compare));
}
else if ((innerval = cgiGetArray(innername, element)) == NULL)
snprintf(s, sizeof(compare) - (s - compare), "{%s}", innername);
snprintf(s, sizeof(compare) - (size_t)(s - compare), "{%s}", innername);
else
strlcpy(s, innerval, sizeof(compare) - (s - compare));
strlcpy(s, innerval, sizeof(compare) - (size_t)(s - compare));
s += strlen(s);
}
else if (ch == '\\')
*s++ = getc(in);
*s++ = (char)getc(in);
else
*s++ = ch;
*s++ = (char)ch;
*s = '\0';
@@ -659,39 +648,7 @@ cgi_puts(const char *s, /* I - String to output */
while (*s)
{
if (*s == '<')
{
/*
* Pass <A HREF="url"> and </A>, otherwise quote it...
*/
if (!_cups_strncasecmp(s, "<A HREF=\"", 9))
{
fputs("<A HREF=\"", out);
s += 9;
while (*s && *s != '\"')
{
if (*s == '&')
fputs("&amp;", out);
else
putc(*s, out);
s ++;
}
if (*s)
s ++;
fputs("\">", out);
}
else if (!_cups_strncasecmp(s, "</A>", 4))
{
fputs("</A>", out);
s += 3;
}
else
fputs("&lt;", out);
}
fputs("&lt;", out);
else if (*s == '>')
fputs("&gt;", out);
else if (*s == '\"')
@@ -729,5 +686,5 @@ cgi_puturi(const char *s, /* I - String to output */
/*
* End of "$Id: template.c 11688 2014-03-05 21:11:32Z msweet $".
* End of "$Id: template.c 12700 2015-06-08 18:32:35Z msweet $".
*/
+11 -17
Ver Arquivo
@@ -1,21 +1,16 @@
/*
* "$Id: testcgi.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: testcgi.c 11558 2014-02-06 18:33:34Z msweet $"
*
* CGI test program for CUPS.
* CGI test program for CUPS.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* main() - Test the help index code.
* list_nodes() - List nodes in an array...
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -30,8 +25,7 @@
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
main(void)
{
/*
* Test file upload/multi-part submissions...
@@ -71,5 +65,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
* End of "$Id: testcgi.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: testcgi.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+65 -75
Ver Arquivo
@@ -1,49 +1,20 @@
/*
* "$Id: var.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: var.c 12621 2015-05-06 21:32:18Z msweet $"
*
* CGI form variable and array functions for CUPS.
* CGI form variable and array functions for CUPS.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* cgiCheckVariables() - Check for the presence of "required"
* variables.
* cgiClearVariables() - Clear all form variables.
* cgiGetArray() - Get an element from a form array.
* cgiGetCookie() - Get a cookie value.
* cgiGetFile() - Get the file (if any) that was submitted in
* the form.
* cgiGetSize() - Get the size of a form array value.
* cgiGetVariable() - Get a CGI variable from the database.
* cgiInitialize() - Initialize the CGI variable "database".
* cgiIsPOST() - Determine whether this page was POSTed.
* cgiSetArray() - Set array element N to the specified string.
* cgiSetCookie() - Set a cookie value.
* cgiSetSize() - Set the array size.
* cgiSetVariable() - Set a CGI variable in the database.
* cgi_add_variable() - Add a form variable.
* cgi_compare_variables() - Compare two variables.
* cgi_find_variable() - Find a variable.
* cgi_initialize_cookies() - Initialize cookies.
* cgi_initialize_get() - Initialize form variables using the GET
* method.
* cgi_initialize_multipart() - Initialize variables and file using the POST
* method.
* cgi_initialize_post() - Initialize variables using the POST method.
* cgi_initialize_string() - Initialize form variables from a string.
* cgi_passwd() - Catch authentication requests and notify the
* server.
* cgi_set_sid() - Set the CUPS session ID.
* cgi_sort_variables() - Sort all form variables for faster lookup.
* cgi_unlink_file() - Remove the uploaded form.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
* Include necessary headers...
*/
/*#define DEBUG*/
@@ -417,7 +388,7 @@ cgiSetArray(const char *name, /* I - Name of variable */
const char **temp; /* Temporary pointer */
temp = (const char **)realloc((void *)(var->values),
sizeof(char *) * (element + 16));
sizeof(char *) * (size_t)(element + 16));
if (!temp)
return;
@@ -466,9 +437,9 @@ cgiSetCookie(const char *name, /* I - Name */
printf(" expires=%s;", httpGetDateString2(expires, date, sizeof(date)));
}
if (secure)
puts(" secure;");
puts(" httponly; secure;");
else
putchar('\n');
puts(" httponly;");
}
@@ -495,7 +466,7 @@ cgiSetSize(const char *name, /* I - Name of variable */
const char **temp; /* Temporary pointer */
temp = (const char **)realloc((void *)(var->values),
sizeof(char *) * (size + 16));
sizeof(char *) * (size_t)(size + 16));
if (!temp)
return;
@@ -581,7 +552,7 @@ cgi_add_variable(const char *name, /* I - Variable name */
if (form_alloc == 0)
temp_vars = malloc(sizeof(_cgi_var_t) * 16);
else
temp_vars = realloc(form_vars, (form_alloc + 16) * sizeof(_cgi_var_t));
temp_vars = realloc(form_vars, (size_t)(form_alloc + 16) * sizeof(_cgi_var_t));
if (!temp_vars)
return;
@@ -592,7 +563,7 @@ cgi_add_variable(const char *name, /* I - Variable name */
var = form_vars + form_count;
if ((var->values = calloc(element + 1, sizeof(char *))) == NULL)
if ((var->values = calloc((size_t)element + 1, sizeof(char *))) == NULL)
return;
var->name = _cupsStrAlloc(name);
@@ -632,7 +603,7 @@ cgi_find_variable(const char *name) /* I - Name of variable */
key.name = name;
return ((_cgi_var_t *)bsearch(&key, form_vars, form_count, sizeof(_cgi_var_t),
return ((_cgi_var_t *)bsearch(&key, form_vars, (size_t)form_count, sizeof(_cgi_var_t),
(int (*)(const void *, const void *))cgi_compare_variables));
}
@@ -655,6 +626,8 @@ cgi_initialize_cookies(void)
while (*cookie)
{
int skip = 0; /* Skip this cookie? */
/*
* Skip leading whitespace...
*/
@@ -670,9 +643,14 @@ cgi_initialize_cookies(void)
for (ptr = name; *cookie && *cookie != '=';)
if (ptr < (name + sizeof(name) - 1))
{
*ptr++ = *cookie++;
}
else
break;
{
skip = 1;
cookie ++;
}
if (*cookie != '=')
break;
@@ -688,26 +666,38 @@ cgi_initialize_cookies(void)
{
for (cookie ++, ptr = value; *cookie && *cookie != '\"';)
if (ptr < (value + sizeof(value) - 1))
{
*ptr++ = *cookie++;
}
else
break;
{
skip = 1;
cookie ++;
}
if (*cookie == '\"')
cookie ++;
else
skip = 1;
}
else
{
for (ptr = value; *cookie && *cookie != ';';)
if (ptr < (value + sizeof(value) - 1))
{
*ptr++ = *cookie++;
}
else
break;
{
skip = 1;
cookie ++;
}
}
if (*cookie == ';')
cookie ++;
else if (*cookie)
break;
skip = 1;
*ptr = '\0';
@@ -716,7 +706,7 @@ cgi_initialize_cookies(void)
* "$"...
*/
if (name[0] != '$')
if (name[0] != '$' && !skip)
num_cookies = cupsAddOption(name, value, num_cookies, &cookies);
}
}
@@ -769,8 +759,8 @@ cgi_initialize_multipart(
*ptr, /* Pointer into name/filename */
*end; /* End of buffer */
int ch, /* Character from file */
fd, /* Temporary file descriptor */
blen; /* Length of boundary string */
fd; /* Temporary file descriptor */
size_t blen; /* Length of boundary string */
DEBUG_printf(("cgi_initialize_multipart(boundary=\"%s\")\n", boundary));
@@ -835,22 +825,22 @@ cgi_initialize_multipart(
while ((ch = getchar()) != EOF)
{
*ptr++ = ch;
*ptr++ = (char)ch;
if ((ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
if ((size_t)(ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
{
ptr -= blen;
break;
}
if ((ptr - line - blen) >= 8192)
if ((ptr - line - (int)blen) >= 8192)
{
/*
* Write out the first 8k of the buffer...
*/
write(fd, line, 8192);
memmove(line, line + 8192, ptr - line - 8192);
memmove(line, line + 8192, (size_t)(ptr - line - 8192));
ptr -= 8192;
}
}
@@ -860,7 +850,7 @@ cgi_initialize_multipart(
*/
if (ptr > line)
write(fd, line, ptr - line);
write(fd, line, (size_t)(ptr - line));
close(fd);
}
@@ -877,9 +867,9 @@ cgi_initialize_multipart(
while ((ch = getchar()) != EOF)
{
if (ptr < end)
*ptr++ = ch;
*ptr++ = (char)ch;
if ((ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
if ((size_t)(ptr - line) >= blen && !memcmp(ptr - blen, bstring, blen))
{
ptr -= blen;
break;
@@ -979,12 +969,12 @@ cgi_initialize_multipart(
static int /* O - 1 if form data was read */
cgi_initialize_post(void)
{
char *content_length, /* Length of input data (string) */
*data; /* Pointer to form data string */
int length, /* Length of input data */
nbytes, /* Number of bytes read this read() */
tbytes, /* Total number of bytes read */
status; /* Return status */
char *content_length, /* Length of input data (string) */
*data; /* Pointer to form data string */
size_t length, /* Length of input data */
tbytes; /* Total number of bytes read */
ssize_t nbytes; /* Number of bytes read this read() */
int status; /* Return status */
DEBUG_puts("cgi_initialize_post: Initializing variables using POST method...");
@@ -1001,7 +991,7 @@ cgi_initialize_post(void)
* Get the length of the input stream and allocate a buffer for it...
*/
length = atoi(content_length);
length = (size_t)strtol(content_length, NULL, 10);
data = malloc(length + 1);
if (data == NULL)
@@ -1011,8 +1001,8 @@ cgi_initialize_post(void)
* Read the data into the buffer...
*/
for (tbytes = 0; tbytes < length; tbytes += nbytes)
if ((nbytes = read(0, data + tbytes, length - tbytes)) < 0)
for (tbytes = 0; tbytes < length; tbytes += (size_t)nbytes)
if ((nbytes = read(0, data + tbytes, (size_t)(length - tbytes))) < 0)
{
if (errno != EAGAIN)
{
@@ -1126,7 +1116,7 @@ cgi_initialize_string(const char *data) /* I - Form data string */
ch = *data - '0';
if (ch > 9)
ch -= 7;
*s = ch << 4;
*s = (char)(ch << 4);
data ++;
ch = *data - '0';
@@ -1264,7 +1254,7 @@ cgi_sort_variables(void)
if (form_count < 2)
return;
qsort(form_vars, form_count, sizeof(_cgi_var_t),
qsort(form_vars, (size_t)form_count, sizeof(_cgi_var_t),
(int (*)(const void *, const void *))cgi_compare_variables);
#ifdef DEBUG
@@ -1307,5 +1297,5 @@ cgi_unlink_file(void)
/*
* End of "$Id: var.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: var.c 12621 2015-05-06 21:32:18Z msweet $".
*/
-116
Ver Arquivo
@@ -1,116 +0,0 @@
/*
* "$Id: websearch.c 1531 2009-05-22 21:50:50Z msweet $"
*
* Web search program for www.cups.org.
*
* Copyright 2007-2009 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Usage:
*
* websearch directory "search string"
*
* Contents:
*
* main() - Search a directory of help files.
* list_nodes() - List matching nodes.
*/
/*
* Include necessary headers...
*/
#include "cgi.h"
/*
* Local functions...
*/
static void list_nodes(help_index_t *hi, const char *title,
cups_array_t *nodes);
/*
* 'main()' - Test the help index code.
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
help_index_t *hi, /* Help index */
*search; /* Search index */
char indexname[1024]; /* Name of index file */
if (argc != 3)
{
puts("Usage: websearch directory \"search terms\"");
return (1);
}
/*
* Load the help index...
*/
snprintf(indexname, sizeof(indexname), "%s/.index", argv[1]);
hi = helpLoadIndex(indexname, argv[1]);
/*
* Do any searches...
*/
search = helpSearchIndex(hi, argv[2], NULL, NULL);
if (search)
list_nodes(hi, argv[1], search->sorted);
/*
* Return with no errors...
*/
return (0);
}
/*
* 'list_nodes()' - List nodes in an array...
*/
static void
list_nodes(help_index_t *hi, /* I - Help index */
const char *title, /* I - Title string */
cups_array_t *nodes) /* I - Nodes */
{
help_node_t *node, /* Current node */
*file; /* File node */
printf("%d\n", cupsArrayCount(nodes));
for (node = (help_node_t *)cupsArrayFirst(nodes);
node;
node = (help_node_t *)cupsArrayNext(nodes))
{
if (node->anchor)
{
file = helpFindNode(hi, node->filename, NULL);
printf("%d|%s#%s|%s|%s\n", node->score, node->filename, node->anchor,
node->text, file ? file->text : node->filename);
}
else
printf("%d|%s|%s|%s\n", node->score, node->filename, node->text,
node->text);
}
}
/*
* End of "$Id: websearch.c 1531 2009-05-22 21:50:50Z msweet $".
*/
+4 -4
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
# "$Id: Makefile 12533 2015-02-27 12:30:26Z msweet $"
#
# Configuration file makefile for CUPS.
#
# Copyright 2007-2012 by Apple Inc.
# Copyright 2007-2015 by Apple Inc.
# Copyright 1993-2006 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
@@ -76,8 +76,8 @@ install-data:
else \
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \
fi ; \
$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \
done
$(INSTALL_CONFIG) -g $(CUPS_GROUP) cupsd.conf $(SERVERROOT)/cupsd.conf.default
$(INSTALL_DIR) -m 755 $(DATADIR)/mime
for file in $(REPLACE); do \
if test -r $(DATADIR)/mime/$$file ; then \
@@ -139,5 +139,5 @@ uninstall:
#
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
# End of "$Id: Makefile 12533 2015-02-27 12:30:26Z msweet $".
#
+4 -12
Ver Arquivo
@@ -1,7 +1,5 @@
#
# "$Id: cups-files.conf.in 11201 2013-07-26 21:27:27Z msweet $"
#
# Sample file/directory/user/group configuration file for the CUPS scheduler.
# File/directory/user/group configuration file for the CUPS scheduler.
# See "man cups-files.conf" for a complete description of this file.
#
@@ -17,6 +15,7 @@
#Group @CUPS_GROUP@
# Administrator user group, used to match @SYSTEM in cupsd.conf policy rules...
# This cannot contain the Group value for security reasons...
SystemGroup @CUPS_SYSTEM_GROUPS@
@CUPS_SYSTEM_AUTHKEY@
@@ -76,11 +75,8 @@ PageLog @CUPS_LOGDIR@/page_log
# Location of helper programs...
#ServerBin @CUPS_SERVERBIN@
# SSL/TLS certificate for the scheduler...
#ServerCertificate @CUPS_SERVERCERT@
# SSL/TLS private key for the scheduler...
#ServerKey @CUPS_SERVERKEY@
# SSL/TLS keychain for the scheduler...
#ServerKeychain @CUPS_SERVERKEYCHAIN@
# Location of other configuration files...
#ServerRoot @CUPS_SERVERROOT@
@@ -95,7 +91,3 @@ PageLog @CUPS_LOGDIR@/page_log
# scheduler startup and cannot be one of the standard (public) temporary
# directory locations for security reasons...
#TempDir @CUPS_REQUESTS@/tmp
#
# End of "$Id: cups-files.conf.in 11201 2013-07-26 21:27:27Z msweet $".
#
+9 -7
Ver Arquivo
@@ -1,13 +1,12 @@
#
# "$Id: cupsd.conf.in 11025 2013-06-07 01:00:33Z msweet $"
#
# Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a
# Configuration file for the CUPS scheduler. See "man cupsd.conf" for a
# complete description of this file.
#
# Log general information in error_log - change "@CUPS_LOG_LEVEL@" to "debug"
# for troubleshooting...
LogLevel @CUPS_LOG_LEVEL@
@CUPS_PAGE_LOG_FORMAT@
# Only listen for connections from the local machine.
Listen localhost:@DEFAULT_IPP_PORT@
@@ -40,6 +39,13 @@ WebInterface @CUPS_WEBIF@
Order allow,deny
</Location>
# Restrict access to log files...
<Location /admin/log>
AuthType Default
Require user @SYSTEM
Order allow,deny
</Location>
# Set the default printer/job policies...
<Policy default>
# Job/subscription privacy...
@@ -128,7 +134,3 @@ WebInterface @CUPS_WEBIF@
Order deny,allow
</Limit>
</Policy>
#
# End of "$Id: cupsd.conf.in 11025 2013-06-07 01:00:33Z msweet $".
#
+11 -3
Ver Arquivo
@@ -7,7 +7,7 @@
# VERSIONS OF CUPS. Instead, create a "local.types" file that
# reflects your local configuration changes.
#
# Copyright 2007-2014 by Apple Inc.
# Copyright 2007-2015 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
@@ -37,6 +37,7 @@
# 100=default, 200=highest)
# printable(offset,length) True if bytes are printable 8-bit chars
# (CR, NL, TAB, BS, 32-126, 128-254)
# regex(offset,"regex") True if bytes match regular expression
# string(offset,"string") True if bytes are identical to string
# istring(offset,"string") True if bytes are identical to
# case-insensitive string
@@ -70,7 +71,7 @@
#
#application/msword doc string(0,<D0CF11E0A1B11AE1>)
application/pdf pdf string(0,%PDF)
application/pdf pdf regex(0,^[\n\r]*%PDF)
application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
contains(0,128,<1B>%-12345X) + \
(contains(0,4096,"LANGUAGE=POSTSCRIPT") \
@@ -80,6 +81,13 @@ application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
(contains(0,4096,<0a>%!) + \
!contains(0,4096,"ENTER LANGUAGE")))
application/g-code gcode
application/sla stl string(0,"solid ") + contains(0,4096,"facet") + contains(0,4096,"vertex")
application/vnd.makerbot-s3g x3g
model/amf amf
model/vnd.collada+xml dae
########################################################################
#
# Image files...
@@ -123,7 +131,7 @@ application/x-shell sh printable(0,1024) + string(0,#!) +\
(contains(2,80,/bash) contains(2,80,/ksh)\
contains(2,80,/sh) contains(2,80,/zsh))
application/x-csource c cxx cpp cc C h hpp \
printable(0,1024) + \
printable(0,1024) + ! css + \
(string(0,/*) string(0,//)
string(0,#include) contains(0,1024,<0a>#include) \
string(0,#define) contains(0,1024,<0a>#define))
+2 -8
Ver Arquivo
@@ -1,13 +1,7 @@
#
# "$Id: snmp.conf.in 11025 2013-06-07 01:00:33Z msweet $"
#
# Sample SNMP configuration file for CUPS. See "man cups-snmp.conf" for a
# complete description of this file.
# SNMP configuration file for CUPS. See "man cups-snmp.conf" for a complete
# description of this file.
#
@CUPS_SNMP_ADDRESS@
@CUPS_SNMP_COMMUNITY@
#
# End of "$Id: snmp.conf.in 11025 2013-06-07 01:00:33Z msweet $".
#
+30 -21
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-common.m4 8781 2009-08-28 17:34:54Z mike $"
dnl "$Id: cups-common.m4 12852 2015-08-28 13:29:21Z msweet $"
dnl
dnl Common configuration stuff for CUPS.
dnl
dnl Copyright 2007-2014 by Apple Inc.
dnl Copyright 2007-2015 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -13,18 +13,26 @@ dnl which should have been included with this file. If this file is
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl We need at least autoconf 2.60...
AC_PREREQ(2.60)
dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Version number information...
CUPS_VERSION=1.7.5
CUPS_REVISION=
#if test -z "$CUPS_REVISION" -a -d .svn; then
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
#fi
CUPS_VERSION=2.1.2
case "$CUPS_VERSION" in
*svn)
if test -z "$CUPS_REVISION" -a -d .svn; then
CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
else
CUPS_REVISION=""
fi
;;
*)
CUPS_REVISION=""
;;
esac
CUPS_BUILD="cups-$CUPS_VERSION"
AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ],
@@ -33,8 +41,8 @@ AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" str
AC_SUBST(CUPS_VERSION)
AC_SUBST(CUPS_REVISION)
AC_SUBST(CUPS_BUILD)
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "AC_PACKAGE_NAME v$CUPS_VERSION$CUPS_REVISION")
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "AC_PACKAGE_NAME/$CUPS_VERSION$CUPS_REVISION")
dnl Default compiler flags...
CFLAGS="${CFLAGS:=}"
@@ -89,7 +97,7 @@ fi
AC_SUBST(INSTALLSTATIC)
dnl Check for pkg-config, which is used for some other tests later on...
AC_PATH_PROG(PKGCONFIG, pkg-config)
AC_PATH_TOOL(PKGCONFIG, pkg-config)
dnl Check for libraries...
AC_SEARCH_LIBS(abs, m, AC_DEFINE(HAVE_ABS))
@@ -134,11 +142,10 @@ AC_CHECK_HEADER(stdint.h,AC_DEFINE(HAVE_STDINT_H))
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
AC_CHECK_HEADER(asl.h,AC_DEFINE(HAVE_ASL_H))
dnl Checks for iconv.h and iconv_open
AC_CHECK_HEADER(iconv.h,
@@ -147,6 +154,9 @@ AC_CHECK_HEADER(iconv.h,
AC_SEARCH_LIBS(iconv_open,iconv,
AC_DEFINE(HAVE_ICONV_H)
SAVELIBS="$SAVELIBS $LIBS")
AC_SEARCH_LIBS(libiconv_open,iconv,
AC_DEFINE(HAVE_ICONV_H)
SAVELIBS="$SAVELIBS $LIBS")
LIBS="$SAVELIBS")
dnl Checks for Mini-XML (www.minixml.org)...
@@ -202,6 +212,9 @@ AC_CHECK_FUNCS(sigaction)
dnl Checks for wait functions.
AC_CHECK_FUNCS(waitpid wait3)
dnl Check for posix_spawn
AC_CHECK_FUNCS(posix_spawn)
dnl See if the tm structure has the tm_gmtoff member...
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
AC_TRY_COMPILE([#include <time.h>],[struct tm t;
@@ -314,7 +327,7 @@ DBUSDIR=""
DBUS_NOTIFIER=""
DBUS_NOTIFIERLIBS=""
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$uname" != xDarwin; then
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
@@ -359,7 +372,6 @@ case $uname in
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
AC_CHECK_HEADER(IOKit/pwr_mgt/IOPMLibPrivate.h,AC_DEFINE(HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H))
dnl Check for dynamic store function...
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName)
@@ -369,9 +381,6 @@ case $uname in
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
AC_CHECK_FUNCS(mbr_uid_to_uuid)
dnl Check for the vproc_transaction_begin/end stuff...
AC_CHECK_FUNCS(vproc_transaction_begin)
dnl Need <dlfcn.h> header...
AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H))
@@ -465,5 +474,5 @@ esac
AC_SUBST(BUILDDIRS)
dnl
dnl End of "$Id: cups-common.m4 8781 2009-08-28 17:34:54Z mike $".
dnl End of "$Id: cups-common.m4 12852 2015-08-28 13:29:21Z msweet $".
dnl
+34 -84
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-compiler.m4 7871 2008-08-27 21:12:43Z mike $"
dnl "$Id: cups-compiler.m4 12742 2015-06-23 14:48:53Z msweet $"
dnl
dnl Compiler stuff for CUPS.
dnl
@@ -103,14 +103,14 @@ if test -n "$GCC"; then
fi
# Generate position-independent code as needed...
if test $PICFLAG = 1 -a $uname != AIX; then
if test $PICFLAG = 1; then
OPTIM="-fPIC $OPTIM"
fi
# The -fstack-protector option is available with some versions of
# GCC and adds "stack canaries" which detect when the return address
# has been overwritten, preventing many types of exploit attacks.
AC_MSG_CHECKING(if GCC supports -fstack-protector)
AC_MSG_CHECKING(whether compiler supports -fstack-protector)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector"
AC_TRY_LINK(,,
@@ -130,7 +130,7 @@ if test -n "$GCC"; then
# exploits that depend on a fixed address for common functions.
#
# Not available to LSB binaries...
AC_MSG_CHECKING(if GCC supports -fPIE)
AC_MSG_CHECKING(whether compiler supports -fPIE)
OLDCFLAGS="$CFLAGS"
case "$uname" in
Darwin*)
@@ -156,18 +156,36 @@ if test -n "$GCC"; then
# Add useful warning options for tracking down problems...
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
AC_MSG_CHECKING(whether compiler supports -Wno-unused-result)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-unused-result"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wno-unused-result"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
AC_MSG_CHECKING(whether compiler supports -Wsign-conversion)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wsign-conversion"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wsign-conversion"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
AC_MSG_CHECKING(whether compiler supports -Wno-tautological-compare)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wno-tautological-compare"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
# Additional warning options for development testing...
if test -d .svn; then
OPTIM="-Wshadow -Werror $OPTIM"
else
AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wno-tautological-compare"
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
OPTIM="-Werror $OPTIM"
fi
fi
@@ -192,40 +210,6 @@ if test -n "$GCC"; then
else
# Add vendor-specific compiler options...
case $uname in
AIX*)
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O2 -qmaxmem=6000"
else
OPTIM="$with_optim $OPTIM"
fi
fi
;;
HP-UX*)
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="+O2"
else
OPTIM="$with_optim $OPTIM"
fi
fi
CFLAGS="-Ae $CFLAGS"
if test $PICFLAG = 1; then
OPTIM="+z $OPTIM"
fi
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O"
else
OPTIM="$with_optim"
fi
fi
;;
SunOS*)
# Solaris
if test -z "$OPTIM"; then
@@ -236,20 +220,6 @@ else
fi
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
;;
UNIX_SVR*)
# UnixWare
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
OPTIM="-O"
else
OPTIM="$with_optim $OPTIM"
fi
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
@@ -259,7 +229,7 @@ else
# should contribute the necessary options to
# cups-support@cups.org...
echo "Building CUPS with default compiler optimizations; contact"
echo "cups-bugs@cups.org with uname and compiler options needed"
echo "cups-devel@cups.org with uname and compiler options needed"
echo "for your platform, or set the CFLAGS and LDFLAGS environment"
echo "variables before running configure."
;;
@@ -268,33 +238,13 @@ fi
# Add general compiler options per platform...
case $uname in
HP-UX*)
# HP-UX 10.20 (at least) needs this definition to get the
# h_errno global...
OPTIM="$OPTIM -D_XOPEN_SOURCE_EXTENDED"
# HP-UX 11.00 (at least) needs this definition to get the
# u_short type used by the IP headers...
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
# HP-UX 11.23 (at least) needs this definition to get the
# IPv6 header to work...
OPTIM="$OPTIM -D_HPUX_SOURCE"
;;
Linux*)
# glibc 2.8 and higher breaks peer credentials unless you
# define _GNU_SOURCE...
OPTIM="$OPTIM -D_GNU_SOURCE"
;;
OSF*)
# Tru64 UNIX aka Digital UNIX aka OSF/1 need to be told
# to be POSIX-compliant...
OPTIM="$OPTIM -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_OSF_SOURCE"
;;
esac
dnl
dnl End of "$Id: cups-compiler.m4 7871 2008-08-27 21:12:43Z mike $".
dnl End of "$Id: cups-compiler.m4 12742 2015-06-23 14:48:53Z msweet $".
dnl
+14 -5
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z mike $"
dnl "$Id: cups-defaults.m4 12846 2015-08-26 18:26:22Z msweet $"
dnl
dnl Default cupsd configuration settings for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 2007-2015 by Apple Inc.
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -78,12 +78,21 @@ AC_SUBST(CUPS_LOG_LEVEL)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
dnl Default AccessLogLevel
AC_ARG_WITH(access_log_level, [ --with-access-log-level set default AccessLogLevel value, default=actions],
AC_ARG_WITH(access_log_level, [ --with-access-log-level set default AccessLogLevel value, default=none],
CUPS_ACCESS_LOG_LEVEL="$withval",
CUPS_ACCESS_LOG_LEVEL="actions")
CUPS_ACCESS_LOG_LEVEL="none")
AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
dnl Default PageLogFormat
AC_ARG_ENABLE(page_logging, [ --enable-page-logging enable page_log by default])
if test "x$enable_page_logging" = xyes; then
CUPS_PAGE_LOG_FORMAT=""
else
CUPS_PAGE_LOG_FORMAT="PageLogFormat"
fi
AC_SUBST(CUPS_PAGE_LOG_FORMAT)
dnl Default Browsing
AC_ARG_ENABLE(browsing, [ --disable-browsing disable Browsing by default])
if test "x$enable_browsing" = xno; then
@@ -400,5 +409,5 @@ AC_SUBST(CUPS_WEBIF)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
dnl
dnl End of "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z mike $".
dnl End of "$Id: cups-defaults.m4 12846 2015-08-26 18:26:22Z msweet $".
dnl
+10 -132
Ver Arquivo
@@ -1,16 +1,16 @@
dnl
dnl "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $"
dnl "$Id: cups-directories.m4 11717 2014-03-21 16:42:53Z msweet $"
dnl
dnl Directory stuff for CUPS.
dnl Directory stuff for CUPS.
dnl
dnl Copyright 2007-2013 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2014 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_PREFIX_DEFAULT(/)
@@ -107,11 +107,6 @@ if test "$libdir" = "\${exec_prefix}/lib"; then
libdir="$exec_prefix/lib64"
fi
;;
HP-UX*)
if test -d /usr/lib/hpux32; then
libdir="$exec_prefix/lib/hpux32"
fi
;;
esac
fi
@@ -126,119 +121,6 @@ fi
AC_SUBST(privateinclude)
AC_SUBST(PRIVATEINCLUDE)
dnl Setup init.d locations...
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="99")
AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="00")
AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],smfmanifestdir="$withval",smfmanifestdir="")
INITDIR=""
INITDDIR=""
RCLEVELS="$rclevels"
RCSTART="$rcstart"
RCSTOP="$rcstop"
SMFMANIFESTDIR=""
if test x$rcdir = x; then
case "$uname" in
AIX*)
INITDIR="/etc/rc.d"
;;
Darwin*)
# Darwin and MacOS X...
if test -x /sbin/launchd; then
INITDDIR="/System/Library/LaunchDaemons"
else
INITDDIR="/System/Library/StartupItems/PrintingServices"
fi
;;
FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
# FreeBSD and OpenBSD
;;
HP-UX*)
INITDIR="/sbin"
RCLEVELS="2"
RCSTART="380"
RCSTOP="620"
;;
Linux | GNU | GNU/k*BSD*)
# Linux/HURD seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
# SuSE
INITDIR="/sbin/init.d"
else
if test -d /etc/init.d; then
# Others
INITDIR="/etc"
else
# RedHat
INITDIR="/etc/rc.d"
fi
fi
RCSTART="81"
RCSTOP="36"
;;
NetBSD*)
# NetBSD
INITDDIR="/etc/rc.d"
;;
OSF1*)
INITDIR="/sbin"
;;
SunOS*)
# Solaris
if test "x$smfmanifestdir" != x; then
SMFMANIFESTDIR=$smfmanifestdir
else
INITDIR="/etc"
RCSTART="81"
fi
;;
*)
INITDIR="/etc"
;;
esac
elif test "x$rcdir" != xno; then
if test "x$rclevels" = x; then
INITDDIR="$rcdir"
else
INITDIR="$rcdir"
fi
fi
AC_SUBST(INITDIR)
AC_SUBST(INITDDIR)
AC_SUBST(RCLEVELS)
AC_SUBST(RCSTART)
AC_SUBST(RCSTOP)
AC_SUBST(SMFMANIFESTDIR)
dnl Xinetd support...
AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],XINETD="$withval",XINETD="")
if test "x$XINETD" = x -a ! -x /sbin/launchd; then
for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
if test -d $dir; then
XINETD="$dir"
break
fi
done
elif test "x$XINETD" = xno; then
XINETD=""
fi
AC_SUBST(XINETD)
dnl LPD sharing support...
AC_ARG_WITH(lpdconfig, [ --with-lpdconfig set URI for LPD config file],
LPDCONFIG="$withval", LPDCONFIG="")
@@ -355,10 +237,6 @@ if test "$localedir" = "\${datarootdir}/locale"; then
CUPS_LOCALEDIR="$datarootdir/locale"
;;
OSF1* | AIX*)
CUPS_LOCALEDIR="$exec_prefix/lib/nls/msg"
;;
*)
# This is the standard System V location...
CUPS_LOCALEDIR="$exec_prefix/lib/locale"
@@ -427,5 +305,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
AC_SUBST(CUPS_STATEDIR)
dnl
dnl End of "$Id: cups-directories.m4 7799 2008-07-25 20:06:08Z mike $".
dnl End of "$Id: cups-directories.m4 11717 2014-03-21 16:42:53Z msweet $".
dnl
+4 -4
Ver Arquivo
@@ -1,9 +1,9 @@
dnl
dnl "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $"
dnl "$Id: cups-dnssd.m4 12845 2015-08-26 18:23:53Z msweet $"
dnl
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 2007-2015 by Apple Inc.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Apple Inc. and are protected by Federal copyright
@@ -26,7 +26,7 @@ DNSSD_BACKEND=""
IPPFIND_BIN=""
IPPFIND_MAN=""
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$uname != xDarwin; then
AC_MSG_CHECKING(for Avahi)
if $PKGCONFIG --exists avahi-client; then
AC_MSG_RESULT(yes)
@@ -82,5 +82,5 @@ AC_SUBST(IPPFIND_BIN)
AC_SUBST(IPPFIND_MAN)
dnl
dnl End of "$Id: cups-dnssd.m4 7890 2008-08-29 22:19:39Z mike $".
dnl End of "$Id: cups-dnssd.m4 12845 2015-08-26 18:23:53Z msweet $".
dnl
+3 -3
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-gssapi.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $"
dnl
dnl GSSAPI/Kerberos library detection for CUPS.
dnl
@@ -22,7 +22,7 @@ LIBGSSAPI=""
AC_SUBST(LIBGSSAPI)
if test x$enable_gssapi != xno; then
AC_PATH_PROG(KRB5CONFIG, krb5-config)
AC_PATH_TOOL(KRB5CONFIG, krb5-config)
if test "x$KRB5CONFIG" != x; then
case "$uname" in
Darwin)
@@ -129,5 +129,5 @@ AC_SUBST(CUPS_DEFAULT_GSSSERVICENAME)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
dnl
dnl End of "$Id: cups-gssapi.m4 11324 2013-10-04 03:11:42Z msweet $".
dnl End of "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $"
dnl "$Id: cups-largefile.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl
dnl Large file support stuff for CUPS.
dnl
@@ -48,5 +48,5 @@ fi
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
dnl
dnl End of "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $".
dnl End of "$Id: cups-largefile.m4 11324 2013-10-04 03:11:42Z msweet $".
dnl
-43
Ver Arquivo
@@ -1,43 +0,0 @@
dnl
dnl "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $"
dnl
dnl launchd stuff for CUPS.
dnl
dnl Copyright 2007-2010 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
DEFAULT_LAUNCHD_CONF=""
LAUNCHDLIBS=""
if test x$enable_launchd != xno; then
AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD))
AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
case "$uname" in
Darwin*)
# Darwin, MacOS X
DEFAULT_LAUNCHD_CONF="/System/Library/LaunchDaemons/org.cups.cupsd.plist"
# liblaunch is already part of libSystem
;;
*)
# All others; this test will need to be updated
;;
esac
fi
AC_SUBST(DEFAULT_LAUNCHD_CONF)
AC_SUBST(LAUNCHDLIBS)
dnl
dnl End of "$Id: cups-launchd.m4 6649 2007-07-11 21:46:42Z mike $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $"
dnl "$Id: cups-libtool.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl
dnl Libtool stuff for CUPS.
dnl
@@ -35,5 +35,5 @@ if test x$LIBTOOL != x; then
fi
dnl
dnl End of "$Id: cups-libtool.m4 6649 2007-07-11 21:46:42Z mike $".
dnl End of "$Id: cups-libtool.m4 11324 2013-10-04 03:11:42Z msweet $".
dnl
+14 -14
Ver Arquivo
@@ -1,16 +1,16 @@
dnl
dnl "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $"
dnl "$Id: cups-manpages.m4 11342 2013-10-18 20:36:01Z msweet $"
dnl
dnl Manpage stuff for CUPS.
dnl Manpage stuff for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2013 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 file is missing or damaged, see the license at "http://www.cups.org/".
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
dnl Fix "mandir" variable...
@@ -22,8 +22,8 @@ fi
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
case "$uname" in
Darwin* | Linux | GNU | *BSD* | AIX*)
# Darwin, MacOS X, Linux, GNU HURD, *BSD, and AIX
Darwin* | Linux | GNU | *BSD*)
# Darwin, MacOS X, Linux, GNU HURD, and *BSD
mandir="/usr/share/man"
AMANDIR="/usr/share/man"
PMANDIR="/usr/share/man"
@@ -45,8 +45,8 @@ AC_SUBST(PMANDIR)
dnl Setup manpage extensions...
case "$uname" in
SunOS* | HP-UX*)
# Solaris and HP-UX
SunOS*)
# Solaris
MAN1EXT=1
MAN5EXT=5
MAN7EXT=7
@@ -78,5 +78,5 @@ AC_SUBST(MAN8EXT)
AC_SUBST(MAN8DIR)
dnl
dnl End of "$Id: cups-manpages.m4 6649 2007-07-11 21:46:42Z mike $".
dnl End of "$Id: cups-manpages.m4 11342 2013-10-18 20:36:01Z msweet $".
dnl
+16 -14
Ver Arquivo
@@ -1,19 +1,24 @@
dnl
dnl "$Id: cups-network.m4 7918 2008-09-08 22:03:01Z mike $"
dnl "$Id: cups-network.m4 12324 2014-12-09 20:28:39Z msweet $"
dnl
dnl Networking stuff for CUPS.
dnl Networking stuff for CUPS.
dnl
dnl Copyright 2007-2011 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2014 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H))
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),,[
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>])
AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(gethostbyaddr, nsl)
AC_SEARCH_LIBS(getifaddrs, nsl, AC_DEFINE(HAVE_GETIFADDRS))
@@ -66,9 +71,6 @@ fi
AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
AC_CHECK_HEADERS(AppleTalk/at_proto.h,AC_DEFINE(HAVE_APPLETALK_AT_PROTO_H),,
[#include <netat/appletalk.h>])
dnl
dnl End of "$Id: cups-network.m4 7918 2008-09-08 22:03:01Z mike $".
dnl End of "$Id: cups-network.m4 12324 2014-12-09 20:28:39Z msweet $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
dnl "$Id: cups-opsys.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl
dnl Operating system stuff for CUPS.
dnl
@@ -35,5 +35,5 @@ case "$uname" in
esac
dnl
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
dnl "$Id: cups-opsys.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl
+9 -14
Ver Arquivo
@@ -1,26 +1,21 @@
dnl
dnl "$Id: cups-pam.m4 7960 2008-09-17 19:42:02Z mike $"
dnl "$Id: cups-pam.m4 11342 2013-10-18 20:36:01Z msweet $"
dnl
dnl PAM stuff for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2013 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support])
AC_ARG_WITH(pam_module, [ --with-pam-module specify the PAM module to use])
dnl Don't use PAM with AIX...
if test $uname = AIX; then
enable_pam=no
fi
PAMDIR=""
PAMFILE="pam.std"
PAMLIBS=""
@@ -98,5 +93,5 @@ AC_SUBST(PAMMOD)
AC_SUBST(PAMMODAUTH)
dnl
dnl End of "$Id: cups-pam.m4 7960 2008-09-17 19:42:02Z mike $".
dnl End of "$Id: cups-pam.m4 11342 2013-10-18 20:36:01Z msweet $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id$"
dnl "$Id: cups-poll.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl
dnl Select/poll stuff for CUPS.
dnl
@@ -18,5 +18,5 @@ AC_CHECK_FUNC(epoll_create, AC_DEFINE(HAVE_EPOLL))
AC_CHECK_FUNC(kqueue, AC_DEFINE(HAVE_KQUEUE))
dnl
dnl End of "$Id$".
dnl End of "$Id: cups-poll.m4 11324 2013-10-04 03:11:42Z msweet $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-scripting.m4 7915 2008-09-07 22:18:29Z mike $"
dnl "$Id: cups-scripting.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl
dnl Scripting configuration stuff for CUPS.
dnl
@@ -85,5 +85,5 @@ if test "x$CUPS_PYTHON" != x; then
fi
dnl
dnl End of "$Id: cups-scripting.m4 7915 2008-09-07 22:18:29Z mike $".
dnl End of "$Id: cups-scripting.m4 11324 2013-10-04 03:11:42Z msweet $".
dnl
+15 -91
Ver Arquivo
@@ -1,16 +1,16 @@
dnl
dnl "$Id: cups-sharedlibs.m4 7630 2008-06-09 22:31:44Z mike $"
dnl "$Id: cups-sharedlibs.m4 11342 2013-10-18 20:36:01Z msweet $"
dnl
dnl Shared library support for CUPS.
dnl Shared library support for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2013 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
PICFLAG=1
@@ -34,51 +34,7 @@ if test x$enable_shared != xno; then
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
;;
UNIX_S*)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\`basename \$@\` -G \$(OPTIM)"
;;
HP-UX*)
case "$uarch" in
ia64)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
;;
*)
LIBCUPS="lib$cupsbase.sl.2"
LIBCUPSCGI="libcupscgi.sl.1"
LIBCUPSIMAGE="libcupsimage.sl.2"
LIBCUPSMIME="libcupsmime.sl.1"
LIBCUPSPPDC="libcupsppdc.sl.1"
DSO="\$(LD)"
DSOXX="\$(LD)"
DSOFLAGS="$DSOFLAGS -b -z +h \`basename \$@\`"
;;
esac
;;
IRIX)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
LIBCUPSMIME="libcupsmime.so.1"
LIBCUPSPPDC="libcupsppdc.so.1"
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
OSF1* | Linux | GNU | *BSD*)
Linux | GNU | *BSD*)
LIBCUPS="lib$cupsbase.so.2"
LIBCUPSCGI="libcupscgi.so.1"
LIBCUPSIMAGE="libcupsimage.so.2"
@@ -98,17 +54,6 @@ if test x$enable_shared != xno; then
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
;;
AIX*)
LIBCUPS="lib${cupsbase}_s.a"
LIBCUPSBASE="${cupsbase}_s"
LIBCUPSCGI="libcupscgi_s.a"
LIBCUPSIMAGE="libcupsimage_s.a"
LIBCUPSMIME="libcupsmime_s.a"
LIBCUPSPPDC="libcupsppdc_s.a"
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)"
;;
*)
echo "Warning: shared libraries may not be supported. Trying -shared"
echo " option with compiler."
@@ -151,19 +96,11 @@ if test x$enable_shared = xno; then
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
else
if test $uname = AIX; then
LINKCUPS="-l${cupsbase}_s"
LINKCUPSIMAGE="-lcupsimage_s"
LINKCUPS="-l${cupsbase}"
LINKCUPSIMAGE="-lcupsimage"
EXTLINKCUPS="-lcups_s"
EXTLINKCUPSIMAGE="-lcupsimage_s"
else
LINKCUPS="-l${cupsbase}"
LINKCUPSIMAGE="-lcupsimage"
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
fi
EXTLINKCUPS="-lcups"
EXTLINKCUPSIMAGE="-lcupsimage"
fi
AC_SUBST(EXTLINKCUPS)
@@ -186,19 +123,6 @@ if test "$DSO" != ":"; then
# need this option, even when the library is installed in a
# standard location...
case $uname in
HP-UX*)
# HP-UX needs the path, even for /usr/lib...
case "$uarch" in
ia64)
DSOFLAGS="-Wl,+s,+b,$libdir $DSOFLAGS"
;;
*)
DSOFLAGS="+s +b $libdir $DSOFLAGS"
;;
esac
LDFLAGS="$LDFLAGS -Wl,+s,+b,$libdir"
EXPORT_LDFLAGS="-Wl,+s,+b,$libdir"
;;
SunOS*)
# Solaris...
if test $exec_prefix != /usr; then
@@ -234,5 +158,5 @@ AC_SUBST(IMGLIBS)
AC_SUBST(EXPORT_LDFLAGS)
dnl
dnl End of "$Id: cups-sharedlibs.m4 7630 2008-06-09 22:31:44Z mike $".
dnl End of "$Id: cups-sharedlibs.m4 11342 2013-10-18 20:36:01Z msweet $".
dnl
+28 -77
Ver Arquivo
@@ -1,34 +1,26 @@
dnl
dnl "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $"
dnl "$Id: cups-ssl.m4 12645 2015-05-20 01:20:52Z msweet $"
dnl
dnl OpenSSL/GNUTLS stuff for CUPS.
dnl TLS stuff for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2015 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_ARG_ENABLE(ssl, [ --disable-ssl disable SSL/TLS support])
AC_ARG_ENABLE(cdsassl, [ --enable-cdsassl use CDSA for SSL/TLS support, default=first])
AC_ARG_ENABLE(gnutls, [ --enable-gnutls use GNU TLS for SSL/TLS support, default=second])
AC_ARG_ENABLE(openssl, [ --enable-openssl use OpenSSL for SSL/TLS support, default=third])
AC_ARG_WITH(openssl-libs, [ --with-openssl-libs set directory for OpenSSL library],
LDFLAGS="-L$withval $LDFLAGS"
DSOFLAGS="-L$withval $DSOFLAGS",)
AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenSSL includes],
CFLAGS="-I$withval $CFLAGS"
CPPFLAGS="-I$withval $CPPFLAGS",)
SSLFLAGS=""
SSLLIBS=""
have_ssl=0
CUPS_SERVERCERT=""
CUPS_SERVERKEY=""
CUPS_SERVERKEYCHAIN=""
if test x$enable_ssl != xno; then
dnl Look for CDSA...
@@ -38,7 +30,7 @@ if test x$enable_ssl != xno; then
have_ssl=1
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_CDSASSL)
CUPS_SERVERCERT="/Library/Keychains/System.keychain"
CUPS_SERVERKEYCHAIN="/Library/Keychains/System.keychain"
dnl Check for the various security headers...
AC_CHECK_HEADER(Security/SecureTransportPriv.h,
@@ -59,14 +51,19 @@ if test x$enable_ssl != xno; then
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
AC_DEFINE(HAVE_CSSMERRORSTRING)])
AC_DEFINE(HAVE_CSSMERRORSTRING)
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
if test $uversion -ge 150; then
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
fi
fi
fi
dnl Then look for GNU TLS...
if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
AC_PATH_PROG(LIBGCRYPTCONFIG,libgcrypt-config)
AC_PATH_TOOL(LIBGNUTLSCONFIG,libgnutls-config)
AC_PATH_TOOL(LIBGCRYPTCONFIG,libgcrypt-config)
if $PKGCONFIG --exists gnutls; then
have_ssl=1
SSLLIBS=`$PKGCONFIG --libs gnutls`
@@ -82,59 +79,14 @@ if test x$enable_ssl != xno; then
fi
if test $have_ssl = 1; then
CUPS_SERVERCERT="ssl/server.crt"
CUPS_SERVERKEY="ssl/server.key"
CUPS_SERVERKEYCHAIN="ssl"
if $PKGCONFIG --exists gcrypt; then
SSLLIBS="$SSLLIBS `$PKGCONFIG --libs gcrypt`"
SSLFLAGS="$SSLFLAGS `$PKGCONFIG --cflags gcrypt`"
elif test "x$LIBGCRYPTCONFIG" != x; then
SSLLIBS="$SSLLIBS `$LIBGCRYPTCONFIG --libs`"
SSLFLAGS="$SSLFLAGS `$LIBGCRYPTCONFIG --cflags`"
fi
fi
fi
dnl Check for the OpenSSL library last...
if test $have_ssl = 0 -a "x$enable_openssl" != "xno"; then
AC_CHECK_HEADER(openssl/ssl.h,[
dnl Save the current libraries so the crypto stuff isn't always
dnl included...
SAVELIBS="$LIBS"
dnl Some ELF systems can't resolve all the symbols in libcrypto
dnl if libcrypto was linked against RSAREF, and fail to link the
dnl test program correctly, even though a correct installation
dnl of OpenSSL exists. So we test the linking three times in
dnl case the RSAREF libraries are needed.
for libcrypto in \
"-lcrypto" \
"-lcrypto -lrsaref" \
"-lcrypto -lRSAglue -lrsaref"
do
AC_CHECK_LIB(ssl,SSL_new,
[have_ssl=1
SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
SSLLIBS="-lssl $libcrypto"
AC_DEFINE(HAVE_SSL)
AC_DEFINE(HAVE_LIBSSL)],,
$libcrypto)
if test "x${SSLLIBS}" != "x"; then
break
fi
done
if test "x${SSLLIBS}" != "x"; then
CUPS_SERVERCERT="ssl/server.crt"
CUPS_SERVERKEY="ssl/server.key"
LIBS="$SAVELIBS $SSLLIBS"
AC_CHECK_FUNCS(SSL_set_tlsext_host_name)
fi
LIBS="$SAVELIBS"])
LIBS="$LIBS $SSLLIBS"
AC_CHECK_FUNC(gnutls_transport_set_pull_timeout_function, AC_DEFINE(HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION))
AC_CHECK_FUNC(gnutls_priority_set_direct, AC_DEFINE(HAVE_GNUTLS_PRIORITY_SET_DIRECT))
LIBS="$SAVELIBS"
fi
fi
fi
@@ -143,12 +95,11 @@ if test $have_ssl = 1; then
AC_MSG_RESULT([ Using SSLLIBS="$SSLLIBS"])
AC_MSG_RESULT([ Using SSLFLAGS="$SSLFLAGS"])
IPPALIASES="http https ipps"
elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes -o x$enable_openssl = xyes; then
elif test x$enable_cdsa = xyes -o x$enable_gnutls = xyes; then
AC_MSG_ERROR([Unable to enable SSL support.])
fi
AC_SUBST(CUPS_SERVERCERT)
AC_SUBST(CUPS_SERVERKEY)
AC_SUBST(CUPS_SERVERKEYCHAIN)
AC_SUBST(IPPALIASES)
AC_SUBST(SSLFLAGS)
AC_SUBST(SSLLIBS)
@@ -157,5 +108,5 @@ EXPORT_SSLLIBS="$SSLLIBS"
AC_SUBST(EXPORT_SSLLIBS)
dnl
dnl End of "$Id: cups-ssl.m4 7241 2008-01-22 22:34:52Z mike $".
dnl End of "$Id: cups-ssl.m4 12645 2015-05-20 01:20:52Z msweet $".
dnl
+192
Ver Arquivo
@@ -0,0 +1,192 @@
dnl
dnl "$Id: cups-startup.m4 12857 2015-08-31 15:00:45Z msweet $"
dnl
dnl Launch-on-demand/startup stuff for CUPS.
dnl
dnl Copyright 2007-2015 by Apple Inc.
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
ONDEMANDFLAGS=""
ONDEMANDLIBS=""
AC_SUBST(ONDEMANDFLAGS)
AC_SUBST(ONDEMANDLIBS)
dnl Launchd is used on OS X/Darwin...
AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
LAUNCHD_DIR=""
AC_SUBST(LAUNCHD_DIR)
if test x$enable_launchd != xno; then
AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD))
if test $uversion -ge 140; then
AC_CHECK_FUNC(launch_activate_socket, [
AC_DEFINE(HAVE_LAUNCHD)
AC_DEFINE(HAVE_LAUNCH_ACTIVATE_SOCKET)])
fi
AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
case "$uname" in
Darwin*)
# Darwin, MacOS X
LAUNCHD_DIR="/System/Library/LaunchDaemons"
# liblaunch is already part of libSystem
;;
*)
# All others; this test will need to be updated
;;
esac
fi
dnl Systemd is used on Linux...
AC_ARG_ENABLE(systemd, [ --disable-systemd disable systemd support])
AC_ARG_WITH(systemd, [ --with-systemd set directory for systemd service files],
SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
AC_SUBST(SYSTEMD_DIR)
if test x$enable_systemd != xno; then
if test "x$PKGCONFIG" = x; then
if test x$enable_systemd = xyes; then
AC_MSG_ERROR(Need pkg-config to enable systemd support.)
fi
else
have_systemd=no
AC_MSG_CHECKING(for libsystemd)
if $PKGCONFIG --exists libsystemd; then
AC_MSG_RESULT(yes)
have_systemd=yes
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd`
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd`
elif $PKGCONFIG --exists libsystemd-daemon; then
AC_MSG_RESULT(yes - legacy)
have_systemd=yes
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
if $PKGCONFIG --exists libsystemd-journal; then
ONDEMANDFLAGS="$ONDEMANDFLAGS `$PKGCONFIG --cflags libsystemd-journal`"
ONDEMANDLIBS="$ONDEMANDLIBS `$PKGCONFIG --libs libsystemd-journal`"
fi
else
AC_MSG_RESULT(no)
fi
if test $have_systemd = yes; then
AC_DEFINE(HAVE_SYSTEMD)
AC_CHECK_HEADER(systemd/sd-journal.h,AC_DEFINE(HAVE_SYSTEMD_SD_JOURNAL_H))
if test "x$SYSTEMD_DIR" = x; then
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
fi
fi
fi
fi
dnl Solaris uses smf
SMFMANIFESTDIR=""
AC_SUBST(SMFMANIFESTDIR)
AC_ARG_WITH(smfmanifestdir, [ --with-smfmanifestdir set path for Solaris SMF manifest],SMFMANIFESTDIR="$withval")
dnl Use init on other platforms...
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
AC_ARG_WITH(rclevels, [ --with-rclevels set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
AC_ARG_WITH(rcstart, [ --with-rcstart set start number for rc scripts],rcstart="$withval",rcstart="")
AC_ARG_WITH(rcstop, [ --with-rcstop set stop number for rc scripts],rcstop="$withval",rcstop="")
if test x$rcdir = x; then
if test x$LAUNCHD_DIR = x -a x$SYSTEMD_DIR = x -a x$SMFMANIFESTDIR = x; then
# Fall back on "init", the original service startup interface...
if test -d /sbin/init.d; then
# SuSE
rcdir="/sbin/init.d"
elif test -d /etc/init.d; then
# Others
rcdir="/etc"
else
# RedHat, NetBSD
rcdir="/etc/rc.d"
fi
else
rcdir="no"
fi
fi
if test "x$rcstart" = x; then
case "$uname" in
Linux | GNU | GNU/k*BSD*)
# Linux
rcstart="81"
;;
SunOS*)
# Solaris
rcstart="81"
;;
*)
# Others
rcstart="99"
;;
esac
fi
if test "x$rcstop" = x; then
case "$uname" in
Linux | GNU | GNU/k*BSD*)
# Linux
rcstop="36"
;;
*)
# Others
rcstop="00"
;;
esac
fi
INITDIR=""
INITDDIR=""
RCLEVELS="$rclevels"
RCSTART="$rcstart"
RCSTOP="$rcstop"
AC_SUBST(INITDIR)
AC_SUBST(INITDDIR)
AC_SUBST(RCLEVELS)
AC_SUBST(RCSTART)
AC_SUBST(RCSTOP)
if test "x$rcdir" != xno; then
if test "x$rclevels" = x; then
INITDDIR="$rcdir"
else
INITDIR="$rcdir"
fi
fi
dnl Xinetd support...
AC_ARG_WITH(xinetd, [ --with-xinetd set path for xinetd config files],xinetd="$withval",xinetd="")
XINETD=""
AC_SUBST(XINETD)
if test "x$xinetd" = x; then
if test ! -x /sbin/launchd; then
for dir in /etc/xinetd.d /usr/local/etc/xinetd.d; do
if test -d $dir; then
XINETD="$dir"
break
fi
done
fi
elif test "x$xinetd" != xno; then
XINETD="$xinetd"
fi
dnl
dnl End of "$Id: cups-startup.m4 12857 2015-08-31 15:00:45Z msweet $".
dnl
+2 -2
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $"
dnl "$Id: cups-threads.m4 11324 2013-10-04 03:11:42Z msweet $"
dnl
dnl Threading stuff for CUPS.
dnl
@@ -50,5 +50,5 @@ fi
AC_SUBST(PTHREAD_FLAGS)
dnl
dnl End of "$Id: cups-threads.m4 6649 2007-07-11 21:46:42Z mike $".
dnl End of "$Id: cups-threads.m4 11324 2013-10-04 03:11:42Z msweet $".
dnl
+72 -39
Ver Arquivo
@@ -1,16 +1,16 @@
/*
* "$Id: config.h.in 11642 2014-02-27 15:57:59Z msweet $"
* "$Id: config.h.in 12687 2015-06-03 17:19:04Z msweet $"
*
* Configuration file for CUPS.
* Configuration file for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
#ifndef _CUPS_CONFIG_H_
@@ -93,7 +93,7 @@
* Default MaxCopies value...
*/
#define CUPS_DEFAULT_MAX_COPIES 100
#define CUPS_DEFAULT_MAX_COPIES 9999
/*
@@ -131,6 +131,13 @@
#define CUPS_STATEDIR "/var/run/cups"
/*
* Do we have posix_spawn?
*/
#undef HAVE_POSIX_SPAWN
/*
* Do we have ZLIB?
*/
@@ -143,10 +150,7 @@
* Do we have PAM stuff?
*/
#ifndef HAVE_LIBPAM
#define HAVE_LIBPAM 0
#endif /* !HAVE_LIBPAM */
#undef HAVE_PAM_PAM_APPL_H
#undef HAVE_PAM_SET_ITEM
#undef HAVE_PAM_SETCRED
@@ -238,6 +242,20 @@
#undef HAVE_VSYSLOG
/*
* Do we have the ASL functions?
*/
#undef HAVE_ASL_H
/*
* Do we have the systemd journal functions?
*/
#undef HAVE_SYSTEMD_SD_JOURNAL_H
/*
* Do we have the (v)snprintf() functions?
*/
@@ -290,15 +308,22 @@
#undef HAVE_CDSASSL
#undef HAVE_GNUTLS
#undef HAVE_LIBSSL
#undef HAVE_SSPISSL
#undef HAVE_SSL
/*
* Do we have the SSL_set_tlsext_host_name function?
* Do we have the gnutls_transport_set_pull_timeout_function function?
*/
#undef HAVE_SSL_SET_TLSEXT_HOST_NAME
#undef HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION
/*
* Do we have the gnutls_priority_set_direct function?
*/
#undef HAVE_GNUTLS_PRIORITY_SET_DIRECT
/*
@@ -323,6 +348,27 @@
#undef HAVE_CSSMERRORSTRING
/*
* Do we have the SecGenerateSelfSignedCertificate function?
*/
#undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE
/*
* Do we have the SecKeychainOpen function?
*/
#undef HAVE_SECKEYCHAINOPEN
/*
* Do we have (a working) SSLSetEnabledCiphers function?
*/
#undef HAVE_SSLSETENABLEDCIPHERS
/*
* Do we have libpaper?
*/
@@ -428,13 +474,6 @@
#undef HAVE_STRUCT_SOCKADDR_SA_LEN
/*
* Do we have the AIX usersec.h header file?
*/
#undef HAVE_USERSEC_H
/*
* Do we have pthread support?
*/
@@ -448,6 +487,14 @@
#undef HAVE_LAUNCH_H
#undef HAVE_LAUNCHD
#undef HAVE_LAUNCH_ACTIVATE_SOCKET
/*
* Do we have systemd support?
*/
#undef HAVE_SYSTEMD
/*
@@ -522,13 +569,6 @@
#undef HAVE_NOTIFY_POST
/*
* Do we have Darwin's IOKit private headers?
*/
#undef HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H
/*
* Do we have DBUS?
*/
@@ -612,7 +652,7 @@
#ifdef HAVE_ARC4RANDOM
# define CUPS_RAND() arc4random()
# define CUPS_SRAND(v) arc4random_stir()
# define CUPS_SRAND(v)
#elif defined(HAVE_RANDOM)
# define CUPS_RAND() random()
# define CUPS_SRAND(v) srandom(v)
@@ -625,13 +665,6 @@
#endif /* HAVE_ARC4RANDOM */
/*
* Do we have vproc_transaction_begin/end?
*/
#undef HAVE_VPROC_TRANSACTION_BEGIN
/*
* Do we have libusb?
*/
@@ -707,5 +740,5 @@ static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
#endif /* !_CUPS_CONFIG_H_ */
/*
* End of "$Id: config.h.in 11642 2014-02-27 15:57:59Z msweet $".
* End of "$Id: config.h.in 12687 2015-06-03 17:19:04Z msweet $".
*/
externo
+729 -572
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+20 -17
Ver Arquivo
@@ -1,19 +1,23 @@
dnl
dnl "$Id: configure.in 11109 2013-07-08 21:15:13Z msweet $"
dnl "$Id: configure.ac 12998 2015-12-02 15:09:04Z msweet $"
dnl
dnl Configuration script for CUPS.
dnl Configuration script for CUPS.
dnl
dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl Copyright 2007-2015 by Apple Inc.
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
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 file is missing or damaged, see the license at "http://www.cups.org/".
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 file is missing or damaged, see the license at "http://www.cups.org/".
dnl
AC_INIT(cups/cups.h)
dnl We need at least autoconf 2.60...
AC_PREREQ(2.60)
dnl Package name and version...
AC_INIT([CUPS], [2.1.2], [https://www.cups.org/str.php], [cups], [https://www.cups.org/])
sinclude(config-scripts/cups-opsys.m4)
sinclude(config-scripts/cups-common.m4)
@@ -32,7 +36,7 @@ sinclude(config-scripts/cups-ssl.m4)
sinclude(config-scripts/cups-pam.m4)
sinclude(config-scripts/cups-largefile.m4)
sinclude(config-scripts/cups-dnssd.m4)
sinclude(config-scripts/cups-launchd.m4)
sinclude(config-scripts/cups-startup.m4)
sinclude(config-scripts/cups-defaults.m4)
sinclude(config-scripts/cups-scripting.m4)
@@ -66,14 +70,9 @@ AC_OUTPUT(Makedefs
conf/pam.std
conf/snmp.conf
cups-config
data/testprint
desktop/cups.desktop
doc/help/ref-cups-files-conf.html
doc/help/ref-cupsd-conf.html
doc/index.html
man/client.conf.man
man/cups-deviced.man
man/cups-driverd.man
man/cups-files.conf.man
man/cups-lpd.man
man/cups-snmp.man
@@ -85,6 +84,10 @@ AC_OUTPUT(Makedefs
scheduler/cups.sh
scheduler/cups.xml
scheduler/org.cups.cups-lpd.plist
scheduler/org.cups.cups-lpdAT.service
scheduler/org.cups.cupsd.path
scheduler/org.cups.cupsd.service
scheduler/org.cups.cupsd.socket
templates/header.tmpl
packaging/cups.list
$LANGFILES)
@@ -92,5 +95,5 @@ AC_OUTPUT(Makedefs
chmod +x cups-config
dnl
dnl End of "$Id: configure.in 11109 2013-07-08 21:15:13Z msweet $".
dnl End of "$Id: configure.ac 12998 2015-12-02 15:09:04Z msweet $".
dnl
+255 -197
Ver Arquivo
@@ -1,260 +1,318 @@
adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h adminutil.h
array.o: array.c string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h adminutil.h
array.o: array.c ../cups/cups.h file.h versioning.h ipp.h http.h array.h \
language.h pwg.h string-private.h ../config.h debug-private.h \
array-private.h
attr.o: attr.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
auth.o: auth.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h
array.h language.h pwg.h
backend.o: backend.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h backend.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h backend.h
conflicts.o: conflicts.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
custom.o: custom.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
debug.o: debug.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
dest.o: dest.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
dest-job.o: dest-job.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
dest-localization.o: dest-localization.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
../cups/ipp.h http.h array.h http-private.h md5-private.h \
language-private.h ../cups/transcode.h language.h pwg-private.h \
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
ppd-private.h ../cups/ppd.h thread-private.h
dest-options.o: dest-options.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
../cups/ipp.h http.h array.h http-private.h md5-private.h \
language-private.h ../cups/transcode.h language.h pwg-private.h \
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
ppd-private.h ../cups/ppd.h thread-private.h
dir.o: dir.c string-private.h ../config.h debug-private.h \
../cups/versioning.h dir.h
emit.o: emit.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
encode.o: encode.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
file.o: file.c file-private.h cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
getdevices.o: getdevices.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/http.h \
versioning.h array.h md5-private.h ipp-private.h ../cups/ipp.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/language.h \
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
../cups/ipp.h
getputfile.o: getputfile.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
globals.o: globals.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
http.o: http.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
http-addr.o: http-addr.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
http-addrlist.o: http-addrlist.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
../cups/ipp.h http.h array.h http-private.h md5-private.h \
language-private.h ../cups/transcode.h language.h pwg-private.h \
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
ppd-private.h ../cups/ppd.h thread-private.h
http-support.o: http-support.c cups-private.h string-private.h \
../config.h debug-private.h ../cups/versioning.h ipp-private.h \
../cups/ipp.h http.h array.h http-private.h md5-private.h \
language-private.h ../cups/transcode.h language.h pwg-private.h \
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
../config.h debug-private.h ../cups/versioning.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
ppd-private.h ../cups/ppd.h thread-private.h
ipp.o: ipp.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h ipp-private.h ../cups/ipp.h http.h array.h \
http-private.h md5-private.h language-private.h ../cups/transcode.h \
language.h pwg-private.h ../cups/cups.h file.h ppd-private.h \
../cups/ppd.h thread-private.h
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h
ipp-support.o: ipp-support.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
langprintf.o: langprintf.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
language.o: language.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
localize.o: localize.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
mark.o: mark.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
md5.o: md5.c md5-private.h string-private.h ../config.h
md5passwd.o: md5passwd.c http-private.h ../config.h ../cups/http.h \
versioning.h array.h md5-private.h ipp-private.h ../cups/ipp.h \
string-private.h
md5passwd.o: md5passwd.c http-private.h ../config.h ../cups/language.h \
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
../cups/ipp.h string-private.h
notify.o: notify.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
options.o: options.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
page.o: page.c string-private.h ../config.h debug-private.h \
../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \
language.h
language.h pwg.h
ppd.o: ppd.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h ipp-private.h ../cups/ipp.h http.h array.h \
http-private.h md5-private.h language-private.h ../cups/transcode.h \
language.h pwg-private.h ../cups/cups.h file.h ppd-private.h \
../cups/ppd.h thread-private.h
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h
ppd-cache.o: ppd-cache.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
request.o: request.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
sidechannel.o: sidechannel.c sidechannel.h versioning.h cups-private.h \
string-private.h ../config.h debug-private.h ipp-private.h \
../cups/ipp.h http.h array.h http-private.h md5-private.h \
language-private.h ../cups/transcode.h language.h pwg-private.h \
../cups/cups.h file.h ppd-private.h ../cups/ppd.h thread-private.h
string-private.h ../config.h debug-private.h array-private.h \
../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \
../cups/language.h md5-private.h language-private.h \
../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \
ppd-private.h ../cups/ppd.h thread-private.h
snmp.o: snmp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h snmp-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h snmp-private.h
snprintf.o: snprintf.c string-private.h ../config.h
string.o: string.c string-private.h ../config.h debug-private.h \
../cups/versioning.h thread-private.h array.h
string.o: string.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
thread.o: thread.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
tls.o: tls.c cups-private.h string-private.h ../config.h debug-private.h \
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \
language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \
file.h pwg.h ppd-private.h ../cups/ppd.h thread-private.h tls-darwin.c
transcode.o: transcode.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
usersys.o: usersys.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
util.o: util.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
testadmin.o: testadmin.c adminutil.h cups.h file.h versioning.h ipp.h \
http.h array.h language.h string-private.h ../config.h
http.h array.h language.h pwg.h string-private.h ../config.h
testarray.o: testarray.c string-private.h ../config.h debug-private.h \
../cups/versioning.h array.h dir.h
../cups/versioning.h array-private.h ../cups/array.h dir.h
testconflicts.o: testconflicts.c cups.h file.h versioning.h ipp.h http.h \
array.h language.h ppd.h string-private.h ../config.h
array.h language.h pwg.h ppd.h string-private.h ../config.h
testcups.o: testcups.c string-private.h ../config.h cups.h file.h \
versioning.h ipp.h http.h array.h language.h ppd.h
versioning.h ipp.h http.h array.h language.h pwg.h ppd.h
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
language.h pwg.h
testfile.o: testfile.c string-private.h ../config.h debug-private.h \
../cups/versioning.h file.h
testhttp.o: testhttp.c string-private.h ../config.h http-private.h \
../cups/http.h versioning.h array.h md5-private.h ipp-private.h \
../cups/ipp.h
testhttp.o: testhttp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
testi18n.o: testi18n.c string-private.h ../config.h language-private.h \
../cups/transcode.h language.h array.h versioning.h
testipp.o: testipp.c file.h versioning.h string-private.h ../config.h \
ipp-private.h ../cups/ipp.h http.h array.h
testoptions.o: testoptions.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
testlang.o: testlang.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
testppd.o: testppd.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h
testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \
ipp.h http.h array.h language.h ../cups/ppd.h pwg-private.h \
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h pwg-private.h \
file-private.h cups-private.h string-private.h ../config.h \
debug-private.h ipp-private.h http-private.h md5-private.h \
language-private.h ../cups/transcode.h thread-private.h
debug-private.h array-private.h ipp-private.h http-private.h \
md5-private.h language-private.h ../cups/transcode.h thread-private.h
testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \
debug-private.h ../cups/versioning.h ipp-private.h ../cups/ipp.h \
http.h array.h http-private.h md5-private.h language-private.h \
../cups/transcode.h language.h pwg-private.h ../cups/cups.h file.h \
ppd-private.h ../cups/ppd.h thread-private.h snmp-private.h
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
../cups/cups.h file.h pwg.h ppd-private.h ../cups/ppd.h \
thread-private.h snmp-private.h
+74 -35
Ver Arquivo
@@ -1,18 +1,18 @@
#
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
# "$Id: Makefile 12850 2015-08-27 19:29:06Z msweet $"
#
# API library Makefile for CUPS.
# API library Makefile for CUPS.
#
# Copyright 2007-2013 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
# Copyright 2007-2014 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# which should have been included with this file. If this file is
# file is missing or damaged, see the license at "http://www.cups.org/".
#
# This file is subject to the Apple OS-Developed Software exception.
# This file is subject to the Apple OS-Developed Software exception.
#
include ../Makedefs
@@ -76,14 +76,17 @@ LIBOBJS = \
string.o \
tempfile.o \
thread.o \
tls.o \
transcode.o \
usersys.o \
util.o
TESTOBJS = \
testadmin.o \
testarray.o \
testcache.o \
testconflicts.o \
testcups.o \
testdest.o \
testfile.o \
testhttp.o \
testi18n.o \
@@ -92,7 +95,8 @@ TESTOBJS = \
testlang.o \
testppd.o \
testpwg.o \
testsnmp.o
testsnmp.o \
tlscheck.o
OBJS = \
$(LIBOBJS) \
$(TESTOBJS)
@@ -147,8 +151,10 @@ LIBTARGETS = \
UNITTARGETS = \
testadmin \
testarray \
testcache \
testconflicts \
testcups \
testdest \
testfile \
testhttp \
testi18n \
@@ -157,7 +163,8 @@ UNITTARGETS = \
testoptions \
testppd \
testpwg \
testsnmp
testsnmp \
tlscheck
TARGETS = \
$(LIBTARGETS)
@@ -190,7 +197,7 @@ unittests: $(UNITTARGETS)
clean:
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
$(RM) libcups.so libcups.sl libcups.dylib
$(RM) libcups.so libcups.dylib
#
@@ -257,7 +264,7 @@ install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
if test $(LIBCUPS) = "libcups.so.2"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
$(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
fi
@@ -286,9 +293,6 @@ uninstall:
$(RM) $(LIBDIR)/libcups.2.dylib
$(RM) $(LIBDIR)/$(LIBCUPSSTATIC)
$(RM) $(LIBDIR)/libcups.dylib
$(RM) $(LIBDIR)/libcups_s.a
$(RM) $(LIBDIR)/libcups.sl
$(RM) $(LIBDIR)/libcups.sl.2
$(RM) $(LIBDIR)/libcups.so
$(RM) $(LIBDIR)/libcups.so.2
-$(RMDIR) $(LIBDIR)
@@ -299,10 +303,10 @@ uninstall:
#
# libcups.so.2, libcups.sl.2
# libcups.so.2
#
libcups.so.2 libcups.sl.2: $(LIBOBJS)
libcups.so.2: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
@@ -322,7 +326,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 2.10.0 \
-current_version 2.11.0 \
-compatibility_version 2.0.0 \
-exported_symbols_list t.exp \
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
@@ -331,19 +335,6 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
$(LN) $@ libcups.dylib
#
# libcups_s.a
#
libcups_s.a: $(LIBOBJS) libcups_s.exp
echo Creating $@...
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
$(RM) $@
$(AR) $(ARFLAGS) $@ libcups_s.o
#
# libcups.la
#
@@ -351,7 +342,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp
libcups.la: $(LIBOBJS)
echo Linking $@...
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
-rpath $(LIBDIR) -version-info 2:10 $(LIBGSSAPI) $(SSLLIBS) \
-rpath $(LIBDIR) -version-info 2:11 $(LIBGSSAPI) $(SSLLIBS) \
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
@@ -366,6 +357,23 @@ libcups.a: $(LIBOBJS)
$(RANLIB) $@
#
# libcups2.def (Windows DLL exports file...)
#
libcups2.def: $(LIBOBJS) Makefile
echo Generating $@...
echo "LIBRARY libcups2" >libcups2.def
echo "VERSION 2.11" >>libcups2.def
echo "EXPORTS" >>libcups2.def
(nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
grep -v -E \
-e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel' \
-e 'Block$$' | \
sed -e '1,$$s/^_//' | sort >>libcups2.def
#
# testadmin (dependency on static CUPS library is intentional)
#
@@ -388,6 +396,16 @@ testarray: testarray.o $(LIBCUPSSTATIC)
./testarray
#
# testcache (dependency on static CUPS library is intentional)
#
testcache: testcache.o $(LIBCUPSSTATIC)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
# testconflicts (dependency on static CUPS library is intentional)
#
@@ -408,6 +426,16 @@ testcups: testcups.o $(LIBCUPSSTATIC)
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
# testdest (dependency on static CUPS library is intentional)
#
testdest: testdest.o $(LIBCUPSSTATIC)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
# testfile (dependency on static CUPS library is intentional)
#
@@ -514,6 +542,16 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
# tlscheck (dependency on static CUPS library is intentional)
#
tlscheck: tlscheck.o $(LIBCUPSSTATIC)
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
#
# Automatic API help files...
#
@@ -636,8 +674,9 @@ sloc:
#
include Dependencies
tls.o: tls-darwin.c tls-gnutls.c tls-sspi.c
#
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
# End of "$Id: Makefile 12850 2015-08-27 19:29:06Z msweet $".
#
+59 -27
Ver Arquivo
@@ -1,29 +1,18 @@
/*
* "$Id: adminutil.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: adminutil.c 12945 2015-10-26 19:46:02Z msweet $"
*
* Administration utility API definitions for CUPS.
* Administration utility API definitions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsAdminCreateWindowsPPD() - Create the Windows PPD file for a printer.
* cupsAdminExportSamba() - Export a printer to Samba.
* cupsAdminGetServerSettings() - Get settings from the server.
* cupsAdminSetServerSettings() - Set settings on the server.
* do_samba_command() - Do a SAMBA command.
* get_cupsd_conf() - Get the current cupsd.conf file.
* invalidate_cupsd_cache() - Invalidate the cached cupsd.conf settings.
* write_option() - Write a CUPS option to a PPD file.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -52,7 +41,7 @@ static int do_samba_command(const char *command,
FILE *logfile);
static http_status_t get_cupsd_conf(http_t *http, _cups_globals_t *cg,
time_t last_update, char *name,
int namelen, int *remote);
size_t namelen, int *remote);
static void invalidate_cupsd_cache(_cups_globals_t *cg);
static void write_option(cups_file_t *dstfp, int order,
const char *name, const char *text,
@@ -319,7 +308,7 @@ cupsAdminCreateWindowsPPD(
}
}
snprintf(ptr + 1, sizeof(line) - (ptr - line + 1),
snprintf(ptr + 1, sizeof(line) - (size_t)(ptr - line + 1),
"%%cupsJobTicket: %s=%s\n\"\n*End", option, choice);
cupsFilePrintf(dstfp, "*%% Changed for CUPS Windows Driver...\n%s\n",
@@ -1186,6 +1175,7 @@ cupsAdminSetServerSettings(
in_cancel_job, /* In a cancel-job section? */
in_admin_location, /* In the /admin location? */
in_conf_location, /* In the /admin/conf location? */
in_log_location, /* In the /admin/log location? */
in_root_location; /* In the / location? */
const char *val; /* Setting value */
int share_printers, /* Share local printers */
@@ -1199,6 +1189,7 @@ cupsAdminSetServerSettings(
wrote_loglevel, /* Wrote the LogLevel line? */
wrote_admin_location, /* Wrote the /admin location? */
wrote_conf_location, /* Wrote the /admin/conf location? */
wrote_log_location, /* Wrote the /admin/log location? */
wrote_root_location; /* Wrote the / location? */
int indent; /* Indentation */
int cupsd_num_settings; /* New number of settings */
@@ -1412,12 +1403,14 @@ cupsAdminSetServerSettings(
in_conf_location = 0;
in_default_policy = 0;
in_location = 0;
in_log_location = 0;
in_policy = 0;
in_root_location = 0;
linenum = 0;
wrote_admin_location = 0;
wrote_browsing = 0;
wrote_conf_location = 0;
wrote_log_location = 0;
wrote_loglevel = 0;
wrote_policy = 0;
wrote_port_listen = 0;
@@ -1561,8 +1554,10 @@ cupsAdminSetServerSettings(
indent += 2;
if (!strcmp(value, "/admin"))
in_admin_location = 1;
if (!strcmp(value, "/admin/conf"))
else if (!strcmp(value, "/admin/conf"))
in_conf_location = 1;
else if (!strcmp(value, "/admin/log"))
in_log_location = 1;
else if (!strcmp(value, "/"))
in_root_location = 1;
@@ -1604,6 +1599,23 @@ cupsAdminSetServerSettings(
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
}
else if (in_log_location && remote_admin >= 0)
{
wrote_log_location = 1;
if (remote_admin)
cupsFilePuts(temp, " # Allow remote access to the log "
"files...\n");
else
cupsFilePuts(temp, " # Restrict access to the log "
"files...\n");
cupsFilePuts(temp, " Order allow,deny\n");
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n",
remote_any > 0 ? "all" : "@LOCAL");
}
else if (in_root_location &&
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
{
@@ -1630,6 +1642,7 @@ cupsAdminSetServerSettings(
in_admin_location = 0;
in_conf_location = 0;
in_log_location = 0;
in_root_location = 0;
cupsFilePuts(temp, "</Location>\n");
@@ -1878,6 +1891,25 @@ cupsAdminSetServerSettings(
cupsFilePuts(temp, "</Location>\n");
}
if (!wrote_log_location && remote_admin >= 0)
{
if (remote_admin)
cupsFilePuts(temp,
"# Allow remote access to the log files...\n");
else
cupsFilePuts(temp, "# Restrict access to the log files...\n");
cupsFilePuts(temp, "<Location /admin/log>\n"
" AuthType Default\n"
" Require user @SYSTEM\n"
" Order allow,deny\n");
if (remote_admin)
cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL");
cupsFilePuts(temp, "</Location>\n");
}
if (!wrote_policy && user_cancel_any >= 0)
{
cupsFilePuts(temp, "<Policy default>\n"
@@ -2120,7 +2152,7 @@ get_cupsd_conf(
_cups_globals_t *cg, /* I - Global data */
time_t last_update, /* I - Last update time for file */
char *name, /* I - Filename buffer */
int namesize, /* I - Size of filename buffer */
size_t namesize, /* I - Size of filename buffer */
int *remote) /* O - Remote file? */
{
int fd; /* Temporary file descriptor */
@@ -2176,7 +2208,7 @@ get_cupsd_conf(
* Read cupsd.conf via a HTTP GET request...
*/
if ((fd = cupsTempFd(name, namesize)) < 0)
if ((fd = cupsTempFd(name, (int)namesize)) < 0)
{
*name = '\0';
@@ -2337,5 +2369,5 @@ write_option(cups_file_t *dstfp, /* I - PPD file */
/*
* End of "$Id: adminutil.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: adminutil.c 12945 2015-10-26 19:46:02Z msweet $".
*/
+24 -2
Ver Arquivo
@@ -3,7 +3,7 @@
Filter and backend programming introduction for CUPS.
Copyright 2007-2013 by Apple Inc.
Copyright 2007-2014 by Apple Inc.
Copyright 1997-2006 by Easy Software Products, all rights reserved.
These coded instructions, statements, and computer programs are the
@@ -81,7 +81,7 @@ directory to write to.</p>
<p>In addition, some operating systems provide additional security mechanisms
that further limit file system access, even for backends running as root. On
OS X, for example, no backend may write to a user's home directory.</p>
OS X, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on OS X</a> section for more information.</p>
</blockquote>
<h3><a name="SIGNALS">Canceled Jobs and Signal Handling</a></h3>
@@ -852,3 +852,25 @@ void *my_data;
<a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
</pre>
<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
<ol>
<li>Reading of files: pursuant to normal UNIX file permissions, filters and backends can read files for the current job from the <var>/private/var/spool/cups</var> directory and other files on mounted filesystems <em>except</em> for user home directories under <var>/Users</var>.</li>
<li>Writing of files: pursuant to normal UNIX file permissions, filters and backends can read/write files to the cache directory specified by the <code>CUPS_CACHEDIR</code> environment variable, to the state directory specified by the <code>CUPS_STATEDIR</code> environment variable, to the temporary directory specified by the <code>TMPDIR</code> environment variable, and under the <var>/private/var/db</var>, <var>/private/var/folders</var>, <var>/private/var/lib</var>, <var>/private/var/mysql</var>, <var>/private/var/run</var>, <var>/private/var/spool</var> (except <var>/private/var/spool/cups</var>), <var>/Library/Application&nbsp;Support</var>, <var>/Library/Caches</var>, <var>/Library/Logs</var>, <var>/Library/Preferences</var>, <var>/Library/WebServer</var>, and <var>/Users/Shared</var> directories.</li>
<li>Execution of programs: pursuant to normal UNIX file permissions, filters and backends can execute any program not located under the <var>/Users</var> directory. Child processes inherit the sandbox and are subject to the same restrictions as the parent.</li>
<li>Bluetooth and USB: backends can access Bluetooth and USB printers through IOKit. <em>Filters cannot access Bluetooth and USB printers directly.</em></li>
<li>Network: filters and backends can access UNIX domain sockets under the <var>/private/tmp</var>, <var>/private/var/run</var>, and <var>/private/var/tmp</var> directories. Backends can also create IPv4 and IPv6 TCP (outgoing) and UDP (incoming and outgoing) socket, and bind to local source ports. <em>Filters cannot directly create IPv4 and IPv6 TCP or UDP sockets.</em></li>
<li>Notifications: filters and backends can send notifications via the Darwin <code>notify_post()</code> API.</li>
</ol>
<blockquote><b>Note:</b> The sandbox profile used in CUPS 2.0 still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</blockquote>
+30 -62
Ver Arquivo
@@ -1,56 +1,25 @@
/*
* "$Id: array.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: array.c 12031 2014-07-15 19:57:59Z msweet $"
*
* Sorted array routines for CUPS.
* Sorted array routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsArrayAdd() - Add an element to the array.
* _cupsArrayAddStrings() - Add zero or more comma-delimited strings to an
* array.
* cupsArrayClear() - Clear the array.
* cupsArrayCount() - Get the number of elements in the array.
* cupsArrayCurrent() - Return the current element in the array.
* cupsArrayDelete() - Free all memory used by the array.
* cupsArrayDup() - Duplicate the array.
* cupsArrayFind() - Find an element in the array.
* cupsArrayFirst() - Get the first element in the array.
* cupsArrayGetIndex() - Get the index of the current element.
* cupsArrayGetInsert() - Get the index of the last inserted element.
* cupsArrayIndex() - Get the N-th element in the array.
* cupsArrayInsert() - Insert an element in the array.
* cupsArrayLast() - Get the last element in the array.
* cupsArrayNew() - Create a new array.
* cupsArrayNew2() - Create a new array with hash.
* cupsArrayNew3() - Create a new array with hash and/or free function.
* _cupsArrayNewStrings() - Create a new array of comma-delimited strings.
* cupsArrayNext() - Get the next element in the array.
* cupsArrayPrev() - Get the previous element in the array.
* cupsArrayRemove() - Remove an element from the array.
* cupsArrayRestore() - Reset the current element to the last @link
* cupsArraySave@.
* cupsArraySave() - Mark the current element for a later @link
* cupsArrayRestore@.
* cupsArrayUserData() - Return the user data for an array.
* cups_array_add() - Insert or append an element to the array.
* cups_array_find() - Find an element in the array.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
* Include necessary headers...
*/
#include <cups/cups.h>
#include "string-private.h"
#include "debug-private.h"
#include "array-private.h"
@@ -423,7 +392,7 @@ cupsArrayDup(cups_array_t *a) /* I - Array */
* Allocate memory for the elements...
*/
da->elements = malloc(a->num_elements * sizeof(void *));
da->elements = malloc((size_t)a->num_elements * sizeof(void *));
if (!da->elements)
{
free(da);
@@ -451,7 +420,7 @@ cupsArrayDup(cups_array_t *a) /* I - Array */
* Just copy raw pointers...
*/
memcpy(da->elements, a->elements, a->num_elements * sizeof(void *));
memcpy(da->elements, a->elements, (size_t)a->num_elements * sizeof(void *));
}
da->num_elements = a->num_elements;
@@ -794,7 +763,7 @@ cupsArrayNew3(cups_array_func_t f, /* I - Comparison function or @code NULL@ fo
{
a->hashfunc = h;
a->hashsize = hsize;
a->hash = malloc(hsize * sizeof(int));
a->hash = malloc((size_t)hsize * sizeof(int));
if (!a->hash)
{
@@ -802,7 +771,7 @@ cupsArrayNew3(cups_array_func_t f, /* I - Comparison function or @code NULL@ fo
return (NULL);
}
memset(a->hash, -1, hsize * sizeof(int));
memset(a->hash, -1, (size_t)hsize * sizeof(int));
}
a->copyfunc = cf;
@@ -918,9 +887,9 @@ int /* O - 1 on success, 0 on failure */
cupsArrayRemove(cups_array_t *a, /* I - Array */
void *e) /* I - Element */
{
int i, /* Looping var */
current, /* Current element */
diff; /* Difference */
ssize_t i, /* Looping var */
current; /* Current element */
int diff; /* Difference */
/*
@@ -952,7 +921,7 @@ cupsArrayRemove(cups_array_t *a, /* I - Array */
if (current < a->num_elements)
memmove(a->elements + current, a->elements + current + 1,
(a->num_elements - current) * sizeof(void *));
(size_t)(a->num_elements - current) * sizeof(void *));
if (current <= a->current)
a->current --;
@@ -1053,9 +1022,9 @@ cups_array_add(cups_array_t *a, /* I - Array */
void *e, /* I - Element to add */
int insert) /* I - 1 = insert, 0 = append */
{
int i, /* Looping var */
current, /* Current element */
diff; /* Comparison with current element */
int i, /* Looping var */
current; /* Current element */
int diff; /* Comparison with current element */
DEBUG_printf(("7cups_array_add(a=%p, e=%p, insert=%d)", a, e, insert));
@@ -1079,7 +1048,7 @@ cups_array_add(cups_array_t *a, /* I - Array */
if (a->alloc_elements == 0)
{
count = 16;
temp = malloc(count * sizeof(void *));
temp = malloc((size_t)count * sizeof(void *));
}
else
{
@@ -1088,10 +1057,10 @@ cups_array_add(cups_array_t *a, /* I - Array */
else
count = a->alloc_elements + 1024;
temp = realloc(a->elements, count * sizeof(void *));
temp = realloc(a->elements, (size_t)count * sizeof(void *));
}
DEBUG_printf(("9cups_array_add: count=%d", count));
DEBUG_printf(("9cups_array_add: count=" CUPS_LLFMT, CUPS_LLCAST count));
if (!temp)
{
@@ -1181,7 +1150,7 @@ cups_array_add(cups_array_t *a, /* I - Array */
*/
memmove(a->elements + current + 1, a->elements + current,
(a->num_elements - current) * sizeof(void *));
(size_t)(a->num_elements - current) * sizeof(void *));
if (a->current >= current)
a->current ++;
@@ -1190,11 +1159,11 @@ cups_array_add(cups_array_t *a, /* I - Array */
if (a->saved[i] >= current)
a->saved[i] ++;
DEBUG_printf(("9cups_array_add: insert element at index %d...", current));
DEBUG_printf(("9cups_array_add: insert element at index " CUPS_LLFMT, CUPS_LLCAST current));
}
#ifdef DEBUG
else
DEBUG_printf(("9cups_array_add: append element at %d...", current));
DEBUG_printf(("9cups_array_add: append element at " CUPS_LLFMT, CUPS_LLCAST current));
#endif /* DEBUG */
if (a->copyfunc)
@@ -1213,8 +1182,7 @@ cups_array_add(cups_array_t *a, /* I - Array */
#ifdef DEBUG
for (current = 0; current < a->num_elements; current ++)
DEBUG_printf(("9cups_array_add: a->elements[%d]=%p", current,
a->elements[current]));
DEBUG_printf(("9cups_array_add: a->elements[" CUPS_LLFMT "]=%p", CUPS_LLCAST current, a->elements[current]));
#endif /* DEBUG */
DEBUG_puts("9cups_array_add: returning 1");
@@ -1362,5 +1330,5 @@ cups_array_find(cups_array_t *a, /* I - Array */
/*
* End of "$Id: array.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: array.c 12031 2014-07-15 19:57:59Z msweet $".
*/
+10 -24
Ver Arquivo
@@ -1,22 +1,16 @@
/*
* "$Id: attr.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: attr.c 12867 2015-09-13 23:49:19Z msweet $"
*
* PPD model-specific attribute routines for CUPS.
* PPD model-specific attribute routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* Contents:
*
* ppdFindAttr() - Find the first matching attribute.
* ppdFindNextAttr() - Find the next matching attribute.
* _ppdNormalizeMakeAndModel() - Normalize a product/make-and-model string.
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
@@ -229,14 +223,6 @@ _ppdNormalizeMakeAndModel(
snprintf(buffer, bufsize, "Canon %s", make_and_model);
}
else if (!_cups_strncasecmp(make_and_model, "primera", 7))
{
/*
* Fargo...
*/
snprintf(buffer, bufsize, "Fargo %s", make_and_model);
}
else if (!_cups_strncasecmp(make_and_model, "designjet", 9) ||
!_cups_strncasecmp(make_and_model, "deskjet", 7))
{
@@ -331,5 +317,5 @@ _ppdNormalizeMakeAndModel(
/*
* End of "$Id: attr.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: attr.c 12867 2015-09-13 23:49:19Z msweet $".
*/
+22 -34
Ver Arquivo
@@ -1,32 +1,21 @@
/*
* "$Id: auth.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: auth.c 12619 2015-05-06 21:00:19Z msweet $"
*
* Authentication functions for CUPS.
* Authentication functions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* This file contains Kerberos support code, copyright 2006 by
* Jelmer Vernooij.
* This file contains Kerberos support code, copyright 2006 by
* Jelmer Vernooij.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsDoAuthentication() - Authenticate a request.
* _cupsSetNegotiateAuthString() - Set the Kerberos authentication string.
* cups_gss_acquire() - Kerberos credentials callback.
* cups_gss_getname() - Get CUPS service credentials for
* authentication.
* cups_gss_printf() - Show debug error messages from GSSAPI.
* cups_local_auth() - Get the local authorization certificate if
* available/applicable.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -272,7 +261,6 @@ cupsDoAuthentication(
char encode[33], /* MD5 buffer */
digest[1024]; /* Digest auth data */
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce);
@@ -323,7 +311,7 @@ _cupsSetNegotiateAuthString(
* to use it...
*/
if (gss_init_sec_context == NULL)
if (&gss_init_sec_context == NULL)
{
DEBUG_puts("1_cupsSetNegotiateAuthString: Weak-linked GSSAPI/Kerberos "
"framework is not present");
@@ -453,21 +441,21 @@ _cupsSetNegotiateAuthString(
* arbitrarily large credentials...
*/
int authsize = 10 + /* "Negotiate " */
output_token.length * 4 / 3 + 1 + /* Base64 */
1; /* nul */
int authsize = 10 + /* "Negotiate " */
(int)output_token.length * 4 / 3 + 1 + 1;
/* Base64 + nul */
httpSetAuthString(http, NULL, NULL);
if ((http->authstring = malloc(authsize)) == NULL)
if ((http->authstring = malloc((size_t)authsize)) == NULL)
{
http->authstring = http->_authstring;
authsize = sizeof(http->_authstring);
}
strlcpy(http->authstring, "Negotiate ", authsize);
strlcpy(http->authstring, "Negotiate ", (size_t)authsize);
httpEncode64_2(http->authstring + 10, authsize - 10, output_token.value,
output_token.length);
(int)output_token.length);
gss_release_buffer(&minor_status, &output_token);
}
@@ -773,7 +761,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
if (
# ifdef HAVE_GSSAPI
strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) &&
_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) &&
# endif /* HAVE_GSSAPI */
# ifdef HAVE_AUTHORIZATION_H
!httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
@@ -820,7 +808,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
filename, strerror(errno)));
# ifdef HAVE_GSSAPI
if (!strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
if (!_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
{
/*
* Kerberos required, don't try the root certificate...
@@ -888,5 +876,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
/*
* End of "$Id: auth.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: auth.c 12619 2015-05-06 21:00:19Z msweet $".
*/
+12 -18
Ver Arquivo
@@ -1,24 +1,18 @@
/*
* "$Id: backchannel.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: backchannel.c 11558 2014-02-06 18:33:34Z msweet $"
*
* Backchannel functions for CUPS.
* Backchannel functions for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsBackChannelRead() - Read data from the backchannel.
* cupsBackChannelWrite() - Write data to the backchannel.
* cups_setup() - Setup select()
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -169,7 +163,7 @@ cupsBackChannelWrite(
*/
buffer += count;
total += count;
total += (size_t)count;
}
}
@@ -195,5 +189,5 @@ cups_setup(fd_set *set, /* I - Set for select() */
/*
* End of "$Id: backchannel.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: backchannel.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+14 -28
Ver Arquivo
@@ -1,34 +1,20 @@
/*
* "$Id: conflicts.c 3933 2012-10-01 03:01:10Z msweet $"
* "$Id: conflicts.c 11558 2014-02-06 18:33:34Z msweet $"
*
* Option marking routines for CUPS.
* Option marking routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* PostScript is a trademark of Adobe Systems, Inc.
* PostScript is a trademark of Adobe Systems, Inc.
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsGetConflicts() - Get a list of conflicting options in a marked
* PPD.
* cupsResolveConflicts() - Resolve conflicts in a marked PPD.
* ppdConflicts() - Check to see if there are any conflicts among
* the marked option choices.
* ppdInstallableConflict() - Test whether an option choice conflicts with an
* installable option.
* ppd_is_installable() - Determine whether an option is in the
* InstallableOptions group.
* ppd_load_constraints() - Load constraints from a PPD file.
* ppd_test_constraints() - See if any constraints are active.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -193,7 +179,7 @@ cupsResolveConflicts(
tries, /* Number of tries */
num_newopts; /* Number of new options */
cups_option_t *newopts; /* New options */
cups_array_t *active, /* Active constraints */
cups_array_t *active = NULL, /* Active constraints */
*pass, /* Resolvers for this pass */
*resolvers, /* Resolvers we have used */
*test; /* Test array for conflicts */
@@ -886,7 +872,7 @@ ppd_load_constraints(ppd_file_t *ppd) /* I - PPD file */
return;
}
if ((constptr = calloc(i, sizeof(_ppd_cups_uiconst_t))) == NULL)
if ((constptr = calloc((size_t)i, sizeof(_ppd_cups_uiconst_t))) == NULL)
{
free(consts);
DEBUG_puts("8ppd_load_constraints: Unable to allocate memory for "
@@ -1210,5 +1196,5 @@ ppd_test_constraints(
/*
* End of "$Id: conflicts.c 3933 2012-10-01 03:01:10Z msweet $".
* End of "$Id: conflicts.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+5 -5
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: cups-private.h 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: cups-private.h 12441 2015-01-29 14:42:32Z msweet $"
*
* Private definitions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -166,9 +166,9 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
void *server_cert_data;
/* Server certificate user data */
int server_version, /* Server IPP version */
any_root, /* Allow any root */
any_root, /* Allow any (e.g., self-signed) root */
expired_certs, /* Allow expired certs */
expired_root; /* Allow expired root */
validate_certs; /* Validate certificates */
/* util.c */
char def_printer[256];
@@ -281,5 +281,5 @@ extern char *_cupsUserDefault(char *name, size_t namesize);
#endif /* !_CUPS_CUPS_PRIVATE_H_ */
/*
* End of "$Id: cups-private.h 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: cups-private.h 12441 2015-01-29 14:42:32Z msweet $".
*/
+24 -11
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: cups.h 12025 2014-07-15 13:00:17Z msweet $"
* "$Id: cups.h 12998 2015-12-02 15:09:04Z msweet $"
*
* API definitions for CUPS.
*
@@ -35,6 +35,15 @@ typedef off_t ssize_t; /* @private@ */
# include "language.h"
# include "pwg.h"
/*
* Define _PPD_DEPRECATED to silence the warnings about PPD functions being
* deprecated...
*/
# ifndef _PPD_DEPRECATED
# define _PPD_DEPRECATED _CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo and friends instead.")
# endif /* !_PPD_DEPRECATED */
/*
* C++ magic...
@@ -49,10 +58,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 1.0705
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 7
# define CUPS_VERSION_PATCH 5
# define CUPS_VERSION 2.0102
# define CUPS_VERSION_MAJOR 2
# define CUPS_VERSION_MINOR 1
# define CUPS_VERSION_PATCH 2
# define CUPS_BC_FD 3
/* Back-channel file descriptor for
@@ -241,6 +250,7 @@ enum cups_ptype_e /* Printer type/capability bit
* @since CUPS 1.4/OS X 10.6@ */
CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities
* @since CUPS 1.4/OS X 10.6@ */
CUPS_PRINTER_3D = 0x8000000, /* 3D Printing @since CUPS 2.1@ */
CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT |
* DEFAULT | FAX | REJECTING | DELETE |
* NOT_SHARED | AUTHENTICATED |
@@ -354,8 +364,7 @@ extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDes
extern const char *cupsGetDefault(void);
extern int cupsGetJobs(cups_job_t **jobs, const char *name,
int myjobs, int whichjobs);
extern const char *cupsGetPPD(const char *name)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo instead.");
extern const char *cupsGetPPD(const char *name) _PPD_DEPRECATED;
extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
extern ipp_status_t cupsLastError(void);
extern int cupsPrintFile(const char *name, const char *filename,
@@ -413,8 +422,7 @@ extern int cupsGetDests2(http_t *http, cups_dest_t **dests)
extern int cupsGetJobs2(http_t *http, cups_job_t **jobs,
const char *name, int myjobs,
int whichjobs) _CUPS_API_1_1_21;
extern const char *cupsGetPPD2(http_t *http, const char *name)
_CUPS_DEPRECATED_1_6_MSG("Use cupsCopyDestInfo instead.");
extern const char *cupsGetPPD2(http_t *http, const char *name) _PPD_DEPRECATED;
extern int cupsPrintFile2(http_t *http, const char *name,
const char *filename,
const char *title, int num_options,
@@ -479,7 +487,7 @@ extern const char *cupsGetPassword2(const char *prompt, http_t *http,
const char *resource) _CUPS_API_1_4;
extern http_status_t cupsGetPPD3(http_t *http, const char *name,
time_t *modtime, char *buffer,
size_t bufsize) _CUPS_API_1_4;
size_t bufsize) _PPD_DEPRECATED;
extern ipp_t *cupsGetResponse(http_t *http,
const char *resource) _CUPS_API_1_4;
extern ssize_t cupsReadResponseData(http_t *http, char *buffer,
@@ -615,6 +623,11 @@ extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
extern const char *cupsUserAgent(void) _CUPS_API_1_7;
/* New in CUPS 2.0/OS X 10.10 */
extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
extern const char *cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, cups_dinfo_t *info, unsigned flags, cups_size_t *size) _CUPS_API_2_0;
extern int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date) _CUPS_API_2_0;
extern int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
# ifdef __cplusplus
}
@@ -623,5 +636,5 @@ extern const char *cupsUserAgent(void) _CUPS_API_1_7;
#endif /* !_CUPS_CUPS_H_ */
/*
* End of "$Id: cups.h 12025 2014-07-15 13:00:17Z msweet $".
* End of "$Id: cups.h 12998 2015-12-02 15:09:04Z msweet $".
*/
+338 -343
Ver Arquivo
@@ -1,24 +1,17 @@
/*
* "$Id: debug.c 4027 2012-11-16 01:00:05Z msweet $"
* "$Id: debug.c 12928 2015-10-23 21:31:58Z msweet $"
*
* Debugging functions for CUPS.
* Debugging functions for CUPS.
*
* Copyright 2008-2012 by Apple Inc.
* Copyright 2008-2015 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* debug_vsnprintf() - Format a string into a fixed size buffer.
* _cups_debug_printf() - Write a formatted line to the log.
* _cups_debug_puts() - Write a single line to the log.
* _cups_debug_set() - Enable or disable debug logging.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -88,325 +81,6 @@ debug_thread_id(void)
}
/*
* 'debug_vsnprintf()' - Format a string into a fixed size buffer.
*/
static int /* O - Number of bytes formatted */
debug_vsnprintf(char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - printf-style format string */
va_list ap) /* I - Pointer to additional arguments */
{
char *bufptr, /* Pointer to position in buffer */
*bufend, /* Pointer to end of buffer */
size, /* Size character (h, l, L) */
type; /* Format type character */
int width, /* Width of field */
prec; /* Number of characters of precision */
char tformat[100], /* Temporary format string for sprintf() */
*tptr, /* Pointer into temporary format */
temp[1024]; /* Buffer for formatted numbers */
char *s; /* Pointer to string */
int bytes; /* Total number of bytes needed */
if (!buffer || bufsize < 2 || !format)
return (-1);
/*
* Loop through the format string, formatting as needed...
*/
bufptr = buffer;
bufend = buffer + bufsize - 1;
bytes = 0;
while (*format)
{
if (*format == '%')
{
tptr = tformat;
*tptr++ = *format++;
if (*format == '%')
{
if (bufptr < bufend)
*bufptr++ = *format;
bytes ++;
format ++;
continue;
}
else if (strchr(" -+#\'", *format))
*tptr++ = *format++;
if (*format == '*')
{
/*
* Get width from argument...
*/
format ++;
width = va_arg(ap, int);
snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", width);
tptr += strlen(tptr);
}
else
{
width = 0;
while (isdigit(*format & 255))
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
width = width * 10 + *format++ - '0';
}
}
if (*format == '.')
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
format ++;
if (*format == '*')
{
/*
* Get precision from argument...
*/
format ++;
prec = va_arg(ap, int);
snprintf(tptr, sizeof(tformat) - (tptr - tformat), "%d", prec);
tptr += strlen(tptr);
}
else
{
prec = 0;
while (isdigit(*format & 255))
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
prec = prec * 10 + *format++ - '0';
}
}
}
if (*format == 'l' && format[1] == 'l')
{
size = 'L';
if (tptr < (tformat + sizeof(tformat) - 2))
{
*tptr++ = 'l';
*tptr++ = 'l';
}
format += 2;
}
else if (*format == 'h' || *format == 'l' || *format == 'L')
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
size = *format++;
}
else
size = 0;
if (!*format)
break;
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
type = *format++;
*tptr = '\0';
switch (type)
{
case 'E' : /* Floating point formats */
case 'G' :
case 'e' :
case 'f' :
case 'g' :
if ((width + 2) > sizeof(temp))
break;
sprintf(temp, tformat, va_arg(ap, double));
bytes += (int)strlen(temp);
if (bufptr)
{
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr += strlen(bufptr);
}
break;
case 'B' : /* Integer formats */
case 'X' :
case 'b' :
case 'd' :
case 'i' :
case 'o' :
case 'u' :
case 'x' :
if ((width + 2) > sizeof(temp))
break;
# ifdef HAVE_LONG_LONG
if (size == 'L')
sprintf(temp, tformat, va_arg(ap, long long));
else
# endif /* HAVE_LONG_LONG */
if (size == 'l')
sprintf(temp, tformat, va_arg(ap, long));
else
sprintf(temp, tformat, va_arg(ap, int));
bytes += (int)strlen(temp);
if (bufptr)
{
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr += strlen(bufptr);
}
break;
case 'p' : /* Pointer value */
if ((width + 2) > sizeof(temp))
break;
sprintf(temp, tformat, va_arg(ap, void *));
bytes += (int)strlen(temp);
if (bufptr)
{
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr += strlen(bufptr);
}
break;
case 'c' : /* Character or character array */
bytes += width;
if (bufptr)
{
if (width <= 1)
*bufptr++ = va_arg(ap, int);
else
{
if ((bufptr + width) > bufend)
width = (int)(bufend - bufptr);
memcpy(bufptr, va_arg(ap, char *), (size_t)width);
bufptr += width;
}
}
break;
case 's' : /* String */
if ((s = va_arg(ap, char *)) == NULL)
s = "(null)";
/*
* Copy the C string, replacing control chars and \ with
* C character escapes...
*/
for (bufend --; *s && bufptr < bufend; s ++)
{
if (*s == '\n')
{
*bufptr++ = '\\';
*bufptr++ = 'n';
bytes += 2;
}
else if (*s == '\r')
{
*bufptr++ = '\\';
*bufptr++ = 'r';
bytes += 2;
}
else if (*s == '\t')
{
*bufptr++ = '\\';
*bufptr++ = 't';
bytes += 2;
}
else if (*s == '\\')
{
*bufptr++ = '\\';
*bufptr++ = '\\';
bytes += 2;
}
else if (*s == '\'')
{
*bufptr++ = '\\';
*bufptr++ = '\'';
bytes += 2;
}
else if (*s == '\"')
{
*bufptr++ = '\\';
*bufptr++ = '\"';
bytes += 2;
}
else if ((*s & 255) < ' ')
{
if ((bufptr + 2) >= bufend)
break;
*bufptr++ = '\\';
*bufptr++ = '0';
*bufptr++ = '0' + *s / 8;
*bufptr++ = '0' + (*s & 7);
bytes += 4;
}
else
{
*bufptr++ = *s;
bytes ++;
}
}
bufend ++;
break;
case 'n' : /* Output number of chars so far */
*(va_arg(ap, int *)) = bytes;
break;
}
}
else
{
bytes ++;
if (bufptr < bufend)
*bufptr++ = *format;
format ++;
}
}
/*
* Nul-terminate the string and return the number of characters needed.
*/
*bufptr = '\0';
return (bytes);
}
/*
* '_cups_debug_printf()' - Write a formatted line to the log.
*/
@@ -418,7 +92,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
va_list ap; /* Pointer to arguments */
struct timeval curtime; /* Current time */
char buffer[2048]; /* Output buffer */
size_t bytes; /* Number of bytes in buffer */
ssize_t bytes; /* Number of bytes in buffer */
int level; /* Log level in message */
@@ -468,10 +142,10 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
(int)(curtime.tv_sec % 60), (int)(curtime.tv_usec / 1000));
va_start(ap, format);
bytes = debug_vsnprintf(buffer + 19, sizeof(buffer) - 20, format, ap) + 19;
bytes = _cups_safe_vsnprintf(buffer + 19, sizeof(buffer) - 20, format, ap) + 19;
va_end(ap);
if (bytes >= (sizeof(buffer) - 1))
if ((size_t)bytes >= (sizeof(buffer) - 1))
{
buffer[sizeof(buffer) - 2] = '\n';
bytes = sizeof(buffer) - 1;
@@ -487,7 +161,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
*/
_cupsMutexLock(&debug_log_mutex);
write(_cups_debug_fd, buffer, bytes);
write(_cups_debug_fd, buffer, (size_t)bytes);
_cupsMutexUnlock(&debug_log_mutex);
}
@@ -501,7 +175,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
{
struct timeval curtime; /* Current time */
char buffer[2048]; /* Output buffer */
size_t bytes; /* Number of bytes in buffer */
ssize_t bytes; /* Number of bytes in buffer */
int level; /* Log level in message */
@@ -551,7 +225,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
(int)(curtime.tv_sec % 60), (int)(curtime.tv_usec / 1000),
s);
if (bytes >= (sizeof(buffer) - 1))
if ((size_t)bytes >= (sizeof(buffer) - 1))
{
buffer[sizeof(buffer) - 2] = '\n';
bytes = sizeof(buffer) - 1;
@@ -567,7 +241,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
*/
_cupsMutexLock(&debug_log_mutex);
write(_cups_debug_fd, buffer, bytes);
write(_cups_debug_fd, buffer, (size_t)bytes);
_cupsMutexUnlock(&debug_log_mutex);
}
@@ -650,5 +324,326 @@ _cups_debug_set(const char *logfile, /* I - Log file or NULL */
/*
* End of "$Id: debug.c 4027 2012-11-16 01:00:05Z msweet $".
* '_cups_safe_vsnprintf()' - Format a string into a fixed size buffer,
* quoting special characters.
*/
ssize_t /* O - Number of bytes formatted */
_cups_safe_vsnprintf(
char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - printf-style format string */
va_list ap) /* I - Pointer to additional arguments */
{
char *bufptr, /* Pointer to position in buffer */
*bufend, /* Pointer to end of buffer */
size, /* Size character (h, l, L) */
type; /* Format type character */
int width, /* Width of field */
prec; /* Number of characters of precision */
char tformat[100], /* Temporary format string for snprintf() */
*tptr, /* Pointer into temporary format */
temp[1024]; /* Buffer for formatted numbers */
char *s; /* Pointer to string */
ssize_t bytes; /* Total number of bytes needed */
if (!buffer || bufsize < 2 || !format)
return (-1);
/*
* Loop through the format string, formatting as needed...
*/
bufptr = buffer;
bufend = buffer + bufsize - 1;
bytes = 0;
while (*format)
{
if (*format == '%')
{
tptr = tformat;
*tptr++ = *format++;
if (*format == '%')
{
if (bufptr < bufend)
*bufptr++ = *format;
bytes ++;
format ++;
continue;
}
else if (strchr(" -+#\'", *format))
*tptr++ = *format++;
if (*format == '*')
{
/*
* Get width from argument...
*/
format ++;
width = va_arg(ap, int);
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", width);
tptr += strlen(tptr);
}
else
{
width = 0;
while (isdigit(*format & 255))
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
width = width * 10 + *format++ - '0';
}
}
if (*format == '.')
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
format ++;
if (*format == '*')
{
/*
* Get precision from argument...
*/
format ++;
prec = va_arg(ap, int);
snprintf(tptr, sizeof(tformat) - (size_t)(tptr - tformat), "%d", prec);
tptr += strlen(tptr);
}
else
{
prec = 0;
while (isdigit(*format & 255))
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
prec = prec * 10 + *format++ - '0';
}
}
}
if (*format == 'l' && format[1] == 'l')
{
size = 'L';
if (tptr < (tformat + sizeof(tformat) - 2))
{
*tptr++ = 'l';
*tptr++ = 'l';
}
format += 2;
}
else if (*format == 'h' || *format == 'l' || *format == 'L')
{
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
size = *format++;
}
else
size = 0;
if (!*format)
break;
if (tptr < (tformat + sizeof(tformat) - 1))
*tptr++ = *format;
type = *format++;
*tptr = '\0';
switch (type)
{
case 'E' : /* Floating point formats */
case 'G' :
case 'e' :
case 'f' :
case 'g' :
if ((size_t)(width + 2) > sizeof(temp))
break;
snprintf(temp, sizeof(temp), tformat, va_arg(ap, double));
bytes += (int)strlen(temp);
if (bufptr)
{
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr += strlen(bufptr);
}
break;
case 'B' : /* Integer formats */
case 'X' :
case 'b' :
case 'd' :
case 'i' :
case 'o' :
case 'u' :
case 'x' :
if ((size_t)(width + 2) > sizeof(temp))
break;
# ifdef HAVE_LONG_LONG
if (size == 'L')
snprintf(temp, sizeof(temp), tformat, va_arg(ap, long long));
else
# endif /* HAVE_LONG_LONG */
if (size == 'l')
snprintf(temp, sizeof(temp), tformat, va_arg(ap, long));
else
snprintf(temp, sizeof(temp), tformat, va_arg(ap, int));
bytes += (int)strlen(temp);
if (bufptr)
{
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr += strlen(bufptr);
}
break;
case 'p' : /* Pointer value */
if ((size_t)(width + 2) > sizeof(temp))
break;
snprintf(temp, sizeof(temp), tformat, va_arg(ap, void *));
bytes += (int)strlen(temp);
if (bufptr)
{
strlcpy(bufptr, temp, (size_t)(bufend - bufptr));
bufptr += strlen(bufptr);
}
break;
case 'c' : /* Character or character array */
bytes += width;
if (bufptr)
{
if (width <= 1)
*bufptr++ = (char)va_arg(ap, int);
else
{
if ((bufptr + width) > bufend)
width = (int)(bufend - bufptr);
memcpy(bufptr, va_arg(ap, char *), (size_t)width);
bufptr += width;
}
}
break;
case 's' : /* String */
if ((s = va_arg(ap, char *)) == NULL)
s = "(null)";
/*
* Copy the C string, replacing control chars and \ with
* C character escapes...
*/
for (bufend --; *s && bufptr < bufend; s ++)
{
if (*s == '\n')
{
*bufptr++ = '\\';
*bufptr++ = 'n';
bytes += 2;
}
else if (*s == '\r')
{
*bufptr++ = '\\';
*bufptr++ = 'r';
bytes += 2;
}
else if (*s == '\t')
{
*bufptr++ = '\\';
*bufptr++ = 't';
bytes += 2;
}
else if (*s == '\\')
{
*bufptr++ = '\\';
*bufptr++ = '\\';
bytes += 2;
}
else if (*s == '\'')
{
*bufptr++ = '\\';
*bufptr++ = '\'';
bytes += 2;
}
else if (*s == '\"')
{
*bufptr++ = '\\';
*bufptr++ = '\"';
bytes += 2;
}
else if ((*s & 255) < ' ')
{
if ((bufptr + 2) >= bufend)
break;
*bufptr++ = '\\';
*bufptr++ = '0';
*bufptr++ = '0' + *s / 8;
*bufptr++ = '0' + (*s & 7);
bytes += 4;
}
else
{
*bufptr++ = *s;
bytes ++;
}
}
bufend ++;
break;
case 'n' : /* Output number of chars so far */
*(va_arg(ap, int *)) = (int)bytes;
break;
}
}
else
{
bytes ++;
if (bufptr < bufend)
*bufptr++ = *format;
format ++;
}
}
/*
* Nul-terminate the string and return the number of characters needed.
*/
*bufptr = '\0';
return (bytes);
}
/*
* End of "$Id: debug.c 12928 2015-10-23 21:31:58Z msweet $".
*/
+17 -19
Ver Arquivo
@@ -1,25 +1,17 @@
/*
* "$Id: dest-job.c 4274 2013-04-09 20:10:23Z msweet $"
* "$Id: dest-job.c 11558 2014-02-06 18:33:34Z msweet $"
*
* Destination job support for CUPS.
* Destination job support for CUPS.
*
* Copyright 2012-2013 by Apple Inc.
* Copyright 2012-2014 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsCancelDestJob() - Cancel a job on a destination.
* cupsCloseDestJob() - Close a job and start printing.
* cupsCreateDestJob() - Create a job on a destination.
* cupsFinishDestDocument() - Finish the current document.
* cupsStartDestDocument() - Start a new document.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -45,6 +37,12 @@ cupsCancelDestJob(http_t *http, /* I - Connection to destination */
cups_dest_t *dest, /* I - Destination */
int job_id) /* I - Job ID */
{
/* TODO: Needs to be implemented! */
/* Probably also needs to be revved to accept cups_dinfo_t... */
(void)http;
(void)dest;
(void)job_id;
return (IPP_STATUS_ERROR_NOT_FOUND);
}
@@ -344,7 +342,7 @@ cupsStartDestDocument(
if (format)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
"document-format", NULL, format);
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", last_document);
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", (char)last_document);
cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION);
cupsEncodeOptions2(request, num_options, options, IPP_TAG_DOCUMENT);
@@ -362,5 +360,5 @@ cupsStartDestDocument(
/*
* End of "$Id: dest-job.c 4274 2013-04-09 20:10:23Z msweet $".
* End of "$Id: dest-job.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+175 -23
Ver Arquivo
@@ -1,28 +1,17 @@
/*
* "$Id: dest-localization.c 4216 2013-03-11 13:57:36Z msweet $"
* "$Id: dest-localization.c 12094 2014-08-19 12:15:11Z msweet $"
*
* Destination localization support for CUPS.
* Destination localization support for CUPS.
*
* Copyright 2012-2013 by Apple Inc.
* Copyright 2012-2014 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsLocalizeDestOption() - Get the localized string for a destination
* option.
* cupsLocalizeDestValue() - Get the localized string for a destination
* option+value pair.
* cups_create_localizations() - Create the localizations array for a
* destination.
* cups_read_strings() - Read a pair of strings from a .strings file.
* cups_scan_strings() - Scan a quoted string.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -42,6 +31,170 @@ static int cups_read_strings(cups_file_t *fp, char *buffer, size_t bufsize,
static char *cups_scan_strings(char *buffer);
/*
* 'cupsLocalizeDestMedia()' - Get the localized string for a destination media
* size.
*
* The returned string is stored in the destination information and will become
* invalid if the destination information is deleted.
*
* @since CUPS 2.0/OS X 10.10@
*/
const char * /* O - Localized string */
cupsLocalizeDestMedia(
http_t *http, /* I - Connection to destination */
cups_dest_t *dest, /* I - Destination */
cups_dinfo_t *dinfo, /* I - Destination information */
unsigned flags, /* I - Media flags */
cups_size_t *size) /* I - Media size */
{
cups_lang_t *lang; /* Standard localizations */
_cups_message_t key, /* Search key */
*match; /* Matching entry */
pwg_media_t *pwg; /* PWG media information */
cups_array_t *db; /* Media database */
_cups_media_db_t *mdb; /* Media database entry */
char name[1024], /* Size name */
temp[256]; /* Temporary string */
const char *lsize, /* Localized media size */
*lsource, /* Localized media source */
*ltype; /* Localized media type */
/*
* Range check input...
*/
if (!http || !dest || !dinfo || !size)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
return (NULL);
}
/*
* See if the localization is cached...
*/
if (!dinfo->localizations)
cups_create_localizations(http, dinfo);
key.id = size->media;
if ((match = (_cups_message_t *)cupsArrayFind(dinfo->localizations, &key)) != NULL)
return (match->str);
/*
* If not, get the localized size, source, and type strings...
*/
lang = cupsLangDefault();
pwg = pwgMediaForSize(size->width, size->length);
if (pwg->ppd)
lsize = _cupsLangString(lang, pwg->ppd);
else
lsize = NULL;
if (!lsize)
{
if ((size->width % 635) == 0 && (size->length % 635) == 0)
{
/*
* Use inches since the size is a multiple of 1/4 inch.
*/
snprintf(temp, sizeof(temp), _cupsLangString(lang, _("%g x %g")), size->width / 2540.0, size->length / 2540.0);
}
else
{
/*
* Use millimeters since the size is not a multiple of 1/4 inch.
*/
snprintf(temp, sizeof(temp), _cupsLangString(lang, _("%d x %d mm")), (size->width + 50) / 100, (size->length + 50) / 100);
}
lsize = temp;
}
if (flags & CUPS_MEDIA_FLAGS_READY)
db = dinfo->ready_db;
else
db = dinfo->media_db;
DEBUG_printf(("1cupsLocalizeDestMedia: size->media=\"%s\"", size->media));
for (mdb = (_cups_media_db_t *)cupsArrayFirst(db); mdb; mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (mdb->key && !strcmp(mdb->key, size->media))
break;
else if (mdb->size_name && !strcmp(mdb->size_name, size->media))
break;
}
if (!mdb)
{
for (mdb = (_cups_media_db_t *)cupsArrayFirst(db); mdb; mdb = (_cups_media_db_t *)cupsArrayNext(db))
{
if (mdb->width == size->width && mdb->length == size->length && mdb->bottom == size->bottom && mdb->left == size->left && mdb->right == size->right && mdb->top == size->top)
break;
}
}
if (mdb)
{
DEBUG_printf(("1cupsLocalizeDestMedia: MATCH mdb%p [key=\"%s\" size_name=\"%s\" source=\"%s\" type=\"%s\" width=%d length=%d B%d L%d R%d T%d]", mdb, mdb->key, mdb->size_name, mdb->source, mdb->type, mdb->width, mdb->length, mdb->bottom, mdb->left, mdb->right, mdb->top));
lsource = cupsLocalizeDestValue(http, dest, dinfo, "media-source", mdb->source);
ltype = cupsLocalizeDestValue(http, dest, dinfo, "media-type", mdb->type);
}
else
{
lsource = NULL;
ltype = NULL;
}
if (!lsource && !ltype)
{
if (size->bottom || size->left || size->right || size->top)
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless)")), lsize);
else
strlcpy(name, lsize, sizeof(name));
}
else if (!lsource)
{
if (size->bottom || size->left || size->right || size->top)
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless, %s)")), lsize, ltype);
else
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (%s)")), lsize, ltype);
}
else if (!ltype)
{
if (size->bottom || size->left || size->right || size->top)
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless, %s)")), lsize, lsource);
else
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (%s)")), lsize, lsource);
}
else
{
if (size->bottom || size->left || size->right || size->top)
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (Borderless, %s, %s)")), lsize, ltype, lsource);
else
snprintf(name, sizeof(name), _cupsLangString(lang, _("%s (%s, %s)")), lsize, ltype, lsource);
}
if ((match = (_cups_message_t *)calloc(1, sizeof(_cups_message_t))) == NULL)
return (NULL);
match->id = strdup(size->media);
match->str = strdup(name);
cupsArrayAdd(dinfo->localizations, match);
return (match->str);
}
/*
* 'cupsLocalizeDestOption()' - Get the localized string for a destination
* option.
@@ -356,8 +509,7 @@ cups_scan_strings(char *buffer) /* I - Start of string */
* Decode \nnn octal escape...
*/
*bufptr = ((((bufptr[1] - '0') << 3) | (bufptr[2] - '0')) << 3) |
(bufptr[3] - '0');
*bufptr = (char)(((((bufptr[1] - '0') << 3) | (bufptr[2] - '0')) << 3) | (bufptr[3] - '0'));
_cups_strcpy(bufptr + 1, bufptr + 4);
}
else
@@ -383,5 +535,5 @@ cups_scan_strings(char *buffer) /* I - Start of string */
/*
* End of "$Id: dest-localization.c 4216 2013-03-11 13:57:36Z msweet $".
* End of "$Id: dest-localization.c 12094 2014-08-19 12:15:11Z msweet $".
*/
+14 -54
Ver Arquivo
@@ -1,55 +1,17 @@
/*
* "$Id: dest-options.c 11883 2014-05-16 21:04:07Z msweet $"
* "$Id: dest-options.c 11882 2014-05-16 21:02:15Z msweet $"
*
* Destination option/media support for CUPS.
* Destination option/media support for CUPS.
*
* Copyright 2012-2013 by Apple Inc.
* Copyright 2012-2014 by Apple Inc.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsCheckDestSupported() - Check that the option and value are supported
* by the destination.
* cupsCopyDestConflicts() - Get conflicts and resolutions for a new
* option/value pair.
* cupsCopyDestInfo() - Get the supported values/capabilities for the
* destination.
* cupsFindDestDefault() - Find the default value(s) for the given
* option.
* cupsFindDestReady() - Find the default value(s) for the given
* option.
* cupsFindDestSupported() - Find the default value(s) for the given
* option.
* cupsFreeDestInfo() - Free destination information obtained using
* @link cupsCopyDestInfo@.
* cupsGetDestMediaByIndex() - Get a media name, dimension, and margins for a
* specific size.
* cupsGetDestMediaByName() - Get media names, dimensions, and margins.
* cupsGetDestMediaBySize() - Get media names, dimensions, and margins.
* cupsGetDestMediaCount() - Get the number of sizes supported by a
* destination.
* cupsGetDestMediaDefault() - Get the default size for a destination.
* cups_add_dconstres() - Add a constraint or resolver to an array.
* cups_compare_dconstres() - Compare to resolver entries.
* cups_compare_media_db() - Compare two media entries.
* cups_copy_media_db() - Copy a media entry.
* cups_create_cached() - Create the media selection cache.
* cups_create_constraints() - Create the constraints and resolvers arrays.
* cups_create_defaults() - Create the -default option array.
* cups_create_media_db() - Create the media database.
* cups_free_media_cb() - Free a media entry.
* cups_get_media_db() - Lookup the media entry for a given size.
* cups_is_close_media_db() - Compare two media entries to see if they are
* close to the same size.
* cups_test_constraints() - Test constraints.
* cups_update_ready() - Update xxx-ready attributes for the printer.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -328,7 +290,7 @@ cupsCopyDestConflicts(
*myres = NULL, /* My resolved options */
*myoption, /* My current option */
*option; /* Current option */
cups_array_t *active, /* Active conflicts */
cups_array_t *active = NULL, /* Active conflicts */
*pass = NULL, /* Resolvers for this pass */
*resolvers = NULL, /* Resolvers we have used */
*test; /* Test array for conflicts */
@@ -669,7 +631,7 @@ cupsCopyDestInfo(
version = 11;
else if (status == IPP_STATUS_ERROR_BUSY)
{
sleep(delay);
sleep((unsigned)delay);
delay = _cupsNextDelay(delay, &prev_delay);
}
@@ -1184,7 +1146,7 @@ cupsGetDestMediaDefault(
* Fall back to the first matching media size...
*/
return (cupsGetDestMediaByIndex(http, dest, dinfo, flags, 0, size));
return (cupsGetDestMediaByIndex(http, dest, dinfo, 0, flags, size));
}
@@ -2286,9 +2248,7 @@ cups_update_ready(http_t *http, /* I - Connection to destination */
dinfo->uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, cupsUser());
ippAddStrings(request, IPP_TAG_OPERATION,
IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "requested-attributes",
(int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_CONST_TAG(IPP_TAG_KEYWORD), "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
dinfo->ready_attrs = cupsDoRequest(http, request, dinfo->resource);
@@ -2307,5 +2267,5 @@ cups_update_ready(http_t *http, /* I - Connection to destination */
/*
* End of "$Id: dest-options.c 11883 2014-05-16 21:04:07Z msweet $".
* End of "$Id: dest-options.c 11882 2014-05-16 21:02:15Z msweet $".
*/
+134 -111
Ver Arquivo
@@ -1,85 +1,18 @@
/*
* "$Id: dest.c 11688 2014-03-05 21:11:32Z msweet $"
* "$Id: dest.c 12733 2015-06-12 01:21:05Z msweet $"
*
* User-defined destination (and option) support for CUPS.
* User-defined destination (and option) support for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsAddDest() - Add a destination to the list of
* destinations.
* _cupsAppleCopyDefaultPaperID() - Get the default paper ID.
* _cupsAppleCopyDefaultPrinter() - Get the default printer at this location.
* _cupsAppleGetUseLastPrinter() - Get whether to use the last used printer.
* _cupsAppleSetDefaultPaperID() - Set the default paper id.
* _cupsAppleSetDefaultPrinter() - Set the default printer for this
* location.
* _cupsAppleSetUseLastPrinter() - Set whether to use the last used printer.
* cupsConnectDest() - Connect to the server for a destination.
* cupsConnectDestBlock() - Connect to the server for a destination.
* cupsCopyDest() - Copy a destination.
* cupsEnumDests() - Enumerate available destinations with a
* callback function.
* cupsEnumDestsBlock() - Enumerate available destinations with a
* block.
* cupsFreeDests() - Free the memory used by the list of
* destinations.
* cupsGetDest() - Get the named destination from the list.
* _cupsGetDestResource() - Get the resource path and URI for a
* destination.
* _cupsGetDests() - Get destinations from a server.
* cupsGetDests() - Get the list of destinations from the
* default server.
* cupsGetDests2() - Get the list of destinations from the
* specified server.
* cupsGetNamedDest() - Get options for the named destination.
* cupsRemoveDest() - Remove a destination from the destination
* list.
* cupsSetDefaultDest() - Set the default destination.
* cupsSetDests() - Save the list of destinations for the
* default server.
* cupsSetDests2() - Save the list of destinations for the
* specified server.
* _cupsUserDefault() - Get the user default printer from
* environment variables and location
* information.
* appleCopyLocations() - Copy the location history array.
* appleCopyNetwork() - Get the network ID for the current
* location.
* appleGetPaperSize() - Get the default paper size.
* appleGetPrinter() - Get a printer from the history array.
* cups_add_dest() - Add a destination to the array.
* cups_block_cb() - Enumeration callback for block API.
* cups_compare_dests() - Compare two destinations.
* cups_dnssd_browse_cb() - Browse for printers.
* cups_dnssd_browse_cb() - Browse for printers.
* cups_dnssd_client_cb() - Avahi client callback function.
* cups_dnssd_compare_device() - Compare two devices.
* cups_dnssd_free_device() - Free the memory used by a device.
* cups_dnssd_get_device() - Lookup a device and create it as needed.
* cups_dnssd_local_cb() - Browse for local printers.
* cups_dnssd_poll_cb() - Wait for input on the specified file
* descriptors.
* cups_dnssd_query_cb() - Process query data.
* cups_dnssd_resolve() - Resolve a Bonjour printer URI.
* cups_dnssd_resolve_cb() - See if we should continue resolving.
* cups_dnssd_unquote() - Unquote a name string.
* cups_find_dest() - Find a destination using a binary search.
* cups_get_default() - Get the default destination from an
* lpoptions file.
* cups_get_dests() - Get destinations from a file.
* cups_make_string() - Make a comma-separated string of values
* from an IPP attribute.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -334,7 +267,7 @@ cupsAddDest(const char *name, /* I - Destination name */
* Copy options from parent...
*/
dest->options = calloc(sizeof(cups_option_t), parent->num_options);
dest->options = calloc(sizeof(cups_option_t), (size_t)parent->num_options);
if (dest->options)
{
@@ -672,9 +605,9 @@ cupsConnectDest(
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
userpass, sizeof(userpass), hostname, sizeof(hostname),
&port, resource, resourcesize) < HTTP_URI_STATUS_OK)
&port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer URI."), 1);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
if (cb)
(*cb)(user_data, CUPS_DEST_FLAGS_UNCONNECTED | CUPS_DEST_FLAGS_ERROR,
@@ -724,6 +657,7 @@ cupsConnectDest(
http = httpConnect2(hostname, port, addrlist, AF_UNSPEC, encryption, 1, 0,
NULL);
httpAddrFreeList(addrlist);
/*
* Connect if requested...
@@ -842,8 +776,7 @@ cupsCopyDest(cups_dest_t *dest,
if (new_dest)
{
if ((new_dest->options = calloc(sizeof(cups_option_t),
dest->num_options)) == NULL)
if ((new_dest->options = calloc(sizeof(cups_option_t), (size_t)dest->num_options)) == NULL)
return (cupsRemoveDest(dest->name, dest->instance, num_dests, dests));
new_dest->num_options = dest->num_options;
@@ -938,7 +871,7 @@ cupsEnumDests(
*/
num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL,
&dests, type, mask);
&dests, type, mask | CUPS_PRINTER_3D);
if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL)
defprinter = name;
@@ -1359,9 +1292,9 @@ _cupsGetDestResource(
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
userpass, sizeof(userpass), hostname, sizeof(hostname),
&port, resource, resourcesize) < HTTP_URI_STATUS_OK)
&port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer URI."), 1);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
return (NULL);
}
@@ -1370,6 +1303,100 @@ _cupsGetDestResource(
}
/*
* 'cupsGetDestWithURI()' - Get a destination associated with a URI.
*
* "name" is the desired name for the printer. If @code NULL@, a name will be
* created using the URI.
*
* "uri" is the "ipp" or "ipps" URI for the printer.
*
* @since CUPS 2.0/OS X 10.10@
*/
cups_dest_t * /* O - Destination or @code NULL@ */
cupsGetDestWithURI(const char *name, /* I - Desired printer name or @code NULL@ */
const char *uri) /* I - URI for the printer */
{
cups_dest_t *dest; /* New destination */
char temp[1024], /* Temporary string */
scheme[256], /* Scheme from URI */
userpass[256], /* Username:password from URI */
hostname[256], /* Hostname from URI */
resource[1024], /* Resource path from URI */
*ptr; /* Pointer into string */
int port; /* Port number from URI */
/*
* Range check input...
*/
if (!uri)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
return (NULL);
}
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK ||
(strncmp(uri, "ipp://", 6) && strncmp(uri, "ipps://", 7)))
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
return (NULL);
}
if (!name)
{
/*
* Create the name from the URI...
*/
if (strstr(hostname, "._tcp"))
{
/*
* Use the service instance name...
*/
if ((ptr = strchr(hostname, '.')) != NULL)
*ptr = '\0';
name = hostname;
}
else if (!strncmp(resource, "/classes/", 9))
{
snprintf(temp, sizeof(temp), "%s @ %s", resource + 9, hostname);
name = temp;
}
else if (!strncmp(resource, "/printers/", 10))
{
snprintf(temp, sizeof(temp), "%s @ %s", resource + 10, hostname);
name = temp;
}
else
{
name = hostname;
}
}
/*
* Create the destination...
*/
if ((dest = calloc(1, sizeof(cups_dest_t))) == NULL)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
return (NULL);
}
dest->name = _cupsStrAlloc(name);
dest->num_options = cupsAddOption("printer-uri-supported", uri, dest->num_options, &(dest->options));
dest->num_options = cupsAddOption("printer-info", name, dest->num_options, &(dest->options));
return (dest);
}
/*
* '_cupsGetDests()' - Get destinations from a server.
*
@@ -1486,10 +1513,8 @@ _cupsGetDests(http_t *http, /* I - Connection to server or
}
else if (mask)
{
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type",
type);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type-mask",
mask);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type", (int)type);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type-mask", (int)mask);
}
/*
@@ -1718,7 +1743,7 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
*/
*dests = (cups_dest_t *)0;
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, dests, 0, 0);
num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, dests, 0, CUPS_PRINTER_3D);
if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
{
@@ -1734,10 +1759,10 @@ cupsGetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
if (num_dests > 0)
{
num_reals = num_dests;
reals = calloc(num_reals, sizeof(cups_dest_t));
reals = calloc((size_t)num_reals, sizeof(cups_dest_t));
if (reals)
memcpy(reals, *dests, num_reals * sizeof(cups_dest_t));
memcpy(reals, *dests, (size_t)num_reals * sizeof(cups_dest_t));
else
num_reals = 0;
}
@@ -1935,7 +1960,7 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
* Get the printer's attributes...
*/
if (!_cupsGetDests(http, op, name, &dest, 0, 0))
if (!_cupsGetDests(http, op, name, &dest, 0, CUPS_PRINTER_3D))
return (NULL);
if (instance)
@@ -2008,10 +2033,10 @@ cupsRemoveDest(const char *name, /* I - Destination name */
num_dests --;
i = dest - *dests;
i = (int)(dest - *dests);
if (i < num_dests)
memmove(dest, dest + 1, (num_dests - i) * sizeof(cups_dest_t));
memmove(dest, dest + 1, (size_t)(num_dests - i) * sizeof(cups_dest_t));
return (num_dests);
}
@@ -2111,7 +2136,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
* Get the server destinations...
*/
num_temps = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &temps, 0, 0);
num_temps = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, &temps, 0, CUPS_PRINTER_3D);
if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE)
{
@@ -2345,7 +2370,7 @@ _cupsUserDefault(char *name, /* I - Name buffer */
if ((locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
{
CFStringGetCString(locprinter, name, namesize, kCFStringEncodingUTF8);
CFStringGetCString(locprinter, name, (CFIndex)namesize, kCFStringEncodingUTF8);
CFRelease(locprinter);
}
else
@@ -2553,7 +2578,7 @@ cups_add_dest(const char *name, /* I - Name of destination */
if (*num_dests == 0)
dest = malloc(sizeof(cups_dest_t));
else
dest = realloc(*dests, sizeof(cups_dest_t) * (*num_dests + 1));
dest = realloc(*dests, sizeof(cups_dest_t) * (size_t)(*num_dests + 1));
if (!dest)
return (NULL);
@@ -2580,8 +2605,7 @@ cups_add_dest(const char *name, /* I - Name of destination */
*/
if (insert < *num_dests)
memmove(*dests + insert + 1, *dests + insert,
(*num_dests - insert) * sizeof(cups_dest_t));
memmove(*dests + insert + 1, *dests + insert, (size_t)(*num_dests - insert) * sizeof(cups_dest_t));
(*num_dests) ++;
@@ -3186,7 +3210,7 @@ cups_dnssd_query_cb(
txtnext = txt + txtlen;
for (ptr = key; txt < txtnext && *txt != '='; txt ++)
*ptr++ = *txt;
*ptr++ = (char)*txt;
*ptr = '\0';
if (txt < txtnext && *txt == '=')
@@ -3194,7 +3218,7 @@ cups_dnssd_query_cb(
txt ++;
if (txt < txtnext)
memcpy(value, txt, txtnext - txt);
memcpy(value, txt, (size_t)(txtnext - txt));
value[txtnext - txt] = '\0';
DEBUG_printf(("6cups_dnssd_query_cb: %s=%s", key, value));
@@ -3271,7 +3295,7 @@ cups_dnssd_query_cb(
*/
saw_printer_type = 1;
type = strtol(value, NULL, 0);
type = (cups_ptype_t)strtol(value, NULL, 0);
}
else if (!saw_printer_type)
{
@@ -3419,7 +3443,7 @@ cups_dnssd_resolve(
_HTTP_RESOLVE_FQDN, cups_dnssd_resolve_cb,
&resolve)) == NULL)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to resolve printer URI."), 1);
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to resolve printer-uri."), 1);
if (cb)
(*cb)(user_data, CUPS_DEST_FLAGS_UNCONNECTED | CUPS_DEST_FLAGS_ERROR,
@@ -3873,22 +3897,21 @@ cups_make_string(
{
case IPP_TAG_INTEGER :
case IPP_TAG_ENUM :
snprintf(ptr, end - ptr + 1, "%d", attr->values[i].integer);
snprintf(ptr, (size_t)(end - ptr + 1), "%d", attr->values[i].integer);
break;
case IPP_TAG_BOOLEAN :
if (attr->values[i].boolean)
strlcpy(ptr, "true", end - ptr + 1);
strlcpy(ptr, "true", (size_t)(end - ptr + 1));
else
strlcpy(ptr, "false", end - ptr + 1);
strlcpy(ptr, "false", (size_t)(end - ptr + 1));
break;
case IPP_TAG_RANGE :
if (attr->values[i].range.lower == attr->values[i].range.upper)
snprintf(ptr, end - ptr + 1, "%d", attr->values[i].range.lower);
snprintf(ptr, (size_t)(end - ptr + 1), "%d", attr->values[i].range.lower);
else
snprintf(ptr, end - ptr + 1, "%d-%d", attr->values[i].range.lower,
attr->values[i].range.upper);
snprintf(ptr, (size_t)(end - ptr + 1), "%d-%d", attr->values[i].range.lower, attr->values[i].range.upper);
break;
default :
@@ -3920,5 +3943,5 @@ cups_make_string(
/*
* End of "$Id: dest.c 11688 2014-03-05 21:11:32Z msweet $".
* End of "$Id: dest.c 12733 2015-06-12 01:21:05Z msweet $".
*/
+28 -51
Ver Arquivo
@@ -1,37 +1,20 @@
/*
* "$Id: emit.c 10996 2013-05-29 11:51:34Z msweet $"
* "$Id: emit.c 11594 2014-02-14 20:09:01Z msweet $"
*
* PPD code emission routines for CUPS.
* PPD code emission routines for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* PostScript is a trademark of Adobe Systems, Inc.
* PostScript is a trademark of Adobe Systems, Inc.
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* ppdCollect() - Collect all marked options that reside in the
* specified section.
* ppdCollect2() - Collect all marked options that reside in the
* specified section and minimum order.
* ppdEmit() - Emit code for marked options to a file.
* ppdEmitAfterOrder() - Emit a subset of the code for marked options to a
* file.
* ppdEmitFd() - Emit code for marked options to a file.
* ppdEmitJCL() - Emit code for JCL options to a file.
* ppdEmitJCLEnd() - Emit JCLEnd code to a file.
* ppdEmitString() - Get a string containing the code for marked
* options.
* ppd_compare_cparams() - Compare the order of two custom parameters.
* ppd_handle_media() - Handle media selection...
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -121,13 +104,13 @@ ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */
count = 0;
if ((collect = calloc(sizeof(ppd_choice_t *),
cupsArrayCount(ppd->marked))) == NULL)
(size_t)cupsArrayCount(ppd->marked))) == NULL)
{
*choices = NULL;
return (0);
}
if ((orders = calloc(sizeof(float), cupsArrayCount(ppd->marked))) == NULL)
if ((orders = calloc(sizeof(float), (size_t)cupsArrayCount(ppd->marked))) == NULL)
{
*choices = NULL;
free(collect);
@@ -358,7 +341,7 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
break;
}
buflength -= bytes;
buflength -= (size_t)bytes;
bufptr += bytes;
}
@@ -831,8 +814,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
break;
case PPD_CUSTOM_INT :
snprintf(bufptr, bufend - bufptr, "%d",
cparam->current.custom_int);
snprintf(bufptr, (size_t)(bufend - bufptr), "%d", cparam->current.custom_int);
bufptr += strlen(bufptr);
break;
@@ -841,8 +823,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
case PPD_CUSTOM_STRING :
if (cparam->current.custom_string)
{
strlcpy(bufptr, cparam->current.custom_string,
bufend - bufptr);
strlcpy(bufptr, cparam->current.custom_string, (size_t)(bufend - bufptr));
bufptr += strlen(bufptr);
}
break;
@@ -862,7 +843,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
* Otherwise just copy the option code directly...
*/
strlcpy(bufptr, choices[i]->code, bufend - bufptr + 1);
strlcpy(bufptr, choices[i]->code, (size_t)(bufend - bufptr + 1));
bufptr += strlen(bufptr);
}
}
@@ -873,7 +854,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
* options...
*/
strlcpy(bufptr, "[{\n", bufend - bufptr + 1);
strlcpy(bufptr, "[{\n", (size_t)(bufend - bufptr + 1));
bufptr += 3;
/*
@@ -898,8 +879,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
float values[5]; /* Values for custom command */
strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n",
bufend - bufptr + 1);
strlcpy(bufptr, "%%BeginFeature: *CustomPageSize True\n", (size_t)(bufend - bufptr + 1));
bufptr += 37;
size = ppdPageSize(ppd, "Custom");
@@ -994,7 +974,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
* Level 2 command sequence...
*/
strlcpy(bufptr, ppd_custom_code, bufend - bufptr + 1);
strlcpy(bufptr, ppd_custom_code, (size_t)(bufend - bufptr + 1));
bufptr += strlen(bufptr);
}
}
@@ -1017,8 +997,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
cupsArrayAdd(params, cparam);
snprintf(bufptr, bufend - bufptr + 1,
"%%%%BeginFeature: *Custom%s True\n", coption->keyword);
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%%%%BeginFeature: *Custom%s True\n", coption->keyword);
bufptr += strlen(bufptr);
for (cparam = (ppd_cparam_t *)cupsArrayFirst(params);
@@ -1037,8 +1016,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
break;
case PPD_CUSTOM_INT :
snprintf(bufptr, bufend - bufptr + 1, "%d\n",
cparam->current.custom_int);
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%d\n", cparam->current.custom_int);
bufptr += strlen(bufptr);
break;
@@ -1053,7 +1031,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
{
if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127)
{
snprintf(bufptr, bufend - bufptr + 1, "\\%03o", *s & 255);
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "\\%03o", *s & 255);
bufptr += strlen(bufptr);
}
else
@@ -1071,15 +1049,14 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
}
else
{
snprintf(bufptr, bufend - bufptr + 1, "%%%%BeginFeature: *%s %s\n",
choices[i]->option->keyword, choices[i]->choice);
snprintf(bufptr, (size_t)(bufend - bufptr + 1), "%%%%BeginFeature: *%s %s\n", choices[i]->option->keyword, choices[i]->choice);
bufptr += strlen(bufptr);
}
if (choices[i]->code && choices[i]->code[0])
{
j = (int)strlen(choices[i]->code);
memcpy(bufptr, choices[i]->code, j);
memcpy(bufptr, choices[i]->code, (size_t)j);
bufptr += j;
if (choices[i]->code[j - 1] != '\n')
@@ -1087,7 +1064,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
}
strlcpy(bufptr, "%%EndFeature\n"
"} stopped cleartomark\n", bufend - bufptr + 1);
"} stopped cleartomark\n", (size_t)(bufend - bufptr + 1));
bufptr += strlen(bufptr);
DEBUG_printf(("2ppdEmitString: Offset in string is %d...",
@@ -1095,7 +1072,7 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
}
else
{
strlcpy(bufptr, choices[i]->code, bufend - bufptr + 1);
strlcpy(bufptr, choices[i]->code, (size_t)(bufend - bufptr + 1));
bufptr += strlen(bufptr);
}
@@ -1225,5 +1202,5 @@ ppd_handle_media(ppd_file_t *ppd) /* I - PPD file */
/*
* End of "$Id: emit.c 10996 2013-05-29 11:51:34Z msweet $".
* End of "$Id: emit.c 11594 2014-02-14 20:09:01Z msweet $".
*/
+14 -8
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: encode.c 11867 2014-05-09 20:33:08Z msweet $"
* "$Id: encode.c 12668 2015-05-27 19:30:32Z msweet $"
*
* Option encoding routines for CUPS.
*
* Copyright 2007-2014 by Apple Inc.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -117,6 +117,9 @@ static const _ipp_option_t ipp_options[] =
{ 0, "copies", IPP_TAG_INTEGER, IPP_TAG_JOB,
IPP_TAG_DOCUMENT },
{ 0, "copies-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "date-time-at-completed",IPP_TAG_DATE, IPP_TAG_ZERO }, /* never send as option */
{ 0, "date-time-at-creation", IPP_TAG_DATE, IPP_TAG_ZERO }, /* never send as option */
{ 0, "date-time-at-processing",IPP_TAG_DATE, IPP_TAG_ZERO }, /* never send as option */
{ 0, "device-uri", IPP_TAG_URI, IPP_TAG_PRINTER },
{ 1, "document-copies", IPP_TAG_RANGE, IPP_TAG_JOB,
IPP_TAG_DOCUMENT,
@@ -151,6 +154,8 @@ static const _ipp_option_t ipp_options[] =
{ 0, "job-accounting-user-id", IPP_TAG_NAME, IPP_TAG_JOB },
{ 0, "job-accounting-user-id-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 0, "job-authorization-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
{ 0, "job-cancel-after", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "job-cancel-after-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
{ 0, "job-hold-until", IPP_TAG_KEYWORD, IPP_TAG_JOB },
{ 0, "job-id", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
{ 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
@@ -272,6 +277,7 @@ static const _ipp_option_t ipp_options[] =
{ 0, "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
{ 1, "printer-commands", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
{ 0, "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 0, "printer-geo-location", IPP_TAG_URI, IPP_TAG_PRINTER },
{ 0, "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
{ 0, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
{ 0, "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
@@ -647,7 +653,7 @@ cupsEncodeOptions2(
* Integer/enumeration value...
*/
attr->values[j].integer = strtol(val, &s, 10);
attr->values[j].integer = (int)strtol(val, &s, 10);
DEBUG_printf(("2cupsEncodeOptions2: Added integer option value "
"%d...", attr->values[j].integer));
@@ -689,12 +695,12 @@ cupsEncodeOptions2(
s = val;
}
else
attr->values[j].range.lower = strtol(val, &s, 10);
attr->values[j].range.lower = (int)strtol(val, &s, 10);
if (*s == '-')
{
if (s[1])
attr->values[j].range.upper = strtol(s + 1, NULL, 10);
attr->values[j].range.upper = (int)strtol(s + 1, NULL, 10);
else
attr->values[j].range.upper = 2147483647;
}
@@ -711,10 +717,10 @@ cupsEncodeOptions2(
* Resolution...
*/
attr->values[j].resolution.xres = strtol(val, &s, 10);
attr->values[j].resolution.xres = (int)strtol(val, &s, 10);
if (*s == 'x')
attr->values[j].resolution.yres = strtol(s + 1, &s, 10);
attr->values[j].resolution.yres = (int)strtol(s + 1, &s, 10);
else
attr->values[j].resolution.yres = attr->values[j].resolution.xres;
@@ -847,5 +853,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */
/*
* End of "$Id: encode.c 11867 2014-05-09 20:33:08Z msweet $".
* End of "$Id: encode.c 12668 2015-05-27 19:30:32Z msweet $".
*/
+15 -15
Ver Arquivo
@@ -1,23 +1,23 @@
/*
* "$Id: file-private.h 11642 2014-02-27 15:57:59Z msweet $"
* "$Id: file-private.h 11627 2014-02-20 16:15:09Z msweet $"
*
* Private file definitions for CUPS.
* Private file definitions for CUPS.
*
* Since stdio files max out at 256 files on many systems, we have to
* write similar functions without this limit. At the same time, using
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
* Since stdio files max out at 256 files on many systems, we have to
* write similar functions without this limit. At the same time, using
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_FILE_PRIVATE_H_
@@ -135,5 +135,5 @@ extern void _cupsFileCheckFilter(void *context,
#endif /* !_CUPS_FILE_PRIVATE_H_ */
/*
* End of "$Id: file-private.h 11642 2014-02-27 15:57:59Z msweet $".
* End of "$Id: file-private.h 11627 2014-02-20 16:15:09Z msweet $".
*/
+171 -91
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: file.c 11642 2014-02-27 15:57:59Z msweet $"
* "$Id: file.c 12641 2015-05-19 15:04:39Z msweet $"
*
* File functions for CUPS.
*
@@ -8,7 +8,7 @@
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -372,7 +372,7 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
if (fp->stream.next_out > fp->cbuf)
{
if (cups_write(fp, (char *)fp->cbuf,
fp->stream.next_out - fp->cbuf) < 0)
(size_t)(fp->stream.next_out - fp->cbuf)) < 0)
status = -1;
fp->stream.next_out = fp->cbuf;
@@ -390,14 +390,14 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
* Write the CRC and length...
*/
trailer[0] = fp->crc;
trailer[1] = fp->crc >> 8;
trailer[2] = fp->crc >> 16;
trailer[3] = fp->crc >> 24;
trailer[4] = fp->pos;
trailer[5] = fp->pos >> 8;
trailer[6] = fp->pos >> 16;
trailer[7] = fp->pos >> 24;
trailer[0] = (unsigned char)fp->crc;
trailer[1] = (unsigned char)(fp->crc >> 8);
trailer[2] = (unsigned char)(fp->crc >> 16);
trailer[3] = (unsigned char)(fp->crc >> 24);
trailer[4] = (unsigned char)fp->pos;
trailer[5] = (unsigned char)(fp->pos >> 8);
trailer[6] = (unsigned char)(fp->pos >> 16);
trailer[7] = (unsigned char)(fp->pos >> 24);
if (cups_write(fp, (char *)trailer, 8) < 0)
status = -1;
@@ -430,7 +430,7 @@ cupsFileClose(cups_file_t *fp) /* I - CUPS file */
if (mode == 's')
{
if (closesocket(fd) < 0)
if (httpAddrClose(NULL, fd) < 0)
status = -1;
}
else if (!is_stdio)
@@ -511,7 +511,7 @@ cupsFileFind(const char *filename, /* I - File to find */
if (!access(filename, 0))
{
strlcpy(buffer, filename, bufsize);
strlcpy(buffer, filename, (size_t)bufsize);
return (buffer);
}
else
@@ -536,7 +536,7 @@ cupsFileFind(const char *filename, /* I - File to find */
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
*bufptr++ = '/';
strlcpy(bufptr, filename, bufend - bufptr);
strlcpy(bufptr, filename, (size_t)(bufend - bufptr));
#ifdef WIN32
if (!access(buffer, 0))
@@ -563,7 +563,7 @@ cupsFileFind(const char *filename, /* I - File to find */
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
*bufptr++ = '/';
strlcpy(bufptr, filename, bufend - bufptr);
strlcpy(bufptr, filename, (size_t)(bufend - bufptr));
if (!access(buffer, 0))
{
@@ -611,10 +611,10 @@ cupsFileFlush(cups_file_t *fp) /* I - CUPS file */
{
#ifdef HAVE_LIBZ
if (fp->compressed)
bytes = cups_compress(fp, fp->buf, bytes);
bytes = cups_compress(fp, fp->buf, (size_t)bytes);
else
#endif /* HAVE_LIBZ */
bytes = cups_write(fp, fp->buf, bytes);
bytes = cups_write(fp, fp->buf, (size_t)bytes);
if (bytes < 0)
return (-1);
@@ -639,6 +639,8 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
* Range check input...
*/
DEBUG_printf(("4cupsFileGetChar(fp=%p)", fp));
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
{
DEBUG_puts("5cupsFileGetChar: Bad arguments!");
@@ -649,8 +651,10 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
* If the input buffer is empty, try to read more data...
*/
DEBUG_printf(("5cupsFileGetChar: fp->eof=%d, fp->ptr=%p, fp->end=%p", fp->eof, fp->ptr, fp->end));
if (fp->ptr >= fp->end)
if (cups_fill(fp) < 0)
if (cups_fill(fp) <= 0)
{
DEBUG_puts("5cupsFileGetChar: Unable to fill buffer!");
return (-1);
@@ -885,7 +889,7 @@ cupsFileGetLine(cups_file_t *fp, /* I - File to read from */
DEBUG_printf(("4cupsFileGetLine: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (ptr - buf);
return ((size_t)(ptr - buf));
}
@@ -960,7 +964,7 @@ cupsFileGets(cups_file_t *fp, /* I - CUPS file */
break;
}
else
*ptr++ = ch;
*ptr++ = (char)ch;
}
*ptr = '\0';
@@ -1132,7 +1136,7 @@ cupsFileOpen(const char *filename, /* I - Name of file */
if ((fp = cupsFileOpenFd(fd, mode)) == NULL)
{
if (*mode == 's')
closesocket(fd);
httpAddrClose(NULL, fd);
else
close(fd);
}
@@ -1215,10 +1219,10 @@ cupsFileOpenFd(int fd, /* I - File descriptor */
header[1] = 0x8b;
header[2] = Z_DEFLATED;
header[3] = 0;
header[4] = curtime;
header[5] = curtime >> 8;
header[6] = curtime >> 16;
header[7] = curtime >> 24;
header[4] = (unsigned char)curtime;
header[5] = (unsigned char)(curtime >> 8);
header[6] = (unsigned char)(curtime >> 16);
header[7] = (unsigned char)(curtime >> 24);
header[8] = 0;
header[9] = 0x03;
@@ -1284,7 +1288,7 @@ cupsFilePeekChar(cups_file_t *fp) /* I - CUPS file */
*/
if (fp->ptr >= fp->end)
if (cups_fill(fp) < 0)
if (cups_fill(fp) <= 0)
return (-1);
/*
@@ -1343,11 +1347,11 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
if (bytes > 65535)
return (-1);
if ((temp = realloc(fp->printf_buffer, bytes + 1)) == NULL)
if ((temp = realloc(fp->printf_buffer, (size_t)(bytes + 1))) == NULL)
return (-1);
fp->printf_buffer = temp;
fp->printf_size = bytes + 1;
fp->printf_size = (size_t)(bytes + 1);
va_start(ap, format);
bytes = vsnprintf(fp->printf_buffer, fp->printf_size, format, ap);
@@ -1356,14 +1360,14 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
if (fp->mode == 's')
{
if (cups_write(fp, fp->printf_buffer, bytes) < 0)
if (cups_write(fp, fp->printf_buffer, (size_t)bytes) < 0)
return (-1);
fp->pos += bytes;
DEBUG_printf(("4cupsFilePrintf: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (bytes);
return ((int)bytes);
}
if ((fp->ptr + bytes) > fp->end)
@@ -1374,20 +1378,20 @@ cupsFilePrintf(cups_file_t *fp, /* I - CUPS file */
DEBUG_printf(("4cupsFilePrintf: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
if (bytes > sizeof(fp->buf))
if ((size_t)bytes > sizeof(fp->buf))
{
#ifdef HAVE_LIBZ
if (fp->compressed)
return (cups_compress(fp, fp->printf_buffer, bytes));
return ((int)cups_compress(fp, fp->printf_buffer, (size_t)bytes));
else
#endif /* HAVE_LIBZ */
return (cups_write(fp, fp->printf_buffer, bytes));
return ((int)cups_write(fp, fp->printf_buffer, (size_t)bytes));
}
else
{
memcpy(fp->ptr, fp->printf_buffer, bytes);
memcpy(fp->ptr, fp->printf_buffer, (size_t)bytes);
fp->ptr += bytes;
return (bytes);
return ((int)bytes);
}
}
@@ -1418,7 +1422,7 @@ cupsFilePutChar(cups_file_t *fp, /* I - CUPS file */
char ch; /* Output character */
ch = c;
ch = (char)c;
if (send(fp->fd, &ch, 1, 0) < 1)
return (-1);
@@ -1433,7 +1437,7 @@ cupsFilePutChar(cups_file_t *fp, /* I - CUPS file */
if (cupsFileFlush(fp))
return (-1);
*(fp->ptr) ++ = c;
*(fp->ptr) ++ = (char)c;
}
fp->pos ++;
@@ -1480,7 +1484,7 @@ cupsFilePutConf(cups_file_t *fp, /* I - CUPS file */
* Need to quote the first # in the info string...
*/
if ((temp = cupsFileWrite(fp, value, ptr - value)) < 0)
if ((temp = cupsFileWrite(fp, value, (size_t)(ptr - value))) < 0)
return (-1);
bytes += temp;
@@ -1531,18 +1535,18 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
* Write the string...
*/
bytes = (int)strlen(s);
bytes = (ssize_t)strlen(s);
if (fp->mode == 's')
{
if (cups_write(fp, s, bytes) < 0)
if (cups_write(fp, s, (size_t)bytes) < 0)
return (-1);
fp->pos += bytes;
DEBUG_printf(("4cupsFilePuts: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (bytes);
return ((int)bytes);
}
if ((fp->ptr + bytes) > fp->end)
@@ -1553,20 +1557,20 @@ cupsFilePuts(cups_file_t *fp, /* I - CUPS file */
DEBUG_printf(("4cupsFilePuts: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
if (bytes > sizeof(fp->buf))
if ((size_t)bytes > sizeof(fp->buf))
{
#ifdef HAVE_LIBZ
if (fp->compressed)
return (cups_compress(fp, s, bytes));
return ((int)cups_compress(fp, s, (size_t)bytes));
else
#endif /* HAVE_LIBZ */
return (cups_write(fp, s, bytes));
return ((int)cups_write(fp, s, (size_t)bytes));
}
else
{
memcpy(fp->ptr, s, bytes);
memcpy(fp->ptr, s, (size_t)bytes);
fp->ptr += bytes;
return (bytes);
return ((int)bytes);
}
}
@@ -1622,7 +1626,7 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
if (count > (ssize_t)bytes)
count = (ssize_t)bytes;
memcpy(buf, fp->ptr, count);
memcpy(buf, fp->ptr,(size_t) count);
fp->ptr += count;
fp->pos += count;
@@ -1632,8 +1636,8 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
* Update the counts for the last read...
*/
bytes -= count;
total += count;
bytes -= (size_t)count;
total += (size_t)count;
buf += count;
}
@@ -1779,7 +1783,7 @@ cupsFileSeek(cups_file_t *fp, /* I - CUPS file */
* Preload a buffer to determine whether the file is compressed...
*/
if (cups_fill(fp) < 0)
if (cups_fill(fp) <= 0)
return (-1);
}
#endif /* HAVE_LIBZ */
@@ -2105,14 +2109,14 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
* Update the CRC...
*/
fp->crc = crc32(fp->crc, (const Bytef *)buf, bytes);
fp->crc = crc32(fp->crc, (const Bytef *)buf, (uInt)bytes);
/*
* Deflate the bytes...
*/
fp->stream.next_in = (Bytef *)buf;
fp->stream.avail_in = bytes;
fp->stream.avail_in = (uInt)bytes;
while (fp->stream.avail_in > 0)
{
@@ -2123,9 +2127,9 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
DEBUG_printf(("9cups_compress: avail_in=%d, avail_out=%d",
fp->stream.avail_in, fp->stream.avail_out));
if (fp->stream.avail_out < (int)(sizeof(fp->cbuf) / 8))
if (fp->stream.avail_out < (uInt)(sizeof(fp->cbuf) / 8))
{
if (cups_write(fp, (char *)fp->cbuf, fp->stream.next_out - fp->cbuf) < 0)
if (cups_write(fp, (char *)fp->cbuf, (size_t)(fp->stream.next_out - fp->cbuf)) < 0)
return (-1);
fp->stream.next_out = fp->cbuf;
@@ -2135,7 +2139,7 @@ cups_compress(cups_file_t *fp, /* I - CUPS file */
deflate(&(fp->stream), Z_NO_FLUSH);
}
return (bytes);
return ((ssize_t)bytes);
}
#endif /* HAVE_LIBZ */
@@ -2195,6 +2199,8 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
DEBUG_printf(("9cups_fill: cups_read() returned " CUPS_LLFMT,
CUPS_LLCAST bytes));
fp->eof = 1;
return (-1);
}
@@ -2234,6 +2240,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
* Can't read from file!
*/
DEBUG_puts("9cups_fill: Extra gzip header data missing, returning -1.");
fp->eof = 1;
errno = EIO;
return (-1);
}
@@ -2246,6 +2257,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
* Can't read from file!
*/
DEBUG_puts("9cups_fill: Extra gzip header data does not fit in initial buffer, returning -1.");
fp->eof = 1;
errno = EIO;
return (-1);
}
}
@@ -2267,6 +2283,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
* Can't read from file!
*/
DEBUG_puts("9cups_fill: Original filename in gzip header data does not fit in initial buffer, returning -1.");
fp->eof = 1;
errno = EIO;
return (-1);
}
}
@@ -2288,6 +2309,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
* Can't read from file!
*/
DEBUG_puts("9cups_fill: Comment in gzip header data does not fit in initial buffer, returning -1.");
fp->eof = 1;
errno = EIO;
return (-1);
}
}
@@ -2306,6 +2332,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
* Can't read from file!
*/
DEBUG_puts("9cups_fill: Header CRC in gzip header data does not fit in initial buffer, returning -1.");
fp->eof = 1;
errno = EIO;
return (-1);
}
}
@@ -2315,7 +2346,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
*/
if ((bytes = end - ptr) > 0)
memcpy(fp->cbuf, ptr, bytes);
memcpy(fp->cbuf, ptr, (size_t)bytes);
/*
* Setup the decompressor data...
@@ -2326,12 +2357,19 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
fp->stream.opaque = (voidpf)0;
fp->stream.next_in = (Bytef *)fp->cbuf;
fp->stream.next_out = NULL;
fp->stream.avail_in = bytes;
fp->stream.avail_in = (uInt)bytes;
fp->stream.avail_out = 0;
fp->crc = crc32(0L, Z_NULL, 0);
if (inflateInit2(&(fp->stream), -15) != Z_OK)
if ((status = inflateInit2(&(fp->stream), -15)) != Z_OK)
{
DEBUG_printf(("9cups_fill: inflateInit2 returned %d, returning -1.", status));
fp->eof = 1;
errno = EIO;
return (-1);
}
fp->compressed = 1;
}
@@ -2343,7 +2381,11 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
*/
if (fp->eof)
return (-1);
{
DEBUG_puts("9cups_fill: EOF, returning 0.");
return (0);
}
/*
* Fill the decompression buffer as needed...
@@ -2352,10 +2394,16 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
if (fp->stream.avail_in == 0)
{
if ((bytes = cups_read(fp, (char *)fp->cbuf, sizeof(fp->cbuf))) <= 0)
return (-1);
{
DEBUG_printf(("9cups_fill: cups_read error, returning %d.", (int)bytes));
fp->eof = 1;
return (bytes);
}
fp->stream.next_in = fp->cbuf;
fp->stream.avail_in = bytes;
fp->stream.avail_in = (uInt)bytes;
}
/*
@@ -2369,7 +2417,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
if (fp->stream.next_out > (Bytef *)fp->buf)
fp->crc = crc32(fp->crc, (Bytef *)fp->buf,
fp->stream.next_out - (Bytef *)fp->buf);
(uInt)(fp->stream.next_out - (Bytef *)fp->buf));
if (status == Z_STREAM_END)
{
@@ -2379,45 +2427,72 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
unsigned char trailer[8]; /* Trailer bytes */
uLong tcrc; /* Trailer CRC */
ssize_t tbytes = 0; /* Number of bytes */
if (read(fp->fd, trailer, sizeof(trailer)) < sizeof(trailer))
if (fp->stream.avail_in > 0)
{
/*
* Can't get it, so mark end-of-file...
*/
if (fp->stream.avail_in > sizeof(trailer))
tbytes = (ssize_t)sizeof(trailer);
else
tbytes = (ssize_t)fp->stream.avail_in;
fp->eof = 1;
memcpy(trailer, fp->stream.next_in, (size_t)tbytes);
fp->stream.next_in += tbytes;
fp->stream.avail_in -= (size_t)tbytes;
}
else
{
tcrc = ((((((uLong)trailer[3] << 8) | (uLong)trailer[2]) << 8) |
(uLong)trailer[1]) << 8) | (uLong)trailer[0];
if (tcrc != fp->crc)
if (tbytes < (ssize_t)sizeof(trailer))
{
if (read(fp->fd, trailer + tbytes, sizeof(trailer) - (size_t)tbytes) < ((ssize_t)sizeof(trailer) - tbytes))
{
/*
* Bad CRC, mark end-of-file...
* Can't get it, so mark end-of-file...
*/
DEBUG_printf(("9cups_fill: tcrc=%08x != fp->crc=%08x",
(unsigned int)tcrc, (unsigned int)fp->crc));
DEBUG_puts("9cups_fill: Unable to read gzip CRC trailer, returning -1.");
fp->eof = 1;
errno = EIO;
return (-1);
}
}
tcrc = ((((((uLong)trailer[3] << 8) | (uLong)trailer[2]) << 8) |
(uLong)trailer[1]) << 8) | (uLong)trailer[0];
if (tcrc != fp->crc)
{
/*
* Otherwise, reset the compressed flag so that we re-read the
* file header...
* Bad CRC, mark end-of-file...
*/
fp->compressed = 0;
DEBUG_printf(("9cups_fill: tcrc=%08x != fp->crc=%08x, returning -1.", (unsigned int)tcrc, (unsigned int)fp->crc));
fp->eof = 1;
errno = EIO;
return (-1);
}
/*
* Otherwise, reset the compressed flag so that we re-read the
* file header...
*/
fp->compressed = 0;
}
else if (status < Z_OK)
{
DEBUG_printf(("9cups_fill: inflate returned %d, returning -1.", status));
fp->eof = 1;
errno = EIO;
return (-1);
}
bytes = sizeof(fp->buf) - fp->stream.avail_out;
bytes = (ssize_t)sizeof(fp->buf) - (ssize_t)fp->stream.avail_out;
/*
* Return the decompressed data...
@@ -2427,7 +2502,10 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
fp->end = fp->buf + bytes;
if (bytes)
{
DEBUG_printf(("9cups_fill: Returning %d.", (int)bytes));
return (bytes);
}
}
}
#endif /* HAVE_LIBZ */
@@ -2445,17 +2523,19 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */
fp->eof = 1;
fp->ptr = fp->buf;
fp->end = fp->buf;
}
else
{
/*
* Return the bytes we read...
*/
return (-1);
fp->eof = 0;
fp->ptr = fp->buf;
fp->end = fp->buf + bytes;
}
/*
* Return the bytes we read...
*/
fp->eof = 0;
fp->ptr = fp->buf;
fp->end = fp->buf + bytes;
DEBUG_printf(("9cups_fill: Not gzip, returning %d.", (int)bytes));
return (bytes);
}
@@ -2658,8 +2738,8 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
* Update the counts for the last write call...
*/
bytes -= count;
total += count;
bytes -= (size_t)count;
total += (size_t)count;
buf += count;
}
@@ -2672,5 +2752,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
/*
* End of "$Id: file.c 11642 2014-02-27 15:57:59Z msweet $".
* End of "$Id: file.c 12641 2015-05-19 15:04:39Z msweet $".
*/
+15 -15
Ver Arquivo
@@ -1,23 +1,23 @@
/*
* "$Id: file.h 11642 2014-02-27 15:57:59Z msweet $"
* "$Id: file.h 11627 2014-02-20 16:15:09Z msweet $"
*
* Public file definitions for CUPS.
* Public file definitions for CUPS.
*
* Since stdio files max out at 256 files on many systems, we have to
* write similar functions without this limit. At the same time, using
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
* Since stdio files max out at 256 files on many systems, we have to
* write similar functions without this limit. At the same time, using
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
* Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_FILE_H_
@@ -114,5 +114,5 @@ extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf,
#endif /* !_CUPS_FILE_H_ */
/*
* End of "$Id: file.h 11642 2014-02-27 15:57:59Z msweet $".
* End of "$Id: file.h 11627 2014-02-20 16:15:09Z msweet $".
*/
+16 -23
Ver Arquivo
@@ -1,25 +1,18 @@
/*
* "$Id: getputfile.c 11153 2013-07-17 14:10:21Z msweet $"
* "$Id: getputfile.c 11558 2014-02-06 18:33:34Z msweet $"
*
* Get/put file functions for CUPS.
* Get/put file functions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* cupsGetFd() - Get a file from the server.
* cupsGetFile() - Get a file from the server.
* cupsPutFd() - Put a file on the server.
* cupsPutFile() - Put a file on the server.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -49,7 +42,7 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
const char *resource, /* I - Resource name */
int fd) /* I - File descriptor */
{
int bytes; /* Number of bytes read */
ssize_t bytes; /* Number of bytes read */
char buffer[8192]; /* Buffer for file */
http_status_t status; /* HTTP status from server */
char if_modified_since[HTTP_MAX_VALUE];
@@ -174,7 +167,7 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
*/
while ((bytes = httpRead2(http, buffer, sizeof(buffer))) > 0)
write(fd, buffer, bytes);
write(fd, buffer, (size_t)bytes);
}
else
{
@@ -273,8 +266,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
const char *resource, /* I - Resource name */
int fd) /* I - File descriptor */
{
int bytes, /* Number of bytes read */
retries; /* Number of retries */
ssize_t bytes; /* Number of bytes read */
int retries; /* Number of retries */
char buffer[8192]; /* Buffer for file */
http_status_t status; /* HTTP status from server */
@@ -362,7 +355,7 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
break;
}
else
httpWrite2(http, buffer, bytes);
httpWrite2(http, buffer, (size_t)bytes);
}
if (status == HTTP_STATUS_CONTINUE)
@@ -518,5 +511,5 @@ cupsPutFile(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DE
/*
* End of "$Id: getputfile.c 11153 2013-07-17 14:10:21Z msweet $".
* End of "$Id: getputfile.c 11558 2014-02-06 18:33:34Z msweet $".
*/
+7 -5
Ver Arquivo
@@ -1,5 +1,5 @@
/*
* "$Id: globals.c 11113 2013-07-10 14:08:39Z msweet $"
* "$Id: globals.c 12480 2015-02-03 12:36:34Z msweet $"
*
* Global variable access routines for CUPS.
*
@@ -216,9 +216,9 @@ cups_globals_alloc(void)
memset(cg, 0, sizeof(_cups_globals_t));
cg->encryption = (http_encryption_t)-1;
cg->password_cb = (cups_password_cb2_t)_cupsGetPassword;
cg->any_root = 1;
cg->expired_certs = 1;
cg->expired_root = 1;
cg->any_root = -1;
cg->expired_certs = -1;
cg->validate_certs = -1;
#ifdef DEBUG
/*
@@ -361,7 +361,9 @@ cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
httpClose(cg->http);
#ifdef HAVE_SSL
_httpFreeCredentials(cg->tls_credentials);
#endif /* HAVE_SSL */
cupsFileClose(cg->stdio_files[0]);
cupsFileClose(cg->stdio_files[1]);
@@ -392,5 +394,5 @@ cups_globals_init(void)
/*
* End of "$Id: globals.c 11113 2013-07-10 14:08:39Z msweet $".
* End of "$Id: globals.c 12480 2015-02-03 12:36:34Z msweet $".
*/
+216 -48
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: http-addr.c 11642 2014-02-27 15:57:59Z msweet $"
* "$Id: http-addr.c 12129 2014-08-28 19:26:31Z msweet $"
*
* HTTP address routines for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -20,6 +20,7 @@
*/
#include "cups-private.h"
#include <sys/stat.h>
#ifdef HAVE_RESOLV_H
# include <resolv.h>
#endif /* HAVE_RESOLV_H */
@@ -55,6 +56,37 @@ httpAddrAny(const http_addr_t *addr) /* I - Address to check */
}
/*
* 'httpAddrClose()' - Close a socket created by @link httpAddrConnect@ or
* @link httpAddrListen@.
*
* Pass @code NULL@ for sockets created with @link httpAddrConnect@ and the
* listen address for sockets created with @link httpAddrListen@. This will
* ensure that domain sockets are removed when closed.
*
* @since CUPS 2.0/OS 10.10@
*/
int /* O - 0 on success, -1 on failure */
httpAddrClose(http_addr_t *addr, /* I - Listen address or @code NULL@ */
int fd) /* I - Socket file descriptor */
{
#ifdef WIN32
if (closesocket(fd))
#else
if (close(fd))
#endif /* WIN32 */
return (-1);
#ifdef AF_LOCAL
if (addr && addr->addr.sa_family == AF_LOCAL)
return (unlink(addr->un.sun_path));
#endif /* AF_LOCAL */
return (0);
}
/*
* 'httpAddrEqual()' - Compare two addresses.
*
@@ -107,8 +139,7 @@ httpAddrLength(const http_addr_t *addr) /* I - Address */
#endif /* AF_INET6 */
#ifdef AF_LOCAL
if (addr->addr.sa_family == AF_LOCAL)
return (offsetof(struct sockaddr_un, sun_path) +
strlen(addr->un.sun_path) + 1);
return ((int)(offsetof(struct sockaddr_un, sun_path) + strlen(addr->un.sun_path) + 1));
else
#endif /* AF_LOCAL */
if (addr->addr.sa_family == AF_INET)
@@ -131,16 +162,21 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
int port) /* I - Port number to bind to */
{
int fd = -1, /* Socket */
val; /* Socket value */
val, /* Socket value */
status; /* Bind status */
/*
* Range check input...
*/
if (!addr || port <= 0)
if (!addr || port < 0)
return (-1);
/*
* Create the socket and set options...
*/
if ((fd = socket(addr->addr.sa_family, SOCK_STREAM, 0)) < 0)
{
_cupsSetHTTPError(HTTP_STATUS_ERROR);
@@ -155,9 +191,50 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, CUPS_SOCAST &val, sizeof(val));
#endif /* IPV6_V6ONLY */
_httpAddrSetPort(addr, port);
/*
* Bind the socket...
*/
if (bind(fd, (struct sockaddr *)addr, httpAddrLength(addr)))
#ifdef AF_LOCAL
if (addr->addr.sa_family == AF_LOCAL)
{
mode_t mask; /* Umask setting */
/*
* Remove any existing domain socket file...
*/
unlink(addr->un.sun_path);
/*
* Save the current umask and set it to 0 so that all users can access
* the domain socket...
*/
mask = umask(0);
/*
* Bind the domain socket...
*/
status = bind(fd, (struct sockaddr *)addr, (socklen_t)httpAddrLength(addr));
/*
* Restore the umask and fix permissions...
*/
umask(mask);
chmod(addr->un.sun_path, 0140777);
}
else
#endif /* AF_LOCAL */
{
_httpAddrSetPort(addr, port);
status = bind(fd, (struct sockaddr *)addr, (socklen_t)httpAddrLength(addr));
}
if (status)
{
_cupsSetHTTPError(HTTP_STATUS_ERROR);
@@ -166,6 +243,10 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
return (-1);
}
/*
* Listen...
*/
if (listen(fd, 5))
{
_cupsSetHTTPError(HTTP_STATUS_ERROR);
@@ -175,6 +256,14 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
return (-1);
}
/*
* Close on exec...
*/
#ifndef WIN32
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
#endif /* !WIN32 */
#ifdef SO_NOSIGPIPE
/*
* Disable SIGPIPE for this socket.
@@ -254,7 +343,7 @@ httpAddrLookup(
#ifdef AF_LOCAL
if (addr->addr.sa_family == AF_LOCAL)
{
strlcpy(name, addr->un.sun_path, namelen);
strlcpy(name, addr->un.sun_path, (size_t)namelen);
return (name);
}
#endif /* AF_LOCAL */
@@ -265,7 +354,7 @@ httpAddrLookup(
if (httpAddrLocalhost(addr))
{
strlcpy(name, "localhost", namelen);
strlcpy(name, "localhost", (size_t)namelen);
return (name);
}
@@ -300,8 +389,7 @@ httpAddrLookup(
* do...
*/
int error = getnameinfo(&addr->addr, httpAddrLength(addr), name, namelen,
NULL, 0, 0);
int error = getnameinfo(&addr->addr, (socklen_t)httpAddrLength(addr), name, (socklen_t)namelen, NULL, 0, 0);
if (error)
{
@@ -337,7 +425,7 @@ httpAddrLookup(
return (httpAddrString(addr, name, namelen));
}
strlcpy(name, host->h_name, namelen);
strlcpy(name, host->h_name, (size_t)namelen);
}
#endif /* HAVE_GETNAMEINFO */
@@ -347,6 +435,20 @@ httpAddrLookup(
}
/*
* 'httpAddrFamily()' - Get the address family of an address.
*/
int /* O - Address family */
httpAddrFamily(http_addr_t *addr) /* I - Address */
{
if (addr)
return (addr->addr.sa_family);
else
return (0);
}
/*
* 'httpAddrPort()' - Get the port number associated with an address.
*
@@ -357,7 +459,7 @@ int /* O - Port number */
httpAddrPort(http_addr_t *addr) /* I - Address */
{
if (!addr)
return (ippPort());
return (-1);
#ifdef AF_INET6
else if (addr->addr.sa_family == AF_INET6)
return (ntohs(addr->ipv6.sin6_port));
@@ -365,12 +467,9 @@ httpAddrPort(http_addr_t *addr) /* I - Address */
else if (addr->addr.sa_family == AF_INET)
return (ntohs(addr->ipv4.sin_port));
else
return (ippPort());
return (0);
}
/* For OS X 10.8 and earlier */
int _httpAddrPort(http_addr_t *addr) { return (httpAddrPort(addr)); }
/*
* '_httpAddrSetPort()' - Set the port number associated with an address.
@@ -422,9 +521,9 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
if (addr->addr.sa_family == AF_LOCAL)
{
if (addr->un.sun_path[0] == '/')
strlcpy(s, addr->un.sun_path, slen);
strlcpy(s, addr->un.sun_path, (size_t)slen);
else
strlcpy(s, "localhost", slen);
strlcpy(s, "localhost", (size_t)slen);
}
else
#endif /* AF_LOCAL */
@@ -432,10 +531,9 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
{
unsigned temp; /* Temporary address */
temp = ntohl(addr->ipv4.sin_addr.s_addr);
snprintf(s, slen, "%d.%d.%d.%d", (temp >> 24) & 255,
snprintf(s, (size_t)slen, "%d.%d.%d.%d", (temp >> 24) & 255,
(temp >> 16) & 255, (temp >> 8) & 255, temp & 255);
}
#ifdef AF_INET6
@@ -445,8 +543,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
temps[64]; /* Temporary string for address */
# ifdef HAVE_GETNAMEINFO
if (getnameinfo(&addr->addr, httpAddrLength(addr), temps, sizeof(temps),
NULL, 0, NI_NUMERICHOST))
if (getnameinfo(&addr->addr, (socklen_t)httpAddrLength(addr), temps, sizeof(temps), NULL, 0, NI_NUMERICHOST))
{
/*
* If we get an error back, then the address type is not supported
@@ -477,8 +574,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
{
temp = ntohl(addr->ipv6.sin6_addr.s6_addr32[i]);
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
(temp >> 16) & 0xffff);
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, (temp >> 16) & 0xffff);
prefix = ":";
sptr += strlen(sptr);
@@ -486,7 +582,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
if (temp || i == 3 || addr->ipv6.sin6_addr.s6_addr32[i + 1])
{
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix, temp);
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, temp);
sptr += strlen(sptr);
}
}
@@ -498,7 +594,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
if (i < 4)
{
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s:", prefix);
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s:", prefix);
prefix = ":";
sptr += strlen(sptr);
@@ -509,13 +605,11 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
if ((temp & 0xffff0000) ||
(i > 0 && addr->ipv6.sin6_addr.s6_addr32[i - 1]))
{
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
(temp >> 16) & 0xffff);
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, (temp >> 16) & 0xffff);
sptr += strlen(sptr);
}
snprintf(sptr, sizeof(temps) - (sptr - temps), "%s%x", prefix,
temp & 0xffff);
snprintf(sptr, sizeof(temps) - (size_t)(sptr - temps), "%s%x", prefix, temp & 0xffff);
sptr += strlen(sptr);
}
}
@@ -533,7 +627,7 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
* Empty at end...
*/
strlcpy(sptr, "::", sizeof(temps) - (sptr - temps));
strlcpy(sptr, "::", sizeof(temps) - (size_t)(sptr - temps));
}
}
# endif /* HAVE_GETNAMEINFO */
@@ -542,11 +636,11 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
* Add "[v1." and "]" around IPv6 address to convert to URI form.
*/
snprintf(s, slen, "[v1.%s]", temps);
snprintf(s, (size_t)slen, "[v1.%s]", temps);
}
#endif /* AF_INET6 */
else
strlcpy(s, "UNKNOWN", slen);
strlcpy(s, "UNKNOWN", (size_t)slen);
DEBUG_printf(("1httpAddrString: returning \"%s\"...", s));
@@ -554,6 +648,24 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
}
/*
* 'httpGetAddress()' - Get the address of the connected peer of a connection.
*
* Returns @code NULL@ if the socket is currently unconnected.
*
* @since CUPS 2.0/OS 10.10@
*/
http_addr_t * /* O - Connected address or @code NULL@ */
httpGetAddress(http_t *http) /* I - HTTP connection */
{
if (http)
return (http->hostaddr);
else
return (NULL);
}
/*
* 'httpGetHostByName()' - Lookup a hostname or IPv4 address, and return
* address records for the specified name.
@@ -603,7 +715,7 @@ httpGetHostByName(const char *name) /* I - Hostname or IP address */
cg->hostent.h_name = (char *)name;
cg->hostent.h_aliases = NULL;
cg->hostent.h_addrtype = AF_LOCAL;
cg->hostent.h_length = strlen(name) + 1;
cg->hostent.h_length = (int)strlen(name) + 1;
cg->hostent.h_addr_list = cg->ip_ptrs;
cg->ip_ptrs[0] = (char *)name;
cg->ip_ptrs[1] = NULL;
@@ -667,7 +779,8 @@ httpGetHostByName(const char *name) /* I - Hostname or IP address */
* 'httpGetHostname()' - Get the FQDN for the connection or local system.
*
* When "http" points to a connected socket, return the hostname or
* address that was used in the call to httpConnect() or httpConnectEncrypt().
* address that was used in the call to httpConnect() or httpConnectEncrypt(),
* or the address of the client for the connection from httpAcceptConnection().
* Otherwise, return the FQDN for the local system using both gethostname()
* and gethostbyname() to get the local hostname with domain.
*
@@ -679,15 +792,19 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
char *s, /* I - String buffer for name */
int slen) /* I - Size of buffer */
{
if (!s || slen <= 1)
return (NULL);
if (http)
{
if (http->hostname[0] == '/')
strlcpy(s, "localhost", slen);
if (!s || slen <= 1)
{
if (http->hostname[0] == '/')
return ("localhost");
else
return (http->hostname);
}
else if (http->hostname[0] == '/')
strlcpy(s, "localhost", (size_t)slen);
else
strlcpy(s, http->hostname, slen);
strlcpy(s, http->hostname, (size_t)slen);
}
else
{
@@ -695,8 +812,11 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
* Get the hostname...
*/
if (gethostname(s, slen) < 0)
strlcpy(s, "localhost", slen);
if (!s || slen <= 1)
return (NULL);
if (gethostname(s, (size_t)slen) < 0)
strlcpy(s, "localhost", (size_t)slen);
if (!strchr(s, '.'))
{
@@ -720,7 +840,7 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
* Append ".local." to the hostname we get...
*/
snprintf(s, slen, "%s.local.", localStr);
snprintf(s, (size_t)slen, "%s.local.", localStr);
}
if (local)
@@ -741,10 +861,17 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
* Use the resolved hostname...
*/
strlcpy(s, host->h_name, slen);
strlcpy(s, host->h_name, (size_t)slen);
}
#endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
}
/*
* Make sure .local hostnames end with a period...
*/
if (strlen(s) > 6 && !strcmp(s + strlen(s) - 6, ".local"))
strlcat(s, ".", (size_t)slen);
}
/*
@@ -756,5 +883,46 @@ httpGetHostname(http_t *http, /* I - HTTP connection or NULL */
/*
* End of "$Id: http-addr.c 11642 2014-02-27 15:57:59Z msweet $".
* 'httpResolveHostname()' - Resolve the hostname of the HTTP connection
* address.
*
* @since CUPS 2.0/OS 10.10@
*/
const char * /* O - Resolved hostname or @code NULL@ */
httpResolveHostname(http_t *http, /* I - HTTP connection */
char *buffer, /* I - Hostname buffer */
size_t bufsize) /* I - Size of buffer */
{
if (!http)
return (NULL);
if (isdigit(http->hostname[0] & 255) || http->hostname[0] == '[')
{
char temp[1024]; /* Temporary string */
if (httpAddrLookup(http->hostaddr, temp, sizeof(temp)))
strlcpy(http->hostname, temp, sizeof(http->hostname));
else
return (NULL);
}
if (buffer)
{
if (http->hostname[0] == '/')
strlcpy(buffer, "localhost", bufsize);
else
strlcpy(buffer, http->hostname, bufsize);
return (buffer);
}
else if (http->hostname[0] == '/')
return ("localhost");
else
return (http->hostname);
}
/*
* End of "$Id: http-addr.c 12129 2014-08-28 19:26:31Z msweet $".
*/
+7 -16
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: http-addrlist.c 11642 2014-02-27 15:57:59Z msweet $"
* "$Id: http-addrlist.c 11627 2014-02-20 16:15:09Z msweet $"
*
* HTTP address list routines for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -115,7 +115,7 @@ httpAddrConnect2(
httpAddrString(&(addrlist->addr), temp, sizeof(temp)),
httpAddrPort(&(addrlist->addr))));
if ((*sock = (int)socket(_httpAddrFamily(&(addrlist->addr)), SOCK_STREAM,
if ((*sock = (int)socket(httpAddrFamily(&(addrlist->addr)), SOCK_STREAM,
0)) < 0)
{
/*
@@ -180,8 +180,7 @@ httpAddrConnect2(
* Then connect...
*/
if (!connect(*sock, &(addrlist->addr.addr),
httpAddrLength(&(addrlist->addr))))
if (!connect(*sock, &(addrlist->addr.addr), (socklen_t)httpAddrLength(&(addrlist->addr))))
{
DEBUG_printf(("1httpAddrConnect2: Connected to %s:%d...",
httpAddrString(&(addrlist->addr), temp, sizeof(temp)),
@@ -218,11 +217,7 @@ httpAddrConnect2(
DEBUG_puts("1httpAddrConnect2: Canceled connect()");
# ifdef WIN32
closesocket(*sock);
# else
close(*sock);
# endif /* WIN32 */
httpAddrClose(NULL, *sock);
*sock = -1;
@@ -290,11 +285,7 @@ httpAddrConnect2(
* Close this socket and move to the next address...
*/
#ifdef WIN32
closesocket(*sock);
#else
close(*sock);
#endif /* WIN32 */
httpAddrClose(NULL, *sock);
*sock = -1;
addrlist = addrlist->next;
@@ -877,5 +868,5 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
/*
* End of "$Id: http-addrlist.c 11642 2014-02-27 15:57:59Z msweet $".
* End of "$Id: http-addrlist.c 11627 2014-02-20 16:15:09Z msweet $".
*/
+69 -64
Ver Arquivo
@@ -1,9 +1,9 @@
/*
* "$Id: http-private.h 11392 2013-11-06 01:29:56Z msweet $"
* "$Id: http-private.h 12645 2015-05-20 01:20:52Z msweet $"
*
* Private HTTP definitions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -23,6 +23,7 @@
*/
# include "config.h"
# include <cups/language.h>
# include <stddef.h>
# include <stdlib.h>
@@ -39,7 +40,6 @@
# include <unistd.h>
# include <fcntl.h>
# include <sys/socket.h>
# define closesocket(f) close(f)
# define CUPS_SOCAST
# endif /* WIN32 */
@@ -73,14 +73,9 @@ typedef int socklen_t;
# include "md5-private.h"
# include "ipp-private.h"
# if defined HAVE_LIBSSL
# include <openssl/err.h>
# include <openssl/rand.h>
# include <openssl/ssl.h>
# elif defined HAVE_GNUTLS
# ifdef HAVE_GNUTLS
# include <gnutls/gnutls.h>
# include <gnutls/x509.h>
# include <gcrypt.h>
# elif defined(HAVE_CDSASSL)
# include <CoreFoundation/CoreFoundation.h>
# include <Security/Security.h>
@@ -98,6 +93,19 @@ typedef int socklen_t;
# include <Security/SecCertificate.h>
# include <Security/SecIdentity.h>
# endif /* HAVE_SECCERTIFICATE_H */
# ifdef HAVE_SECCERTIFICATEPRIV_H
# include <Security/SecCertificatePriv.h>
# else
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
extern SecCertificateRef SecCertificateCreateWithBytes(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
extern bool SecCertificateIsValid(SecCertificateRef certificate, CFAbsoluteTime verifyTime);
extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate);
# ifdef __cplusplus
}
# endif /* __cplusplus */
# endif /* HAVE_SECCERTIFICATEPRIV_H */
# ifdef HAVE_SECITEMPRIV_H
# include <Security/SecItemPriv.h>
# endif /* HAVE_SECITEMPRIV_H */
@@ -108,11 +116,17 @@ typedef int socklen_t;
# include <Security/SecPolicyPriv.h>
# endif /* HAVE_SECPOLICYPRIV_H */
# elif defined(HAVE_SSPISSL)
# include "sspi-private.h"
# endif /* HAVE_LIBSSL */
# include <wincrypt.h>
# include <wintrust.h>
# include <schannel.h>
# define SECURITY_WIN32
# include <security.h>
# include <sspi.h>
# endif /* HAVE_GNUTLS */
# ifndef WIN32
# include <net/if.h>
# include <resolv.h>
# ifdef HAVE_GETIFADDRS
# include <ifaddrs.h>
# else
@@ -142,40 +156,30 @@ extern "C" {
*/
#define _HTTP_MAX_SBUFFER 65536 /* Size of (de)compression buffer */
#define _HTTP_RESOLVE_DEFAULT 0 /* Just resolve with default options */
#define _HTTP_RESOLVE_STDERR 1 /* Log resolve progress to stderr */
#define _HTTP_RESOLVE_FQDN 2 /* Resolve to a FQDN */
#define _HTTP_RESOLVE_FAXOUT 4 /* Resolve FaxOut service? */
#define _HTTP_TLS_NONE 0 /* No TLS options */
#define _HTTP_TLS_ALLOW_RC4 1 /* Allow RC4 cipher suites */
#define _HTTP_TLS_ALLOW_SSL3 2 /* Allow SSL 3.0 */
#define _HTTP_TLS_ALLOW_DH 4 /* Allow DH/DHE key negotiation */
#define _HTTP_TLS_DENY_TLS10 16 /* Deny TLS 1.0 */
/*
* Types and functions for SSL support...
*/
# if defined HAVE_LIBSSL
/*
* The OpenSSL library provides its own SSL/TLS context structure for its
* IO and protocol management. However, we need to provide our own BIO
* (basic IO) implementation to do timeouts...
*/
typedef SSL *http_tls_t;
typedef void *http_tls_credentials_t;
extern BIO_METHOD *_httpBIOMethods(void);
# elif defined HAVE_GNUTLS
# ifdef HAVE_GNUTLS
/*
* The GNU TLS library is more of a "bare metal" SSL/TLS library...
*/
typedef gnutls_session_t http_tls_t;
typedef void *http_tls_credentials_t;
extern ssize_t _httpReadGNUTLS(gnutls_transport_ptr_t ptr, void *data,
size_t length);
extern ssize_t _httpWriteGNUTLS(gnutls_transport_ptr_t ptr, const void *data,
size_t length);
typedef gnutls_certificate_credentials_t *http_tls_credentials_t;
# elif defined(HAVE_CDSASSL)
/*
@@ -186,10 +190,6 @@ extern ssize_t _httpWriteGNUTLS(gnutls_transport_ptr_t ptr, const void *data,
# if !defined(HAVE_SECBASEPRIV_H) && defined(HAVE_CSSMERRORSTRING) /* Declare prototype for function in that header... */
extern const char *cssmErrorString(int error);
# endif /* !HAVE_SECBASEPRIV_H && HAVE_CSSMERRORSTRING */
# ifndef HAVE_SECITEMPRIV_H /* Declare constants from that header... */
extern const CFTypeRef kSecClassCertificate;
extern const CFTypeRef kSecClassIdentity;
# endif /* !HAVE_SECITEMPRIV_H */
# if !defined(HAVE_SECIDENTITYSEARCHPRIV_H) && defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */
extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy,
CFStringRef idString, CSSM_KEYUSE keyUsage,
@@ -205,18 +205,31 @@ extern OSStatus SecPolicySetValue(SecPolicyRef policyRef,
typedef SSLContextRef http_tls_t;
typedef CFArrayRef http_tls_credentials_t;
extern OSStatus _httpReadCDSA(SSLConnectionRef connection, void *data,
size_t *dataLength);
extern OSStatus _httpWriteCDSA(SSLConnectionRef connection, const void *data,
size_t *dataLength);
# elif defined(HAVE_SSPISSL)
/*
* Windows' SSPI library gets a CUPS wrapper...
*/
typedef _sspi_struct_t * http_tls_t;
typedef void *http_tls_credentials_t;
typedef struct _http_sspi_s /**** SSPI/SSL data structure ****/
{
CredHandle creds; /* Credentials */
CtxtHandle context; /* SSL context */
BOOL contextInitialized; /* Is context init'd? */
SecPkgContext_StreamSizes streamSizes;/* SSL data stream sizes */
BYTE *decryptBuffer; /* Data pre-decryption*/
size_t decryptBufferLength; /* Length of decrypt buffer */
size_t decryptBufferUsed; /* Bytes used in buffer */
BYTE *readBuffer; /* Data post-decryption */
int readBufferLength; /* Length of read buffer */
int readBufferUsed; /* Bytes used in buffer */
BYTE *writeBuffer; /* Data pre-encryption */
int writeBufferLength; /* Length of write buffer */
PCCERT_CONTEXT localCert, /* Local certificate */
remoteCert; /* Remote (peer's) certificate */
char error[256]; /* Most recent error message */
} _http_sspi_t;
typedef _http_sspi_t *http_tls_t;
typedef PCCERT_CONTEXT http_tls_credentials_t;
# else
/*
@@ -225,7 +238,7 @@ typedef void *http_tls_credentials_t;
typedef void *http_tls_t;
typedef void *http_tls_credentials_t;
# endif /* HAVE_LIBSSL */
# endif /* HAVE_GNUTLS */
typedef enum _http_coding_e /**** HTTP content coding enumeration ****/
{
@@ -242,6 +255,7 @@ typedef enum _http_mode_e /**** HTTP mode enumeration ****/
_HTTP_MODE_SERVER /* Server connected (accepted) from client */
} _http_mode_t;
# ifndef _HTTP_NO_PRIVATE
struct _http_s /**** HTTP connection structure ****/
{
int fd; /* File descriptor for this socket */
@@ -263,7 +277,7 @@ struct _http_s /**** HTTP connection structure ****/
int used; /* Number of bytes used in buffer */
char buffer[HTTP_MAX_BUFFER];
/* Buffer for incoming data */
int auth_type; /* Authentication in use */
int _auth_type; /* Authentication in use (deprecated) */
_cups_md5_state_t md5_state; /* MD5 state */
char nonce[HTTP_MAX_VALUE];
/* Nonce value */
@@ -329,9 +343,10 @@ struct _http_s /**** HTTP connection structure ****/
# ifdef HAVE_LIBZ
_http_coding_t coding; /* _HTTP_CODING_xxx */
z_stream stream; /* (De)compression stream */
Bytef *dbuffer; /* Decompression buffer */
Bytef *sbuffer; /* (De)compression buffer */
# endif /* HAVE_LIBZ */
};
# endif /* !_HTTP_NO_PRIVATE */
/*
@@ -341,11 +356,6 @@ struct _http_s /**** HTTP connection structure ****/
# ifndef HAVE_HSTRERROR
extern const char *_cups_hstrerror(int error);
# define hstrerror _cups_hstrerror
# elif defined(_AIX) || defined(__osf__)
/*
* AIX and Tru64 UNIX don't provide a prototype but do provide the function...
*/
extern const char *hstrerror(int error);
# endif /* !HAVE_HSTRERROR */
@@ -395,19 +405,7 @@ extern void _cups_freeifaddrs(struct ifaddrs *addrs);
* Prototypes...
*/
#define _httpAddrFamily(addrp) (addrp)->addr.sa_family
extern int _httpAddrPort(http_addr_t *addr)
_CUPS_INTERNAL_MSG("Use httpAddrPort instead.");
extern void _httpAddrSetPort(http_addr_t *addr, int port);
extern char *_httpAssembleUUID(const char *server, int port,
const char *name, int number,
char *buffer, size_t bufsize)
_CUPS_INTERNAL_MSG("Use httpAssembleUUID instead.");
extern http_t *_httpCreate(const char *host, int port,
http_addrlist_t *addrlist,
http_encryption_t encryption,
int family)
_CUPS_INTERNAL_MSG("Use httpConnect2 or httpAccept instead.");
extern http_tls_credentials_t
_httpCreateCredentials(cups_array_t *credentials);
extern char *_httpDecodeURI(char *dst, const char *src,
@@ -416,12 +414,19 @@ extern void _httpDisconnect(http_t *http);
extern char *_httpEncodeURI(char *dst, const char *src,
size_t dstsize);
extern void _httpFreeCredentials(http_tls_credentials_t credentials);
extern ssize_t _httpPeek(http_t *http, char *buffer, size_t length)
_CUPS_INTERNAL_MSG("Use httpPeek instead.");
extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
size_t resolved_size, int options,
int (*cb)(void *context),
void *context);
extern const char *_httpStatus(cups_lang_t *lang, http_status_t status);
extern void _httpTLSInitialize(void);
extern size_t _httpTLSPending(http_t *http);
extern int _httpTLSRead(http_t *http, char *buf, int len);
extern int _httpTLSSetCredentials(http_t *http);
extern void _httpTLSSetOptions(int options);
extern int _httpTLSStart(http_t *http);
extern void _httpTLSStop(http_t *http);
extern int _httpTLSWrite(http_t *http, const char *buf, int len);
extern int _httpUpdate(http_t *http, http_status_t *status);
extern int _httpWait(http_t *http, int msec, int usessl);
@@ -437,5 +442,5 @@ extern int _httpWait(http_t *http, int msec, int usessl);
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
/*
* End of "$Id: http-private.h 11392 2013-11-06 01:29:56Z msweet $".
* End of "$Id: http-private.h 12645 2015-05-20 01:20:52Z msweet $".
*/
+282 -114
Ver Arquivo
@@ -1,53 +1,18 @@
/*
* "$Id: http-support.c 11445 2013-12-05 19:57:43Z msweet $"
* "$Id: http-support.c 12970 2015-11-13 20:02:51Z msweet $"
*
* HTTP support routines for CUPS.
* HTTP support routines for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
* Contents:
*
* httpAssembleURI() - Assemble a uniform resource identifier from its
* components.
* httpAssembleURIf() - Assemble a uniform resource identifier from its
* components with a formatted resource.
* httpAssembleUUID() - Assemble a name-based UUID URN conforming to RFC
* 4122.
* httpDecode64() - Base64-decode a string.
* httpDecode64_2() - Base64-decode a string.
* httpEncode64() - Base64-encode a string.
* httpEncode64_2() - Base64-encode a string.
* httpGetDateString() - Get a formatted date/time string from a time value.
* httpGetDateString2() - Get a formatted date/time string from a time value.
* httpGetDateTime() - Get a time value from a formatted date/time string.
* httpSeparate() - Separate a Universal Resource Identifier into its
* components.
* httpSeparate2() - Separate a Universal Resource Identifier into its
* components.
* httpSeparateURI() - Separate a Universal Resource Identifier into its
* components.
* httpStatus() - Return a short string describing a HTTP status
* code.
* _cups_hstrerror() - hstrerror() emulation function for Solaris and
* others.
* _httpDecodeURI() - Percent-decode a HTTP request URI.
* _httpEncodeURI() - Percent-encode a HTTP request URI.
* _httpResolveURI() - Resolve a DNS-SD URI.
* http_client_cb() - Client callback for resolving URI.
* http_copy_decode() - Copy and decode a URI.
* http_copy_encode() - Copy and encode a URI.
* http_poll_cb() - Wait for input on the specified file descriptors.
* http_resolve_cb() - Build a device URI for the given service name.
* http_resolve_cb() - Build a device URI for the given service name.
* This file is subject to the Apple OS-Developed Software exception.
*/
/*
@@ -84,6 +49,7 @@ typedef struct _http_uribuf_s /* URI buffer */
size_t bufsize; /* Size of buffer */
int options; /* Options passed to _httpResolveURI */
const char *resource; /* Resource from URI */
const char *uuid; /* UUID from URI */
} _http_uribuf_t;
@@ -91,7 +57,7 @@ typedef struct _http_uribuf_s /* URI buffer */
* Local globals...
*/
static const char * const http_days[7] =
static const char * const http_days[7] =/* Days of the week */
{
"Sun",
"Mon",
@@ -102,7 +68,7 @@ static const char * const http_days[7] =
"Sat"
};
static const char * const http_months[12] =
{
{ /* Months of the year */
"Jan",
"Feb",
"Mar",
@@ -116,6 +82,26 @@ static const char * const http_months[12] =
"Nov",
"Dec"
};
static const char * const http_states[] =
{ /* HTTP state strings */
"HTTP_STATE_ERROR",
"HTTP_STATE_WAITING",
"HTTP_STATE_OPTIONS",
"HTTP_STATE_GET",
"HTTP_STATE_GET_SEND",
"HTTP_STATE_HEAD",
"HTTP_STATE_POST",
"HTTP_STATE_POST_RECV",
"HTTP_STATE_POST_SEND",
"HTTP_STATE_PUT",
"HTTP_STATE_PUT_RECV",
"HTTP_STATE_DELETE",
"HTTP_STATE_TRACE",
"HTTP_STATE_CONNECT",
"HTTP_STATE_STATUS",
"HTTP_STATE_UNKNOWN_METHOD",
"HTTP_STATE_UNKNOWN_VERSION"
};
/*
@@ -206,10 +192,10 @@ httpAssembleURI(
if (!ptr)
goto assemble_overflow;
if (!strcmp(scheme, "mailto") || !strcmp(scheme, "tel"))
if (!strcmp(scheme, "geo") || !strcmp(scheme, "mailto") || !strcmp(scheme, "tel"))
{
/*
* mailto: and tel: only have :, no //...
* geo:, mailto:, and tel: only have :, no //...
*/
if (ptr < end)
@@ -220,7 +206,7 @@ httpAssembleURI(
else
{
/*
* Schemes other than mailto: and tel: all have //...
* Schemes other than geo:, mailto:, and tel: typically have //...
*/
if ((ptr + 2) < end)
@@ -372,7 +358,7 @@ httpAssembleURI(
if (port > 0)
{
snprintf(ptr, end - ptr + 1, ":%d", port);
snprintf(ptr, (size_t)(end - ptr + 1), ":%d", port);
ptr += strlen(ptr);
if (ptr >= end)
@@ -486,7 +472,7 @@ httpAssembleURIf(
bytes = vsnprintf(resource, sizeof(resource), resourcef, ap);
va_end(ap);
if (bytes >= sizeof(resource))
if ((size_t)bytes >= sizeof(resource))
{
*uri = '\0';
return (HTTP_URI_STATUS_OVERFLOW);
@@ -534,7 +520,7 @@ httpAssembleUUID(const char *server, /* I - Server name */
(unsigned)CUPS_RAND() & 0xffff, (unsigned)CUPS_RAND() & 0xffff);
_cupsMD5Init(&md5state);
_cupsMD5Append(&md5state, (unsigned char *)data, strlen(data));
_cupsMD5Append(&md5state, (unsigned char *)data, (int)strlen(data));
_cupsMD5Finish(&md5state, md5sum);
/*
@@ -552,13 +538,6 @@ httpAssembleUUID(const char *server, /* I - Server name */
return (buffer);
}
/* For OS X 10.8 and earlier */
char *_httpAssembleUUID(const char *server, int port, const char *name,
int number, char *buffer, size_t bufsize)
{
return (httpAssembleUUID(server, port, name, number, buffer, bufsize));
}
/*
* 'httpDecode64()' - Base64-decode a string.
@@ -597,10 +576,10 @@ httpDecode64_2(char *out, /* I - String to write to */
int *outlen, /* IO - Size of output string */
const char *in) /* I - String to read from */
{
int pos, /* Bit position */
base64; /* Value of this character */
char *outptr, /* Output pointer */
*outend; /* End of output buffer */
int pos; /* Bit position */
unsigned base64; /* Value of this character */
char *outptr, /* Output pointer */
*outend; /* End of output buffer */
/*
@@ -629,11 +608,11 @@ httpDecode64_2(char *out, /* I - String to write to */
*/
if (*in >= 'A' && *in <= 'Z')
base64 = *in - 'A';
base64 = (unsigned)(*in - 'A');
else if (*in >= 'a' && *in <= 'z')
base64 = *in - 'a' + 26;
base64 = (unsigned)(*in - 'a' + 26);
else if (*in >= '0' && *in <= '9')
base64 = *in - '0' + 52;
base64 = (unsigned)(*in - '0' + 52);
else if (*in == '+')
base64 = 62;
else if (*in == '/')
@@ -651,26 +630,26 @@ httpDecode64_2(char *out, /* I - String to write to */
{
case 0 :
if (outptr < outend)
*outptr = base64 << 2;
*outptr = (char)(base64 << 2);
pos ++;
break;
case 1 :
if (outptr < outend)
*outptr++ |= (base64 >> 4) & 3;
*outptr++ |= (char)((base64 >> 4) & 3);
if (outptr < outend)
*outptr = (base64 << 4) & 255;
*outptr = (char)((base64 << 4) & 255);
pos ++;
break;
case 2 :
if (outptr < outend)
*outptr++ |= (base64 >> 2) & 15;
*outptr++ |= (char)((base64 >> 2) & 15);
if (outptr < outend)
*outptr = (base64 << 6) & 255;
*outptr = (char)((base64 << 6) & 255);
pos ++;
break;
case 3 :
if (outptr < outend)
*outptr++ |= base64;
*outptr++ |= (char)base64;
pos = 0;
break;
}
@@ -830,10 +809,7 @@ httpGetDateString2(time_t t, /* I - UNIX time */
tdate = gmtime(&t);
if (tdate)
snprintf(s, 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);
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';
@@ -1028,7 +1004,7 @@ httpSeparateURI(
* Workaround for HP IPP client bug...
*/
strlcpy(scheme, "ipp", schemelen);
strlcpy(scheme, "ipp", (size_t)schemelen);
status = HTTP_URI_STATUS_MISSING_SCHEME;
}
else if (*uri == '/')
@@ -1037,7 +1013,7 @@ httpSeparateURI(
* Filename...
*/
strlcpy(scheme, "file", schemelen);
strlcpy(scheme, "file", (size_t)schemelen);
status = HTTP_URI_STATUS_MISSING_SCHEME;
}
else
@@ -1255,7 +1231,13 @@ httpSeparateURI(
return (HTTP_URI_STATUS_BAD_PORT);
}
*port = strtol(uri + 1, (char **)&uri, 10);
*port = (int)strtol(uri + 1, (char **)&uri, 10);
if (*port <= 0 || *port > 65535)
{
*port = 0;
return (HTTP_URI_STATUS_BAD_PORT);
}
if (*uri != '/' && *uri)
{
@@ -1322,22 +1304,34 @@ httpSeparateURI(
/*
* 'httpStatus()' - Return a short string describing a HTTP status code.
* 'httpStateString()' - Return the string describing a HTTP state value.
*
* The returned string is localized to the current POSIX locale and is based
* on the status strings defined in RFC 2616.
* @since CUPS 2.0/OS 10.10@
*/
const char * /* O - State string */
httpStateString(http_state_t state) /* I - HTTP state value */
{
if (state < HTTP_STATE_ERROR || state > HTTP_STATE_UNKNOWN_VERSION)
return ("HTTP_STATE_???");
else
return (http_states[state - HTTP_STATE_ERROR]);
}
/*
* '_httpStatus()' - Return the localized string describing a HTTP status code.
*
* The returned string is localized using the passed message catalog.
*/
const char * /* O - Localized status string */
httpStatus(http_status_t status) /* I - HTTP status code */
_httpStatus(cups_lang_t *lang, /* I - Language */
http_status_t status) /* I - HTTP status code */
{
const char *s; /* Status string */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
if (!cg->lang_default)
cg->lang_default = cupsLangDefault();
switch (status)
{
case HTTP_STATUS_ERROR :
@@ -1419,6 +1413,90 @@ httpStatus(http_status_t status) /* I - HTTP status code */
break;
}
return (_cupsLangString(lang, s));
}
/*
* 'httpStatus()' - Return a short string describing a HTTP status code.
*
* The returned string is localized to the current POSIX locale and is based
* on the status strings defined in RFC 2616.
*/
const char * /* O - Localized status string */
httpStatus(http_status_t status) /* I - HTTP status code */
{
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
if (!cg->lang_default)
cg->lang_default = cupsLangDefault();
return (_httpStatus(cg->lang_default, status));
}
/*
* 'httpURIStatusString()' - Return a string describing a URI status code.
*
* @since CUPS 2.0/OS 10.10@
*/
const char * /* O - Localized status string */
httpURIStatusString(
http_uri_status_t status) /* I - URI status code */
{
const char *s; /* Status string */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
if (!cg->lang_default)
cg->lang_default = cupsLangDefault();
switch (status)
{
case HTTP_URI_STATUS_OVERFLOW :
s = _("URI too large");
break;
case HTTP_URI_STATUS_BAD_ARGUMENTS :
s = _("Bad arguments to function");
break;
case HTTP_URI_STATUS_BAD_RESOURCE :
s = _("Bad resource in URI");
break;
case HTTP_URI_STATUS_BAD_PORT :
s = _("Bad port number in URI");
break;
case HTTP_URI_STATUS_BAD_HOSTNAME :
s = _("Bad hostname/address in URI");
break;
case HTTP_URI_STATUS_BAD_USERNAME :
s = _("Bad username in URI");
break;
case HTTP_URI_STATUS_BAD_SCHEME :
s = _("Bad scheme in URI");
break;
case HTTP_URI_STATUS_BAD_URI :
s = _("Bad/empty URI");
break;
case HTTP_URI_STATUS_OK :
s = _("OK");
break;
case HTTP_URI_STATUS_MISSING_SCHEME :
s = _("Missing scheme in URI");
break;
case HTTP_URI_STATUS_UNKNOWN_SCHEME :
s = _("Unknown scheme in URI");
break;
case HTTP_URI_STATUS_MISSING_RESOURCE :
s = _("Missing resource in URI");
break;
default:
s = _("Unknown");
break;
}
return (_cupsLangString(cg->lang_default, s));
}
@@ -1538,7 +1616,9 @@ _httpResolveURI(
{
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
char *regtype, /* Pointer to type in hostname */
*domain; /* Pointer to domain in hostname */
*domain, /* Pointer to domain in hostname */
*uuid, /* Pointer to UUID in URI */
*uuidend; /* Pointer to end of UUID in URI */
_http_uribuf_t uribuf; /* URI buffer */
int offline = 0; /* offline-report state set? */
# ifdef HAVE_DNSSD
@@ -1546,9 +1626,11 @@ _httpResolveURI(
# pragma comment(lib, "dnssd.lib")
# endif /* WIN32 */
DNSServiceRef ref, /* DNS-SD master service reference */
domainref, /* DNS-SD service reference for domain */
domainref = NULL,/* DNS-SD service reference for domain */
ippref = NULL, /* DNS-SD service reference for network IPP */
ippsref = NULL, /* DNS-SD service reference for network IPPS */
localref; /* DNS-SD service reference for .local */
int domainsent = 0; /* Send the domain resolve? */
int extrasent = 0; /* Send the domain/IPP/IPPS resolves? */
# ifdef HAVE_POLL
struct pollfd polldata; /* Polling data */
# else /* select() */
@@ -1595,12 +1677,21 @@ _httpResolveURI(
if (domain)
*domain++ = '\0';
if ((uuid = strstr(resource, "?uuid=")) != NULL)
{
*uuid = '\0';
uuid += 6;
if ((uuidend = strchr(uuid, '&')) != NULL)
*uuidend = '\0';
}
resolved_uri[0] = '\0';
uribuf.buffer = resolved_uri;
uribuf.bufsize = resolved_size;
uribuf.options = options;
uribuf.resource = resource;
resolved_uri[0] = '\0';
uribuf.uuid = uuid;
DEBUG_printf(("6_httpResolveURI: Resolving hostname=\"%s\", regtype=\"%s\", "
"domain=\"%s\"\n", hostname, regtype, domain));
@@ -1616,7 +1707,7 @@ _httpResolveURI(
# ifdef HAVE_DNSSD
if (DNSServiceCreateConnection(&ref) == kDNSServiceErr_NoError)
{
int myinterface = kDNSServiceInterfaceIndexAny;
uint32_t myinterface = kDNSServiceInterfaceIndexAny;
/* Lookup on any interface */
if (!strcmp(scheme, "ippusb"))
@@ -1637,7 +1728,7 @@ _httpResolveURI(
while (time(NULL) < end_time)
{
if (options & _HTTP_RESOLVE_STDERR)
_cupsLangPrintFilter(stderr, "INFO", _("Looking for printer."));
_cupsLangPrintFilter(stderr, "INFO", _("Looking for printer..."));
if (cb && !(*cb)(context))
{
@@ -1656,7 +1747,7 @@ _httpResolveURI(
polldata.fd = DNSServiceRefSockFD(ref);
polldata.events = POLLIN;
fds = poll(&polldata, 1, 1000 * timeout);
fds = poll(&polldata, 1, (int)(1000 * timeout));
# else /* select() */
FD_ZERO(&input_set);
@@ -1688,7 +1779,7 @@ _httpResolveURI(
* comes in, do an additional domain resolution...
*/
if (domainsent == 0 && domain && _cups_strcasecmp(domain, "local."))
if (extrasent == 0 && domain && _cups_strcasecmp(domain, "local."))
{
if (options & _HTTP_RESOLVE_STDERR)
fprintf(stderr,
@@ -1702,7 +1793,33 @@ _httpResolveURI(
myinterface, hostname, regtype, domain,
http_resolve_cb,
&uribuf) == kDNSServiceErr_NoError)
domainsent = 1;
extrasent = 1;
}
else if (extrasent == 0 && !strcmp(scheme, "ippusb"))
{
if (options & _HTTP_RESOLVE_STDERR)
fprintf(stderr, "DEBUG: Resolving \"%s\", regtype=\"_ipps._tcp\", domain=\"local.\"...\n", hostname);
ippsref = ref;
if (DNSServiceResolve(&ippsref,
kDNSServiceFlagsShareConnection,
kDNSServiceInterfaceIndexAny, hostname,
"_ipps._tcp", domain, http_resolve_cb,
&uribuf) == kDNSServiceErr_NoError)
extrasent = 1;
}
else if (extrasent == 1 && !strcmp(scheme, "ippusb"))
{
if (options & _HTTP_RESOLVE_STDERR)
fprintf(stderr, "DEBUG: Resolving \"%s\", regtype=\"_ipp._tcp\", domain=\"local.\"...\n", hostname);
ippref = ref;
if (DNSServiceResolve(&ippref,
kDNSServiceFlagsShareConnection,
kDNSServiceInterfaceIndexAny, hostname,
"_ipp._tcp", domain, http_resolve_cb,
&uribuf) == kDNSServiceErr_NoError)
extrasent = 2;
}
/*
@@ -1719,7 +1836,8 @@ _httpResolveURI(
}
else
{
if (DNSServiceProcessResult(ref) == kDNSServiceErr_NoError)
if (DNSServiceProcessResult(ref) == kDNSServiceErr_NoError &&
resolved_uri[0])
{
uri = resolved_uri;
break;
@@ -1727,8 +1845,15 @@ _httpResolveURI(
}
}
if (domainsent)
DNSServiceRefDeallocate(domainref);
if (extrasent)
{
if (domainref)
DNSServiceRefDeallocate(domainref);
if (ippref)
DNSServiceRefDeallocate(ippref);
if (ippsref)
DNSServiceRefDeallocate(ippsref);
}
DNSServiceRefDeallocate(localref);
}
@@ -1920,7 +2045,7 @@ http_copy_decode(char *dst, /* O - Destination buffer */
else
quoted |= *src - '0';
*ptr++ = quoted;
*ptr++ = (char)quoted;
}
else
{
@@ -2032,6 +2157,31 @@ http_resolve_cb(
interfaceIndex, errorCode, fullName, hostTarget, port, txtLen,
txtRecord, context));
/*
* If we have a UUID, compare it...
*/
if (uribuf->uuid &&
(value = TXTRecordGetValuePtr(txtLen, txtRecord, "UUID",
&valueLen)) != NULL)
{
char uuid[256]; /* UUID value */
memcpy(uuid, value, valueLen);
uuid[valueLen] = '\0';
if (_cups_strcasecmp(uuid, uribuf->uuid))
{
if (uribuf->options & _HTTP_RESOLVE_STDERR)
fprintf(stderr, "DEBUG: Found UUID %s, looking for %s.", uuid,
uribuf->uuid);
DEBUG_printf(("7http_resolve_cb: Found UUID %s, looking for %s.", uuid,
uribuf->uuid));
return;
}
}
/*
* Figure out the scheme from the full name...
*/
@@ -2123,9 +2273,7 @@ http_resolve_cb(
{
for (addr = addrlist; addr; addr = addr->next)
{
int error = getnameinfo(&(addr->addr.addr),
httpAddrLength(&(addr->addr)),
fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
int error = getnameinfo(&(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)), fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
if (!error)
{
@@ -2156,12 +2304,9 @@ http_resolve_cb(
if ((!strcmp(scheme, "ipp") || !strcmp(scheme, "ipps")) &&
!strcmp(uribuf->resource, "/cups"))
httpAssembleURIf(HTTP_URI_CODING_ALL, uribuf->buffer, uribuf->bufsize,
scheme, NULL, hostTarget, ntohs(port), "%s?snmp=false",
resource);
httpAssembleURIf(HTTP_URI_CODING_ALL, uribuf->buffer, (int)uribuf->bufsize, scheme, NULL, hostTarget, ntohs(port), "%s?snmp=false", resource);
else
httpAssembleURI(HTTP_URI_CODING_ALL, uribuf->buffer, uribuf->bufsize,
scheme, NULL, hostTarget, ntohs(port), resource);
httpAssembleURI(HTTP_URI_CODING_ALL, uribuf->buffer, (int)uribuf->bufsize, scheme, NULL, hostTarget, ntohs(port), resource);
DEBUG_printf(("8http_resolve_cb: Resolved URI is \"%s\"...", uribuf->buffer));
}
@@ -2236,6 +2381,31 @@ http_resolve_cb(
return;
}
/*
* If we have a UUID, compare it...
*/
if (uribuf->uuid && (pair = avahi_string_list_find(txt, "UUID")) != NULL)
{
char uuid[256]; /* UUID value */
avahi_string_list_get_pair(pair, NULL, &value, &valueLen);
memcpy(uuid, value, valueLen);
uuid[valueLen] = '\0';
if (_cups_strcasecmp(uuid, uribuf->uuid))
{
if (uribuf->options & _HTTP_RESOLVE_STDERR)
fprintf(stderr, "DEBUG: Found UUID %s, looking for %s.", uuid,
uribuf->uuid);
DEBUG_printf(("7http_resolve_cb: Found UUID %s, looking for %s.", uuid,
uribuf->uuid));
return;
}
}
/*
* Figure out the scheme from the full name...
*/
@@ -2341,9 +2511,7 @@ http_resolve_cb(
{
for (addr = addrlist; addr; addr = addr->next)
{
int error = getnameinfo(&(addr->addr.addr),
httpAddrLength(&(addr->addr)),
fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
int error = getnameinfo(&(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)), fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD);
if (!error)
{
@@ -2382,5 +2550,5 @@ http_resolve_cb(
/*
* End of "$Id: http-support.c 11445 2013-12-05 19:57:43Z msweet $".
* End of "$Id: http-support.c 12970 2015-11-13 20:02:51Z msweet $".
*/
+533 -1589
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+48 -15
Ver Arquivo
@@ -1,18 +1,18 @@
/*
* "$Id: http.h 11085 2013-07-03 13:53:05Z msweet $"
* "$Id: http.h 12848 2015-08-26 18:51:57Z msweet $"
*
* Hyper-Text Transport Protocol definitions for CUPS.
* Hyper-Text Transport Protocol definitions for CUPS.
*
* Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
* which should have been included with this file. If this file is
* file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
* This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_HTTP_H_
@@ -87,8 +87,6 @@ extern "C" {
# define s6_addr32 _S6_un._S6_u32
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
# define s6_addr32 __u6_addr.__u6_addr32
# elif defined(__osf__)
# define s6_addr32 s6_un.sa6_laddr
# elif defined(WIN32)
/*
* Windows only defines byte and 16-bit word members of the union and
@@ -248,7 +246,7 @@ typedef enum http_status_e /**** HTTP status codes ****/
HTTP_STATUS_NOT_AUTHORITATIVE, /* Information isn't authoritative */
HTTP_STATUS_NO_CONTENT, /* Successful command, no new data */
HTTP_STATUS_RESET_CONTENT, /* Content was reset/recreated */
HTTP_STATUS_PARTIAL_CONTENT, /* Only a partial file was recieved/sent */
HTTP_STATUS_PARTIAL_CONTENT, /* Only a partial file was received/sent */
HTTP_STATUS_MULTIPLE_CHOICES = 300, /* Multiple files match request */
HTTP_STATUS_MOVED_PERMANENTLY, /* Document has moved permanently */
@@ -344,6 +342,16 @@ typedef enum http_status_e /**** HTTP status codes ****/
# endif /* !_CUPS_NO_DEPRECATED */
} http_status_t;
typedef enum http_trust_e /**** Level of trust for credentials @since CUPS 2.0/OS 10.10@ */
{
HTTP_TRUST_OK = 0, /* Credentials are OK/trusted */
HTTP_TRUST_INVALID, /* Credentials are invalid */
HTTP_TRUST_CHANGED, /* Credentials have changed */
HTTP_TRUST_EXPIRED, /* Credentials are expired */
HTTP_TRUST_RENEWED, /* Credentials have been renewed */
HTTP_TRUST_UNKNOWN, /* Credentials are unknown/new */
} http_trust_t;
typedef enum http_uri_status_e /**** URI separation status @since CUPS 1.2@ ****/
{
HTTP_URI_STATUS_OVERFLOW = -8, /* URI buffer for httpAssembleURI is too small */
@@ -585,7 +593,7 @@ extern int httpReconnect2(http_t *http, int msec, int *cancel)
_CUPS_API_1_6;
/**** New in CUPS 1.7 ****/
/**** New in CUPS 1.7/OS X 10.9 ****/
extern http_t *httpAcceptConnection(int fd, int blocking)
_CUPS_API_1_7;
extern http_addrlist_t *httpAddrCopyList(http_addrlist_t *src) _CUPS_API_1_7;
@@ -612,6 +620,31 @@ extern void httpSetDefaultField(http_t *http, http_field_t field,
extern http_state_t httpWriteResponse(http_t *http,
http_status_t status) _CUPS_API_1_7;
/* New in CUPS 2.0/OS X 10.10 */
extern int httpAddrClose(http_addr_t *addr, int fd) _CUPS_API_2_0;
extern int httpAddrFamily(http_addr_t *addr) _CUPS_API_2_0;
extern int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2) _CUPS_API_2_0;
extern int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);
extern time_t httpCredentialsGetExpiration(cups_array_t *credentials) _CUPS_API_2_0;
extern http_trust_t httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name) _CUPS_API_2_0;
extern size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize) _CUPS_API_2_0;
extern http_field_t httpFieldValue(const char *name) _CUPS_API_2_0;
extern time_t httpGetActivity(http_t *http) _CUPS_API_2_0;
extern http_addr_t *httpGetAddress(http_t *http) _CUPS_API_2_0;
extern http_encryption_t httpGetEncryption(http_t *http) _CUPS_API_2_0;
extern http_keepalive_t httpGetKeepAlive(http_t *http) _CUPS_API_2_0;
extern size_t httpGetPending(http_t *http) _CUPS_API_2_0;
extern size_t httpGetReady(http_t *http) _CUPS_API_2_0;
extern size_t httpGetRemaining(http_t *http) _CUPS_API_2_0;
extern int httpIsChunked(http_t *http) _CUPS_API_2_0;
extern int httpIsEncrypted(http_t *http) _CUPS_API_2_0;
extern int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name) _CUPS_API_2_0;
extern const char *httpResolveHostname(http_t *http, char *buffer, size_t bufsize) _CUPS_API_2_0;
extern int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name) _CUPS_API_2_0;
extern void httpSetKeepAlive(http_t *http, http_keepalive_t keep_alive) _CUPS_API_2_0;
extern void httpShutdown(http_t *http) _CUPS_API_2_0;
extern const char *httpStateString(http_state_t state) _CUPS_API_2_0;
extern const char *httpURIStatusString(http_uri_status_t status) _CUPS_API_2_0;
/*
* C++ magic...
@@ -623,5 +656,5 @@ extern http_state_t httpWriteResponse(http_t *http,
#endif /* !_CUPS_HTTP_H_ */
/*
* End of "$Id: http.h 11085 2013-07-03 13:53:05Z msweet $".
* End of "$Id: http.h 12848 2015-08-26 18:51:57Z msweet $".
*/

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