Comparar commits
383 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| b93671244e | |||
| 5d2cc5d32d | |||
| 1a18c85cd1 | |||
| b60086f8ae | |||
| 215ef63830 | |||
| a51f28ec99 | |||
| 71f63681cb | |||
| 61515785f7 | |||
| 75efa1051d | |||
| f9d9f12690 | |||
| 7416dfe99a | |||
| dd0eea8e71 | |||
| 0c229544f4 | |||
| b3533f112d | |||
| 3b2526b366 | |||
| ba38d7d9dc | |||
| 4bdbabf76b | |||
| 64e918f26a | |||
| 111ff13a26 | |||
| f4515965b3 | |||
| c7233aabe5 | |||
| 8eabd901fe | |||
| 1d708564b3 | |||
| e5d9b5e191 | |||
| 00c4573088 | |||
| 27efcd61e0 | |||
| 06cefec35c | |||
| c2def0ced7 | |||
| e9152ac713 | |||
| 3d3f64a982 | |||
| 4ecc320364 | |||
| 60c3ee0499 | |||
| 305331a392 | |||
| 40e88e9009 | |||
| 5f19ab52fe | |||
| 4a842d5397 | |||
| 75ff7c7fea | |||
| ee8618f3fd | |||
| dfc4cea4be | |||
| f253405029 | |||
| f6008c81b9 | |||
| 9941cf57f2 | |||
| fde3d2df54 | |||
| 4972f4feee | |||
| f593fc1f91 | |||
| 8a25966925 | |||
| 1d670c3987 | |||
| 1523f10d81 | |||
| 0d4d48ad63 | |||
| f902c56223 | |||
| e826f56b16 | |||
| 80360a5e4c | |||
| 737b017edf | |||
| 483fc76b98 | |||
| d939104ddc | |||
| 7d1419a770 | |||
| e1a3eca81c | |||
| f8f52a9058 | |||
| 89a653066e | |||
| 0c4bedc42d | |||
| e924ce801a | |||
| f9a12035df | |||
| f8e23ef7e7 | |||
| 54f63cdfb5 | |||
| ac0ec51ba0 | |||
| 990c79d278 | |||
| cca2420513 | |||
| 1505041083 | |||
| f0ccfab317 | |||
| 6c78e3f887 | |||
| bc0305b0b9 | |||
| ad0357ca1d | |||
| 75b9ea1c3a | |||
| 24a8828edd | |||
| 7a712c54f8 | |||
| 3f786819c8 | |||
| 567f49cba3 | |||
| ffa2ca90d5 | |||
| 9520743f2d | |||
| bf500a5653 | |||
| a782e5574a | |||
| c606bcae4e | |||
| 83385e2997 | |||
| 8a78aa3778 | |||
| 94446c2699 | |||
| 7374e9e5d4 | |||
| d48a10026a | |||
| 9c0e8e5d83 | |||
| d1f0f86b73 | |||
| 7bf181980c | |||
| 223bdaa186 | |||
| 25f3e1eef0 | |||
| ad29aeab8c | |||
| 7e5023ddea | |||
| b63a0d90da | |||
| 5489ad4342 | |||
| 3699c6372c | |||
| d680d3826c | |||
| e666fe5e38 | |||
| ff862e509f | |||
| 71f294cef9 | |||
| 56cd8959f0 | |||
| 94b4b4a07d | |||
| e5528d423b | |||
| b34254bcf1 | |||
| 4875b2f3f6 | |||
| 83f65dd609 | |||
| e4e5666b10 | |||
| 2d0a0f48e7 | |||
| 70752071b3 | |||
| a505eef406 | |||
| 4174320042 | |||
| c4aa297584 | |||
| 4ffc419764 | |||
| 766a822957 | |||
| 69518a8578 | |||
| bac0799207 | |||
| 26340b35e8 | |||
| 1bc82dd928 | |||
| 21f36711d9 | |||
| 0687ea6984 | |||
| f2d18633e2 | |||
| 23ef1cac65 | |||
| 86c809d99c | |||
| 4fcfa0cf96 | |||
| ee8d237de0 | |||
| 06399b6e0d | |||
| 890a10b7de | |||
| 1d47b929b0 | |||
| 9475ec92d8 | |||
| 2a241c9efc | |||
| 90c6ec2104 | |||
| a8109fbe78 | |||
| 94436c5a61 | |||
| 6961465fb2 | |||
| cb7f98ee7f | |||
| c5b24bfa98 | |||
| db8b865d20 | |||
| 0cb67df369 | |||
| 0fa6c7fa54 | |||
| c1420c8744 | |||
| c41769ffd0 | |||
| a469f8a576 | |||
| 76aa1ac14c | |||
| 3dd9c34058 | |||
| 5a9febac19 | |||
| 37e7e6e0b2 | |||
| a29fd7ddb5 | |||
| f3c17241a4 | |||
| 271780fb87 | |||
| 82cc1f9ac3 | |||
| 3e7fe0ca76 | |||
| bb0d23b21b | |||
| 3ee4274c97 | |||
| 12f89d241c | |||
| dcb445bcf3 | |||
| 9c80ffa289 | |||
| a2326b5b72 | |||
| d7225fc298 | |||
| 9b66acc599 | |||
| 10ddcf65af | |||
| 83e0800111 | |||
| 85dda01c84 | |||
| a48458814a | |||
| 771bd8cbff | |||
| bd8b6777d6 | |||
| f99f369831 | |||
| d4d033982c | |||
| f228370c3f | |||
| 88f9aafc49 | |||
| 321d8d57da | |||
| eac3a0a01b | |||
| 22c9029b44 | |||
| 07ed0e9a43 | |||
| 84315f460a | |||
| 82f972324d | |||
| 31db8dedac | |||
| f14324a792 | |||
| c8fef167ba | |||
| e60ec91f3e | |||
| 515b46cde4 | |||
| 0268488e2f | |||
| c779abb06a | |||
| 229681c188 | |||
| 0837b7e828 | |||
| 1106b00e75 | |||
| 10d09e334a | |||
| 6c48a6cafc | |||
| 7cf5915ead | |||
| 030ae6a14e | |||
| 4220952d4d | |||
| c7017eccd2 | |||
| cc75483441 | |||
| 6d2f911bdd | |||
| 39ff2fe72b | |||
| aaf19ab07e | |||
| e2d18a01cc | |||
| 5180a04ce8 | |||
| 61e2aeb0be | |||
| a480a1b6b4 | |||
| 71e160228f | |||
| 54afec3350 | |||
| ba55dc12de | |||
| 5a6b583acf | |||
| f8b3a85b79 | |||
| 4168188389 | |||
| 5a662dc060 | |||
| ef55b74533 | |||
| 3fb9c47ea6 | |||
| 101decd054 | |||
| 4d301e694f | |||
| b226ab9913 | |||
| 18ecb42821 | |||
| 7a0cbd5e57 | |||
| ee6ddad257 | |||
| 4a4b4f9914 | |||
| f701418f7b | |||
| 60198c6dba | |||
| e38f5e9c4d | |||
| 85b5d1dfa7 | |||
| 4e6f60f000 | |||
| acb056cb17 | |||
| 97c9a8d722 | |||
| 393ac6abae | |||
| b0f6947b4d | |||
| 68b10830fa | |||
| 536bc2c652 | |||
| 6c663ae27a | |||
| 178cb7369d | |||
| f11a948a02 | |||
| e07d4801f9 | |||
| 38e73f8781 | |||
| 94da7e344c | |||
| 238c383265 | |||
| 8b116e6004 | |||
| 9aff70cc17 | |||
| d7871c8c7f | |||
| 1340db2dab | |||
| b9faaae17c | |||
| ede613e028 | |||
| f0ab5bff8a | |||
| bf3816c7ed | |||
| 745129beeb | |||
| dfd5680b87 | |||
| d1c13e1686 | |||
| d2354e6397 | |||
| c168a833ca | |||
| 557dde9fbc | |||
| 426c6a5959 | |||
| 8b450588f4 | |||
| ed6e7faf3e | |||
| 52f6f666c3 | |||
| 9380acaa78 | |||
| 4b3f67ff4c | |||
| e6013cfab0 | |||
| e4572d571c | |||
| 28b9d139c0 | |||
| 6e8b116d7f | |||
| 758a062feb | |||
| 02797ade68 | |||
| 61cf44e2b7 | |||
| 076fd0e4fb | |||
| 58dc193312 | |||
| f2245c695c | |||
| cda47a960f | |||
| 1f6f3dbcf9 | |||
| 0af14961a8 | |||
| b19ccc9e27 | |||
| 49d8745278 | |||
| c5571a1d68 | |||
| 9a4f8274e9 | |||
| 5f64df2982 | |||
| 247efae55f | |||
| 06d4e77b9b | |||
| 1ff0402e47 | |||
| 9f5eb9be66 | |||
| ee571f261a | |||
| 749b1e90a8 | |||
| 005dd1eb9e | |||
| 5d6412a9f1 | |||
| e78998dfeb | |||
| 66ab9486ef | |||
| 1f0275e3cc | |||
| 4509bb4933 | |||
| 75bd9771f6 | |||
| dd1abb6b5f | |||
| c934a06cde | |||
| 79e1d494ec | |||
| 8922323b9f | |||
| bdd6c45b5e | |||
| 20fbc90347 | |||
| 47879b8b63 | |||
| 5eb9da713f | |||
| 01ce6322ca | |||
| 3c8c76971a | |||
| c9fc04c6ec | |||
| 969307f096 | |||
| a0f6818ebf | |||
| d8bcaa3c4c | |||
| 7a14d7682b | |||
| a4f1b3dff2 | |||
| 634763e80e | |||
| 3dfe78b336 | |||
| ae71f5deb4 | |||
| 839a51c83c | |||
| 50fe720154 | |||
| db0bd74adb | |||
| 64a69576c8 | |||
| a603edef72 | |||
| 568fa3faf1 | |||
| d6943d1d31 | |||
| ac884b6a1c | |||
| 5a738aeaea | |||
| d9bca400be | |||
| 5bd77a735f | |||
| 91c84a3551 | |||
| 080811b190 | |||
| 3d052e4330 | |||
| a4924f6c45 | |||
| 0a6827453a | |||
| a41f09e265 | |||
| e94d2f1068 | |||
| 2fb7629816 | |||
| cc9a7e967e | |||
| 65a152d3f1 | |||
| 183ee7626a | |||
| 2e4ff8afcb | |||
| 56ab62c60c | |||
| 7dfedb921d | |||
| c277e2f802 | |||
| db1f069b7f | |||
| 76cd9e37aa | |||
| 7ff4fea9bc | |||
| c24d21342f | |||
| 355e94dc85 | |||
| cc0d019f5e | |||
| bc44d92092 | |||
| 09a101d671 | |||
| 3d8365b8dc | |||
| b94498cfba | |||
| 323c5de1e8 | |||
| c0e1af835b | |||
| f42414bf8a | |||
| f899b12170 | |||
| 7594b2247b | |||
| f7deaa1a21 | |||
| b86bc4cf57 | |||
| 411affcf6a | |||
| 26d47ec688 | |||
| 2abf387cae | |||
| 07725fee41 | |||
| d09495fadd | |||
| 8ca02f3c05 | |||
| f7faf1f5c3 | |||
| c07d5b2daf | |||
| ed48691112 | |||
| 9e22304f01 | |||
| 7a6a01ddca | |||
| 3608048605 | |||
| f301802fc2 | |||
| a9252913e7 | |||
| a74454a757 | |||
| 89d46774ee | |||
| e53920b922 | |||
| d6ae789d92 | |||
| 80ca45929e | |||
| e1d6a77454 | |||
| 480ef0fe29 | |||
| 757d2cad8f | |||
| 4744bd907e | |||
| b423cd4cb9 | |||
| ecdc06282a | |||
| bd7854cb4d | |||
| 4400e98de2 | |||
| e00b005a05 | |||
| ffb6300882 | |||
| a4d045870e | |||
| 09ec001812 | |||
| 923edb689d | |||
| fa73b22906 | |||
| 4a09f02d10 | |||
| ef416fc25c | |||
| 9ec11526e1 |
@@ -1,10 +1,47 @@
|
||||
CHANGES-1.6.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V1.6.4
|
||||
|
||||
- Removed some duplicate size definitions for some ISO sizes that were
|
||||
causing problems (<rdar://problem/14722721>)
|
||||
- The IPP backend did not add the "last-document" attribute
|
||||
(<rdar://problem/114660379>)
|
||||
- Added a SyncOnClose directive to cups-files.conf to force cupsd to
|
||||
call fsync before closing any configuration/state files it writes
|
||||
(<rdar://problem/14523043>)
|
||||
- Added USB quirk rule for Lexmark E238 (<rdar://problem/14493054>)
|
||||
- Closed server connections were still not always detected
|
||||
(<rdar://problem/14484313>)
|
||||
- The libusb-based USB backend now loads its list of quirks from files
|
||||
in /usr/share/cups/usb instead of using a hardcoded table
|
||||
(<rdar://problem/14442769>)
|
||||
- The scheduler did not properly register ICC color profiles with
|
||||
colord (<rdar://problem/14455625>)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.6.3
|
||||
|
||||
- The configure script now prefers Clang over GCC.
|
||||
- Fixed a compile problem on AIX (STR #4307)
|
||||
- The default IPP version did not always get set before creating a new
|
||||
IPP request message (<rdar://problem/14401718>)
|
||||
- The lp, lpq, lpr, and lpstat now display an error message advising the
|
||||
use of the /version=1.1 ServerName option (<rdar://problem/14290628>)
|
||||
- Added documentation about the /version=1.1 option to ServerName in
|
||||
client.conf (<rdar://problem/14216262>)
|
||||
- httpStatus(HTTP_ERROR) did not return a useful error message
|
||||
(<rdar://problem/14217326>)
|
||||
- The lp, lpq, lpr, and lpstat commands incorrectly ignored the default
|
||||
printer set in the lpoptions file (<rdar://problem/14216472>)
|
||||
- Fixed a URI encoding issue for hostnames containing the ` (backquote)
|
||||
character (<rdar://problem/14243133>)
|
||||
- Added support for RFC 6874's IPv6 link local address format in URIs
|
||||
(<rdar://problem/13979453>)
|
||||
- The USB backend could crash on libusb-based systems if USB was
|
||||
disabled in the BIOS (<rdar://problem/13875729>)
|
||||
- Fixed a rounding error in the PWG media size mapping code
|
||||
(<rdar://problem/13493241>)
|
||||
- Fixed several ipptool test files that used old STATUS names.
|
||||
- Kerberos credentials could get truncated when printing to a shared
|
||||
printer.
|
||||
|
||||
@@ -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)
|
||||
+13
-3
@@ -1,11 +1,21 @@
|
||||
CHANGES-IPPTOOL.txt - 2013-05-02
|
||||
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.
|
||||
|
||||
2013-05-02
|
||||
2014-05-15
|
||||
|
||||
- Added support for simultaneous XML and test output from ipptool.
|
||||
- Added support for PAUSE directive in ipptool test files.
|
||||
|
||||
|
||||
2013-07-15
|
||||
|
||||
- New ippfind tool now included with ipptool.
|
||||
- Added support for automatically extending the timeout when all of the
|
||||
request data has not yet been written (all platforms but Windows
|
||||
which does not support it...)
|
||||
- Fixed several ipptool test files that used old STATUS names.
|
||||
|
||||
|
||||
|
||||
+91
-34
@@ -1,37 +1,94 @@
|
||||
CHANGES.txt - 1.7b1 - 2013-04-18
|
||||
CHANGES.txt - 2.0.0 - 2014-10-01
|
||||
--------------------------------
|
||||
|
||||
CHANGES IN CUPS V1.7b1
|
||||
CHANGES IN CUPS V2.0.0
|
||||
|
||||
- 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)
|
||||
- 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)
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
CREDITS.txt - 2012-07-16
|
||||
CREDITS.txt - 2013-07-23
|
||||
------------------------
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
@@ -39,6 +39,7 @@ like to thank the following individuals for their contributions:
|
||||
Vincenzo Reale - Italian localization.
|
||||
Petter Reinholdtsen - HP-UX compiler stuff.
|
||||
Juan Pablo González Riopedre - Spanish localization.
|
||||
Giovanni Scafora - Italian localization.
|
||||
Opher Shachar - Hebrew localization.
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
|
||||
+9
-11
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.7b1 - 2013-04-18
|
||||
INSTALL - CUPS v2.0.0 - 2014-10-01
|
||||
----------------------------------
|
||||
|
||||
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
|
||||
@@ -147,7 +152,7 @@ INSTALLING THE SOFTWARE
|
||||
|
||||
The EPM software is available at:
|
||||
|
||||
http://www.epmhome.org/
|
||||
http://www.msweet.org/
|
||||
|
||||
|
||||
CREATING BINARY DISTRIBUTIONS WITH EPM
|
||||
@@ -165,17 +170,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
|
||||
@@ -197,10 +196,9 @@ GETTING DEBUG LOGGING FROM CUPS
|
||||
REPORTING PROBLEMS
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! If the documentation
|
||||
does not solve your problems, please post a message on the "cups.general"
|
||||
forum at:
|
||||
does not solve your problems, please post a message on the users forum at:
|
||||
|
||||
http://www.cups.org/newsgroups.php
|
||||
http://www.cups.org/
|
||||
|
||||
Include your operating system and version, compiler and version, and any
|
||||
errors or problems you've run into. The "config.log" file and the output
|
||||
|
||||
+52
-29
@@ -1,4 +1,4 @@
|
||||
IPPTOOL.txt - 2013-05-02
|
||||
IPPTOOL.txt - 2013-07-15
|
||||
------------------------
|
||||
|
||||
See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
|
||||
@@ -6,14 +6,46 @@ See the file CHANGES-IPPTOOL.txt for a list of changes to this software.
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
CUPS includes a user program called ipptool that can be used to send
|
||||
arbitrary IPP requests to a CUPS server or IPP printer. This tool started
|
||||
life as part of the CUPS automated test suite and has grown to support
|
||||
complex conformance tests and a simple way to query printer, job, and
|
||||
subscription attributes.
|
||||
CUPS includes two user programs for IPP printers. The first is called
|
||||
ipptool and can be used to send arbitrary IPP requests to a CUPS server or
|
||||
IPP printer. This tool started life as part of the CUPS automated test
|
||||
suite and has grown to support complex conformance tests and a simple way
|
||||
to query printer, job, and subscription attributes.
|
||||
|
||||
The second program called ippfind that can be used to find IPP printers
|
||||
that have registered themselves using Bonjour (DNS-SD, mDNS, and Zeroconf)
|
||||
and run commands such as ipptool.
|
||||
|
||||
|
||||
BASIC USAGE
|
||||
READING THE DOCUMENTATION
|
||||
|
||||
Full documentation on the ipptool command can be found in the
|
||||
"man-ipptool.html" and "man-ipptoolfile.html" files; the latter describes
|
||||
the test file format supported by ipptool.
|
||||
|
||||
Full documentation on the ippfind command can be found in the
|
||||
"man-ippfind.html" file.
|
||||
|
||||
|
||||
IPPFIND BASIC USAGE
|
||||
|
||||
The ippfind command can be used to discover IPP printers on your network.
|
||||
For example, the following command prints the printer URI of registered IPP
|
||||
printers:
|
||||
|
||||
ippfind
|
||||
|
||||
To find all color IPP printers, run:
|
||||
|
||||
ippfind --txt-color T
|
||||
|
||||
And to run the IPP Everywhere conformance test file on every registered IPP
|
||||
printer, run the following command:
|
||||
|
||||
ippfind _ipp._tcp,_print --exec ipptool -t '{}' ipp-everywhere.test \;
|
||||
|
||||
|
||||
IPPTOOL BASIC USAGE
|
||||
|
||||
The ipptool command requires a printer URI and one or more "test" files that
|
||||
describe the operations, attributes to display, and expected status and
|
||||
@@ -151,37 +183,28 @@ IPP EVERYWHERE TESTING
|
||||
372 pages including the 90 pages produced by the regular IPP test suite.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
|
||||
The command usage is described in the ipptest(1) man page, while the file
|
||||
format is described in the ipptestfile(5) man page. Both are provided in
|
||||
HTML format with the standalone releases of ipptool.
|
||||
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide many
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide
|
||||
discussion forums which are available at:
|
||||
|
||||
http://www.cups.org/newsgroups.php
|
||||
|
||||
See the CUPS web site at "http://www.cups.org/" for other resources.
|
||||
http://www.cups.org/
|
||||
|
||||
|
||||
REPORTING BUGS
|
||||
|
||||
If you believe you have discovered a bug in ipptool, please fill out the
|
||||
bug form at:
|
||||
If you believe you have discovered a bug in ippfind or ipptool, please fill
|
||||
out the bug form at:
|
||||
|
||||
http://www.cups.org/str.php
|
||||
|
||||
Be sure to identify the version of CUPS and ipptool (if you downloaded the
|
||||
standalone version) you are using, the printer (if any) and firmware
|
||||
version, and include any files that apply.
|
||||
Be sure to identify the version of CUPS and ippfind/ipptool (if you
|
||||
downloaded the standalone version) you are using, the printer (if any) and
|
||||
firmware version, and include any files that apply.
|
||||
|
||||
If you downloaded the standalone version of ipptool, please also re-run the
|
||||
test with debug logging enabled. Run the following commands on Windows to
|
||||
enable debug logging:
|
||||
If you downloaded the standalone version of ippfind/ipptool, please also
|
||||
re-run the command with debug logging enabled. Run the following commands
|
||||
on Windows to enable debug logging:
|
||||
|
||||
setdebug.bat
|
||||
|
||||
@@ -190,9 +213,9 @@ REPORTING BUGS
|
||||
CUPS_DEBUG_LOG=ipptool.log; export CUPS_DEBUG_LOG
|
||||
CUPS_DEBUG_LEVEL=6; export CUPS_DEBUG_LEVEL
|
||||
|
||||
Then when you run the ipptool command a new "ipptool.log" file will be
|
||||
created with detailed information - attach this file to the bug you file
|
||||
as well.
|
||||
Then when you run the ippfind or ipptool command a new "ipptool.log" file
|
||||
will be created with detailed information - attach this file to the bug you
|
||||
file as well.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
+7
-13
@@ -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
|
||||
|
||||
+25
-19
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
# Common makefile 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"
|
||||
# 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@
|
||||
@@ -138,13 +138,16 @@ DNSSD_BACKEND = @DNSSD_BACKEND@
|
||||
DSOFLAGS = -L../cups @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
DNSSDLIBS = @DNSSDLIBS@
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
IPPFIND_BIN = @IPPFIND_BIN@
|
||||
IPPFIND_MAN = @IPPFIND_MAN@
|
||||
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
ONDEMANDFLAGS = @ONDEMANDFLAGS@
|
||||
ONDEMANDLIBS = @ONDEMANDLIBS@
|
||||
OPTIM = @OPTIM@
|
||||
OPTIONS =
|
||||
PAMLIBS = @PAMLIBS@
|
||||
@@ -198,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@
|
||||
@@ -214,9 +215,7 @@ REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
|
||||
SBINDIR = $(BUILDROOT)@sbindir@
|
||||
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
|
||||
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
|
||||
SMFMANIFESTDIR = @SMFMANIFESTDIR@
|
||||
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
|
||||
XINETD = @XINETD@
|
||||
|
||||
MAN1EXT = @MAN1EXT@
|
||||
MAN5EXT = @MAN5EXT@
|
||||
@@ -227,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@
|
||||
|
||||
|
||||
#
|
||||
@@ -258,5 +264,5 @@ DBUSDIR = @DBUSDIR@
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$"
|
||||
# End of "$Id: Makedefs.in 11716 2014-03-21 14:50:24Z msweet $"
|
||||
#
|
||||
|
||||
+47
-28
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: Makefile 12145 2014-09-02 15:00:50Z msweet $"
|
||||
#
|
||||
# Top-level Makefile for CUPS.
|
||||
# Top-level Makefile 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/".
|
||||
#
|
||||
|
||||
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.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
|
||||
|
||||
|
||||
#
|
||||
@@ -128,8 +124,11 @@ depend:
|
||||
|
||||
|
||||
#
|
||||
# Run the clang.llvm.org static code analysis tool on the C sources.
|
||||
# (at least checker-231 is required for scan-build to work this way)
|
||||
# Run the Clang static code analysis tool on the sources, available here:
|
||||
#
|
||||
# http://clang-analyzer.llvm.org
|
||||
#
|
||||
# At least checker-231 is required.
|
||||
#
|
||||
|
||||
.PHONY: clang clang-changes
|
||||
@@ -140,6 +139,26 @@ clang-changes:
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
|
||||
|
||||
|
||||
#
|
||||
# Run the STACK tool on the sources, available here:
|
||||
#
|
||||
# http://css.csail.mit.edu/stack/
|
||||
#
|
||||
# Do the following to pass options to configure:
|
||||
#
|
||||
# make CONFIGFLAGS="--foo --bar" stack
|
||||
#
|
||||
|
||||
.PHONY: stack
|
||||
stack:
|
||||
stack-build ./configure $(CONFIGFLAGS)
|
||||
stack-build $(MAKE) $(MFLAGS) clean all
|
||||
poptck
|
||||
$(MAKE) $(MFLAGS) distclean
|
||||
$(RM) */*.ll
|
||||
$(RM) */*.ll.out
|
||||
|
||||
|
||||
#
|
||||
# Generate a ctags file...
|
||||
#
|
||||
@@ -242,7 +261,7 @@ debugcheck: all unittests
|
||||
|
||||
|
||||
#
|
||||
# Create HTML documentation...
|
||||
# Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
|
||||
#
|
||||
|
||||
apihelp:
|
||||
@@ -259,7 +278,7 @@ framedhelp:
|
||||
|
||||
|
||||
#
|
||||
# Create an Xcode docset...
|
||||
# Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
|
||||
#
|
||||
|
||||
docset: apihelp
|
||||
@@ -295,12 +314,12 @@ sloc:
|
||||
|
||||
|
||||
#
|
||||
# Make software distributions using EPM (http://www.epmhome.org/)...
|
||||
# Make software distributions using EPM (http://www.msweet.org/)...
|
||||
#
|
||||
|
||||
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:
|
||||
@@ -329,5 +348,5 @@ dist: all
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: Makefile 12145 2014-09-02 15:00:50Z msweet $".
|
||||
#
|
||||
|
||||
+9
-28
@@ -1,14 +1,6 @@
|
||||
README - CUPS v1.7b1 - 2013-04-18
|
||||
README - CUPS v2.0.0 - 2014-10-01
|
||||
---------------------------------
|
||||
|
||||
************************************************
|
||||
************************************************
|
||||
**** ****
|
||||
**** BETA SOFTWARE - USE AT YOUR OWN RISK ****
|
||||
**** ****
|
||||
************************************************
|
||||
************************************************
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt" instead...
|
||||
|
||||
|
||||
@@ -49,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.
|
||||
|
||||
@@ -86,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
|
||||
@@ -121,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
|
||||
@@ -142,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:
|
||||
@@ -151,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-2013 by Apple Inc. CUPS and the CUPS logo are
|
||||
CUPS is Copyright 2007-2014 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
@@ -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
|
||||
|
||||
+28
-9
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $"
|
||||
#
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 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)
|
||||
|
||||
|
||||
#
|
||||
@@ -109,6 +111,11 @@ install: all install-data install-headers install-libs install-exec
|
||||
#
|
||||
|
||||
install-data:
|
||||
if test "x$(USBQUIRKS)" != x; then \
|
||||
echo Installing USB quirks in $(USBQUIRKS); \
|
||||
$(INSTALL_DIR) -m 755 $(USBQUIRKS); \
|
||||
$(INSTALL_DATA) org.cups.usb-quirks $(USBQUIRKS); \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
@@ -162,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
|
||||
|
||||
|
||||
#
|
||||
@@ -174,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 \
|
||||
@@ -296,5 +315,5 @@ include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: Makefile 11859 2014-05-08 22:42:44Z msweet $".
|
||||
#
|
||||
|
||||
+12
-12
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: backend-private.h 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+57
-47
@@ -1,33 +1,17 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: dnssd.c 11969 2014-06-30 14:27:01Z msweet $"
|
||||
*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2012 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:
|
||||
*
|
||||
* main() - Browse for printers.
|
||||
* browse_callback() - Browse devices.
|
||||
* browse_local_callback() - Browse local devices.
|
||||
* client_callback() - Avahi client callback function.
|
||||
* compare_devices() - Compare two devices.
|
||||
* exec_backend() - Execute the backend that corresponds to the
|
||||
* resolved service name.
|
||||
* device_type() - Get DNS-SD type enumeration from string.
|
||||
* get_device() - Create or update a device.
|
||||
* query_callback() - Process query data.
|
||||
* find_device() - Find a device from its name and domain.
|
||||
* sigterm_handler() - Handle termination signals.
|
||||
* unquote() - Unquote a name string.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -77,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? */
|
||||
@@ -95,6 +80,7 @@ static int job_canceled = 0;
|
||||
static AvahiSimplePoll *simple_poll = NULL;
|
||||
/* Poll information */
|
||||
static int got_data = 0; /* Got data from poll? */
|
||||
static int browsers = 0; /* Number of running browsers */
|
||||
#endif /* HAVE_AVAHI */
|
||||
|
||||
|
||||
@@ -137,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,
|
||||
@@ -345,6 +331,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
return (1);
|
||||
}
|
||||
|
||||
browsers = 6;
|
||||
avahi_service_browser_new(client, AVAHI_IF_UNSPEC,
|
||||
AVAHI_PROTO_UNSPEC,
|
||||
"_fax-ipp._tcp", NULL, 0,
|
||||
@@ -513,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);
|
||||
@@ -546,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);
|
||||
@@ -558,7 +557,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
fprintf(stderr, "DEBUG: sent=%d, count=%d\n", sent, count);
|
||||
|
||||
#ifdef HAVE_AVAHI
|
||||
if (sent == cupsArrayCount(devices) && browsers == 0)
|
||||
#else
|
||||
if (sent == cupsArrayCount(devices))
|
||||
#endif /* HAVE_AVAHI */
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -710,9 +713,12 @@ browse_callback(
|
||||
break;
|
||||
|
||||
case AVAHI_BROWSER_REMOVE:
|
||||
case AVAHI_BROWSER_ALL_FOR_NOW:
|
||||
case AVAHI_BROWSER_CACHE_EXHAUSTED:
|
||||
break;
|
||||
|
||||
case AVAHI_BROWSER_ALL_FOR_NOW:
|
||||
browsers--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -824,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"))
|
||||
@@ -915,8 +921,12 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
* Yes, add the device...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Found \"%s.%s%s\"...\n", serviceName, regtype,
|
||||
replyDomain);
|
||||
#ifdef HAVE_DNSSD
|
||||
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
|
||||
#else /* HAVE_AVAHI */
|
||||
avahi_service_name_join(fullName, kDNSServiceMaxDomainName,
|
||||
serviceName, regtype, replyDomain);
|
||||
#endif /* HAVE_DNSSD */
|
||||
|
||||
device = calloc(sizeof(cups_device_t), 1);
|
||||
device->name = strdup(serviceName);
|
||||
@@ -1102,7 +1112,7 @@ query_callback(
|
||||
datanext = data + datalen;
|
||||
|
||||
for (ptr = key; data < datanext && *data != '='; data ++)
|
||||
*ptr++ = *data;
|
||||
*ptr++ = (char)*data;
|
||||
*ptr = '\0';
|
||||
|
||||
if (data < datanext && *data == '=')
|
||||
@@ -1110,7 +1120,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",
|
||||
@@ -1130,8 +1140,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") ||
|
||||
@@ -1180,6 +1189,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)
|
||||
@@ -1200,7 +1211,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",
|
||||
@@ -1235,7 +1246,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;
|
||||
}
|
||||
@@ -1244,8 +1255,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])
|
||||
@@ -1320,5 +1330,5 @@ unquote(char *dst, /* I - Destination buffer */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: dnssd.c 11969 2014-06-30 14:27:01Z msweet $".
|
||||
*/
|
||||
|
||||
+18
-30
@@ -1,24 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: ieee1284.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+234
-147
@@ -1,36 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: ipp.c 12048 2014-07-18 14:26:14Z msweet $"
|
||||
*
|
||||
* IPP backend for CUPS.
|
||||
* IPP backend 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"
|
||||
* "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.
|
||||
* cancel_job() - Cancel a print job.
|
||||
* check_printer_state() - Check the printer state.
|
||||
* monitor_printer() - Monitor the printer state.
|
||||
* new_request() - Create a new print creation or validation
|
||||
* request.
|
||||
* password_cb() - Disable the password prompt for
|
||||
* cupsDoFileRequest().
|
||||
* quote_string() - Quote a string value.
|
||||
* report_attr() - Report an IPP attribute value.
|
||||
* report_printer_state() - Report the printer state.
|
||||
* run_as_user() - Run the IPP backend as the printing user.
|
||||
* sigterm_handler() - Handle 'terminate' signals that stop the backend.
|
||||
* timeout_cb() - Handle HTTP timeouts.
|
||||
* update_reasons() - Update the printer-state-reasons values.
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -97,7 +79,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 */
|
||||
{
|
||||
@@ -109,8 +91,10 @@ static const char * const jattrs[] = /* Job attributes we want */
|
||||
"job-state",
|
||||
"job-state-reasons"
|
||||
};
|
||||
static int job_canceled = 0;
|
||||
static int job_canceled = 0,
|
||||
/* Job cancelled? */
|
||||
uri_credentials = 0;
|
||||
/* Credentials supplied in URI? */
|
||||
static char username[256] = "",
|
||||
/* Username for device URI */
|
||||
*password = NULL;
|
||||
@@ -133,6 +117,7 @@ static const char * const pattrs[] = /* Printer attributes we want */
|
||||
"media-col-supported",
|
||||
"multiple-document-handling-supported",
|
||||
"operations-supported",
|
||||
"print-color-mode-supported",
|
||||
"printer-alert",
|
||||
"printer-alert-description",
|
||||
"printer-is-accepting-jobs",
|
||||
@@ -180,7 +165,7 @@ static ipp_t *new_request(ipp_op_t op, int version, const char *uri,
|
||||
ppd_file_t *ppd,
|
||||
ipp_attribute_t *media_col_sup,
|
||||
ipp_attribute_t *doc_handling_sup,
|
||||
int print_color_mode);
|
||||
ipp_attribute_t *print_color_mode_sup);
|
||||
static const char *password_cb(const char *prompt, http_t *http,
|
||||
const char *method, const char *resource,
|
||||
int *user_data);
|
||||
@@ -267,12 +252,12 @@ main(int argc, /* I - Number of command-line args */
|
||||
ipp_attribute_t *doc_handling_sup; /* multiple-document-handling-supported */
|
||||
ipp_attribute_t *printer_state; /* printer-state attribute */
|
||||
ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
|
||||
ipp_attribute_t *print_color_mode_sup;/* Does printer support print-color-mode? */
|
||||
int create_job = 0, /* Does printer support Create-Job? */
|
||||
get_job_attrs = 0, /* Does printer support Get-Job-Attributes? */
|
||||
send_document = 0, /* Does printer support Send-Document? */
|
||||
validate_job = 0, /* Does printer support Validate-Job? */
|
||||
print_color_mode = 0; /* Does printer support print-color-mode? */
|
||||
int copies, /* Number of copies for job */
|
||||
copies, /* Number of copies for job */
|
||||
copies_remaining; /* Number of copies remaining */
|
||||
const char *content_type, /* CONTENT_TYPE environment variable */
|
||||
*final_content_type, /* FINAL_CONTENT_TYPE environment var */
|
||||
@@ -366,7 +351,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
* that way.
|
||||
*/
|
||||
|
||||
if (!getuid() && (value = getenv("AUTH_UID")) != NULL)
|
||||
if (!getuid() && (value = getenv("AUTH_UID")) != NULL &&
|
||||
!getenv("AUTH_PASSWORD"))
|
||||
{
|
||||
uid_t uid = (uid_t)atoi(value);
|
||||
/* User ID */
|
||||
@@ -542,8 +528,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
_cups_strcasecmp(value, "yes") ||
|
||||
_cups_strcasecmp(value, "true");
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!_cups_strcasecmp(name, "version"))
|
||||
{
|
||||
@@ -646,6 +632,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
*password++ = '\0';
|
||||
|
||||
cupsSetUser(username);
|
||||
uri_credentials = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -695,6 +682,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...
|
||||
*/
|
||||
@@ -801,7 +826,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
}
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -847,15 +872,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
|
||||
{
|
||||
@@ -870,9 +896,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);
|
||||
|
||||
@@ -921,7 +945,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
report_printer_state(supported);
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -1035,12 +1059,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
report_printer_state(supported);
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
|
||||
ippDelete(supported);
|
||||
supported = NULL;
|
||||
supported = NULL;
|
||||
ipp_status = IPP_STATUS_ERROR_BUSY;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1116,9 +1141,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
media_col_sup->values[i].string.text);
|
||||
}
|
||||
|
||||
print_color_mode = ippFindAttribute(supported,
|
||||
"print-color-mode-supported",
|
||||
IPP_TAG_KEYWORD) != NULL;
|
||||
print_color_mode_sup = ippFindAttribute(supported, "print-color-mode-supported", IPP_TAG_KEYWORD);
|
||||
|
||||
if ((operations_sup = ippFindAttribute(supported, "operations-supported",
|
||||
IPP_TAG_ENUM)) != NULL)
|
||||
@@ -1325,7 +1348,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);
|
||||
@@ -1400,7 +1423,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
request = new_request(IPP_VALIDATE_JOB, version, uri, argv[2],
|
||||
monitor.job_name, num_options, options, compression,
|
||||
copies_sup ? copies : 1, document_format, pc, ppd,
|
||||
media_col_sup, doc_handling_sup, print_color_mode);
|
||||
media_col_sup, doc_handling_sup, print_color_mode_sup);
|
||||
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
@@ -1427,6 +1450,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
sleep(10);
|
||||
}
|
||||
else if (ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED ||
|
||||
ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
|
||||
@@ -1486,7 +1510,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
version, uri, argv[2], monitor.job_name, num_options,
|
||||
options, compression, copies_sup ? copies : 1,
|
||||
document_format, pc, ppd, media_col_sup,
|
||||
doc_handling_sup, print_color_mode);
|
||||
doc_handling_sup, print_color_mode_sup);
|
||||
|
||||
/*
|
||||
* Do the request...
|
||||
@@ -1523,7 +1547,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 &&
|
||||
@@ -1549,7 +1573,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;
|
||||
}
|
||||
@@ -1685,8 +1709,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);
|
||||
@@ -1698,8 +1721,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, argv[2]);
|
||||
|
||||
if ((i + 1) >= num_files)
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
|
||||
ippAddBoolean(request, IPP_TAG_OPERATION, "last-document",
|
||||
(i + 1) >= num_files);
|
||||
|
||||
if (document_format)
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
|
||||
@@ -1719,7 +1742,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
|
||||
{
|
||||
@@ -1738,7 +1761,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
|
||||
@@ -1788,6 +1811,20 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
copies_remaining --;
|
||||
}
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_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)
|
||||
@@ -1871,6 +1908,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;)
|
||||
@@ -1895,8 +1934,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);
|
||||
@@ -2021,7 +2059,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Wait before polling again...
|
||||
*/
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -2032,8 +2070,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...
|
||||
*/
|
||||
@@ -2155,8 +2198,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);
|
||||
@@ -2171,9 +2213,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."));
|
||||
}
|
||||
|
||||
|
||||
@@ -2201,8 +2240,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);
|
||||
@@ -2305,8 +2343,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);
|
||||
@@ -2368,7 +2405,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))
|
||||
@@ -2455,7 +2492,7 @@ monitor_printer(
|
||||
* Sleep for N seconds...
|
||||
*/
|
||||
|
||||
sleep(delay);
|
||||
sleep((unsigned)delay);
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
@@ -2465,10 +2502,17 @@ 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)
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleanup and return...
|
||||
*/
|
||||
@@ -2499,7 +2543,8 @@ new_request(
|
||||
ppd_file_t *ppd, /* I - PPD file data */
|
||||
ipp_attribute_t *media_col_sup, /* I - media-col-supported values */
|
||||
ipp_attribute_t *doc_handling_sup, /* I - multiple-document-handling-supported values */
|
||||
int print_color_mode) /* I - Printer supports print-color-mode */
|
||||
ipp_attribute_t *print_color_mode_sup)
|
||||
/* I - Printer supports print-color-mode */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_t *request; /* Request data */
|
||||
@@ -2521,9 +2566,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),
|
||||
@@ -2590,8 +2634,7 @@ new_request(
|
||||
(keyword = cupsGetOption("job-password", num_options,
|
||||
options)) != NULL)
|
||||
{
|
||||
ippAddOctetString(request, IPP_TAG_OPERATION, "job-password",
|
||||
keyword, strlen(keyword));
|
||||
ippAddOctetString(request, IPP_TAG_OPERATION, "job-password", keyword, (int)strlen(keyword));
|
||||
|
||||
if ((keyword = cupsGetOption("job-password-encryption", num_options,
|
||||
options)) == NULL)
|
||||
@@ -2601,17 +2644,27 @@ new_request(
|
||||
"job-password-encryption", NULL, keyword);
|
||||
}
|
||||
|
||||
if (pc->account_id &&
|
||||
(keyword = cupsGetOption("job-account-id", num_options,
|
||||
options)) != NULL)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME, "job-account-id",
|
||||
NULL, keyword);
|
||||
if (pc->account_id)
|
||||
{
|
||||
if ((keyword = cupsGetOption("job-account-id", num_options,
|
||||
options)) == NULL)
|
||||
keyword = cupsGetOption("job-billing", num_options, options);
|
||||
|
||||
if (pc->accounting_user_id &&
|
||||
(keyword = cupsGetOption("job-accounting-user-id", num_options,
|
||||
options)) != NULL)
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_NAME,
|
||||
"job-accounting-user-id", NULL, keyword);
|
||||
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;
|
||||
@@ -2660,10 +2713,17 @@ new_request(
|
||||
}
|
||||
break;
|
||||
case IPP_TAG_STRING :
|
||||
ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword,
|
||||
strlen(keyword));
|
||||
ippAddOctetString(request, IPP_TAG_JOB, mandatory, keyword, (int)strlen(keyword));
|
||||
break;
|
||||
default :
|
||||
if (!strcmp(mandatory, "print-color-mode") && !strcmp(keyword, "monochrome"))
|
||||
{
|
||||
if (ippContainsString(print_color_mode_sup, "auto-monochrome"))
|
||||
keyword = "auto-monochrome";
|
||||
else if (ippContainsString(print_color_mode_sup, "process-monochrome") && !ippContainsString(print_color_mode_sup, "monochrome"))
|
||||
keyword = "process-monochrome";
|
||||
}
|
||||
|
||||
ippAddString(request, IPP_TAG_JOB, value_tag, mandatory,
|
||||
NULL, keyword);
|
||||
break;
|
||||
@@ -2738,21 +2798,31 @@ new_request(
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-bin",
|
||||
NULL, keyword);
|
||||
|
||||
color_attr_name = print_color_mode ? "print-color-mode" : "output-mode";
|
||||
color_attr_name = print_color_mode_sup ? "print-color-mode" : "output-mode";
|
||||
|
||||
if ((keyword = cupsGetOption("print-color-mode", num_options,
|
||||
options)) != NULL)
|
||||
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);
|
||||
else if ((choice = ppdFindMarkedChoice(ppd, "ColorModel")) != NULL)
|
||||
{
|
||||
if (!_cups_strcasecmp(choice->choice, "Gray"))
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD,
|
||||
color_attr_name, NULL, "monochrome");
|
||||
else
|
||||
ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD,
|
||||
color_attr_name, NULL, "color");
|
||||
}
|
||||
|
||||
if ((keyword = cupsGetOption("print-quality", num_options,
|
||||
options)) != NULL)
|
||||
@@ -2865,19 +2935,39 @@ new_request(
|
||||
if ((keyword = cupsGetOption("phone", num_options, options)) != NULL)
|
||||
{
|
||||
ipp_t *destination; /* destination collection */
|
||||
char tel_uri[1024]; /* tel: URI */
|
||||
char phone[1024], /* Phone number string */
|
||||
*ptr, /* Pointer into string */
|
||||
tel_uri[1024]; /* tel: URI */
|
||||
static const char * const allowed = "0123456789#*-+.()";
|
||||
/* Allowed characters */
|
||||
|
||||
destination = ippNew();
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, tel_uri, sizeof(tel_uri), "tel",
|
||||
NULL, NULL, 0, keyword);
|
||||
ippAddString(destination, IPP_TAG_JOB, IPP_TAG_URI, "destination-uri",
|
||||
NULL, tel_uri);
|
||||
/*
|
||||
* Unescape and filter out spaces and other characters that are not
|
||||
* allowed in a tel: URI.
|
||||
*/
|
||||
|
||||
_httpDecodeURI(phone, keyword, sizeof(phone));
|
||||
for (ptr = phone; *ptr;)
|
||||
{
|
||||
if (!strchr(allowed, *ptr))
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
else
|
||||
ptr ++;
|
||||
}
|
||||
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, tel_uri, sizeof(tel_uri), "tel", NULL, NULL, 0, phone);
|
||||
ippAddString(destination, IPP_TAG_JOB, IPP_TAG_URI, "destination-uri", NULL, tel_uri);
|
||||
|
||||
if ((keyword = cupsGetOption("faxPrefix", num_options,
|
||||
options)) != NULL && *keyword)
|
||||
ippAddString(destination, IPP_TAG_JOB, IPP_TAG_TEXT,
|
||||
"pre-dial-string", NULL, keyword);
|
||||
{
|
||||
char predial[1024]; /* Pre-dial string */
|
||||
|
||||
_httpDecodeURI(predial, keyword, sizeof(predial));
|
||||
ippAddString(destination, IPP_TAG_JOB, IPP_TAG_TEXT, "pre-dial-string", NULL, predial);
|
||||
}
|
||||
|
||||
ippAddCollection(request, IPP_TAG_JOB, "destination-uris", destination);
|
||||
ippDelete(destination);
|
||||
@@ -2953,26 +3043,31 @@ password_cb(const char *prompt, /* I - Prompt (not used) */
|
||||
(void)method;
|
||||
(void)resource;
|
||||
|
||||
/*
|
||||
* Remember that we need to authenticate...
|
||||
*/
|
||||
|
||||
auth_info_required = "username,password";
|
||||
|
||||
if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
|
||||
def_username))
|
||||
if (!uri_credentials)
|
||||
{
|
||||
char quoted[HTTP_MAX_VALUE * 2 + 4];
|
||||
/* Quoted string */
|
||||
/*
|
||||
* Remember that we need to authenticate...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "ATTR: auth-info-default=%s,\n",
|
||||
quote_string(def_username, quoted, sizeof(quoted)));
|
||||
auth_info_required = "username,password";
|
||||
|
||||
if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
|
||||
def_username))
|
||||
{
|
||||
char quoted[HTTP_MAX_VALUE * 2 + 4];
|
||||
/* Quoted string */
|
||||
|
||||
fprintf(stderr, "ATTR: auth-info-default=%s,\n",
|
||||
quote_string(def_username, quoted, sizeof(quoted)));
|
||||
}
|
||||
}
|
||||
|
||||
if (password && *password && *password_tries < 3)
|
||||
{
|
||||
(*password_tries) ++;
|
||||
|
||||
cupsSetUser(username);
|
||||
|
||||
return (password);
|
||||
}
|
||||
else
|
||||
@@ -3015,7 +3110,7 @@ quote_string(const char *s, /* I - String */
|
||||
{
|
||||
if (*s == '\\' || *s == '\"' || *s == '\'')
|
||||
{
|
||||
if (q < (qend - 3))
|
||||
if (qptr < (qend - 4))
|
||||
{
|
||||
*qptr++ = '\\';
|
||||
*qptr++ = '\\';
|
||||
@@ -3064,16 +3159,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;
|
||||
|
||||
@@ -3324,12 +3417,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",
|
||||
@@ -3375,7 +3468,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)
|
||||
{
|
||||
@@ -3403,7 +3496,6 @@ run_as_user(char *argv[], /* I - Command-line arguments */
|
||||
|
||||
if (conn)
|
||||
{
|
||||
xpc_connection_suspend(conn);
|
||||
xpc_connection_cancel(conn);
|
||||
xpc_release(conn);
|
||||
}
|
||||
@@ -3575,8 +3667,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 = ",";
|
||||
|
||||
@@ -3589,8 +3680,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 = ",";
|
||||
}
|
||||
@@ -3608,8 +3698,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 = ",";
|
||||
|
||||
@@ -3629,8 +3718,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 = ",";
|
||||
|
||||
@@ -3646,8 +3734,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 = ",";
|
||||
}
|
||||
@@ -3669,5 +3756,5 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
}
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: ipp.c 12048 2014-07-18 14:26:14Z msweet $".
|
||||
*/
|
||||
|
||||
+47
-58
@@ -1,27 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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 */
|
||||
@@ -393,8 +384,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*/
|
||||
|
||||
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
_cups_strcasecmp(value, "yes") ||
|
||||
_cups_strcasecmp(value, "true");
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!_cups_strcasecmp(name, "timeout"))
|
||||
{
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1276,7 +1269,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */
|
||||
* Try binding the port to the socket; return if all is OK...
|
||||
*/
|
||||
|
||||
if (!bind(fd, (struct sockaddr *)&addr, sizeof(addr)))
|
||||
if (!bind(fd, (struct sockaddr *)&addr, httpAddrLength(&addr)))
|
||||
return (fd);
|
||||
|
||||
/*
|
||||
@@ -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$".
|
||||
* End of "$Id: lpd.c 12024 2014-07-15 12:58:39Z msweet $".
|
||||
*/
|
||||
|
||||
+33
-51
@@ -1,23 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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';
|
||||
@@ -268,6 +250,12 @@ backendNetworkSideCB(
|
||||
datalen = 0;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_CONNECTED :
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
data[0] = device_fd != -1;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
case CUPS_SC_CMD_GET_DEVICE_ID :
|
||||
if (snmp_fd >= 0)
|
||||
{
|
||||
@@ -305,12 +293,6 @@ backendNetworkSideCB(
|
||||
break;
|
||||
}
|
||||
|
||||
case CUPS_SC_CMD_GET_CONNECTED :
|
||||
status = CUPS_SC_STATUS_OK;
|
||||
data[0] = device_fd != -1;
|
||||
datalen = 1;
|
||||
break;
|
||||
|
||||
default :
|
||||
status = CUPS_SC_STATUS_NOT_IMPLEMENTED;
|
||||
datalen = 0;
|
||||
@@ -322,5 +304,5 @@ backendNetworkSideCB(
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: network.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
# USB backend 'quirks' file.
|
||||
#
|
||||
# This file lists known issues with various vendors or printers. Each
|
||||
# line contains either a comment (starting with #) or the USB vendor ID,
|
||||
# product ID (omit for all vendor products), and a list of known issues:
|
||||
#
|
||||
# blacklist The printer is not functional with the USB backend.
|
||||
# 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
|
||||
# usb-init Needs vendor USB initialization string.
|
||||
# vendor-class Uses vendor-specific class or subclass.
|
||||
# whitelist The printer is functional with the USB backend.
|
||||
|
||||
# HP DeskJet 895C
|
||||
0x03f0 0x0004 unidir
|
||||
|
||||
# HP DeskJet 880C
|
||||
0x03f0 0x0104 unidir
|
||||
|
||||
# HP DeskJet 815C
|
||||
0x03f0 0x0204 unidir
|
||||
|
||||
# HP DeskJet 810C/812C
|
||||
0x03f0 0x0304 unidir
|
||||
|
||||
# HP DeskJet 830C
|
||||
0x03f0 0x0404 unidir
|
||||
|
||||
# HP DeskJet 885C
|
||||
0x03f0 0x0504 unidir
|
||||
|
||||
# HP DeskJet 840C
|
||||
0x03f0 0x0604 unidir
|
||||
|
||||
# HP DeskJet 816C
|
||||
0x03f0 0x0804 unidir
|
||||
|
||||
# HP Deskjet 959C
|
||||
0x03f0 0x1104 unidir
|
||||
|
||||
# NEC Picty900 (HP OEM)
|
||||
0x0409 0xefbe unidir
|
||||
|
||||
# NEC Picty760 (HP OEM)
|
||||
0x0409 0xbef4 unidir
|
||||
|
||||
# NEC Picty920 (HP OEM)
|
||||
0x0409 0xf0be unidir
|
||||
|
||||
# NEC Picty800 (HP OEM)
|
||||
0x0409 0xf1be unidir
|
||||
|
||||
# Lexmark International, Inc. (e250d), https://bugs.launchpad.net/bugs/1084164
|
||||
0x043d 0x00f3 no-reattach
|
||||
|
||||
# Kyocera Mita FS 820, by zut <kernel@zut.de>
|
||||
0x0482 0x0010 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP6000D Printer, https://bugs.launchpad.net/bugs/1160638
|
||||
0x04a9 0x1095 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP4200 Printer, http://www.cups.org/str.php?L4155
|
||||
0x04a9 0x10a2 unidir
|
||||
|
||||
# Canon, Inc. PIXMA iP4300 Printer, https://bugs.launchpad.net/bugs/1032385
|
||||
0x04a9 0x10b6 unidir
|
||||
|
||||
# Canon, Inc. MP210 https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53
|
||||
0x04a9 0x1721 unidir
|
||||
|
||||
# Canon, Inc. MP500 Printer, https://bugs.launchpad.net/bugs/1032456
|
||||
0x04a9 0x170c unidir
|
||||
|
||||
# Canon, Inc. MP510 Printer, https://bugs.launchpad.net/bugs/1050009
|
||||
0x04a9 0x1717 unidir
|
||||
|
||||
# Canon, Inc. MP550 Printer, http://www.cups.org/str.php?L4155
|
||||
0x04a9 0x173d unidir
|
||||
|
||||
# Canon, Inc. MP560 Printer, http://www.cups.org/str.php?L4155
|
||||
0x04a9 0x173e unidir
|
||||
|
||||
# Canon, Inc. MF4150 Printer, https://bugs.launchpad.net/bugs/1160638
|
||||
0x04a9 0x26a3 no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1430 Laser Printer, https://bugs.launchpad.net/bugs/1038695
|
||||
0x04f9 0x001a no-reattach
|
||||
|
||||
# Brother Industries, Ltd HL-1440 Laser Printer, https://bugs.launchpad.net/bugs/1000253
|
||||
0x04f9 0x000d no-reattach unidir
|
||||
|
||||
# Brother Industries, Ltd HL-1450 Laser Printer, https://bugs.launchpad.net/bugs/1000253
|
||||
0x04f9 0x000e no-reattach unidir
|
||||
|
||||
# Oki Data Corp. Okipage 14ex Printer, https://bugs.launchpad.net/bugs/872483
|
||||
0x06bc 0x000b no-reattach
|
||||
|
||||
# Oki Data Corp. B410d, https://bugs.launchpad.net/bugs/872483
|
||||
0x06bc 0x01c7 no-reattach
|
||||
|
||||
# Seiko Epson Corp. Stylus Color 740 / Photo 750, http://bugs.debian.org/697970
|
||||
0x04b8 0x0001 no-reattach unidir
|
||||
|
||||
# Seiko Epson Corp. Stylus Color 670, https://bugs.launchpad.net/bugs/872483
|
||||
0x04b8 0x0005 no-reattach
|
||||
|
||||
# Seiko Epson Receipt Printer M129C
|
||||
0x04b8 0x0202 vendor-class
|
||||
|
||||
# Prolific Technology, Inc. PL2305 Parallel Port (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485
|
||||
0x067b 0x2305 no-reattach soft-reset unidir
|
||||
|
||||
# Xerox Phaser 3124 https://bugzilla.redhat.com/show_bug.cgi?id=867392
|
||||
0x0924 0x3ce9 no-reattach
|
||||
|
||||
# Xerox WorkCentre 3210 https://bugs.launchpad.net/bugs/1102470
|
||||
0x0924 0x4293 no-reattach
|
||||
|
||||
# QinHeng Electronics CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253
|
||||
0x1a86 0x7584 no-reattach
|
||||
|
||||
# All Samsung devices, https://bugs.launchpad.net/bugs/1032456
|
||||
0x04e8 soft-reset
|
||||
|
||||
# All Zebra devices, https://bugs.launchpad.net/bugs/1001028
|
||||
0x0a5f unidir
|
||||
|
||||
# Canon CP-10
|
||||
0x04a9 0x304a blacklist
|
||||
|
||||
# Canon CP-100
|
||||
0x04a9 0x3063 blacklist
|
||||
|
||||
# Canon CP-200
|
||||
0x04a9 0x307c blacklist
|
||||
|
||||
# Canon CP-300
|
||||
0x04a9 0x307d blacklist
|
||||
|
||||
# Canon CP-220
|
||||
0x04a9 0x30bd blacklist
|
||||
|
||||
# Canon CP-330
|
||||
0x04a9 0x30be blacklist
|
||||
|
||||
# Canon SELPHY CP400
|
||||
0x04a9 0x30f6 blacklist
|
||||
|
||||
# Canon SELPHY CP600
|
||||
0x04a9 0x310b blacklist
|
||||
|
||||
# Canon SELPHY CP710
|
||||
0x04a9 0x3127 blacklist
|
||||
|
||||
# Canon SELPHY CP510
|
||||
0x04a9 0x3128 blacklist
|
||||
|
||||
# Canon SELPHY ES1
|
||||
0x04a9 0x3141 blacklist
|
||||
|
||||
# Canon SELPHY CP730
|
||||
0x04a9 0x3142 blacklist
|
||||
|
||||
# Canon SELPHY CP720
|
||||
0x04a9 0x3143 blacklist
|
||||
|
||||
# Canon SELPHY CP750
|
||||
0x04a9 0x3170 blacklist
|
||||
|
||||
# Canon SELPHY CP740
|
||||
0x04a9 0x3171 blacklist
|
||||
|
||||
# Canon SELPHY ES2
|
||||
0x04a9 0x3185 blacklist
|
||||
|
||||
# Canon SELPHY ES20
|
||||
0x04a9 0x3186 blacklist
|
||||
|
||||
# Canon SELPHY CP770
|
||||
0x04a9 0x31aa blacklist
|
||||
|
||||
# Canon SELPHY CP760
|
||||
0x04a9 0x31ab blacklist
|
||||
|
||||
# Canon SELPHY ES30
|
||||
0x04a9 0x31b0 blacklist
|
||||
|
||||
# Canon SELPHY CP780
|
||||
0x04a9 0x31dd blacklist
|
||||
|
||||
# Canon SELPHY ES40
|
||||
0x04a9 0x31ee blacklist
|
||||
|
||||
# Canon SELPHY CP800
|
||||
0x04a9 0x3214 blacklist
|
||||
|
||||
# Canon SELPHY CP900
|
||||
0x04a9 0x3255 blacklist
|
||||
|
||||
# Canon SELPHY CP810
|
||||
0x04a9 0x3256 blacklist
|
||||
|
||||
# Canon SELPHY CP500
|
||||
0x04a9 0x30f5 blacklist
|
||||
|
||||
# Canon SELPHY ES3
|
||||
0x04a9 0x31af blacklist
|
||||
|
||||
# Canon SELPHY CP780
|
||||
0x04a9 0x31dd blacklist
|
||||
|
||||
# Lexmark E238 (<rdar://problem/14493054>)
|
||||
0x043d 0x00d7 no-reattach
|
||||
|
||||
# Lexmark E238 (STR #4448)
|
||||
0x043d 0x009a no-reattach
|
||||
|
||||
# Canon MX310 (STR #4482)
|
||||
0x04a9 0x1728 unidir
|
||||
|
||||
# Canon MX320 (STR #4482)
|
||||
0x04A9 0x1736 unidir
|
||||
Arquivo executável → Arquivo normal
+15
-26
@@ -1,25 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: runloop.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+56
-33
@@ -1,24 +1,17 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: snmp-supplies.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* SNMP supplies functions for CUPS.
|
||||
* SNMP supplies functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2012 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -62,6 +55,7 @@ typedef struct /**** Printer supply data ****/
|
||||
char name[CUPS_SNMP_MAX_STRING], /* Name of supply */
|
||||
color[8]; /* Color: "#RRGGBB" or "none" */
|
||||
int colorant, /* Colorant index */
|
||||
sclass, /* Supply class */
|
||||
type, /* Supply type */
|
||||
max_capacity, /* Maximum capacity */
|
||||
level; /* Current level value */
|
||||
@@ -148,6 +142,13 @@ static const int prtMarkerSuppliesMaxCapacity[] =
|
||||
(sizeof(prtMarkerSuppliesMaxCapacity) /
|
||||
sizeof(prtMarkerSuppliesMaxCapacity[0]));
|
||||
/* Offset to supply index */
|
||||
static const int prtMarkerSuppliesClass[] =
|
||||
{ CUPS_OID_prtMarkerSuppliesClass, -1 },
|
||||
/* Class OID */
|
||||
prtMarkerSuppliesClassOffset =
|
||||
(sizeof(prtMarkerSuppliesClass) /
|
||||
sizeof(prtMarkerSuppliesClass[0]));
|
||||
/* Offset to supply index */
|
||||
static const int prtMarkerSuppliesType[] =
|
||||
{ CUPS_OID_prtMarkerSuppliesType, -1 },
|
||||
/* Type OID */
|
||||
@@ -257,6 +258,9 @@ backendSNMPSupplies(
|
||||
else
|
||||
percent = 50;
|
||||
|
||||
if (supplies[i].sclass == CUPS_TC_receptacleThatIsFilled)
|
||||
percent = 100 - percent;
|
||||
|
||||
if (percent <= 5)
|
||||
{
|
||||
switch (supplies[i].type)
|
||||
@@ -318,9 +322,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);
|
||||
@@ -561,20 +565,20 @@ backend_init_supplies(
|
||||
/*
|
||||
* Yes, read the cache file:
|
||||
*
|
||||
* 2 num_supplies charset
|
||||
* 3 num_supplies charset
|
||||
* device description
|
||||
* supply structures...
|
||||
*/
|
||||
|
||||
if (cupsFileGets(cachefile, value, sizeof(value)))
|
||||
{
|
||||
if (sscanf(value, "2 %d%d", &num_supplies, &charset) == 2 &&
|
||||
if (sscanf(value, "3 %d%d", &num_supplies, &charset) == 2 &&
|
||||
num_supplies <= CUPS_MAX_SUPPLIES &&
|
||||
cupsFileGets(cachefile, value, sizeof(value)))
|
||||
{
|
||||
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;
|
||||
@@ -664,12 +668,12 @@ backend_init_supplies(
|
||||
|
||||
if ((cachefile = cupsFileOpen(cachefilename, "w")) != NULL)
|
||||
{
|
||||
cupsFilePrintf(cachefile, "2 %d %d\n", num_supplies, charset);
|
||||
cupsFilePrintf(cachefile, "3 %d %d\n", num_supplies, charset);
|
||||
cupsFilePrintf(cachefile, "%s\n", description);
|
||||
|
||||
if (num_supplies > 0)
|
||||
cupsFileWrite(cachefile, (char *)supplies,
|
||||
num_supplies * sizeof(backend_supplies_t));
|
||||
(size_t)num_supplies * sizeof(backend_supplies_t));
|
||||
|
||||
cupsFileClose(cachefile);
|
||||
}
|
||||
@@ -697,7 +701,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);
|
||||
@@ -745,9 +749,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);
|
||||
@@ -969,6 +973,25 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
|
||||
packet->object_value.integer > 0)
|
||||
supplies[i - 1].max_capacity = packet->object_value.integer;
|
||||
}
|
||||
else if (_cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesClass))
|
||||
{
|
||||
/*
|
||||
* Get marker class...
|
||||
*/
|
||||
|
||||
i = packet->object_name[prtMarkerSuppliesClassOffset];
|
||||
if (i < 1 || i > CUPS_MAX_SUPPLIES ||
|
||||
packet->object_type != CUPS_ASN1_INTEGER)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "DEBUG2: prtMarkerSuppliesClass.1.%d = %d\n", i,
|
||||
packet->object_value.integer);
|
||||
|
||||
if (i > num_supplies)
|
||||
num_supplies = i;
|
||||
|
||||
supplies[i - 1].sclass = packet->object_value.integer;
|
||||
}
|
||||
else if (_cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesType))
|
||||
{
|
||||
/*
|
||||
@@ -1032,9 +1055,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;
|
||||
@@ -1045,13 +1068,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)
|
||||
{
|
||||
@@ -1068,10 +1091,10 @@ utf16_to_utf8(
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
cupsUTF32ToUTF8(dst, temp, dstsize);
|
||||
cupsUTF32ToUTF8(dst, temp, (int)dstsize);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: snmp-supplies.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-47
@@ -1,44 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: snmp.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-23
@@ -1,23 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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);
|
||||
|
||||
|
||||
/*
|
||||
@@ -250,8 +245,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*/
|
||||
|
||||
snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
_cups_strcasecmp(value, "yes") ||
|
||||
_cups_strcasecmp(value, "true");
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!_cups_strcasecmp(name, "contimeout"))
|
||||
{
|
||||
@@ -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$".
|
||||
* End of "$Id: socket.c 11907 2014-06-09 18:35:32Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: test1284.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* IEEE-1284 support functions test program for CUPS.
|
||||
*
|
||||
@@ -80,5 +80,5 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: test1284.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-24
@@ -1,25 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: testbackend.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $"
|
||||
*
|
||||
* SNMP supplies test program for CUPS.
|
||||
*
|
||||
@@ -79,5 +79,5 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: testsupplies.c 3247 2011-05-12 06:22:31Z msweet $".
|
||||
*/
|
||||
|
||||
+96
-87
@@ -1,75 +1,46 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Copyright 2005-2013 Apple Inc. All rights reserved.
|
||||
*
|
||||
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
|
||||
* Inc. ("Apple") in consideration of your agreement to the following
|
||||
* terms, and your use, installation, modification or redistribution of
|
||||
* this Apple software constitutes acceptance of these terms. If you do
|
||||
* not agree with these terms, please do not use, install, modify or
|
||||
* redistribute this Apple software.
|
||||
*
|
||||
* In consideration of your agreement to abide by the following terms, and
|
||||
* subject to these terms, Apple grants you a personal, non-exclusive
|
||||
* license, under Apple's copyrights in this original Apple software (the
|
||||
* "Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
* Software, with or without modifications, in source and/or binary forms;
|
||||
* provided that if you redistribute the Apple Software in its entirety and
|
||||
* without modifications, you must retain this notice and the following
|
||||
* text and disclaimers in all such redistributions of the Apple Software.
|
||||
* Neither the name, trademarks, service marks or logos of Apple Computer,
|
||||
* Inc. may be used to endorse or promote products derived from the Apple
|
||||
* Software without specific prior written permission from Apple. Except
|
||||
* as expressly stated in this notice, no other rights or licenses, express
|
||||
* or implied, are granted by Apple herein, including but not limited to
|
||||
* any patent rights that may be infringed by your derivative works or by
|
||||
* other works in which the Apple Software may be incorporated.
|
||||
*
|
||||
* The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
* MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
* THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
* OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
*
|
||||
* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
* MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
* AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
* STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* list_devices() - List all USB devices.
|
||||
* print_device() - Print a file to a USB device.
|
||||
* read_thread() - Thread to read the backchannel data on.
|
||||
* sidechannel_thread() - Handle side-channel requests.
|
||||
* iterate_printers() - Iterate over all the printers.
|
||||
* device_added() - Device added notifier.
|
||||
* list_device_cb() - list_device iterator callback.
|
||||
* find_device_cb() - print_device iterator callback.
|
||||
* status_timer_cb() - Status timer callback.
|
||||
* copy_deviceinfo() - Copy strings from the 1284 device ID.
|
||||
* release_deviceinfo() - Release deviceinfo strings.
|
||||
* load_classdriver() - Load a classdriver.
|
||||
* unload_classdriver() - Unload a classdriver.
|
||||
* load_printerdriver() - Load vendor's classdriver.
|
||||
* registry_open() - Open a connection to the printer.
|
||||
* registry_close() - Close the connection to the printer.
|
||||
* copy_deviceid() - Copy the 1284 device id string.
|
||||
* copy_devicestring() - Copy the 1284 device id string.
|
||||
* copy_value_for_key() - Copy value string associated with a key.
|
||||
* cfstr_create_trim() - Create CFString and trim whitespace characters.
|
||||
* parse_options() - Parse URI options.
|
||||
* sigterm_handler() - SIGTERM handler.
|
||||
* next_line() - Find the next line in a buffer.
|
||||
* parse_pserror() - Scan the backchannel data for postscript errors.
|
||||
* soft_reset() - Send a soft reset to the device.
|
||||
* get_device_id() - Return IEEE-1284 device ID.
|
||||
*/
|
||||
* "$Id: usb-darwin.c 11669 2014-03-04 14:53:34Z msweet $"
|
||||
*
|
||||
* Copyright 2005-2014 Apple Inc. All rights reserved.
|
||||
*
|
||||
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
|
||||
* Inc. ("Apple") in consideration of your agreement to the following
|
||||
* terms, and your use, installation, modification or redistribution of
|
||||
* this Apple software constitutes acceptance of these terms. If you do
|
||||
* not agree with these terms, please do not use, install, modify or
|
||||
* redistribute this Apple software.
|
||||
*
|
||||
* In consideration of your agreement to abide by the following terms, and
|
||||
* subject to these terms, Apple grants you a personal, non-exclusive
|
||||
* license, under Apple's copyrights in this original Apple software (the
|
||||
* "Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
* Software, with or without modifications, in source and/or binary forms;
|
||||
* provided that if you redistribute the Apple Software in its entirety and
|
||||
* without modifications, you must retain this notice and the following
|
||||
* text and disclaimers in all such redistributions of the Apple Software.
|
||||
* Neither the name, trademarks, service marks or logos of Apple Computer,
|
||||
* Inc. may be used to endorse or promote products derived from the Apple
|
||||
* Software without specific prior written permission from Apple. Except
|
||||
* as expressly stated in this notice, no other rights or licenses, express
|
||||
* or implied, are granted by Apple herein, including but not limited to
|
||||
* any patent rights that may be infringed by your derivative works or by
|
||||
* other works in which the Apple Software may be incorporated.
|
||||
*
|
||||
* The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
* MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
* THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
* OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
*
|
||||
* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
* MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
* AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
* STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
@@ -97,7 +68,7 @@
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
#include <libproc.h>
|
||||
|
||||
#include <asl.h>
|
||||
#include <spawn.h>
|
||||
#include <pthread.h>
|
||||
|
||||
@@ -309,13 +280,16 @@ static void release_deviceinfo(CFStringRef *make, CFStringRef *model, CFStringRe
|
||||
static void setup_cfLanguage(void);
|
||||
static void soft_reset(void);
|
||||
static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
|
||||
static void log_usb_class_driver(int is_64bit);
|
||||
#define IS_64BIT 1
|
||||
#define IS_NOT_64BIT 0
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static pid_t child_pid; /* Child PID */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd); /* Starts child backend process running as a ppc executable */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd) __attribute__((noreturn)); /* Starts child backend process running as a ppc executable */
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
static void sigterm_handler(int sig); /* SIGTERM handler */
|
||||
static void sigquit_handler(int sig, siginfo_t *si, void *unused);
|
||||
static void sigquit_handler(int sig, siginfo_t *si, void *unused) __attribute__((noreturn));
|
||||
|
||||
#ifdef PARSE_PS_ERRORS
|
||||
static const char *next_line (const char *buffer);
|
||||
@@ -477,6 +451,11 @@ print_device(const char *uri, /* I - Device URI */
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
if (status == noErr && driverBundlePath != NULL && CFStringCompare(driverBundlePath, kUSBGenericTOPrinterClassDriver, 0) != kCFCompareEqualTo)
|
||||
log_usb_class_driver(IS_64BIT);
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
if (driverBundlePath)
|
||||
CFRelease(driverBundlePath);
|
||||
|
||||
@@ -709,7 +688,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (g.print_bytes)
|
||||
{
|
||||
bytes = g.print_bytes;
|
||||
bytes = (UInt32)g.print_bytes;
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
|
||||
/*
|
||||
@@ -731,7 +710,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
{
|
||||
fputs("DEBUG: Got USB pipe stalled during write\n", stderr);
|
||||
|
||||
bytes = g.print_bytes;
|
||||
bytes = (UInt32)g.print_bytes;
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
}
|
||||
|
||||
@@ -751,7 +730,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
sleep(5);
|
||||
#endif /* DEBUG_WRITES */
|
||||
|
||||
bytes = g.print_bytes;
|
||||
bytes = (UInt32)g.print_bytes;
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
}
|
||||
|
||||
@@ -790,6 +769,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Sent %lld bytes...\n", (off_t)total_bytes);
|
||||
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
|
||||
|
||||
/*
|
||||
* Signal the side channel thread to exit...
|
||||
@@ -1038,7 +1018,7 @@ sidechannel_thread(void *reference)
|
||||
fputs("DEBUG: CUPS_SC_CMD_GET_BIDI received from driver...\n",
|
||||
stderr);
|
||||
|
||||
data[0] = g.bidi_flag;
|
||||
data[0] = (char)g.bidi_flag;
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0);
|
||||
|
||||
fprintf(stderr,
|
||||
@@ -1054,7 +1034,7 @@ sidechannel_thread(void *reference)
|
||||
get_device_id(&status, data, &datalen);
|
||||
cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, datalen, 1.0);
|
||||
|
||||
if (datalen < sizeof(data))
|
||||
if ((size_t)datalen < sizeof(data))
|
||||
data[datalen] = '\0';
|
||||
else
|
||||
data[sizeof(data) - 1] = '\0';
|
||||
@@ -1257,7 +1237,7 @@ static Boolean find_device_cb(void *refcon,
|
||||
if (obj != 0x0)
|
||||
{
|
||||
CFStringRef idString = NULL;
|
||||
UInt32 location = -1;
|
||||
UInt32 location = ~0U;
|
||||
UInt8 interfaceNum = 0;
|
||||
|
||||
copy_devicestring(obj, &idString, &location, &interfaceNum);
|
||||
@@ -1607,7 +1587,7 @@ static OSStatus copy_deviceid(classdriver_t **classdriver,
|
||||
CFStringRef deviceMake = NULL;
|
||||
CFStringRef deviceModel = NULL;
|
||||
CFStringRef deviceSerial = NULL;
|
||||
|
||||
|
||||
*deviceID = NULL;
|
||||
|
||||
OSStatus err = (*classdriver)->GetDeviceID(classdriver, &devID, DEFAULT_TIMEOUT);
|
||||
@@ -1682,13 +1662,13 @@ static OSStatus copy_deviceid(classdriver_t **classdriver,
|
||||
CFRange range = (deviceSerial != NULL ? CFStringFind(deviceSerial, CFSTR("+"), 0) : CFRangeMake(0, 0));
|
||||
if (range.length == 1) {
|
||||
range = CFStringFind(*deviceID, deviceSerial, 0);
|
||||
|
||||
|
||||
CFMutableStringRef deviceIDString = CFStringCreateMutableCopy(NULL, 0, *deviceID);
|
||||
CFStringFindAndReplace(deviceIDString, CFSTR("+"), CFSTR(""), range, 0);
|
||||
CFRelease(*deviceID);
|
||||
*deviceID = deviceIDString;
|
||||
}
|
||||
|
||||
|
||||
release_deviceinfo(&deviceMake, &deviceModel, &deviceSerial);
|
||||
|
||||
return err;
|
||||
@@ -1897,7 +1877,7 @@ static void parse_options(char *options,
|
||||
else if (!_cups_strcasecmp(name, "serial"))
|
||||
strlcpy(serial, value, serial_size);
|
||||
else if (!_cups_strcasecmp(name, "location") && location)
|
||||
*location = strtol(value, NULL, 16);
|
||||
*location = (UInt32)strtoul(value, NULL, 16);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1960,6 +1940,7 @@ static void run_legacy_backend(int argc,
|
||||
char *my_argv[32];
|
||||
char *usb_legacy_status;
|
||||
|
||||
|
||||
/*
|
||||
* If we're running as x86_64 or i386 and couldn't load the class driver
|
||||
* (because it's ppc or i386), then try to re-exec ourselves in ppc or i386
|
||||
@@ -1976,6 +1957,8 @@ static void run_legacy_backend(int argc,
|
||||
|
||||
if (!usb_legacy_status)
|
||||
{
|
||||
log_usb_class_driver(IS_NOT_64BIT);
|
||||
|
||||
/*
|
||||
* Setup a SIGTERM handler then block it before forking...
|
||||
*/
|
||||
@@ -2043,7 +2026,7 @@ static void run_legacy_backend(int argc,
|
||||
cups_serverbin = CUPS_SERVERBIN;
|
||||
snprintf(usbpath, sizeof(usbpath), "%s/backend/usb", cups_serverbin);
|
||||
|
||||
for (i = 0; i < argc && i < (sizeof(my_argv) / sizeof(my_argv[0])) - 1; i ++)
|
||||
for (i = 0; i < argc && i < (int)(sizeof(my_argv) / sizeof(my_argv[0])) - 1; i ++)
|
||||
my_argv[i] = argv[i];
|
||||
|
||||
my_argv[i] = NULL;
|
||||
@@ -2331,13 +2314,39 @@ static void get_device_id(cups_sc_status_t *status,
|
||||
if (deviceIDString)
|
||||
{
|
||||
CFStringGetCString(deviceIDString, data, *datalen, kCFStringEncodingUTF8);
|
||||
*datalen = strlen(data);
|
||||
*datalen = (int)strlen(data);
|
||||
CFRelease(deviceIDString);
|
||||
}
|
||||
*status = CUPS_SC_STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
log_usb_class_driver(int is_64bit) /* I - Is the USB class driver 64-bit? */
|
||||
{
|
||||
/*
|
||||
* Report the usage of legacy USB class drivers to Apple if the user opts into providing
|
||||
* feedback to Apple...
|
||||
*/
|
||||
|
||||
aslmsg aslm = asl_new(ASL_TYPE_MSG);
|
||||
if (aslm)
|
||||
{
|
||||
ppd_file_t *ppd = ppdOpenFile(getenv("PPD"));
|
||||
const char *make_model = ppd ? ppd->nickname : NULL;
|
||||
ppd_attr_t *version = ppdFindAttr(ppd, "FileVersion", "");
|
||||
|
||||
asl_set(aslm, "com.apple.message.domain", "com.apple.printing.usb.64bit");
|
||||
asl_set(aslm, "com.apple.message.result", is_64bit ? "yes" : "no");
|
||||
asl_set(aslm, "com.apple.message.signature", make_model ? make_model : "Unknown");
|
||||
asl_set(aslm, "com.apple.message.signature2", version ? version->value : "?.?");
|
||||
asl_set(aslm, "com.apple.message.summarize", "YES");
|
||||
asl_log(NULL, aslm, ASL_LEVEL_NOTICE, "");
|
||||
asl_free(aslm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: usb-darwin.c 11669 2014-03-04 14:53:34Z msweet $".
|
||||
*/
|
||||
|
||||
+267
-241
@@ -1,33 +1,15 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: usb-libusb.c 11594 2014-02-14 20:09:01Z msweet $"
|
||||
*
|
||||
* LIBUSB interface code for CUPS.
|
||||
* LIBUSB interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 2007-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/".
|
||||
*
|
||||
* 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.
|
||||
* find_device() - Find or enumerate USB printers.
|
||||
* get_device_id() - Get the IEEE-1284 device ID for the printer.
|
||||
* list_cb() - List USB printers for discovery.
|
||||
* 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.
|
||||
* printer_class_soft_reset()' - Do the soft reset request specific to
|
||||
* printers
|
||||
* quirks() - Get the known quirks of a given printer model
|
||||
* read_thread() - Thread to read the backchannel data on.
|
||||
* sidechannel_thread() - Handle side-channel requests.
|
||||
* soft_reset() - Send a soft reset to the device.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -36,6 +18,7 @@
|
||||
|
||||
#include <libusb.h>
|
||||
#include <cups/cups-private.h>
|
||||
#include <cups/dir.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
@@ -70,15 +53,15 @@ typedef struct usb_printer_s /**** USB Printer Data ****/
|
||||
read_endp, /* Read endpoint */
|
||||
protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */
|
||||
usblp_attached, /* "usblp" kernel module attached? */
|
||||
reset_after_job; /* Set to 1 by print_device() */
|
||||
unsigned int quirks; /* Quirks flags */
|
||||
reset_after_job;/* Set to 1 by print_device() */
|
||||
unsigned quirks; /* Quirks flags */
|
||||
struct libusb_device_handle *handle; /* Open handle to device */
|
||||
} usb_printer_t;
|
||||
|
||||
typedef int (*usb_cb_t)(usb_printer_t *, const char *, const char *,
|
||||
const void *);
|
||||
|
||||
typedef struct usb_globals_s
|
||||
typedef struct usb_globals_s /* Global USB printer information */
|
||||
{
|
||||
usb_printer_t *printer; /* Printer */
|
||||
|
||||
@@ -105,143 +88,41 @@ typedef struct usb_globals_s
|
||||
} usb_globals_t;
|
||||
|
||||
/*
|
||||
* Quirks: various printer quirks are handled by this table & its flags.
|
||||
* Quirks: various printer quirks are handled by this structure and its flags.
|
||||
*
|
||||
* This is copied from the usblp kernel module. So we can easily copy and paste
|
||||
* new quirks from the module.
|
||||
* The quirks table used to be compiled into the backend but is now loaded from
|
||||
* one or more files in the /usr/share/cups/usb directory.
|
||||
*/
|
||||
|
||||
struct quirk_printer_struct {
|
||||
int vendorId;
|
||||
int productId;
|
||||
unsigned int quirks;
|
||||
};
|
||||
|
||||
#define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires
|
||||
unidirectional mode (no INs/reads) */
|
||||
#define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
|
||||
#define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific
|
||||
Class or SubClass */
|
||||
#define USBLP_QUIRK_BLACKLIST 0x8 /* these printers do not conform to the USB print spec */
|
||||
#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset
|
||||
for clean-up */
|
||||
#define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach
|
||||
#define USB_QUIRK_BLACKLIST 0x0001 /* Does not conform to the spec */
|
||||
#define USB_QUIRK_NO_REATTACH 0x0002 /* After printing we cannot re-attach
|
||||
the usblp kernel module */
|
||||
#define USB_QUIRK_SOFT_RESET 0x0004 /* After printing do a soft reset
|
||||
for clean-up */
|
||||
#define USB_QUIRK_UNIDIR 0x0008 /* Requires unidirectional mode */
|
||||
#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_WHITELIST 0x0000 /* no quirks */
|
||||
|
||||
|
||||
typedef struct usb_quirk_s /* USB "quirk" information */
|
||||
{
|
||||
int vendor_id, /* Affected vendor ID */
|
||||
product_id; /* Affected product ID or 0 for all */
|
||||
unsigned quirks; /* Quirks bitfield */
|
||||
} usb_quirk_t;
|
||||
|
||||
|
||||
static const struct quirk_printer_struct quirk_printers[] = {
|
||||
{ 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
|
||||
{ 0x03f0, 0x0104, USBLP_QUIRK_BIDIR }, /* HP DeskJet 880C */
|
||||
{ 0x03f0, 0x0204, USBLP_QUIRK_BIDIR }, /* HP DeskJet 815C */
|
||||
{ 0x03f0, 0x0304, USBLP_QUIRK_BIDIR }, /* HP DeskJet 810C/812C */
|
||||
{ 0x03f0, 0x0404, USBLP_QUIRK_BIDIR }, /* HP DeskJet 830C */
|
||||
{ 0x03f0, 0x0504, USBLP_QUIRK_BIDIR }, /* HP DeskJet 885C */
|
||||
{ 0x03f0, 0x0604, USBLP_QUIRK_BIDIR }, /* HP DeskJet 840C */
|
||||
{ 0x03f0, 0x0804, USBLP_QUIRK_BIDIR }, /* HP DeskJet 816C */
|
||||
{ 0x03f0, 0x1104, USBLP_QUIRK_BIDIR }, /* HP Deskjet 959C */
|
||||
{ 0x0409, 0xefbe, USBLP_QUIRK_BIDIR }, /* NEC Picty900 (HP OEM) */
|
||||
{ 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */
|
||||
{ 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
|
||||
{ 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
|
||||
{ 0x043d, 0x00f3, USBLP_QUIRK_NO_REATTACH }, /* Lexmark International,
|
||||
Inc. (e250d), https://bugs.launchpad.net/bugs/1084164 */
|
||||
{ 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820,
|
||||
by zut <kernel@zut.de> */
|
||||
{ 0x04a9, 0x1095, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP6000D
|
||||
Printer, https://bugs.launchpad.net/bugs/1160638 */
|
||||
{ 0x04a9, 0x10a2, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4200
|
||||
Printer, http://www.cups.org/str.php?L4155 */
|
||||
{ 0x04a9, 0x10b6, USBLP_QUIRK_BIDIR }, /* Canon, Inc. PIXMA iP4300
|
||||
Printer, https://bugs.launchpad.net/bugs/1032385 */
|
||||
{ 0x04a9, 0x1721, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP210
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=847923#c53 */
|
||||
{ 0x04a9, 0x170c, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP500
|
||||
Printer, https://bugs.launchpad.net/bugs/1032456 */
|
||||
{ 0x04a9, 0x1717, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP510
|
||||
Printer, https://bugs.launchpad.net/bugs/1050009 */
|
||||
{ 0x04a9, 0x173d, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP550
|
||||
Printer, http://www.cups.org/str.php?L4155 */
|
||||
{ 0x04a9, 0x173e, USBLP_QUIRK_BIDIR }, /* Canon, Inc. MP560
|
||||
Printer, http://www.cups.org/str.php?L4155 */
|
||||
{ 0x04a9, 0x26a3, USBLP_QUIRK_NO_REATTACH }, /* Canon, Inc. MF4150
|
||||
Printer, https://bugs.launchpad.net/bugs/1160638 */
|
||||
{ 0x04f9, 0x001a, USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
|
||||
HL-1430 Laser Printer,
|
||||
https://bugs.launchpad.net/bugs/1038695 */
|
||||
{ 0x04f9, 0x000d, USBLP_QUIRK_BIDIR |
|
||||
USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
|
||||
HL-1440 Laser Printer,
|
||||
https://bugs.launchpad.net/bugs/1000253 */
|
||||
{ 0x04f9, 0x000e, USBLP_QUIRK_BIDIR |
|
||||
USBLP_QUIRK_NO_REATTACH }, /* Brother Industries, Ltd
|
||||
HL-1450 Laser Printer,
|
||||
https://bugs.launchpad.net/bugs/1000253 */
|
||||
{ 0x06bc, 0x000b, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp.
|
||||
Okipage 14ex Printer,
|
||||
https://bugs.launchpad.net/bugs/872483 */
|
||||
{ 0x06bc, 0x01c7, USBLP_QUIRK_NO_REATTACH }, /* Oki Data Corp. B410d,
|
||||
https://bugs.launchpad.net/bugs/872483 */
|
||||
{ 0x04b8, 0x0001, USBLP_QUIRK_BIDIR |
|
||||
USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 740 / Photo 750,
|
||||
http://bugs.debian.org/697970 */
|
||||
{ 0x04b8, 0x0005, USBLP_QUIRK_NO_REATTACH }, /* Seiko Epson Corp. Stylus Color 670,
|
||||
https://bugs.launchpad.net/bugs/872483 */
|
||||
{ 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt
|
||||
Printer M129C */
|
||||
{ 0x067b, 0x2305, USBLP_QUIRK_BIDIR |
|
||||
USBLP_QUIRK_NO_REATTACH |
|
||||
USBLP_QUIRK_RESET },
|
||||
/* Prolific Technology, Inc. PL2305 Parallel Port
|
||||
(USB -> Parallel adapter), https://bugs.launchpad.net/bugs/987485 */
|
||||
{ 0x0924, 0x3ce9, USBLP_QUIRK_NO_REATTACH }, /* Xerox Phaser 3124
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=867392 */
|
||||
{ 0x0924, 0x4293, USBLP_QUIRK_NO_REATTACH }, /* Xerox WorkCentre 3210
|
||||
https://bugs.launchpad.net/bugs/1102470 */
|
||||
{ 0x1a86, 0x7584, USBLP_QUIRK_NO_REATTACH }, /* QinHeng Electronics
|
||||
CH340S (USB -> Parallel adapter), https://bugs.launchpad.net/bugs/1000253 */
|
||||
{ 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices,
|
||||
https://bugs.launchpad.net/bugs/1032456 */
|
||||
{ 0x0a5f, 0x0000, USBLP_QUIRK_BIDIR }, /* All Zebra devices,
|
||||
https://bugs.launchpad.net/bugs/1001028 */
|
||||
/* Canon */
|
||||
{ 0x04a9, 0x304a, USBLP_QUIRK_BLACKLIST }, /* Canon CP-10 */
|
||||
{ 0x04a9, 0x3063, USBLP_QUIRK_BLACKLIST }, /* Canon CP-100 */
|
||||
{ 0x04a9, 0x307c, USBLP_QUIRK_BLACKLIST }, /* Canon CP-200 */
|
||||
{ 0x04a9, 0x307d, USBLP_QUIRK_BLACKLIST }, /* Canon CP-300 */
|
||||
{ 0x04a9, 0x30bd, USBLP_QUIRK_BLACKLIST }, /* Canon CP-220 */
|
||||
{ 0x04a9, 0x30be, USBLP_QUIRK_BLACKLIST }, /* Canon CP-330 */
|
||||
{ 0x04a9, 0x30f6, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP400 */
|
||||
{ 0x04a9, 0x310b, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP600 */
|
||||
{ 0x04a9, 0x3127, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP710 */
|
||||
{ 0x04a9, 0x3128, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP510 */
|
||||
{ 0x04a9, 0x3141, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES1 */
|
||||
{ 0x04a9, 0x3142, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP730 */
|
||||
{ 0x04a9, 0x3143, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP720 */
|
||||
{ 0x04a9, 0x3170, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP750 */
|
||||
{ 0x04a9, 0x3171, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP740 */
|
||||
{ 0x04a9, 0x3185, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES2 */
|
||||
{ 0x04a9, 0x3186, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES20 */
|
||||
{ 0x04a9, 0x31aa, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP770 */
|
||||
{ 0x04a9, 0x31ab, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP760 */
|
||||
{ 0x04a9, 0x31b0, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES30 */
|
||||
{ 0x04a9, 0x31dd, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
|
||||
{ 0x04a9, 0x31ee, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES40 */
|
||||
{ 0x04a9, 0x3214, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP800 */
|
||||
{ 0x04a9, 0x3255, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP900 */
|
||||
{ 0x04a9, 0x3256, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP810 */
|
||||
{ 0x04a9, 0x30F5, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP500 */
|
||||
{ 0x04a9, 0x31AF, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY ES3 */
|
||||
{ 0x04a9, 0x31DD, USBLP_QUIRK_BLACKLIST }, /* Canon SELPHY CP780 */
|
||||
/* MISSING PIDs: CP520, CP530, CP790 */
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Globals...
|
||||
*/
|
||||
|
||||
cups_array_t *all_quirks; /* Array of printer quirks */
|
||||
usb_globals_t g = { 0 }; /* Globals */
|
||||
libusb_device **list; /* List of connected USB devices */
|
||||
libusb_device **all_list; /* List of connected USB devices */
|
||||
|
||||
|
||||
/*
|
||||
@@ -249,22 +130,24 @@ libusb_device **list; /* List of connected USB devices */
|
||||
*/
|
||||
|
||||
static int close_device(usb_printer_t *printer);
|
||||
static int compare_quirks(usb_quirk_t *a, usb_quirk_t *b);
|
||||
static usb_printer_t *find_device(usb_cb_t cb, const void *data);
|
||||
static unsigned find_quirks(int vendor_id, int product_id);
|
||||
static int get_device_id(usb_printer_t *printer, char *buffer,
|
||||
size_t bufsize);
|
||||
static int list_cb(usb_printer_t *printer, const char *device_uri,
|
||||
const char *device_id, const void *data);
|
||||
static void load_quirks(void);
|
||||
static char *make_device_uri(usb_printer_t *printer,
|
||||
const char *device_id,
|
||||
char *uri, size_t uri_size);
|
||||
static int open_device(usb_printer_t *printer, int verbose);
|
||||
static int print_cb(usb_printer_t *printer, const char *device_uri,
|
||||
const char *device_id, const void *data);
|
||||
static int printer_class_soft_reset(usb_printer_t *printer);
|
||||
static unsigned int quirks(int vendor, int product);
|
||||
static void *read_thread(void *reference);
|
||||
static void *sidechannel_thread(void *reference);
|
||||
static void soft_reset(void);
|
||||
static int soft_reset_printer(usb_printer_t *printer);
|
||||
|
||||
|
||||
/*
|
||||
@@ -274,6 +157,8 @@ static void soft_reset(void);
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
load_quirks();
|
||||
|
||||
fputs("DEBUG: list_devices\n", stderr);
|
||||
find_device(list_cb, NULL);
|
||||
}
|
||||
@@ -316,6 +201,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
const char *val; /* Option value */
|
||||
|
||||
|
||||
load_quirks();
|
||||
|
||||
/*
|
||||
* See if the side-channel descriptor is valid...
|
||||
*/
|
||||
@@ -341,9 +228,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
/*
|
||||
* Some devices need a reset after finishing a job, these devices are
|
||||
* marked with the USBLP_QUIRK_RESET quirk.
|
||||
* marked with the USB_QUIRK_SOFT_RESET quirk.
|
||||
*/
|
||||
g.printer->reset_after_job = (g.printer->quirks & USBLP_QUIRK_RESET ? 1 : 0);
|
||||
g.printer->reset_after_job = (g.printer->quirks & USB_QUIRK_SOFT_RESET ? 1 : 0);
|
||||
|
||||
/*
|
||||
* If we are printing data from a print driver on stdin, ignore SIGTERM
|
||||
@@ -589,7 +476,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
iostatus = libusb_bulk_transfer(g.printer->handle,
|
||||
g.printer->write_endp,
|
||||
print_buffer, g.print_bytes,
|
||||
&bytes, 60000);
|
||||
&bytes, 0);
|
||||
/*
|
||||
* Ignore timeout errors, but retain the number of bytes written to
|
||||
* avoid sending duplicate data...
|
||||
@@ -612,7 +499,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
iostatus = libusb_bulk_transfer(g.printer->handle,
|
||||
g.printer->write_endp,
|
||||
print_buffer, g.print_bytes,
|
||||
&bytes, 60000);
|
||||
&bytes, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -627,7 +514,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
iostatus = libusb_bulk_transfer(g.printer->handle,
|
||||
g.printer->write_endp,
|
||||
print_buffer, g.print_bytes,
|
||||
&bytes, 60000);
|
||||
&bytes, 0);
|
||||
}
|
||||
|
||||
if (iostatus)
|
||||
@@ -760,7 +647,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* Clean up ....
|
||||
*/
|
||||
|
||||
libusb_free_device_list(list, 1);
|
||||
libusb_free_device_list(all_list, 1);
|
||||
libusb_exit(NULL);
|
||||
|
||||
return (status);
|
||||
@@ -879,6 +766,23 @@ close_device(usb_printer_t *printer) /* I - Printer */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'compare_quirks()' - Compare two quirks entries.
|
||||
*/
|
||||
|
||||
static int /* O - Result of comparison */
|
||||
compare_quirks(usb_quirk_t *a, /* I - First quirk entry */
|
||||
usb_quirk_t *b) /* I - Second quirk entry */
|
||||
{
|
||||
int result; /* Result of comparison */
|
||||
|
||||
if ((result = b->vendor_id - a->vendor_id) == 0)
|
||||
result = b->product_id - a->product_id;
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'find_device()' - Find or enumerate USB printers.
|
||||
*/
|
||||
@@ -899,7 +803,8 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
/* Pointer to current alternate setting */
|
||||
const struct libusb_endpoint_descriptor *endpptr = NULL;
|
||||
/* Pointer to current endpoint */
|
||||
ssize_t numdevs, /* number of connected devices */
|
||||
ssize_t err = 0, /* Error code */
|
||||
numdevs, /* number of connected devices */
|
||||
i = 0;
|
||||
uint8_t conf, /* Current configuration */
|
||||
iface, /* Current interface */
|
||||
@@ -918,7 +823,14 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
* Initialize libusb...
|
||||
*/
|
||||
|
||||
libusb_init(NULL);
|
||||
err = libusb_init(NULL);
|
||||
if (err)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
|
||||
"libusb error %i\n", (int)err);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
numdevs = libusb_get_device_list(NULL, &list);
|
||||
fprintf(stderr, "DEBUG: libusb_get_device_list=%d\n", (int)numdevs);
|
||||
|
||||
@@ -943,13 +855,13 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
!devdesc.idProduct)
|
||||
continue;
|
||||
|
||||
printer.quirks = quirks(devdesc.idVendor, devdesc.idProduct);
|
||||
printer.quirks = find_quirks(devdesc.idVendor, devdesc.idProduct);
|
||||
|
||||
/*
|
||||
* Ignore blacklisted printers...
|
||||
*/
|
||||
|
||||
if (printer.quirks & USBLP_QUIRK_BLACKLIST)
|
||||
if (printer.quirks & USB_QUIRK_BLACKLIST)
|
||||
continue;
|
||||
|
||||
for (conf = 0; conf < devdesc.bNumConfigurations; conf ++)
|
||||
@@ -978,18 +890,18 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
|
||||
if (((altptr->bInterfaceClass != LIBUSB_CLASS_PRINTER ||
|
||||
altptr->bInterfaceSubClass != 1) &&
|
||||
((printer.quirks & USBLP_QUIRK_BAD_CLASS) == 0)) ||
|
||||
((printer.quirks & USB_QUIRK_VENDOR_CLASS) == 0)) ||
|
||||
(altptr->bInterfaceProtocol != 1 && /* Unidirectional */
|
||||
altptr->bInterfaceProtocol != 2) || /* Bidirectional */
|
||||
altptr->bInterfaceProtocol < protocol)
|
||||
continue;
|
||||
|
||||
if (printer.quirks & USBLP_QUIRK_BAD_CLASS)
|
||||
if (printer.quirks & USB_QUIRK_VENDOR_CLASS)
|
||||
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;
|
||||
@@ -1041,7 +953,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Device protocol: %d\n",
|
||||
printer.protocol);
|
||||
if (printer.quirks & USBLP_QUIRK_BIDIR)
|
||||
if (printer.quirks & USB_QUIRK_UNIDIR)
|
||||
{
|
||||
printer.read_endp = -1;
|
||||
fprintf(stderr, "DEBUG: Printer reports bi-di support "
|
||||
@@ -1061,7 +973,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
altsetting[printer.altset].
|
||||
endpoint[printer.write_endp].
|
||||
bEndpointAddress;
|
||||
if (printer.quirks & USBLP_QUIRK_NO_REATTACH)
|
||||
if (printer.quirks & USB_QUIRK_NO_REATTACH)
|
||||
{
|
||||
printer.usblp_attached = 0;
|
||||
fprintf(stderr, "DEBUG: Printer does not like usblp "
|
||||
@@ -1088,13 +1000,43 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
* Clean up ....
|
||||
*/
|
||||
|
||||
libusb_free_device_list(list, 1);
|
||||
if (numdevs >= 0)
|
||||
libusb_free_device_list(list, 1);
|
||||
libusb_exit(NULL);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'find_quirks()' - Find the quirks for the given printer, if any.
|
||||
*
|
||||
* First looks for an exact match, then looks for the vendor ID wildcard match.
|
||||
*/
|
||||
|
||||
static unsigned /* O - Quirks flags */
|
||||
find_quirks(int vendor_id, /* I - Vendor ID */
|
||||
int product_id) /* I - Product ID */
|
||||
{
|
||||
usb_quirk_t key, /* Search key */
|
||||
*match; /* Matching quirk entry */
|
||||
|
||||
|
||||
key.vendor_id = vendor_id;
|
||||
key.product_id = product_id;
|
||||
|
||||
if ((match = cupsArrayFind(all_quirks, &key)) != NULL)
|
||||
return (match->quirks);
|
||||
|
||||
key.product_id = 0;
|
||||
|
||||
if ((match = cupsArrayFind(all_quirks, &key)) != NULL)
|
||||
return (match->quirks);
|
||||
|
||||
return (USB_QUIRK_WHITELIST);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'get_device_id()' - Get the IEEE-1284 device ID for the printer.
|
||||
*/
|
||||
@@ -1123,8 +1065,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
|
||||
@@ -1135,8 +1076,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;
|
||||
@@ -1158,7 +1098,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);
|
||||
@@ -1200,6 +1140,104 @@ list_cb(usb_printer_t *printer, /* I - Printer */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'load_quirks()' - Load all quirks files in the /usr/share/cups/usb directory.
|
||||
*/
|
||||
|
||||
static void
|
||||
load_quirks(void)
|
||||
{
|
||||
const char *datadir; /* CUPS_DATADIR environment variable */
|
||||
char filename[1024], /* Filename */
|
||||
line[1024]; /* Line from file */
|
||||
cups_dir_t *dir; /* Directory */
|
||||
cups_dentry_t *dent; /* Directory entry */
|
||||
cups_file_t *fp; /* Quirks file */
|
||||
usb_quirk_t *quirk; /* New quirk */
|
||||
|
||||
|
||||
all_quirks = cupsArrayNew((cups_array_func_t)compare_quirks, NULL);
|
||||
|
||||
if ((datadir = getenv("CUPS_DATADIR")) == NULL)
|
||||
datadir = CUPS_DATADIR;
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/usb", datadir);
|
||||
if ((dir = cupsDirOpen(filename)) == NULL)
|
||||
{
|
||||
perror(filename);
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Loading USB quirks from \"%s\".\n", filename);
|
||||
|
||||
while ((dent = cupsDirRead(dir)) != NULL)
|
||||
{
|
||||
if (!S_ISREG(dent->fileinfo.st_mode))
|
||||
continue;
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/usb/%s", datadir, dent->filename);
|
||||
if ((fp = cupsFileOpen(filename, "r")) == NULL)
|
||||
{
|
||||
perror(filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
while (cupsFileGets(fp, line, sizeof(line)))
|
||||
{
|
||||
/*
|
||||
* Skip blank and comment lines...
|
||||
*/
|
||||
|
||||
if (line[0] == '#' || !line[0])
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Add a quirk...
|
||||
*/
|
||||
|
||||
if ((quirk = calloc(1, sizeof(usb_quirk_t))) == NULL)
|
||||
{
|
||||
perror("DEBUG: Unable to allocate memory for quirk");
|
||||
break;
|
||||
}
|
||||
|
||||
if (sscanf(line, "%x%x", &quirk->vendor_id, &quirk->product_id) < 1)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Bad line: %s\n", line);
|
||||
free(quirk);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strstr(line, " blacklist"))
|
||||
quirk->quirks |= USB_QUIRK_BLACKLIST;
|
||||
|
||||
if (strstr(line, " no-reattach"))
|
||||
quirk->quirks |= USB_QUIRK_NO_REATTACH;
|
||||
|
||||
if (strstr(line, " soft-reset"))
|
||||
quirk->quirks |= USB_QUIRK_SOFT_RESET;
|
||||
|
||||
if (strstr(line, " unidir"))
|
||||
quirk->quirks |= USB_QUIRK_UNIDIR;
|
||||
|
||||
if (strstr(line, " usb-init"))
|
||||
quirk->quirks |= USB_QUIRK_USB_INIT;
|
||||
|
||||
if (strstr(line, " vendor-class"))
|
||||
quirk->quirks |= USB_QUIRK_VENDOR_CLASS;
|
||||
|
||||
cupsArrayAdd(all_quirks, quirk);
|
||||
}
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Loaded %d quirks.\n", cupsArrayCount(all_quirks));
|
||||
|
||||
cupsDirClose(dir);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'make_device_uri()' - Create a device URI for a USB printer.
|
||||
*/
|
||||
@@ -1626,65 +1664,6 @@ print_cb(usb_printer_t *printer, /* I - Printer */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'printer_class_soft_reset()' - Do the soft reset request specific to printers
|
||||
*
|
||||
* This soft reset is specific to the printer device class and is much less
|
||||
* invasive than the general USB reset libusb_reset_device(). Especially it
|
||||
* does never happen that the USB addressing and configuration changes. What
|
||||
* is actually done is that all buffers get flushed and the bulk IN and OUT
|
||||
* pipes get reset to their default states. This clears all stall conditions.
|
||||
* See http://cholla.mmto.org/computers/linux/usb/usbprint11.pdf
|
||||
*/
|
||||
|
||||
static int /* O - 0 on success, < 0 on error */
|
||||
printer_class_soft_reset(usb_printer_t *printer) /* I - Printer */
|
||||
{
|
||||
struct libusb_config_descriptor *confptr = NULL;
|
||||
/* Pointer to current configuration */
|
||||
int interface,
|
||||
errcode;
|
||||
|
||||
if (libusb_get_config_descriptor(printer->device, printer->conf, &confptr)
|
||||
< 0)
|
||||
interface = printer->iface;
|
||||
else
|
||||
interface = confptr->interface[printer->iface].
|
||||
altsetting[printer->altset].bInterfaceNumber;
|
||||
libusb_free_config_descriptor(confptr);
|
||||
if ((errcode = libusb_control_transfer(printer->handle,
|
||||
LIBUSB_REQUEST_TYPE_CLASS |
|
||||
LIBUSB_ENDPOINT_OUT |
|
||||
LIBUSB_RECIPIENT_OTHER,
|
||||
2, 0, interface, NULL, 0, 5000)) < 0)
|
||||
errcode = libusb_control_transfer(printer->handle,
|
||||
LIBUSB_REQUEST_TYPE_CLASS |
|
||||
LIBUSB_ENDPOINT_OUT |
|
||||
LIBUSB_RECIPIENT_INTERFACE,
|
||||
2, 0, interface, NULL, 0, 5000);
|
||||
return errcode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'quirks()' - Get the known quirks of a given printer model
|
||||
*/
|
||||
|
||||
static unsigned int quirks(int vendor, int product)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; quirk_printers[i].vendorId; i++)
|
||||
{
|
||||
if (vendor == quirk_printers[i].vendorId &&
|
||||
(quirk_printers[i].productId == 0x0000 ||
|
||||
product == quirk_printers[i].productId))
|
||||
return quirk_printers[i].quirks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'read_thread()' - Thread to read the backchannel data on.
|
||||
*/
|
||||
@@ -1733,7 +1712,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);
|
||||
@@ -1908,13 +1887,15 @@ sidechannel_thread(void *reference)
|
||||
* 'soft_reset()' - Send a soft reset to the device.
|
||||
*/
|
||||
|
||||
static void soft_reset(void)
|
||||
static void
|
||||
soft_reset(void)
|
||||
{
|
||||
fd_set input_set; /* Input set for select() */
|
||||
struct timeval tv; /* Time value */
|
||||
char buffer[2048]; /* Buffer */
|
||||
struct timespec cond_timeout; /* pthread condition timeout */
|
||||
|
||||
|
||||
/*
|
||||
* Send an abort once a second until the I/O lock is released by the main
|
||||
* thread...
|
||||
@@ -1959,7 +1940,7 @@ static void soft_reset(void)
|
||||
* Send the reset...
|
||||
*/
|
||||
|
||||
printer_class_soft_reset(g.printer);
|
||||
soft_reset_printer(g.printer);
|
||||
|
||||
/*
|
||||
* Release the I/O lock...
|
||||
@@ -1973,6 +1954,51 @@ static void soft_reset(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* 'soft_reset_printer()' - Do the soft reset request specific to printers
|
||||
*
|
||||
* This soft reset is specific to the printer device class and is much less
|
||||
* invasive than the general USB reset libusb_reset_device(). Especially it
|
||||
* does never happen that the USB addressing and configuration changes. What
|
||||
* is actually done is that all buffers get flushed and the bulk IN and OUT
|
||||
* pipes get reset to their default states. This clears all stall conditions.
|
||||
* See http://cholla.mmto.org/computers/linux/usb/usbprint11.pdf
|
||||
*/
|
||||
|
||||
static int /* O - 0 on success, < 0 on error */
|
||||
soft_reset_printer(
|
||||
usb_printer_t *printer) /* I - Printer */
|
||||
{
|
||||
struct libusb_config_descriptor *confptr = NULL;
|
||||
/* Pointer to current configuration */
|
||||
int interface, /* Interface to reset */
|
||||
errcode; /* Error code */
|
||||
|
||||
|
||||
if (libusb_get_config_descriptor(printer->device, printer->conf,
|
||||
&confptr) < 0)
|
||||
interface = printer->iface;
|
||||
else
|
||||
interface = confptr->interface[printer->iface].
|
||||
altsetting[printer->altset].bInterfaceNumber;
|
||||
|
||||
libusb_free_config_descriptor(confptr);
|
||||
|
||||
if ((errcode = libusb_control_transfer(printer->handle,
|
||||
LIBUSB_REQUEST_TYPE_CLASS |
|
||||
LIBUSB_ENDPOINT_OUT |
|
||||
LIBUSB_RECIPIENT_OTHER,
|
||||
2, 0, interface, NULL, 0, 5000)) < 0)
|
||||
errcode = libusb_control_transfer(printer->handle,
|
||||
LIBUSB_REQUEST_TYPE_CLASS |
|
||||
LIBUSB_ENDPOINT_OUT |
|
||||
LIBUSB_RECIPIENT_INTERFACE,
|
||||
2, 0, interface, NULL, 0, 5000);
|
||||
|
||||
return (errcode);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: usb-libusb.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
|
||||
+13
-22
@@ -1,27 +1,20 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: usb-unix.c 12124 2014-08-28 15:37:22Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: usb.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
@@ -260,5 +260,5 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: usb.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+22
-19
@@ -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
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
#
|
||||
# Berkeley commands makefile for CUPS.
|
||||
#
|
||||
@@ -164,5 +164,5 @@ include Dependencies
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
#
|
||||
|
||||
+13
-21
@@ -1,24 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: lpc.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+34
-71
@@ -1,27 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpq" command for CUPS.
|
||||
* "lpq" 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.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -60,8 +49,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
all, /* All printers */
|
||||
interval, /* Reporting interval */
|
||||
longstatus; /* Show file details */
|
||||
int num_dests; /* Number of destinations */
|
||||
cups_dest_t *dests; /* Destinations */
|
||||
cups_dest_t *named_dest; /* Named destination */
|
||||
|
||||
|
||||
_cupsSetLocale(argv);
|
||||
@@ -77,8 +65,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
interval = 0;
|
||||
longstatus = 0;
|
||||
all = 0;
|
||||
num_dests = 0;
|
||||
dests = NULL;
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
if (argv[i][0] == '+')
|
||||
@@ -127,7 +113,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
httpClose(http);
|
||||
cupsFreeDests(num_dests, dests);
|
||||
|
||||
usage();
|
||||
}
|
||||
@@ -140,12 +125,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
http = connect_server(argv[0], http);
|
||||
|
||||
if (num_dests == 0)
|
||||
num_dests = cupsGetDests2(http, &dests);
|
||||
|
||||
if (cupsGetDest(dest, instance, num_dests, dests) == NULL)
|
||||
if ((named_dest = cupsGetNamedDest(http, dest, instance)) == NULL)
|
||||
{
|
||||
if (instance)
|
||||
if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - add '/version=1.1' to server "
|
||||
"name."), argv[0]);
|
||||
else if (instance)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown destination \"%s/%s\"."),
|
||||
argv[0], dest, instance);
|
||||
@@ -155,6 +142,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsFreeDests(1, named_dest);
|
||||
break;
|
||||
|
||||
case 'a' : /* All printers */
|
||||
@@ -192,10 +181,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
default :
|
||||
httpClose(http);
|
||||
cupsFreeDests(num_dests, dests);
|
||||
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (isdigit(argv[i][0] & 255))
|
||||
@@ -207,15 +194,17 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (dest == NULL && !all)
|
||||
{
|
||||
if (num_dests == 0)
|
||||
num_dests = cupsGetDests2(http, &dests);
|
||||
|
||||
for (i = 0; i < num_dests; i ++)
|
||||
if (dests[i].is_default)
|
||||
dest = dests[i].name;
|
||||
|
||||
if (dest == NULL)
|
||||
if ((named_dest = cupsGetNamedDest(http, NULL, NULL)) == NULL)
|
||||
{
|
||||
if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - add '/version=1.1' to server name."),
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
val = NULL;
|
||||
|
||||
if ((dest = getenv("LPDEST")) == NULL)
|
||||
@@ -231,7 +220,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
else
|
||||
val = "LPDEST";
|
||||
|
||||
if (dest && !cupsGetDest(dest, NULL, num_dests, dests))
|
||||
if (dest && val)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - %s environment variable names "
|
||||
"non-existent destination \"%s\"."), argv[0], val,
|
||||
@@ -241,9 +230,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
_("%s: Error - no default destination available."),
|
||||
argv[0]);
|
||||
httpClose(http);
|
||||
cupsFreeDests(num_dests, dests);
|
||||
return (1);
|
||||
}
|
||||
|
||||
dest = named_dest->name;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -260,7 +250,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i && interval)
|
||||
{
|
||||
fflush(stdout);
|
||||
sleep(interval);
|
||||
sleep((unsigned)interval);
|
||||
}
|
||||
else
|
||||
break;
|
||||
@@ -270,7 +260,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* Close the connection to the server and return...
|
||||
*/
|
||||
|
||||
cupsFreeDests(num_dests, dests);
|
||||
httpClose(http);
|
||||
|
||||
return (0);
|
||||
@@ -322,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 */
|
||||
@@ -447,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";
|
||||
@@ -466,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;
|
||||
@@ -509,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 ++;
|
||||
|
||||
@@ -559,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;
|
||||
@@ -678,5 +641,5 @@ usage(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: lpq.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+29
-15
@@ -1,20 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $"
|
||||
*
|
||||
* "lpr" command for CUPS.
|
||||
* "lpr" command 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/".
|
||||
*
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -61,6 +57,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
if (argv[i][0] == '-')
|
||||
{
|
||||
switch (ch = argv[i][1])
|
||||
{
|
||||
case 'E' : /* Encrypt */
|
||||
@@ -226,6 +223,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
dest->options[j].value,
|
||||
num_options, &options);
|
||||
}
|
||||
else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - add '/version=1.1' to server "
|
||||
"name."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
break;
|
||||
|
||||
case '#' : /* Number of copies */
|
||||
@@ -275,6 +280,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
argv[i][1]);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else if (num_files < 1000)
|
||||
{
|
||||
/*
|
||||
@@ -320,6 +326,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
dest->options[j].value,
|
||||
num_options, &options);
|
||||
}
|
||||
else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - add '/version=1.1' to server "
|
||||
"name."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (printer == NULL)
|
||||
@@ -388,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)
|
||||
{
|
||||
@@ -418,5 +432,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: lpr.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: lprm.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* "lprm" command for CUPS.
|
||||
*
|
||||
@@ -213,5 +213,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: lprm.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+19
-20
@@ -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
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: Makefile 11777 2014-03-28 19:18:10Z 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$".
|
||||
# End of "$Id: Makefile 11777 2014-03-28 19:18:10Z msweet $".
|
||||
#
|
||||
|
||||
+37
-57
@@ -1,37 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: admin.c 12123 2014-08-28 14:24:45Z msweet $"
|
||||
*
|
||||
* Administration CGI for CUPS.
|
||||
* Administration CGI 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/".
|
||||
*
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -89,8 +68,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 */
|
||||
@@ -1172,7 +1150,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 +1172,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 +1189,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
|
||||
@@ -1348,20 +1328,20 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
|
||||
if (!file)
|
||||
{
|
||||
var = cgiGetVariable("PPD_NAME");
|
||||
if (strcmp(var, "__no_change__"))
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, var);
|
||||
}
|
||||
|
||||
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-location",
|
||||
NULL, cgiGetVariable("PRINTER_LOCATION"));
|
||||
|
||||
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info",
|
||||
NULL, cgiGetVariable("PRINTER_INFO"));
|
||||
|
||||
if (!file)
|
||||
{
|
||||
var = cgiGetVariable("PPD_NAME");
|
||||
if (strcmp(var, "__no_change__"))
|
||||
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, var);
|
||||
}
|
||||
|
||||
strlcpy(uri, cgiGetVariable("DEVICE_URI"), sizeof(uri));
|
||||
|
||||
/*
|
||||
@@ -1380,7 +1360,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"));
|
||||
@@ -1881,7 +1861,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 +1897,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 +1986,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 +2005,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 +2015,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 +2028,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
*bufptr++ = 't';
|
||||
}
|
||||
else if (ch >= ' ')
|
||||
*bufptr++ = ch;
|
||||
*bufptr++ = (char)ch;
|
||||
}
|
||||
|
||||
*bufptr = '\0';
|
||||
@@ -3882,7 +3862,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 +4076,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 +4090,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 +4100,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 +4118,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 +4198,5 @@ get_points(double number, /* I - Original number */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: admin.c 12123 2014-08-28 14:24:45Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: cgi-private.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Private CGI definitions for CUPS.
|
||||
*
|
||||
@@ -32,5 +32,5 @@
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: cgi-private.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: cgi.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* CGI support library definitions for CUPS.
|
||||
*
|
||||
@@ -115,5 +115,5 @@ extern const char *cgiText(const char *message);
|
||||
#endif /* !_CUPS_CGI_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: cgi.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+15
-23
@@ -1,23 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: classes.c 11928 2014-06-13 00:08:32Z msweet $".
|
||||
*/
|
||||
|
||||
+16
-34
@@ -1,34 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: help-index.c 11594 2014-02-14 20:09:01Z 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-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:
|
||||
*
|
||||
* 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 ++;
|
||||
@@ -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);
|
||||
}
|
||||
@@ -1324,5 +1306,5 @@ help_sort_words(help_word_t *w1, /* I - Second word */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: help-index.c 11594 2014-02-14 20:09:01Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: help-index.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Online help index definitions for CUPS.
|
||||
*
|
||||
@@ -83,5 +83,5 @@ extern help_index_t *helpSearchIndex(help_index_t *hi, const char *query,
|
||||
#endif /* !_CUPS_HELP_INDEX_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: help-index.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: help.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Online help CGI for CUPS.
|
||||
*
|
||||
@@ -393,5 +393,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: help.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: html.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* HTML support functions for CUPS.
|
||||
*
|
||||
@@ -235,5 +235,5 @@ cgi_null_passwd(const char *prompt) /* I - Prompt string (unused) */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: html.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+28
-56
@@ -1,31 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: ipp-var.c 11889 2014-05-22 13:54:15Z msweet $"
|
||||
*
|
||||
* CGI <-> IPP variable routines for CUPS.
|
||||
* CGI <-> IPP variable 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/".
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cgiGetAttributes() - Get the list of attributes that are needed by the
|
||||
* template file.
|
||||
* cgiGetIPPObjects() - Get the objects in an IPP response.
|
||||
* cgiMoveJobs() - Move one or more jobs.
|
||||
* cgiPrintCommand() - Print a CUPS command job.
|
||||
* cgiPrintTestPage() - Print a test page.
|
||||
* cgiRewriteURL() - Rewrite a printer URI into a web browser URL...
|
||||
* cgiSetIPPObjectVars() - Set CGI variables from an IPP object.
|
||||
* cgiSetIPPVars() - Set CGI variables from an IPP response.
|
||||
* cgiShowIPPError() - Show the last IPP error message.
|
||||
* cgiShowJobs() - Show print jobs.
|
||||
* cgiText() - Return localized text.
|
||||
* 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/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -65,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] = '_';
|
||||
|
||||
@@ -107,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...
|
||||
@@ -123,7 +108,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
|
||||
if (ch == '_')
|
||||
*nameptr++ = '-';
|
||||
else
|
||||
*nameptr++ = ch;
|
||||
*nameptr++ = (char)ch;
|
||||
}
|
||||
|
||||
*nameptr = '\0';
|
||||
@@ -917,7 +902,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
|
||||
{
|
||||
@@ -926,17 +911,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);
|
||||
}
|
||||
@@ -958,7 +939,6 @@ cgiSetIPPObjectVars(
|
||||
*nameptr, /* Pointer into name */
|
||||
value[16384], /* Value(s) */
|
||||
*valptr; /* Pointer into value */
|
||||
struct tm *date; /* Date information */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG2: cgiSetIPPObjectVars(obj=%p, prefix=\"%s\", "
|
||||
@@ -1039,7 +1019,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);
|
||||
@@ -1177,7 +1157,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);
|
||||
|
||||
@@ -1186,36 +1166,28 @@ cgiSetIPPObjectVars(
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
if (strncmp(name, "time_at_", 8) == 0)
|
||||
{
|
||||
time_t t; /* Temporary time value */
|
||||
|
||||
t = (time_t)attr->values[i].integer;
|
||||
date = localtime(&t);
|
||||
|
||||
strftime(valptr, sizeof(value) - (valptr - value), "%c", date);
|
||||
}
|
||||
_cupsStrDate(valptr, sizeof(value) - (size_t)(valptr - value), (time_t)ippGetInteger(attr, i));
|
||||
else
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
"%d", attr->values[i].integer);
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value), "%d", ippGetInteger(attr, i));
|
||||
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 ?
|
||||
@@ -1238,13 +1210,13 @@ cgiSetIPPObjectVars(
|
||||
cgiRewriteURL(attr->values[i].string.text, url,
|
||||
sizeof(url), NULL);
|
||||
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
snprintf(valptr, sizeof(value) - (size_t)(valptr - value),
|
||||
"<A HREF=\"%s\">%s</A>", url,
|
||||
strrchr(attr->values[i].string.text, '/') + 1);
|
||||
}
|
||||
else
|
||||
cgiRewriteURL(attr->values[i].string.text, valptr,
|
||||
sizeof(value) - (valptr - value), NULL);
|
||||
(int)(sizeof(value) - (size_t)(valptr - value)), NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1256,7 +1228,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 :
|
||||
@@ -1589,5 +1561,5 @@ cgiText(const char *message) /* I - Message */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: ipp-var.c 11889 2014-05-22 13:54:15Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-17
@@ -1,21 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: jobs.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: makedocset.c 3833 2012-05-23 22:51:18Z msweet $"
|
||||
*
|
||||
* Xcode documentation set generator.
|
||||
*
|
||||
@@ -482,5 +482,5 @@ write_nodes(const char *path, /* I - File to write */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: makedocset.c 3833 2012-05-23 22:51:18Z msweet $".
|
||||
*/
|
||||
|
||||
+15
-23
@@ -1,23 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: printers.c 11928 2014-06-13 00:08:32Z msweet $".
|
||||
*/
|
||||
|
||||
+14
-20
@@ -1,22 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: search.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+20
-31
@@ -1,27 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: template.c 11685 2014-03-05 20:03:29Z msweet $"
|
||||
*
|
||||
* CGI template function.
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007-2011 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:
|
||||
*
|
||||
* 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';
|
||||
|
||||
@@ -553,7 +542,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
if (regcomp(&re, compare, REG_EXTENDED | REG_ICASE))
|
||||
{
|
||||
fprintf(stderr,
|
||||
"ERROR: Unable to compile regular expresion \"%s\"!\n",
|
||||
"ERROR: Unable to compile regular expression \"%s\"!\n",
|
||||
compare);
|
||||
result = 0;
|
||||
}
|
||||
@@ -729,5 +718,5 @@ cgi_puturi(const char *s, /* I - String to output */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: template.c 11685 2014-03-05 20:03:29Z msweet $".
|
||||
*/
|
||||
|
||||
+11
-17
@@ -1,21 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$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$".
|
||||
* End of "$Id: testcgi.c 11558 2014-02-06 18:33:34Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: testhi.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Help index test program for CUPS.
|
||||
*
|
||||
@@ -109,5 +109,5 @@ list_nodes(const char *title, /* I - Title string */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: testhi.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: testtemplate.c 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* CGI template test program for CUPS.
|
||||
*
|
||||
@@ -99,5 +99,5 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: testtemplate.c 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
+41
-70
@@ -1,49 +1,20 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: var.c 12034 2014-07-16 19:37:34Z 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-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:
|
||||
*
|
||||
* 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));
|
||||
}
|
||||
|
||||
@@ -769,8 +740,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 +806,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 +831,7 @@ cgi_initialize_multipart(
|
||||
*/
|
||||
|
||||
if (ptr > line)
|
||||
write(fd, line, ptr - line);
|
||||
write(fd, line, (size_t)(ptr - line));
|
||||
|
||||
close(fd);
|
||||
}
|
||||
@@ -877,9 +848,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 +950,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 +972,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 +982,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 +1097,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 +1235,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 +1278,5 @@ cgi_unlink_file(void)
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: var.c 12034 2014-07-16 19:37:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* 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$".
|
||||
*/
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $"
|
||||
#
|
||||
# Configuration file makefile for CUPS.
|
||||
#
|
||||
@@ -139,5 +139,5 @@ uninstall:
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: Makefile 10996 2013-05-29 11:51:34Z msweet $".
|
||||
#
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# List of events that are considered fatal errors for the scheduler...
|
||||
#FatalErrors @CUPS_FATAL_ERRORS@
|
||||
|
||||
# Do we call fsync() after writing configuration or status files?
|
||||
#SyncOnClose No
|
||||
|
||||
# Default user and group for filters/backends/helper programs; this cannot be
|
||||
# any user or group that resolves to ID 0 for security reasons...
|
||||
#User @CUPS_USER@
|
||||
@@ -92,7 +93,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$".
|
||||
#
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# 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@
|
||||
@@ -128,7 +127,3 @@ WebInterface @CUPS_WEBIF@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: mime.convs.in 11025 2013-06-07 01:00:33Z msweet $"
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
@@ -59,5 +59,5 @@ application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: mime.convs.in 11025 2013-06-07 01:00:33Z msweet $".
|
||||
#
|
||||
|
||||
+18
-17
@@ -1,20 +1,20 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $"
|
||||
#
|
||||
# Base MIME types file for CUPS.
|
||||
# Base MIME types file for CUPS.
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007-2011 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/".
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -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") \
|
||||
@@ -92,7 +93,7 @@ image/jpeg jpeg jpg jpe string(0,<FFD8FF>) +\
|
||||
char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
|
||||
char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
|
||||
char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
|
||||
image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(100)
|
||||
image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(150)
|
||||
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
|
||||
image/x-photocd pcd string(2048,PCD_IPI)
|
||||
image/x-portable-anymap pnm
|
||||
@@ -123,7 +124,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))
|
||||
@@ -152,7 +153,7 @@ application/vnd.cups-pdf
|
||||
application/vnd.cups-postscript
|
||||
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
|
||||
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR") \
|
||||
string(0,"RaS2") string(0,"2SaR") \
|
||||
(string(0,"RaS2") + !string(4,PwgRaster<00>)) string(0,"2SaR") \
|
||||
string(0,"RaS3") string(0,"3SaR")
|
||||
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
string(0,<1B>@) \
|
||||
@@ -170,5 +171,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $".
|
||||
#
|
||||
|
||||
+2
-8
@@ -1,13 +1,7 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# 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$".
|
||||
#
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-common.m4 12180 2014-10-01 12:08:02Z msweet $"
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl Common configuration 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
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
@@ -20,8 +20,8 @@ dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.7b1"
|
||||
CUPS_REVISION=""
|
||||
CUPS_VERSION=2.0.0
|
||||
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
|
||||
@@ -89,7 +89,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 +134,9 @@ 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))
|
||||
|
||||
dnl Checks for iconv.h and iconv_open
|
||||
AC_CHECK_HEADER(iconv.h,
|
||||
@@ -202,6 +200,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;
|
||||
@@ -225,18 +226,24 @@ dnl See if we have libusb...
|
||||
AC_ARG_ENABLE(libusb, [ --enable-libusb use libusb for USB printing])
|
||||
|
||||
LIBUSB=""
|
||||
USBQUIRKS=""
|
||||
AC_SUBST(LIBUSB)
|
||||
AC_SUBST(USBQUIRKS)
|
||||
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
if test x$enable_libusb = xyes -o $uname != Darwin; then
|
||||
if test x$enable_libusb != xno -a $uname != Darwin; then
|
||||
AC_MSG_CHECKING(for libusb-1.0)
|
||||
if $PKGCONFIG --exists libusb-1.0; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LIBUSB)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags libusb-1.0`"
|
||||
LIBUSB="`$PKGCONFIG --libs libusb-1.0`"
|
||||
USBQUIRKS="\$(DATADIR)/usb"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test x$enable_libusb = xyes; then
|
||||
AC_MSG_ERROR(libusb required for --enable-libusb.)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif test x$enable_libusb = xyes; then
|
||||
@@ -300,16 +307,11 @@ fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for DBUS support
|
||||
if test -d /etc/dbus-1; then
|
||||
DBUSDIR="/etc/dbus-1"
|
||||
else
|
||||
DBUSDIR=""
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
@@ -326,7 +328,12 @@ if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
|
||||
LIBS="$LIBS $DBUS_NOTIFIERLIBS"
|
||||
AC_CHECK_FUNC(dbus_message_iter_init_append,
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
|
||||
AC_CHECK_FUNC(dbus_threads_init,
|
||||
AC_DEFINE(HAVE_DBUS_THREADS_INIT))
|
||||
LIBS="$SAVELIBS"
|
||||
if test -d /etc/dbus-1; then
|
||||
DBUSDIR="/etc/dbus-1"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
@@ -353,7 +360,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)
|
||||
@@ -363,9 +369,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))
|
||||
|
||||
@@ -459,5 +462,5 @@ esac
|
||||
AC_SUBST(BUILDDIRS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl End of "$Id: cups-common.m4 12180 2014-10-01 12:08:02Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-compiler.m4 12122 2014-08-28 12:55:52Z msweet $"
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl Compiler 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
|
||||
|
||||
dnl Clear the debugging and non-shared library options unless the user asks
|
||||
@@ -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,20 +130,25 @@ 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"
|
||||
CFLAGS="$CFLAGS -fPIE"
|
||||
AC_TRY_COMPILE(,,
|
||||
[case "$CC" in
|
||||
*clang)
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
CFLAGS="$CFLAGS -fPIE -Wl,-pie"
|
||||
AC_TRY_COMPILE(,,[
|
||||
PIEFLAGS="-fPIE -Wl,-pie"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
;;
|
||||
|
||||
*)
|
||||
CFLAGS="$CFLAGS -fPIE -pie"
|
||||
AC_TRY_COMPILE(,,[
|
||||
PIEFLAGS="-fPIE -pie"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
;;
|
||||
esac
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
fi
|
||||
|
||||
@@ -151,18 +156,27 @@ 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 -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
|
||||
|
||||
@@ -180,47 +194,13 @@ if test -n "$GCC"; then
|
||||
# The -z relro option is provided by the Linux linker command to
|
||||
# make relocatable data read-only.
|
||||
if test x$enable_relro = xyes; then
|
||||
RELROFLAGS="-Wl,-z,relro"
|
||||
RELROFLAGS="-Wl,-z,relro,-z,now"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
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
|
||||
@@ -231,20 +211,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
|
||||
@@ -254,7 +220,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."
|
||||
;;
|
||||
@@ -263,33 +229,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$".
|
||||
dnl End of "$Id: cups-compiler.m4 12122 2014-08-28 12:55:52Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
@@ -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_WITH(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$".
|
||||
dnl End of "$Id: cups-defaults.m4 11789 2014-04-02 16:52:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-directories.m4 11717 2014-03-21 16:42:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
@@ -23,6 +23,8 @@ AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes set directory for DNS Ser
|
||||
|
||||
DNSSDLIBS=""
|
||||
DNSSD_BACKEND=""
|
||||
IPPFIND_BIN=""
|
||||
IPPFIND_MAN=""
|
||||
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
|
||||
AC_MSG_CHECKING(for Avahi)
|
||||
@@ -31,6 +33,8 @@ if test "x$PKGCONFIG" != x -a x$enable_avahi != xno; then
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
|
||||
DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
AC_DEFINE(HAVE_AVAHI)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -45,6 +49,8 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
;;
|
||||
*)
|
||||
# All others...
|
||||
@@ -61,6 +67,8 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
DNSSDLIBS="-ldns_sd"
|
||||
DNSSD_BACKEND="dnssd",
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
AC_MSG_RESULT(no))
|
||||
LIBS="$SAVELIBS"
|
||||
;;
|
||||
@@ -70,7 +78,9 @@ fi
|
||||
|
||||
AC_SUBST(DNSSDLIBS)
|
||||
AC_SUBST(DNSSD_BACKEND)
|
||||
AC_SUBST(IPPFIND_BIN)
|
||||
AC_SUBST(IPPFIND_MAN)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl End of "$Id: cups-dnssd.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $"
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products.
|
||||
dnl
|
||||
dnl This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -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)
|
||||
@@ -71,38 +71,9 @@ if test x$enable_gssapi != xno; then
|
||||
if test "x$LIBGSSAPI" != x; then
|
||||
AC_CHECK_HEADER(krb5.h, AC_DEFINE(HAVE_KRB5_H))
|
||||
if test -d /System/Library/Frameworks/GSS.framework; then
|
||||
gssdir="/System/Library/Frameworks/GSS.framework"
|
||||
AC_MSG_CHECKING(for GSS/gssapi.h presence)
|
||||
if test -f $gssdir/Headers/gssapi.h; then
|
||||
AC_DEFINE(HAVE_GSS_GSSAPI_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_MSG_CHECKING(for GSS/gssapi_generic.h presence)
|
||||
if test -f $gssdir/Headers/gssapi_generic.h; then
|
||||
AC_DEFINE(HAVE_GSSAPI_GENERIC_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_MSG_CHECKING(for GSS/gssapi_spi.h presence)
|
||||
if test -f $gssdir/PrivateHeaders/gssapi_spi.h; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING(for GSS/gssapi_spi.h usability)
|
||||
if test -s $gssdir/PrivateHeaders/gssapi_spi.h; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GSS_GSSAPI_SPI_H)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test $uversion -ge 110 -a $uversion -lt 120; then
|
||||
# Broken public headers in 10.7.x...
|
||||
AC_MSG_ERROR(Run 'sudo mkdir -p $gssdir/PrivateHeaders' and 'sudo touch $gssdir/PrivateHeaders/gssapi_spi.h' to build CUPS.)
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_HEADER(GSS/gssapi.h, AC_DEFINE(HAVE_GSS_GSSAPI_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_generic.h, AC_DEFINE(HAVE_GSS_GSSAPI_GENERIC_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_spi.h, AC_DEFINE(HAVE_GSS_GSSAPI_SPI_H))
|
||||
else
|
||||
AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_H))
|
||||
@@ -158,5 +129,5 @@ AC_SUBST(CUPS_DEFAULT_GSSSERVICENAME)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl End of "$Id: cups-gssapi.m4 11911 2014-06-10 13:54:53Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-largefile.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-libtool.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-manpages.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-network.m4 11719 2014-03-21 18:07:23Z 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))
|
||||
@@ -66,9 +66,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$".
|
||||
dnl End of "$Id: cups-network.m4 11719 2014-03-21 18:07:23Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$"
|
||||
dnl "$Id: cups-opsys.m4 11324 2013-10-04 03:11:42Z msweet $"
|
||||
dnl
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-pam.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-scripting.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-sharedlibs.m4 11342 2013-10-18 20:36:01Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: cups-ssl.m4 12122 2014-08-28 12:55: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-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_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=""
|
||||
@@ -59,14 +52,15 @@ 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)])
|
||||
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`
|
||||
@@ -85,56 +79,11 @@ if test x$enable_ssl != xno; then
|
||||
CUPS_SERVERCERT="ssl/server.crt"
|
||||
CUPS_SERVERKEY="ssl/server.key"
|
||||
|
||||
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))
|
||||
LIBS="$SAVELIBS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -143,7 +92,7 @@ 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
|
||||
|
||||
@@ -157,5 +106,5 @@ EXPORT_SSLLIBS="$SSLLIBS"
|
||||
AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl End of "$Id: cups-ssl.m4 12122 2014-08-28 12:55:52Z msweet $".
|
||||
dnl
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
dnl
|
||||
dnl "$Id: cups-startup.m4 11747 2014-03-27 01:15:48Z msweet $"
|
||||
dnl
|
||||
dnl Launch-on-demand/startup stuff for CUPS.
|
||||
dnl
|
||||
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
|
||||
|
||||
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
|
||||
AC_MSG_CHECKING(for libsystemd-daemon)
|
||||
if $PKGCONFIG --exists libsystemd-daemon; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ONDEMANDFLAGS=`$PKGCONFIG --cflags libsystemd-daemon`
|
||||
ONDEMANDLIBS=`$PKGCONFIG --libs libsystemd-daemon`
|
||||
AC_DEFINE(HAVE_SYSTEMD)
|
||||
if test "x$SYSTEMD_DIR" = x; then
|
||||
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
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$xinet" != xno; then
|
||||
XINETD="$xinetd"
|
||||
fi
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-startup.m4 11747 2014-03-27 01:15:48Z msweet $".
|
||||
dnl
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
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$".
|
||||
dnl End of "$Id: cups-threads.m4 11324 2013-10-04 03:11:42Z msweet $".
|
||||
dnl
|
||||
|
||||
+44
-38
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: config.h.in 12140 2014-08-30 01:51:22Z msweet $"
|
||||
*
|
||||
* Configuration file for CUPS.
|
||||
* Configuration file 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/".
|
||||
* 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
|
||||
@@ -290,15 +294,15 @@
|
||||
|
||||
#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
|
||||
|
||||
|
||||
/*
|
||||
@@ -323,6 +327,20 @@
|
||||
#undef HAVE_CSSMERRORSTRING
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecGenerateSelfSignedCertificate function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecKeychainOpen function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECKEYCHAINOPEN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have libpaper?
|
||||
*/
|
||||
@@ -428,13 +446,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 +459,14 @@
|
||||
|
||||
#undef HAVE_LAUNCH_H
|
||||
#undef HAVE_LAUNCHD
|
||||
#undef HAVE_LAUNCH_ACTIVATE_SOCKET
|
||||
|
||||
|
||||
/*
|
||||
* Do we have systemd support?
|
||||
*/
|
||||
|
||||
#undef HAVE_SYSTEMD
|
||||
|
||||
|
||||
/*
|
||||
@@ -522,19 +541,13 @@
|
||||
#undef HAVE_NOTIFY_POST
|
||||
|
||||
|
||||
/*
|
||||
* Do we have Darwin's IOKit private headers?
|
||||
*/
|
||||
|
||||
#undef HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have DBUS?
|
||||
*/
|
||||
|
||||
#undef HAVE_DBUS
|
||||
#undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
|
||||
#undef HAVE_DBUS_THREADS_INIT
|
||||
|
||||
|
||||
/*
|
||||
@@ -624,13 +637,6 @@
|
||||
#endif /* HAVE_ARC4RANDOM */
|
||||
|
||||
|
||||
/*
|
||||
* Do we have vproc_transaction_begin/end?
|
||||
*/
|
||||
|
||||
#undef HAVE_VPROC_TRANSACTION_BEGIN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have libusb?
|
||||
*/
|
||||
@@ -706,5 +712,5 @@ static __inline int _cups_abs(int i) { return (i < 0 ? -i : i); }
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: config.h.in 12140 2014-08-30 01:51:22Z msweet $".
|
||||
*/
|
||||
|
||||
+11420
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -1,16 +1,16 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl "$Id: configure.ac 11823 2014-04-21 12:22:03Z 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-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_INIT(cups/cups.h)
|
||||
@@ -32,7 +32,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)
|
||||
|
||||
@@ -68,13 +68,8 @@ AC_OUTPUT(Makedefs
|
||||
cups-config
|
||||
data/testprint
|
||||
desktop/cups.desktop
|
||||
doc/help/ref-cups-files-conf.html
|
||||
doc/help/ref-cupsd-conf.html
|
||||
doc/help/standard.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
|
||||
@@ -86,6 +81,9 @@ AC_OUTPUT(Makedefs
|
||||
scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
scheduler/org.cups.cups-lpd.plist
|
||||
scheduler/org.cups.cupsd.path
|
||||
scheduler/org.cups.cupsd.service
|
||||
scheduler/org.cups.cupsd.socket
|
||||
templates/header.tmpl
|
||||
packaging/cups.list
|
||||
$LANGFILES)
|
||||
@@ -93,5 +91,5 @@ AC_OUTPUT(Makedefs
|
||||
chmod +x cups-config
|
||||
|
||||
dnl
|
||||
dnl End of "$Id$".
|
||||
dnl End of "$Id: configure.ac 11823 2014-04-21 12:22:03Z msweet $".
|
||||
dnl
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: cups-config.in 10996 2013-05-29 11:51:34Z msweet $"
|
||||
#
|
||||
# CUPS configuration utility.
|
||||
#
|
||||
@@ -142,5 +142,5 @@ while test $# -gt 0; do
|
||||
done
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: cups-config.in 10996 2013-05-29 11:51:34Z msweet $".
|
||||
#
|
||||
|
||||
+255
-197
@@ -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
|
||||
|
||||
+59
-33
@@ -1,18 +1,18 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# "$Id: Makefile 12032 2014-07-15 20:37:32Z 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,6 +76,7 @@ LIBOBJS = \
|
||||
string.o \
|
||||
tempfile.o \
|
||||
thread.o \
|
||||
tls.o \
|
||||
transcode.o \
|
||||
usersys.o \
|
||||
util.o
|
||||
@@ -84,6 +85,7 @@ TESTOBJS = \
|
||||
testarray.o \
|
||||
testconflicts.o \
|
||||
testcups.o \
|
||||
testdest.o \
|
||||
testfile.o \
|
||||
testhttp.o \
|
||||
testi18n.o \
|
||||
@@ -147,8 +149,10 @@ LIBTARGETS = \
|
||||
UNITTARGETS = \
|
||||
testadmin \
|
||||
testarray \
|
||||
testcache \
|
||||
testconflicts \
|
||||
testcups \
|
||||
testdest \
|
||||
testfile \
|
||||
testhttp \
|
||||
testi18n \
|
||||
@@ -190,7 +194,7 @@ unittests: $(UNITTARGETS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
|
||||
$(RM) libcups.so libcups.sl libcups.dylib
|
||||
$(RM) libcups.so libcups.dylib
|
||||
|
||||
|
||||
#
|
||||
@@ -257,7 +261,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 +290,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 +300,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 +323,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 +332,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 +339,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 +354,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 +393,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 +423,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)
|
||||
#
|
||||
@@ -636,8 +661,9 @@ sloc:
|
||||
#
|
||||
|
||||
include Dependencies
|
||||
tls.o: tls-darwin.c tls-gnutls.c tls-sspi.c
|
||||
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
# End of "$Id: Makefile 12032 2014-07-15 20:37:32Z msweet $".
|
||||
#
|
||||
|
||||
+15
-26
@@ -1,29 +1,18 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: adminutil.c 11598 2014-02-18 18:58:19Z 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-2014 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",
|
||||
@@ -2120,7 +2109,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 +2165,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 +2326,5 @@ write_option(cups_file_t *dstfp, /* I - PPD file */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: adminutil.c 11598 2014-02-18 18:58:19Z msweet $".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
* "$Id: adminutil.h 10996 2013-05-29 11:51:34Z msweet $"
|
||||
*
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
@@ -77,5 +77,5 @@ extern int cupsAdminSetServerSettings(http_t *http,
|
||||
#endif /* !_CUPS_ADMINUTIL_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
* End of "$Id: adminutil.h 10996 2013-05-29 11:51:34Z msweet $".
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-array.header 7266 2008-01-29 02:15:29Z mike $"
|
||||
|
||||
Array API header for CUPS.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
|
||||
|
||||
Array API introduction for CUPS.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-cups.header 7279 2008-01-31 01:50:44Z mike $"
|
||||
|
||||
CUPS API header for CUPS.
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-cups.shtml 7337 2008-02-22 04:44:04Z mike $"
|
||||
|
||||
API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2011 by Apple Inc.
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
@@ -183,7 +183,7 @@ int num_options = 0;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
|
||||
for (i = 0; i < dest->num_options; i ++)
|
||||
for (i = 0; i < dest->num_options; i ++)
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>(dest->options[i].name, dest->options[i].value,
|
||||
num_options, &options);
|
||||
</pre>
|
||||
@@ -235,7 +235,7 @@ job_id = <a href='#cupsPrintFiles'>cupsPrintFiles</a>(dest->name, 3, files, "Tes
|
||||
|
||||
<p>Finally, the <a href='#cupsCreateJob'><code>cupsCreateJob</code></a>
|
||||
function creates a new job with no files in it. Files are added using the
|
||||
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
|
||||
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
|
||||
<a href='api-httpipp.html#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>,
|
||||
and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions.
|
||||
The following example creates a job with 10 text files for printing:</p>
|
||||
@@ -299,7 +299,7 @@ int num_jobs;
|
||||
<a href='#cups_job_t'>cups_job_t</a> *jobs;
|
||||
int i;
|
||||
ipp_jstate_t job_state = IPP_JOB_PENDING;
|
||||
|
||||
|
||||
while (job_state < IPP_JOB_STOPPED)
|
||||
{
|
||||
/* Get my jobs (1) with any state (-1) */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-filedir.header 7279 2008-01-31 01:50:44Z mike $"
|
||||
|
||||
File and Directory API header for CUPS.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-filedir.shtml 7279 2008-01-31 01:50:44Z mike $"
|
||||
|
||||
File and directory API introduction for CUPS.
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-filter.header 7616 2008-05-28 00:34:13Z mike $"
|
||||
|
||||
Filter and backend programming header for CUPS.
|
||||
|
||||
Copyright 2008-2011 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
|
||||
|
||||
+124
-13
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
"$Id$"
|
||||
"$Id: api-filter.shtml 7677 2008-06-19 23:22:19Z mike $"
|
||||
|
||||
Filter and backend programming introduction for CUPS.
|
||||
|
||||
Copyright 2007-2012 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>
|
||||
@@ -237,7 +237,7 @@ prefix strings:</p>
|
||||
<code>marker-types</code>, <code>printer-alert</code>, and
|
||||
<code>printer-alert-description</code> printer attributes. Standard
|
||||
<code>marker-types</code> values are listed in <a href='#TABLE1'>Table
|
||||
1</a>.</dd>
|
||||
1</a>. String values need special handling - see <a href="#ATTR_STRINGS">Reporting Attribute String Values</a> below.</dd>
|
||||
|
||||
<dt>CRIT: message</dt>
|
||||
<dd>Sets the printer-state-message attribute and adds the specified
|
||||
@@ -320,11 +320,11 @@ the "DEBUG:" prefix string.</p>
|
||||
<td>Fuser unit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fuserCleaningPad</td>
|
||||
<td>fuser-cleaning-pad</td>
|
||||
<td>Fuser cleaning pad</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fuserOil</td>
|
||||
<td>fuser-oil</td>
|
||||
<td>Fuser oil</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -336,7 +336,7 @@ the "DEBUG:" prefix string.</p>
|
||||
<td>Photo conductor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>solidWax</td>
|
||||
<td>solid-wax</td>
|
||||
<td>Wax supply</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -348,19 +348,19 @@ the "DEBUG:" prefix string.</p>
|
||||
<td>Toner supply</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>transferUnit</td>
|
||||
<td>transfer-unit</td>
|
||||
<td>Transfer unit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>wasteInk</td>
|
||||
<td>waste-ink</td>
|
||||
<td>Waste ink tank</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>wasteToner</td>
|
||||
<td>waste-toner</td>
|
||||
<td>Waste toner tank</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>wasteWax</td>
|
||||
<td>waste-wax</td>
|
||||
<td>Waste wax tank</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -440,6 +440,95 @@ the "DEBUG:" prefix string.</p>
|
||||
</tbody>
|
||||
</table></div>
|
||||
|
||||
|
||||
<h4><a name="ATTR_STRINGS">Reporting Attribute String Values</a></h4>
|
||||
|
||||
<p>When reporting string values using "ATTR:" messages, a filter or backend must take special care to appropriately quote those values. The scheduler uses the CUPS option parsing code for attributes, so the general syntax is:</p>
|
||||
|
||||
<pre class="example">
|
||||
name=simple
|
||||
name=simple,simple,...
|
||||
name='complex value'
|
||||
name="complex value"
|
||||
name='"complex value"','"complex value"',...
|
||||
</pre>
|
||||
|
||||
<p>Simple values are strings that do not contain spaces, quotes, backslashes, or the comma and can be placed verbatim in the "ATTR:" message, for example:</p>
|
||||
|
||||
<pre class="example">
|
||||
int levels[4] = { 40, 50, 60, 70 }; /* CMYK */
|
||||
|
||||
fputs("ATTR: marker-colors=#00FFFF,#FF00FF,#FFFF00,#000000\n", stderr);
|
||||
fputs("ATTR: marker-high-levels=100,100,100,100\n", stderr);
|
||||
fprintf(stderr, "ATTR: marker-levels=%d,%d,%d,%d\n", levels[0], levels[1],
|
||||
levels[2], levels[3], levels[4]);
|
||||
fputs("ATTR: marker-low-levels=5,5,5,5\n", stderr);
|
||||
fputs("ATTR: marker-types=toner,toner,toner,toner\n", stderr);
|
||||
</pre>
|
||||
|
||||
<p>Complex values that contains spaces, quotes, backslashes, or the comma must be quoted. For a single value a single set of quotes is sufficient:</p>
|
||||
|
||||
<pre class="example">
|
||||
fputs("ATTR: marker-message='Levels shown are approximate.'\n", stderr);
|
||||
</pre>
|
||||
|
||||
<p>When multiple values are reported, each value must be enclosed by a set of single and double quotes:</p>
|
||||
|
||||
<pre class="example">
|
||||
fputs("ATTR: marker-names='\"Cyan Toner\"','\"Magenta Toner\"',"
|
||||
"'\"Yellow Toner\"','\"Black Toner\"'\n", stderr);
|
||||
</pre>
|
||||
|
||||
<p>The IPP backend includes a <var>quote_string</var> function that may be used to properly quote a complex value in an "ATTR:" message:</p>
|
||||
|
||||
<pre class="example">
|
||||
static const char * /* O - Quoted string */
|
||||
quote_string(const char *s, /* I - String */
|
||||
char *q, /* I - Quoted string buffer */
|
||||
size_t qsize) /* I - Size of quoted string buffer */
|
||||
{
|
||||
char *qptr, /* Pointer into string buffer */
|
||||
*qend; /* End of string buffer */
|
||||
|
||||
|
||||
qptr = q;
|
||||
qend = q + qsize - 5;
|
||||
|
||||
if (qend < q)
|
||||
{
|
||||
*q = '\0';
|
||||
return (q);
|
||||
}
|
||||
|
||||
*qptr++ = '\'';
|
||||
*qptr++ = '\"';
|
||||
|
||||
while (*s && qptr < qend)
|
||||
{
|
||||
if (*s == '\\' || *s == '\"' || *s == '\'')
|
||||
{
|
||||
if (qptr < (qend - 4))
|
||||
{
|
||||
*qptr++ = '\\';
|
||||
*qptr++ = '\\';
|
||||
*qptr++ = '\\';
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
*qptr++ = *s++;
|
||||
}
|
||||
|
||||
*qptr++ = '\"';
|
||||
*qptr++ = '\'';
|
||||
*qptr = '\0';
|
||||
|
||||
return (q);
|
||||
}
|
||||
</pre>
|
||||
|
||||
|
||||
<h4><a name="MANAGING_STATE">Managing Printer State in a Filter</a></h4>
|
||||
|
||||
<p>Filters are responsible for managing the state keywords they set using
|
||||
@@ -488,7 +577,7 @@ from localizing the vendor-prefixed keyword in the PPD file - otherwise both
|
||||
the generic and vendor-specific keyword will be shown in the user
|
||||
interface.</p>
|
||||
|
||||
</blockquote></dd>
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="REPORTING_SUPPLIES">Reporting Supply Levels</a></h4>
|
||||
|
||||
@@ -613,7 +702,7 @@ datalen = sizeof(data) - 1;
|
||||
status = <a href="#cupsSideChannelDoRequest">cupsSideChannelDoRequest</a>(CUPS_SC_CMD_GET_DEVICE_ID, data, &datalen, 1.0);
|
||||
|
||||
/* Use the returned value if OK was returned and the length is non-zero */
|
||||
if (status == CUPS_SC_STATUS_OK && datalen > 0)
|
||||
if (status == CUPS_SC_STATUS_OK && datalen > 0)
|
||||
data[datalen] = '\0';
|
||||
else
|
||||
data[0] = '\0';
|
||||
@@ -763,3 +852,25 @@ void *my_data;
|
||||
|
||||
<a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
|
||||
</pre>
|
||||
|
||||
<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
|
||||
|
||||
<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
|
||||
|
||||
<ol>
|
||||
|
||||
<li>Reading of files: pursuant to normal UNIX file permissions, filters and backends can read files for the current job from the <var>/private/var/spool/cups</var> directory and other files on mounted filesystems <em>except</em> for user home directories under <var>/Users</var>.</li>
|
||||
|
||||
<li>Writing of files: pursuant to normal UNIX file permissions, filters and backends can read/write files to the cache directory specified by the <code>CUPS_CACHEDIR</code> environment variable, to the state directory specified by the <code>CUPS_STATEDIR</code> environment variable, to the temporary directory specified by the <code>TMPDIR</code> environment variable, and under the <var>/private/var/db</var>, <var>/private/var/folders</var>, <var>/private/var/lib</var>, <var>/private/var/mysql</var>, <var>/private/var/run</var>, <var>/private/var/spool</var> (except <var>/private/var/spool/cups</var>), <var>/Library/Application Support</var>, <var>/Library/Caches</var>, <var>/Library/Logs</var>, <var>/Library/Preferences</var>, <var>/Library/WebServer</var>, and <var>/Users/Shared</var> directories.</li>
|
||||
|
||||
<li>Execution of programs: pursuant to normal UNIX file permissions, filters and backends can execute any program not located under the <var>/Users</var> directory. Child processes inherit the sandbox and are subject to the same restrictions as the parent.</li>
|
||||
|
||||
<li>Bluetooth and USB: backends can access Bluetooth and USB printers through IOKit. <em>Filters cannot access Bluetooth and USB printers directly.</em></li>
|
||||
|
||||
<li>Network: filters and backends can access UNIX domain sockets under the <var>/private/tmp</var>, <var>/private/var/run</var>, and <var>/private/var/tmp</var> directories. Backends can also create IPv4 and IPv6 TCP (outgoing) and UDP (incoming and outgoing) socket, and bind to local source ports. <em>Filters cannot directly create IPv4 and IPv6 TCP or UDP sockets.</em></li>
|
||||
|
||||
<li>Notifications: filters and backends can send notifications via the Darwin <code>notify_post()</code> API.</li>
|
||||
|
||||
</ol>
|
||||
|
||||
<blockquote><b>Note:</b> The sandbox profile used in CUPS 2.0 still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</blockquote>
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário