Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 7d2950f11a |
@@ -0,0 +1,835 @@
|
||||
CHANGES-1.4.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V1.4.7
|
||||
|
||||
- Documentation changes (STR #3710, STR #3720, STR #3745, STR #3750,
|
||||
STR #3757, STR #3758, STR #3782, STR #3826, STR #3829, STR #3837)
|
||||
- Web interface fixes (STR #3412, STR #3345, STR #3455, STR #3707,
|
||||
STR #3755, STR #3769, STR #3783)
|
||||
- Configure script fixes (STR #3659, STR #3691)
|
||||
- Compilation fixes (STR #3718, STR #3771, STR #3774)
|
||||
- The scheduler might leave old job data files in the spool directory
|
||||
(STR #3795)
|
||||
- CUPS did not work with locales using the ASCII character set
|
||||
(STR #3832)
|
||||
- httpAddrString() did not return a URI-style IPv6 numeric address
|
||||
(STR #3814)
|
||||
- Fixed an issue when reading compressed CUPS raster streams (STR #3812)
|
||||
- Fixed an issue with PostScript printer auto-configuration (STR #3443)
|
||||
- Fixed some compatibility issues with the libusb-based USB backend
|
||||
(STR #3799)
|
||||
- The network backends no longer try to collect SNMP supply and status
|
||||
information for raw queues (STR #3809)
|
||||
- The DBUS notifier did not report job state changes (STR #3805)
|
||||
- The scheduler did not always report that the "normal" print-quality
|
||||
value was supported (STR #3803)
|
||||
- The gziptoany filter did not report the correct error if it was unable
|
||||
to write the uncompressed document to the next filter or backend in
|
||||
the chain (STR #3797)
|
||||
- The Epson and Oki 9-pin drivers had a bad resolution option
|
||||
(STR #3798)
|
||||
- The scheduler did not always register the correct default ICC profile
|
||||
on Mac OS X.
|
||||
- The scheduler did not use the job owner when authorizing access for
|
||||
the CUPS-Get-Document operation, preventing non-admins from accessing
|
||||
their own jobs.
|
||||
- CUPS did not work with some printers that incorrectly implemented the
|
||||
HTTP/1.1 standard (STR #3778, STR #3791)
|
||||
- The scheduler did not retry fax jobs properly.
|
||||
- The scheduler now recognizes an empty cupsCommands PPD keyword as
|
||||
meaning that CUPS commands are not supported for a printer (STR #3773)
|
||||
- Fixed a crash bug in the scheduler when the application/octet-stream
|
||||
MIME type was not defined (STR #3690)
|
||||
- Polled printers were advertised more slowly than necessary (STR #3574)
|
||||
- cupsResolveConflicts() did not handle resolving multiple UIConstraints
|
||||
issues (STR #3705)
|
||||
- The SetEnv and PassEnv directives had no effect (STR #3664)
|
||||
- The libusb-based USB backend printed slowly to the LaserJet 1300 and
|
||||
other printers (STR #3405)
|
||||
- "lp" and "lpr" failed to print with Kerberos enabled (STR #3768)
|
||||
- The cupsctl program now displays an error if you try to directly set
|
||||
the Port or Listen directives (STR #3749)
|
||||
- PPD files with "*JobPatchFile: bla" no longer fail to load in relaxed
|
||||
conformance mode (STR #3747)
|
||||
- The scheduler generated a bad notify-text string for printer state
|
||||
change notifications (STR #3739)
|
||||
- The scheduler incorrectly updated printers.conf when it really needed
|
||||
to update classes.conf or remote.cache (STR #3726)
|
||||
- Hardwired remote printers with options did not work (STR #3717)
|
||||
- Accessing the CUPS web interface using a CNAME-based hostname would
|
||||
sometimes fail due to redirection to the actual hostname (STR #3701)
|
||||
- Subscription events had a misspelled attribute (STR #3693)
|
||||
- "make check" failed if LC_MESSAGES was set (STR #3765)
|
||||
- Fixed the configure script to always look for the pkg-config script
|
||||
(STR #3761)
|
||||
- The scheduler now only looks up interface hostnames if HostNameLookups
|
||||
are enabled (STR #3737)
|
||||
- Fixed a compilation problem on DragonFly BSD (STR #3738)
|
||||
- The default PageLogFormat value had the username and job ID swapped
|
||||
from CUPS 1.3.x (STR #3727)
|
||||
- The scheduler could crash if a browsed printer times out while a job
|
||||
is printing (STR #3754)
|
||||
- The scheduler incorrectly mapped custom page sizes to standard sizes
|
||||
(STR #3764)
|
||||
- cupsfilter and pstops did not map IPP attributes to PPD options due to
|
||||
a change in cupsMarkOptions (STR #3756)
|
||||
- The scheduler did not always show the most recent status message from
|
||||
the print filters (STR #3731)
|
||||
- The PostScript filter did not apply the mirror and number-up options
|
||||
properly, leading to offset and clipped output (STR #3732)
|
||||
- The network backends always reported "low toner" or "out of toner"
|
||||
states, even for inkjet printers (STR #3733)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.6
|
||||
|
||||
- Fixed a "make check" issue on Solaris (STR #3729)
|
||||
- Regression: The pstops filter did not support landscape printing of
|
||||
PostScript files (STR #3722)
|
||||
- The scheduler killed retried (fax) jobs after restarting them
|
||||
(STR #3697)
|
||||
- The cupsAdminSetServerSettings() function disabled sharing when
|
||||
debug logging was enabled (STR #3712)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.5
|
||||
|
||||
- Documentation fixes (STR #3542, STR #3650)
|
||||
- Localization fixes (STR #3635, STR #3636, STR #3647, STR #3666)
|
||||
- Security: Fixed a memory corruption bug reported in CVE-2010-2941
|
||||
(STR #3648)
|
||||
- The CUPS API incorrectly mapped the HTTP_UNAUTHORIZED status to the
|
||||
IPP_NOT_AUTHORIZED status code, when IPP_NOT_AUTHENTICATED would be
|
||||
the correct mapping (STR #3684)
|
||||
- The scheduler would restart jobs while shutting down (STR #3679)
|
||||
- Fixed a PPD loader bug that could cause a crash in cupsd (STR #3680)
|
||||
- Improved the mapping of non-standard PPD and PWG names (STR #3671)
|
||||
- The scheduler did not initialize Kerberos in all cases (STR #3662)
|
||||
- cupsAdminSetServerSettings duplicated Listen and Order lines
|
||||
(STR #3645)
|
||||
- Added DeviceN colorspace support to the CUPS Raster format (STR #3419)
|
||||
- ppdMarkDefaults() did not clear the marked field of the previous
|
||||
choices (STR #3642)
|
||||
- The serial backend would not allow a raw job to be canceled
|
||||
(STR #3649)
|
||||
- The socket backend could go into an infinite loop with certain
|
||||
printers (STR #3622)
|
||||
- Setting the PRINTER or LPDEST environment variables to "name/instance"
|
||||
did not work (STR #3485)
|
||||
- The scheduler did not handle the JobRetryLimit setting properly
|
||||
(STR #3466)
|
||||
- The lpstat command always showed a remote job ID of 0 for shared
|
||||
printers (STR #3627)
|
||||
- Increased the write timeout for the libusb-based USB backend to 5
|
||||
minutes (STR #3595)
|
||||
- The libusb-base USB backend did not check whether the printer has a
|
||||
serial number (STR #3590)
|
||||
- The lpadmin command did not support setting of custom option values
|
||||
(STR #3631)
|
||||
- The lpadmin command did not support setting of the location or
|
||||
description of a class (STR #3613)
|
||||
- The cupsaddsmb command did not give up after too many failed attempts
|
||||
(STR #3615)
|
||||
- The CUPS library no longer uses certain problematic ctype macros that
|
||||
change based on the locale's character set.
|
||||
- PJL value substitution of more than 9 values was broken (STR #3621)
|
||||
- Custom options with missing string values caused ppdEmit* to segfault
|
||||
(STR #3620)
|
||||
- Fixed an issue with the Italian version of the web interface
|
||||
(STR #3624)
|
||||
- Fixed the Solaris SMF configuration file for cups-lpd (STR #3611)
|
||||
- The scheduler did not set the notify-subscribed-event attribute when
|
||||
delivering printer-added or printer-modified events (STR #3608)
|
||||
- The mailto notifier could get into an infinite loop (STR #3609)
|
||||
- Date/time information was not shown in banner pages.
|
||||
- Relational operators were broken in #if/#elif/#else/#endif expressions
|
||||
for the PPD compiler.
|
||||
- Moving a job via the web interface failed without asking for
|
||||
authentication (STR #3559)
|
||||
- The scheduler now clears the printer-state-reasons when the driver is
|
||||
changed (STR #3570)
|
||||
- The web interface did not allow a user to change the driver
|
||||
(STR #3537, STR #3601)
|
||||
- The scheduler was not setting the PATH_INFO environment variable when
|
||||
needed (STR #3600)
|
||||
- The scheduler incorrectly set the CUPSD_AUTH_TYPE environment
|
||||
variable instead of AUTH_TYPE (STR #3599)
|
||||
- Fixed a buffer overrun in the PPD compiler (STR #3594)
|
||||
- Fixed some additional IPP job template attribute mapping issues in the
|
||||
scheduler.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.4
|
||||
|
||||
- Documentation updates (STR #3453, STR #3527, STR #3528, STR #3529)
|
||||
- Security: The fix for CVE-2009-3553 was incomplete (STR #3490)
|
||||
- Security: The texttops filter did not check the results of allocations
|
||||
(STR #3516)
|
||||
- Security: The web admin interface could disclose the contents of
|
||||
memory (STR #3577)
|
||||
- Security: CUPS could overwrite files as root in directories owned or
|
||||
writable by non-root users (STR #3510)
|
||||
- The cups-config utility did not return the correct linker options on
|
||||
AIX (STR #3587)
|
||||
- Fixed some IPP conformance issues with the scheduler's
|
||||
ippget-event-life, operations-supported, output-bin, and sides
|
||||
attributes (STR #3554)
|
||||
- The OpenSSL interfaces have been made thread-safe and the GNU TLS
|
||||
interface is explicitly forbidden when threading is enabled
|
||||
(STR #3461)
|
||||
- Fixed an IPP conformance issue with the scheduler's Send-Document
|
||||
implementation (STR #3514)
|
||||
- Added additional validation checks for the 1284 device ID (STR #3534)
|
||||
- Fixed a problem with the RPM spec file (STR #3544)
|
||||
- The lpstat command did not limit the job list to the specified
|
||||
printers (STR #3541)
|
||||
- The cupsfilter command did not set the RIP_MAX_CACHE environment
|
||||
variable (STR #3531)
|
||||
- Fixed support for media-col and page size variants (STR #3394)
|
||||
- The PostScript filter did not support all media selection options for
|
||||
the first page (STR #3525)
|
||||
- The scheduler did not always remove job control files (STR #3425)
|
||||
- The scheduler could crash on restart if classes were defined
|
||||
(STR #3524)
|
||||
- The scheduler no longer looks up network interface hostnames by
|
||||
default on Mac OS X (STR #3523)
|
||||
- ippWriteIO did not write collection (member) attributes properly in
|
||||
all cases (STR #3521)
|
||||
- The "cupsctl --remote-any" and corresponding web interface check box
|
||||
(allow printing from the Internet) did not work reliably (STR #3520)
|
||||
- The lpq and lpr commands would sometimes choose different default
|
||||
printers (STR #3503)
|
||||
- cupsDo*Request did not flush error text, leading to multiple issues
|
||||
(STR #3325, STR #3519)
|
||||
- cupsDoAuthentication did not cancel password authentication after 3
|
||||
failures (STR #3518)
|
||||
- Fixed several LDAP browsing bugs (STR #3392)
|
||||
- The Dymo driver did not support copies (STR #3457)
|
||||
- The scheduler did not update the classes.conf file when deleting a
|
||||
printer belonging to a class (STR #3505)
|
||||
- The lppasswd command did not use localized password prompts
|
||||
(STR #3492)
|
||||
- The socket backend no longer waits for back-channel data on platforms
|
||||
other than Mac OS X (STR #3495)
|
||||
- The scheduler didn't send events when a printer started accepting or
|
||||
rejecting jobs (STR #3480)
|
||||
- The web interface now includes additional CSRF protection (STR #3498)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.3
|
||||
|
||||
- SECURITY: The scheduler could try responding on a closed client
|
||||
connection, leading to a crash (STR #3200)
|
||||
- SECURITY: The lppasswd program allowed the localization files to be
|
||||
overridden when running in setuid mode (STR #3482)
|
||||
- Localization updates (STR #3352, STR #3409, STR #3422, STR #3452,
|
||||
STR #3473, STR #3502)
|
||||
- Documentation updates (STR #3451, STR #3504)
|
||||
- The IPP backend now sets the printer-state-message to "Ready to
|
||||
print." at the end of a successful job (STR #3460)
|
||||
- The PPD compiler did not correctly add the manufacturer to the output
|
||||
filename when using the "-m" option (STR #3469)
|
||||
- The IPP backend did not handle authentication properly for the Get-
|
||||
Printer-Attributes operation (STR 3458)
|
||||
- Getting SNMP values larger than 127 bytes did not work.
|
||||
- IPP conformance: Get-Jobs has a default value for requested-attributes
|
||||
(STR #3383)
|
||||
- cupsPrintFiles() did not report all errors (STR #3449)
|
||||
- cupsAddDest() could read freed memory (STR #3448)
|
||||
- The DBUS notifier did not build (STR #3447)
|
||||
- The scheduler would crash when an active printer was deleted.
|
||||
- The snmp backend did not work with some printers (STR #3413)
|
||||
- The web interface did not show the conflicting values when setting
|
||||
options (STR #3440)
|
||||
- Setting options in the web interface did not always work (STR #3439)
|
||||
- The scheduler did not use the Get-Job-Attributes policy for a printer
|
||||
(STR #3431)
|
||||
- The scheduler added two job-name attributes to each job object
|
||||
(STR #3428)
|
||||
- CSS files would not print (STR #3442)
|
||||
- The scheduler did not clean out completed jobs when PreserveJobHistory
|
||||
was turned off (STR #3425)
|
||||
- The web interface did not show completed jobs for a printer
|
||||
(STR #3436)
|
||||
- Authenticated printing did not always work when printing directly to
|
||||
a remote server (STR #3435)
|
||||
- The USB backend did not work on Solaris (STR #3423)
|
||||
- cupstestppd didn't catch problems with JobPatchFile definitions
|
||||
(STR #3421)
|
||||
- The socket backend could crash if a SNMP string had a negative length.
|
||||
- Fixed some termination issues with the USB backend on Mac OS X.
|
||||
- The side-channel APIs did not handle interrupts properly.
|
||||
- The network backends incorrectly cleared the media-empty-warning
|
||||
state.
|
||||
- The web interface did not allow users to successfully add serial
|
||||
printers (STR #3391)
|
||||
- cupsTempFd() did not work in some situations (STR #3382)
|
||||
- Some C API headers were missing C++ wrapper logic.
|
||||
- The PPD compiler did not localize single-language PPD options properly
|
||||
(STR #3386)
|
||||
- Modifying a printer from the web interface sometimes caused the wrong
|
||||
driver to be selected (STR #3418)
|
||||
- The scheduler did not handle out-of-memory conditions properly when
|
||||
loading a job (STR #3407)
|
||||
- When adding printers from the web interface, the dynamic updates of
|
||||
the device list made it hard to pick a device (STR #3406)
|
||||
- Fixed a typo in the web interface admin page template (STR 3403)
|
||||
- The web interface did not preserve the "printer is shared" state when
|
||||
modifying a printer (STR #3390)
|
||||
- The PPD compiler incorrectly inserted translations of empty strings
|
||||
(STR #3411)
|
||||
- The scheduler did not reset the SIGPIPE handler of child processes
|
||||
(STR #3399)
|
||||
- cupsGetNamedDest() incorrectly returned the default printer if the
|
||||
named printer did not exist (STR #3397)
|
||||
- Fixed a GNU TLS error handling bug (STR #3381)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.2
|
||||
|
||||
- SECURITY: The CUPS web interface was vulnerable to several XSS and
|
||||
HTTP header/body attacks via attribute injection (STR #3367,
|
||||
STR #3401)
|
||||
- Fixed localization errors (STR #3359, STR #3372, STR #3380, STR #3387)
|
||||
- The documentation for classes.conf and printers.conf did not provide
|
||||
the correct instructions for manual changes (STR #3351)
|
||||
- The scheduler did not always rebuild printer cache files when the
|
||||
driver was changed (STR #3356)
|
||||
- The documentation makefile failed to install localizations when using
|
||||
newer versions of Bash (STR #3360)
|
||||
- The configure script did not use the --with-xinetd value for the
|
||||
default LPD configuration path (STR #3347)
|
||||
- The configure script incorrectly required glib for DBUS support
|
||||
(STR #3346)
|
||||
- The cupstestppd program incorrectly reported filters with bad
|
||||
permisssions as missing (STR #3363)
|
||||
- The cups.desktop file used the wrong locale names (STR #3358)
|
||||
- cupsSideChannelRead() did not return an error for short reads.
|
||||
- The installed PAM configuration file did not use the correct options
|
||||
with the pam_unix2 module (STR #3313)
|
||||
- The scheduler did not preserve default options that contained special
|
||||
characters (STR #3340)
|
||||
- The scheduler did not remove old pre-filters when updating a printer
|
||||
driver (STR #3342)
|
||||
- The HP/GL-2 filter did not check for early end-of-file (STR #3319)
|
||||
- The USB backend did not compile on some platforms (STR #3332)
|
||||
- cupsSideChannelSNMPWalk() could go into an infinite loop with broken
|
||||
SNMP implementations.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.1
|
||||
|
||||
- Documention fixes (STR #3296)
|
||||
- SNMP supply levels and states were wrong for some printers.
|
||||
- The IPP backend did not update the auth-info-required value.
|
||||
- The libusb-based USB backend would hang at the end of the job
|
||||
(STR #3315, STR #3318)
|
||||
- DNS-SD registrations for raw queues had an empty "ty" key (STR #3299)
|
||||
- The JPEG and BMP MIME type rules were broken (STR #3284)
|
||||
- cupsGetNamedDest returned the default printer when the named
|
||||
destination did not exist (STR #3285)
|
||||
- The JobKillDelay was not triggered for canceled jobs (STR #3292)
|
||||
- The PPD compiler could get in an infinite loop (STR #3293)
|
||||
- The configure check for dns-sd.h was broken (STR #3297)
|
||||
- The "Query Printer for Default Options" page did not go away if the
|
||||
query job was held (STR #3302)
|
||||
- Boolean options did not show up as selected in the web interface
|
||||
(STR #3303)
|
||||
- The scheduler did not cache or report driver information files
|
||||
correctly, leading to a variety of issues (STR #3283, STR #3297,
|
||||
STR #3305)
|
||||
- cupsDoIORequest() did not abort on permanent errors (STR #3311)
|
||||
- Modifying a class in the web interface did not work (STR #3312)
|
||||
- BrowseLocalProtocols could be cleared when changing the sharing
|
||||
setting (STR #3287)
|
||||
- The scheduler could return an empty supported document format
|
||||
(STR #3308)
|
||||
- The PPD compiler generated invalid PPD files when the locale used
|
||||
something other than "." for the decimal point (STR #3300)
|
||||
- The IPP backend did not handle some non-comforming IPP printer
|
||||
implementations (STR #3262)
|
||||
- The scheduler leaked three file descriptors to each job filter
|
||||
(STR #3263)
|
||||
- The scheduler now uses a default CUPS-Get-Devices timeout of 15
|
||||
seconds (STR #3307)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.0
|
||||
|
||||
- Localization updates (STR #3223, STR #3246, STR #3248, STR #3250)
|
||||
- Documentation updates (STR #3225, STR #3230, STR #3242, STR #3260)
|
||||
- The --with-pdftops configure option did not accept a full path to the
|
||||
filter (STR #3278)
|
||||
- The banner filter did not position the back side image correctly
|
||||
(STR #3277)
|
||||
- The dnssd backend could crash (STR #3272)
|
||||
- The 1284 device ID sometimes contained trailing garbage (STR #3266)
|
||||
- The USB backend returned different URIs for some printers than in
|
||||
CUPS 1.3 (STR #3259)
|
||||
- The scheduler did not do local job-hold-until processing for remote
|
||||
queues (STR #3258)
|
||||
- The scheduler did not try all possible SSL certificates on Mac OS X.
|
||||
- The scheduler did not always remove a file descriptor when using the
|
||||
kqueue interface (STR #3256)
|
||||
- The scheduler did not protect against bad job control files in all
|
||||
cases (STR #3253)
|
||||
- The scheduler did not encode "+" in model names (STR #3254)
|
||||
- The web interface didn't show the default options (STR #3244)
|
||||
- The IPP and LPD backends needed print data before they would do an
|
||||
SNMP query.
|
||||
- Fixed a GNU TLS compatibility issue (STR #3231)
|
||||
- Fixed a HTML error in the add and modify printer web interface
|
||||
templates (STR #3229)
|
||||
- The scheduler did not minimize the number of printer state events that
|
||||
were generated by filter STATE: messages, which could lead to poor
|
||||
performance.
|
||||
- The USB backend on Mac OS X did not cleanly cancel a job.
|
||||
- The network backends now set the connecting-to-device printer-state-
|
||||
reasons value when looking up the address and copying the print data
|
||||
for consistency.
|
||||
- The scheduler now supports the com.apple.print.recoverable-warning
|
||||
reason on all platforms.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4rc1
|
||||
|
||||
- The PPD compiler documentation was missing information on localization
|
||||
(STR #3212)
|
||||
- The IPP backend now reconnects after every request when talking to
|
||||
printers that claim IPP support but only use HTTP/1.0.
|
||||
- The PPD compiler crashed when both "Resolution" and "Group foo Option
|
||||
Resolution" were specified in the .drv file.
|
||||
- The PPD compiler's #if/#elif/#else/#endif did not work for undefined
|
||||
variables (STR #3210)
|
||||
- Static libraries could not be installed by a non-root user on systems
|
||||
needing a ranlib program (STR #3209)
|
||||
- The scheduler incorrectly always tried to copy Kerberos credentials
|
||||
for print jobs.
|
||||
- Updated the Spanish localization (STR #3204)
|
||||
- The scheduler crashed when getting the default paper size from
|
||||
libpaper (STR #3205, STR #3206)
|
||||
- The PPD compiler now defines six variables: CUPS_VERSION,
|
||||
CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, CUPS_VERSION_PATCH,
|
||||
PLATFORM_NAME, and PLATFORM_ARCH (STR #3203)
|
||||
- Fixed a whitespace skipping bug in cupsRasterInterpretPPD.
|
||||
- The scheduler did not return HTTP 403 (Forbidden) for authenticated
|
||||
users that were not authorized to do IPP operations (STR #3193)
|
||||
- The scheduler did not report more than 8 Product strings from a PPD
|
||||
file. Some PPD files have as many as 24.
|
||||
- ppdOpen*() could crash if a keyword had no value string (something
|
||||
that cupstestppd looks for...)
|
||||
- cupsLangDefault() did not return the correct language on Mac OS X.
|
||||
- The Mac OS X USB backend did not handle aborted or stalled pipe
|
||||
conditions properly, which prevented drivers from ejecting partial
|
||||
pages when a job was canceled or held.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4b3
|
||||
|
||||
- Documentation fixes (STR #3044, STR #3057, STR #3153, STR #3158,
|
||||
STR #3173)
|
||||
- Added complete localizations for German, Japanese, Polish, and
|
||||
Russian and partial localizations for Chinese, Danish, Finnish,
|
||||
French, Italian, Korean, Norwegian, Portuguese, and Swedish
|
||||
(STR #3096, STR #3098, STR #3109, STR #3111, STR #3141)
|
||||
- Updated the configure check for -fstack-protector (STR #3198)
|
||||
- The network backends now correctly convert SNMP supply descriptions to
|
||||
UTF-8 encoding as needed.
|
||||
- The scheduler could crash when deleting an attribute (STR #3197)
|
||||
- The cups-driverd program did not detect symlink loops (STR #3185)
|
||||
- The EPSON 24-pin series driver should now feed the correct amount
|
||||
(STR #2624)
|
||||
- The scheduler now automatically logs the last N debug messages for
|
||||
failed print jobs.
|
||||
- You can now modify a raw print queue (STR #3133)
|
||||
- Fixed a number of ppdi issues and added a unit test to validate that
|
||||
ppdc + ppdi can generate and import the same data (STR #3152)
|
||||
- Moving jobs in the web interface now shows an error if you only have
|
||||
one printer or class added (STR #3094)
|
||||
- Since classes have never truly supported the printer-error-policy
|
||||
stuff added in CUPS 1.2, update the code to reflect the current
|
||||
reality and support only the retry-current-job policy for now
|
||||
(STR #3171)
|
||||
- Revised the password callback support (STR #2953)
|
||||
- ppdEmit*() did not choose between PageSize and PageRegion properly.
|
||||
- Make some fairly substantial changes to the Kerberos support code so
|
||||
that CUPS can work in multi-realm environments and does not require
|
||||
delegatable credentials. Shared printing still requires delegation,
|
||||
however "delegation by policy" can be enabled in the KDC to make this
|
||||
all work.
|
||||
- "AccessLogLevel actions" did not hide client-error-not-found errors.
|
||||
- AP_FIRST_InputSlot did not work with number-up.
|
||||
- cupsBackChannelRead() and cupsBackChannelWrite() could fail due to a
|
||||
lack of kernel buffers.
|
||||
- The IPP and LPD backends did not respond to side-channel requests
|
||||
while copying print data to a temporary file.
|
||||
- cupsWriteRequestData() flushed the output buffer unnecessarily,
|
||||
causing reduced performance in some situations.
|
||||
- If a CGI process died before sending its MIME headers, the request
|
||||
would hang on the client.
|
||||
- The printer/class/job search feature on the web interface did not
|
||||
work (STR #3132)
|
||||
- The scheduler did not write the printers out for classes.
|
||||
- CUPS-Get-PPDs did not work properly when filtering by language,
|
||||
product, or psversion (STR #3136)
|
||||
- The scheduler now kills job filters when it takes more than 30 seconds
|
||||
(configurable) to cancel or hold the job.
|
||||
- The cupstestppd program did not validate the capitalization of
|
||||
filenames in the PPD file.
|
||||
- The cupstestppd program did not validate the PageSize and PageRegion
|
||||
values.
|
||||
- The cups-deviced helper program could miss reporting some backend
|
||||
devices (STR #3108)
|
||||
- The cupsSideChannelSNMP* functions did not work.
|
||||
- The scheduler could consume 100% CPU when jobs were canceled.
|
||||
- Clicking on "Select Another Make/Manufacturer" in the web interface
|
||||
incorrectly added the printer (STR #3095)
|
||||
- The scheduler no longer uses programs with insecure file
|
||||
permissions.
|
||||
- httpAssembleURI*() did not escape backslashes in hostnames.
|
||||
- The dnssd backend did not unquote "full names" before creating the
|
||||
device URI.
|
||||
- The scheduler now supports JobRetryInterval values less than 10
|
||||
seconds.
|
||||
- Updated the Spanish localization (STR #3090)
|
||||
- The scheduler did not redo Bonjour/DNS-SD registrations when updating
|
||||
them failed.
|
||||
- The "authenticated" policy incorrectly required authentication for
|
||||
status operations.
|
||||
- ppdOpen*() incorrectly loaded PPDs with multiple JobPatchFile
|
||||
keywords.
|
||||
- The network backends no longer report the SNMP "offline" or
|
||||
maintenance status bits since they are inconsistently implemented and
|
||||
often unreliable.
|
||||
- The scheduler no longer logs child processes killed via SIGKILL as
|
||||
"crashed".
|
||||
- The printer link shown on the "job moved" template was bad (STR #3085)
|
||||
- Updated the HTML templates to use the final HTML 4 DOCTYPE (STR #3086)
|
||||
- The scheduler did not track the "paused" reason properly if a
|
||||
printer had other reasons associated with it.
|
||||
- cupsSendRequest() did not clear old local certificate auth data.
|
||||
- The PPD compiler did not search for localization files properly
|
||||
(STR #3084)
|
||||
- cupsGetNamedDest() did not use the fallback default like
|
||||
cupsGetDests*() (STR #3082)
|
||||
- The scheduler now provides a LogTimeFormat directive to enable
|
||||
microseconds in the date and time that are logged.
|
||||
- The scheduler now provides a MultipleOperationTimeout directive to
|
||||
control the timeout for multi-file print jobs.
|
||||
- The configure script incorrectly allowed Avahi to be used for DNS-SD
|
||||
printer discovery (STR #3065)
|
||||
- The web interface and scheduler did not support URIs up to 1024 bytes
|
||||
in length (STR #3072)
|
||||
- Fixed pdftops issues with page sizes (STR #3063)
|
||||
- Fixed pdftops issues with Ghostscript (STR #3062)
|
||||
- The scheduler incorrectly registered default profiles for PostScript
|
||||
printers with no specified colorspace.
|
||||
- The scheduler incorrectly created an empty org.cups.printers.plist
|
||||
file on Mac OS X.
|
||||
- cupsGetPPD3() did not look for local PPDs in the right directory.
|
||||
- SNMP lookups via side-channel did not work for NULL-VALUE and
|
||||
and OCTET-STRING OIDs containing nul characters.
|
||||
- The libusb-based USB backend did not work.
|
||||
- The scheduler did not set the printer-commands attribute correctly
|
||||
for some PPDs.
|
||||
- The ppdi utility did not work.
|
||||
- The web interface no longer uses multi-part output with old or broken
|
||||
web browsers (STR #3049)
|
||||
- CUPS now conforms to the draft IPP/2.0 and IPP/2.1 specification.
|
||||
- Added a new cupsGetConflicts() API to get a list of conflicting
|
||||
options.
|
||||
- The PPD compiler didn't localize options or choices that did not
|
||||
have associated translation text (STR #3045)
|
||||
- Updated the Spanish localization (STR #3043)
|
||||
- Fixed build problems (STR #3040, STR #3047)
|
||||
- cupsResolveConflicts() did not resolve using the default option
|
||||
choice in some cases due to the mirror UIConstraints that are
|
||||
present in most PPD files.
|
||||
- The scheduler did not honor MIME type priorities.
|
||||
- The commandtops filter incorrectly used the JCLBegin code to end
|
||||
its jobs.
|
||||
- The default BrowseLocalProtocols value was not set properly.
|
||||
- Since the commandtops filter does not actually support ReportLevels
|
||||
all on its own, don't list that printer command by default for PS
|
||||
printers.
|
||||
- The scheduler did not give filters a chance to log errors or update
|
||||
printer attributes when a job was canceled.
|
||||
- The scheduler did not clear the "connecting-to-device" reason keyword
|
||||
when a job finished.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4b2
|
||||
|
||||
- Documentation updates (STR #2983, STR #2998, STR #3021)
|
||||
- The cupstestppd utility now validates the FileVersion and
|
||||
FormatVersion values in PPD files.
|
||||
- The default cupsd.conf file did not reflect the
|
||||
--with-local-protocols value set at compile-time (STR #3037)
|
||||
- The cupsGetPPD* APIs now create symlinks to local PPD files
|
||||
rather than copying them whenever possible.
|
||||
- Various performance optimizations in the string pool, dests, and
|
||||
options implementations.
|
||||
- The cupsGetDests* APIs now return the marker and printer-commands
|
||||
attributes.
|
||||
- Side-channel SNMP lookups would not work when cupsSNMPSupplies
|
||||
was set to False in the PPD file.
|
||||
- Localized the device descriptions for the SCSI, serial,
|
||||
and network backends (STR #3014)
|
||||
- Added a Spanish localization (STR #3015)
|
||||
- Added support for marker-low-levels and marker-high-levels
|
||||
attributes.
|
||||
- The scheduler could hang writing a long log line.
|
||||
- The cupsGetDevices() function now has an "include_schemes"
|
||||
parameter.
|
||||
- The lpinfo command now supports --include-schemes and
|
||||
--exclude-schemes options.
|
||||
- The CUPS-Get-PPDs operation now supports the include-schemes
|
||||
and exclude-schemes attributes.
|
||||
- The CUPS-Get-Devices operation now supports the include-schemes
|
||||
attribute.
|
||||
- The print filters now support a replacement for the fitplot
|
||||
option called "fit-to-page".
|
||||
- The LPD backend no longer tries to collect page accounting
|
||||
information since the LPD protocol does not allow us to
|
||||
prevent race conditions.
|
||||
- The scheduler did not save the last marker-change-time value.
|
||||
- Fixed a problem with printing to some IPP printers, including
|
||||
CUPS 1.1.x.
|
||||
- Fixed a redirection problem with the printer web page (STR #3012)
|
||||
- Fixed a PPD compiler problem with the loading of message
|
||||
catalogs (STR #2990)
|
||||
- Fixed a PPD compiler problem with the loading of .strings files
|
||||
(STR #2989)
|
||||
- The cupsfilter utility did not set the CONTENT_TYPE environment
|
||||
variable when running filters.
|
||||
- The scheduler now waits to allow system sleep until the jobs
|
||||
have all stopped.
|
||||
- The IPP, LPD, and socket backends used different "connecting"
|
||||
progress messages.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4b1
|
||||
|
||||
- Documentation updates (STR #2567)
|
||||
- The PPD compiler now allows local message catalogs to
|
||||
override the standard CUPS translations (STR #2642)
|
||||
- The ppdmerge command did not merge custom option strings
|
||||
(STR #2863)
|
||||
- The scheduler now supports the Hold-New-Jobs and
|
||||
Release-Held-New-Jobs operations; these are exposed via the
|
||||
cupsdisable and cupsenable commands (STR #2332)
|
||||
- The lpstat command is now much faster when displaying the
|
||||
status of a single printer (STR #2843)
|
||||
- The scheduler now caches information from PPD files to provide
|
||||
significantly faster startup time with large numbers of PPDs
|
||||
(STR #1293)
|
||||
- CUPS-Get-Driver now provides much better driver matching based
|
||||
on the IEEE-1284 device ID and make/model strings (STR #2707)
|
||||
- Now support the cupsSNMPSupplies keyword to control whether
|
||||
the network backends query the SNMP Printer MIB for supply
|
||||
levels.
|
||||
- Now support and use a new banner file format for better text
|
||||
support and easier customization (STR #2490)
|
||||
- The scheduler now sets the PRINTER_INFO and PRINTER_LOCATION
|
||||
environment variables from the corresponding IPP attributes.
|
||||
- The ippRead*() and ippWrite*() functions no longer use a
|
||||
stack-based buffer (STR #2388)
|
||||
- The CUPS-Add-Modify-Printer operation now allows you to set
|
||||
the printer-state-reasons attribute.
|
||||
- The "set printer options" page now supports auto-configuration
|
||||
of printer options (STR #1440)
|
||||
- The web interface now provides an advanced server settings
|
||||
form.
|
||||
- The web interface's "modify printer" pages now make it
|
||||
easier to change just one setting (STR #1919)
|
||||
- The scheduler now supports a plist PrintcapFormat.
|
||||
- The scheduler now supports multiple addresses in Allow and
|
||||
Deny lines, just like Apache (STR #2947)
|
||||
- Added CUPS_JOBTYPE environment variable for job filters so
|
||||
they know whether they are printing a banner or document
|
||||
file (STR #2799)
|
||||
- Added support for printer filtering by the cupsfilter
|
||||
command (STR #2562)
|
||||
- Added a SSLOptions directive to allow Windows clients to
|
||||
talk to CUPS in FIPS mode (STR #2827)
|
||||
- Renamed the accept and reject commands to cupsaccept and
|
||||
cupsreject; the old names are still available (STR #2936)
|
||||
- The locale/translate utility needed an update to work with
|
||||
Google (STR #2882)
|
||||
- The lpstat command now supports a -H option to display the
|
||||
default server (STR #2833)
|
||||
- The scheduler now supports a FatalErrors directive to control
|
||||
which errors should cause the scheduler to exit (STR #2536)
|
||||
- The scheduler now uses the php-cgi program if it is available
|
||||
(STR #2923)
|
||||
- The scheduler now supports a DefaultPaperSize directive
|
||||
(STR #2848)
|
||||
- The scheduler now passes the job-originating-host-name
|
||||
value to filters in the options argument (STR #2558)
|
||||
- CUPS now supports job tickets in PDF files (STR #2903)
|
||||
- Added a DBUS notifier (STR #2529)
|
||||
- The LPD mini-daemon now passes the document name when queuing
|
||||
print jobs (STR #2482)
|
||||
- The IPP backend did not relay com.apple.print.recoverable-message
|
||||
values.
|
||||
- The scheduler now supports a job-media-progress attribute to
|
||||
track the progress of individual pages.
|
||||
- The sample HP driver now supports A5 (STR #2798)
|
||||
- The CUPS web interface menu item now uses the xdg-open
|
||||
command, when available (STR #2724)
|
||||
- The cups-lpd program now supports the -h option (STR #2794)
|
||||
- The scheduler now sets the PAM_TTY parameter and the
|
||||
PAM_ESTABLISH_CRED credential flag (STR #2745)
|
||||
- The scheduler now logs unsuccessful requests to the error_log
|
||||
file as errors (STR #2616)
|
||||
- Added support for a "retry-current-job" error policy that
|
||||
retries the current job immediately when the backend encounters
|
||||
an error (STR #2555)
|
||||
- The scheduler now returns a "forbidden" error when a user
|
||||
correctly authenticates but does not have permission to
|
||||
continue further (STR #2101)
|
||||
- The scheduler now loads both the server and CA certificates
|
||||
(if present) from the ServerCertificate file (STR #2146)
|
||||
- New RSS subscriptions now create their feed files immediately
|
||||
(STR #2853)
|
||||
- Added support for a device-location attribute which provides
|
||||
the physical location of a printer device.
|
||||
- Added a cupsBackendReport() API which handles quoting of the
|
||||
device data by a backend.
|
||||
- Added support for custom options in the web interface
|
||||
(STR #1729)
|
||||
- Added support for Mozilla LDAP, reconnection to LDAP servers,
|
||||
and improved LDAP performance (STR #1962)
|
||||
- Added Solaris SMF support (STR #1477)
|
||||
- Added optional support for using TCP wrappers to limit access
|
||||
to CUPS (STR #263)
|
||||
- Added ppdPageSizeLimits API.
|
||||
- Added support for new cupsMediaQualifier2, cupsMediaQualifier3,
|
||||
cupsMinSize, and cupsMaxSize attributes.
|
||||
- Added cupsResolveConflicts and ppdInstallableConflict APIs.
|
||||
- Added support for new cupsUIConstraints and cupsUIResolver
|
||||
attributes for better option conflict detection and
|
||||
resolution.
|
||||
- Increased the maximum size of 1284 device ID strings to
|
||||
256 bytes (STR #2877)
|
||||
- Added an AccessLogLevel directive to cupsd.conf to control
|
||||
what is logged to the access_log file.
|
||||
- The default LogLevel is now "warn" instead of "info" to reduce
|
||||
the amount of logging that is done to disk by default.
|
||||
- The PPD compiler did not include OID query keywords in PPD
|
||||
files (STR #2871)
|
||||
- The cups-driverd helper program now directly supports driver
|
||||
information files.
|
||||
- The USB backend now uses libusb when available (STR #1575)
|
||||
- Added ppdLocalizeAttr function to get the localized version
|
||||
of an attribute.
|
||||
- MIME types now support a priority() attribute (STR #2719)
|
||||
- The standard MIME types are now installed in
|
||||
DataDir/mime (STR #2719)
|
||||
- The lpoptions command now describes custom options and
|
||||
the necessary parameters (STR #2660)
|
||||
- The ppdmerge program did not support Simplified Chinese
|
||||
or Traditional Chinese language version strings (STR #2851)
|
||||
- The PPD compiler now supports localizable attributes
|
||||
(STR #2738)
|
||||
- The ppdpo utility now includes cupsIPPReasons values in
|
||||
the message catalogs it generates (STR #2754)
|
||||
- The PPD compiler now supports conditional directives
|
||||
(STR #2636)
|
||||
- The ppdc utility now supports a "-t" option to test PPD
|
||||
files (STR #2739)
|
||||
- The ppdc utility now supports a "-m" option to use the
|
||||
ModelName value as the output filename.
|
||||
- The ppdc utility now supports a FileName directive to
|
||||
set an alternate output filename (STR #2740)
|
||||
- The side-channel API now supports SNMP queries for the
|
||||
standard network backends.
|
||||
- Added a PageLogFormat directive to the cupsd.conf file to
|
||||
control the format of lines in the page_log file.
|
||||
- Filters can now send PPD: messages to stderr to set PPD
|
||||
keywords like DefaultPageSize while a job is printing.
|
||||
- Added a mdns backend for discovery and printing to printers
|
||||
that advertise themselves via DNS-SD (Bonjour)
|
||||
- The ipp, lpd, and socket backends now support DNS-SD service
|
||||
name resolution.
|
||||
- The scheduler now uses a single shared file descriptor for
|
||||
all DNS-SD registrations (STR #2674)
|
||||
- The ipp, lpd, and socket backends now support SNMP-based
|
||||
page accounting and supply level monitoring (STR #1655)
|
||||
- Added support for cupsPJLDisplay attribute to control what
|
||||
PJL commands are used to display the job information.
|
||||
- Driver information files can now be installed in
|
||||
/Library/Printers/PPDs.drv on Mac OS X.
|
||||
- The CUPS image library now supports reading images larger
|
||||
than 2GB.
|
||||
- The scheduler now delays writing config and state files to
|
||||
reduce disk activity (STR #2684)
|
||||
- The CUPS-Get-Devices operation now supports the
|
||||
exclude-schemes and timeout attributes to control which
|
||||
backends are polled and for how long.
|
||||
- The cups-deviced helper application now runs backends in
|
||||
parallel to get the list of devices faster.
|
||||
- Added --enable-pap configure option.
|
||||
- The default cupsd.conf file now includes an "authenticated"
|
||||
policy which requires authentication for remote print jobs.
|
||||
- Added support for Czech and Hungarian in PPD files
|
||||
(STR #2735, STR #2736)
|
||||
- The PPD compiler tools now support Mac OS X .strings files
|
||||
for localization (STR #2737)
|
||||
- ppdOpen*() now default the colorspace member to PPD_CS_N
|
||||
when no DefaultColorSpace attribute is present in the PPD
|
||||
file.
|
||||
- The build system has been updated to support separate
|
||||
installation of data, program, header, and library files.
|
||||
- All support libraries are now built as shared libraries
|
||||
by default.
|
||||
- The scheduler now manages ICC color profiles on Mac OS X.
|
||||
- The network backends (ipp, lpd, socket) now support
|
||||
SNMP-based supply and page count monitoring (STR #1655)
|
||||
- The lppasswd program is no longer installed setuid to
|
||||
root to make the default installation more secure.
|
||||
- Added a new ppdLocalizeMarkerName() function to get
|
||||
the localized version of a marker-names value.
|
||||
- The scheduler now provides the printer-dns-sd-name
|
||||
attribute for printers shared via DNS-SD/Bonjour.
|
||||
- The pdftops filter now executes the Xpdf or poppler
|
||||
pdftops utility to convert PDF files (STR #1471)
|
||||
- Bonjour printer registrations now advertise as local or
|
||||
global based on the current access policies for the
|
||||
printer.
|
||||
- cupsGetDests*() and cupsSetDests*() now track the last
|
||||
used printer preference on Mac OS X.
|
||||
- Added a new streaming request API (STR #2261)
|
||||
- Added a new cupsGetNamedDest() function to the CUPS
|
||||
library for faster printing with lp and lpr (STR #2638)
|
||||
- The scheduler now sets the PAM RHOST value on systems
|
||||
that support it (STR #2637)
|
||||
- The scheduler now sandboxes child processes when
|
||||
possible.
|
||||
- The Cancel-Job operation now supports a purge-job
|
||||
attriibute to purge a specified job.
|
||||
- ppdEmit* and ppdCollect* now use the NonUIOrderDependency
|
||||
attributes for custom option selections.
|
||||
- The web interface now enables/disables the printer
|
||||
sharing (formerly publishing) controls based on the
|
||||
server-is-sharing-printers state (STR #2233)
|
||||
- The scheduler now tracks printer sharing via the
|
||||
server-is-sharing-printers attribute, and manages LPD
|
||||
and SMB sharing as well (STR #2233)
|
||||
- The web interface now allows you to go back to the make/
|
||||
manufacturer page if there is no matching printer driver
|
||||
on the model page (STR #2436)
|
||||
- The printer list now shows the default media, banner, and
|
||||
duplex options as well as the color and duplex capabilities
|
||||
of printers (STR #1175)
|
||||
- The web interface look-n-feel has been updated (STR #2492)
|
||||
- The scheduler now supports a CUPS-Get-Document operation
|
||||
that returns the specified print job document (STR #118)
|
||||
- The cupsfilter utility now supports a "-J jobid" option
|
||||
to filter the document from the specified job.
|
||||
- The scheduler (cupsd) now supports a new option (-t) to
|
||||
do a syntax check of the cupsd.conf file (STR #2003)
|
||||
- Added new cupsGetPPD3() API to allow applications to
|
||||
cache PPDs safely (STR #1473)
|
||||
- Added generic PostScript and PCL printer driver PPDs.
|
||||
+93
-738
@@ -1,743 +1,98 @@
|
||||
CHANGES.txt - 2010-11-11
|
||||
CHANGES.txt - 2011-05-20
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.4.5
|
||||
CHANGES IN CUPS V1.5b1
|
||||
|
||||
- Documentation fixes (STR #3542, STR #3650)
|
||||
- Localization fixes (STR #3635, STR #3636, STR #3647, STR #3666)
|
||||
- Security: Fixed a memory corruption bug reported in CVE-2010-2941
|
||||
(STR #3648)
|
||||
- The CUPS API incorrectly mapped the HTTP_UNAUTHORIZED status to the
|
||||
IPP_NOT_AUTHORIZED status code, when IPP_NOT_AUTHENTICATED would be
|
||||
the correct mapping (STR #3684)
|
||||
- The scheduler would restart jobs while shutting down (STR #3679)
|
||||
- Fixed a PPD loader bug that could cause a crash in cupsd (STR #3680)
|
||||
- Improved the mapping of non-standard PPD and PWG names (STR #3671)
|
||||
- The scheduler did not initialize Kerberos in all cases (STR #3662)
|
||||
- cupsAdminSetServerSettings duplicated Listen and Order lines
|
||||
(STR #3645)
|
||||
- Added DeviceN colorspace support to the CUPS Raster format (STR #3419)
|
||||
- ppdMarkDefaults() did not clear the marked field of the previous
|
||||
choices (STR #3642)
|
||||
- The serial backend would not allow a raw job to be canceled
|
||||
(STR #3649)
|
||||
- The socket backend could go into an infinite loop with certain
|
||||
printers (STR #3622)
|
||||
- Setting the PRINTER or LPDEST environment variables to "name/instance"
|
||||
did not work (STR #3485)
|
||||
- The scheduler did not handle the JobRetryLimit setting properly
|
||||
(STR #3466)
|
||||
- The lpstat command always showed a remote job ID of 0 for shared
|
||||
printers (STR #3627)
|
||||
- Increased the write timeout for the libusb-based USB backend to 5
|
||||
minutes (STR #3595)
|
||||
- The libusb-base USB backend did not check whether the printer has a
|
||||
serial number (STR #3590)
|
||||
- The lpadmin command did not support setting of custom option values
|
||||
(STR #3631)
|
||||
- The lpadmin command did not support setting of the location or
|
||||
description of a class (STR #3613)
|
||||
- The cupsaddsmb command did not give up after too many failed attempts
|
||||
(STR #3615)
|
||||
- The CUPS library no longer uses certain problematic ctype macros that
|
||||
change based on the locale's character set.
|
||||
- PJL value substitution of more than 9 values was broken (STR #3621)
|
||||
- Custom options with missing string values caused ppdEmit* to segfault
|
||||
(STR #3620)
|
||||
- Fixed an issue with the Italian version of the web interface
|
||||
(STR #3624)
|
||||
- Fixed the Solaris SMF configuration file for cups-lpd (STR #3611)
|
||||
- The scheduler did not set the notify-subscribed-event attribute when
|
||||
delivering printer-added or printer-modified events (STR #3608)
|
||||
- The mailto notifier could get into an infinite loop (STR #3609)
|
||||
- Date/time information was not shown in banner pages.
|
||||
- Relational operators were broken in #if/#elif/#else/#endif expressions
|
||||
for the PPD compiler.
|
||||
- Moving a job via the web interface failed without asking for
|
||||
authentication (STR #3559)
|
||||
- The scheduler now clears the printer-state-reasons when the driver is
|
||||
changed (STR #3570)
|
||||
- The web interface did not allow a user to change the driver
|
||||
(STR #3537, STR #3601)
|
||||
- The scheduler was not setting the PATH_INFO environment variable when
|
||||
needed (STR #3600)
|
||||
- The scheduler incorrectly set the CUPSD_AUTH_TYPE environment
|
||||
variable instead of AUTH_TYPE (STR #3599)
|
||||
- Fixed a buffer overrun in the PPD compiler (STR #3594)
|
||||
- Fixed some additional IPP job template attribute mapping issues in the
|
||||
scheduler.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.4
|
||||
|
||||
- Documentation updates (STR #3453, STR #3527, STR #3528, STR #3529)
|
||||
- Security: The texttops filter did not check the results of allocations
|
||||
(STR #3516)
|
||||
- Security: The fix for CVE-2009-3553 was incomplete (STR #3490)
|
||||
- Security: The web admin interface could disclose the contents of
|
||||
memory (STR #3577)
|
||||
- Security: CUPS could overwrite files as root in directories owned or
|
||||
writable by non-root users (STR #3510)
|
||||
- The cups-config utility did not return the correct linker options on
|
||||
AIX (STR #3587)
|
||||
- Fixed some IPP conformance issues with the scheduler's
|
||||
ippget-event-life, operations-supported, output-bin, and sides
|
||||
attributes (STR #3554)
|
||||
- The OpenSSL interfaces have been made thread-safe and the GNU TLS
|
||||
interface is explicitly forbidden when threading is enabled
|
||||
(STR #3461)
|
||||
- Fixed an IPP conformance issue with the scheduler's Send-Document
|
||||
implementation (STR #3514)
|
||||
- Added additional validation checks for the 1284 device ID (STR #3534)
|
||||
- Fixed a problem with the RPM spec file (STR #3544)
|
||||
- The lpstat command did not limit the job list to the specified
|
||||
printers (STR #3541)
|
||||
- The cupsfilter command did not set the RIP_MAX_CACHE environment
|
||||
variable (STR #3531)
|
||||
- Fixed support for media-col and page size variants (STR #3394)
|
||||
- The PostScript filter did not support all media selection options for
|
||||
the first page (STR #3525)
|
||||
- The scheduler did not always remove job control files (STR #3425)
|
||||
- The scheduler could crash on restart if classes were defined
|
||||
(STR #3524)
|
||||
- The scheduler no longer looks up network interface hostnames by
|
||||
default on Mac OS X (STR #3523)
|
||||
- ippWriteIO did not write collection (member) attributes properly in
|
||||
all cases (STR #3521)
|
||||
- The "cupsctl --remote-any" and corresponding web interface check box
|
||||
(allow printing from the Internet) did not work reliably (STR #3520)
|
||||
- The lpq and lpr commands would sometimes choose different default
|
||||
printers (STR #3503)
|
||||
- cupsDo*Request did not flush error text, leading to multiple issues
|
||||
(STR #3325, STR #3519)
|
||||
- cupsDoAuthentication did not cancel password authentication after 3
|
||||
failures (STR #3518)
|
||||
- Fixed several LDAP browsing bugs (STR #3392)
|
||||
- The Dymo driver did not support copies (STR #3457)
|
||||
- The scheduler did not update the classes.conf file when deleting a
|
||||
printer belonging to a class (STR #3505)
|
||||
- The lppasswd command did not use localized password prompts
|
||||
(STR #3492)
|
||||
- The socket backend no longer waits for back-channel data on platforms
|
||||
other than Mac OS X (STR #3495)
|
||||
- The scheduler didn't send events when a printer started accepting or
|
||||
rejecting jobs (STR #3480)
|
||||
- The web interface now includes additional CSRF protection (STR #3498)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.3
|
||||
|
||||
- SECURITY: The scheduler could try responding on a closed client
|
||||
connection, leading to a crash (STR #3200)
|
||||
- SECURITY: The lppasswd program allowed the localization files to be
|
||||
overridden when running in setuid mode (STR #3482)
|
||||
- Localization updates (STR #3352, STR #3409, STR #3422, STR #3452,
|
||||
STR #3473, STR #3502)
|
||||
- Documentation updates (STR #3451, STR #3504)
|
||||
- The IPP backend now sets the printer-state-message to "Ready to
|
||||
print." at the end of a successful job (STR #3460)
|
||||
- The PPD compiler did not correctly add the manufacturer to the output
|
||||
filename when using the "-m" option (STR #3469)
|
||||
- The IPP backend did not handle authentication properly for the Get-
|
||||
Printer-Attributes operation (STR 3458)
|
||||
- Getting SNMP values larger than 127 bytes did not work.
|
||||
- IPP conformance: Get-Jobs has a default value for requested-attributes
|
||||
(STR #3383)
|
||||
- cupsPrintFiles() did not report all errors (STR #3449)
|
||||
- cupsAddDest() could read freed memory (STR #3448)
|
||||
- The DBUS notifier did not build (STR #3447)
|
||||
- The scheduler would crash when an active printer was deleted.
|
||||
- The snmp backend did not work with some printers (STR #3413)
|
||||
- The web interface did not show the conflicting values when setting
|
||||
options (STR #3440)
|
||||
- Setting options in the web interface did not always work (STR #3439)
|
||||
- The scheduler did not use the Get-Job-Attributes policy for a printer
|
||||
(STR #3431)
|
||||
- The scheduler added two job-name attributes to each job object
|
||||
(STR #3428)
|
||||
- CSS files would not print (STR #3442)
|
||||
- The scheduler did not clean out completed jobs when PreserveJobHistory
|
||||
was turned off (STR #3425)
|
||||
- The web interface did not show completed jobs for a printer
|
||||
(STR #3436)
|
||||
- Authenticated printing did not always work when printing directly to
|
||||
a remote server (STR #3435)
|
||||
- The USB backend did not work on Solaris (STR #3423)
|
||||
- cupstestppd didn't catch problems with JobPatchFile definitions
|
||||
(STR #3421)
|
||||
- The socket backend could crash if a SNMP string had a negative length.
|
||||
- Fixed some termination issues with the USB backend on Mac OS X.
|
||||
- The side-channel APIs did not handle interrupts properly.
|
||||
- The network backends incorrectly cleared the media-empty-warning
|
||||
state.
|
||||
- The web interface did not allow users to successfully add serial
|
||||
printers (STR #3391)
|
||||
- cupsTempFd() did not work in some situations (STR #3382)
|
||||
- Some C API headers were missing C++ wrapper logic.
|
||||
- The PPD compiler did not localize single-language PPD options properly
|
||||
(STR #3386)
|
||||
- Modifying a printer from the web interface sometimes caused the wrong
|
||||
driver to be selected (STR #3418)
|
||||
- The scheduler did not handle out-of-memory conditions properly when
|
||||
loading a job (STR #3407)
|
||||
- When adding printers from the web interface, the dynamic updates of
|
||||
the device list made it hard to pick a device (STR #3406)
|
||||
- Fixed a typo in the web interface admin page template (STR 3403)
|
||||
- The web interface did not preserve the "printer is shared" state when
|
||||
modifying a printer (STR #3390)
|
||||
- The PPD compiler incorrectly inserted translations of empty strings
|
||||
(STR #3411)
|
||||
- The scheduler did not reset the SIGPIPE handler of child processes
|
||||
(STR #3399)
|
||||
- cupsGetNamedDest() incorrectly returned the default printer if the
|
||||
named printer did not exist (STR #3397)
|
||||
- Fixed a GNU TLS error handling bug (STR #3381)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.2
|
||||
|
||||
- SECURITY: The CUPS web interface was vulnerable to several XSS and
|
||||
HTTP header/body attacks via attribute injection (STR #3367,
|
||||
STR #3401)
|
||||
- Fixed localization errors (STR #3359, STR #3372, STR #3380, STR #3387)
|
||||
- The documentation for classes.conf and printers.conf did not provide
|
||||
the correct instructions for manual changes (STR #3351)
|
||||
- The scheduler did not always rebuild printer cache files when the
|
||||
driver was changed (STR #3356)
|
||||
- The documentation makefile failed to install localizations when using
|
||||
newer versions of Bash (STR #3360)
|
||||
- The configure script did not use the --with-xinetd value for the
|
||||
default LPD configuration path (STR #3347)
|
||||
- The configure script incorrectly required glib for DBUS support
|
||||
(STR #3346)
|
||||
- The cupstestppd program incorrectly reported filters with bad
|
||||
permisssions as missing (STR #3363)
|
||||
- The cups.desktop file used the wrong locale names (STR #3358)
|
||||
- cupsSideChannelRead() did not return an error for short reads.
|
||||
- The installed PAM configuration file did not use the correct options
|
||||
with the pam_unix2 module (STR #3313)
|
||||
- The scheduler did not preserve default options that contained special
|
||||
characters (STR #3340)
|
||||
- The scheduler did not remove old pre-filters when updating a printer
|
||||
driver (STR #3342)
|
||||
- The HP/GL-2 filter did not check for early end-of-file (STR #3319)
|
||||
- The USB backend did not compile on some platforms (STR #3332)
|
||||
- cupsSideChannelSNMPWalk() could go into an infinite loop with broken
|
||||
SNMP implementations.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.1
|
||||
|
||||
- Documention fixes (STR #3296)
|
||||
- SNMP supply levels and states were wrong for some printers.
|
||||
- The IPP backend did not update the auth-info-required value.
|
||||
- The libusb-based USB backend would hang at the end of the job
|
||||
(STR #3315, STR #3318)
|
||||
- DNS-SD registrations for raw queues had an empty "ty" key (STR #3299)
|
||||
- The JPEG and BMP MIME type rules were broken (STR #3284)
|
||||
- cupsGetNamedDest returned the default printer when the named
|
||||
destination did not exist (STR #3285)
|
||||
- The JobKillDelay was not triggered for canceled jobs (STR #3292)
|
||||
- The PPD compiler could get in an infinite loop (STR #3293)
|
||||
- The configure check for dns-sd.h was broken (STR #3297)
|
||||
- The "Query Printer for Default Options" page did not go away if the
|
||||
query job was held (STR #3302)
|
||||
- Boolean options did not show up as selected in the web interface
|
||||
(STR #3303)
|
||||
- The scheduler did not cache or report driver information files
|
||||
correctly, leading to a variety of issues (STR #3283, STR #3297,
|
||||
STR #3305)
|
||||
- cupsDoIORequest() did not abort on permanent errors (STR #3311)
|
||||
- Modifying a class in the web interface did not work (STR #3312)
|
||||
- BrowseLocalProtocols could be cleared when changing the sharing
|
||||
setting (STR #3287)
|
||||
- The scheduler could return an empty supported document format
|
||||
(STR #3308)
|
||||
- The PPD compiler generated invalid PPD files when the locale used
|
||||
something other than "." for the decimal point (STR #3300)
|
||||
- The IPP backend did not handle some non-comforming IPP printer
|
||||
implementations (STR #3262)
|
||||
- The scheduler leaked three file descriptors to each job filter
|
||||
(STR #3263)
|
||||
- The scheduler now uses a default CUPS-Get-Devices timeout of 15
|
||||
seconds (STR #3307)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.0
|
||||
|
||||
- Localization updates (STR #3223, STR #3246, STR #3248, STR #3250)
|
||||
- Documentation updates (STR #3225, STR #3230, STR #3242, STR #3260)
|
||||
- The --with-pdftops configure option did not accept a full path to the
|
||||
filter (STR #3278)
|
||||
- The banner filter did not position the back side image correctly
|
||||
(STR #3277)
|
||||
- The dnssd backend could crash (STR #3272)
|
||||
- The 1284 device ID sometimes contained trailing garbage (STR #3266)
|
||||
- The USB backend returned different URIs for some printers than in
|
||||
CUPS 1.3 (STR #3259)
|
||||
- The scheduler did not do local job-hold-until processing for remote
|
||||
queues (STR #3258)
|
||||
- The scheduler did not try all possible SSL certificates on Mac OS X.
|
||||
- The scheduler did not always remove a file descriptor when using the
|
||||
kqueue interface (STR #3256)
|
||||
- The scheduler did not protect against bad job control files in all
|
||||
cases (STR #3253)
|
||||
- The scheduler did not encode "+" in model names (STR #3254)
|
||||
- The web interface didn't show the default options (STR #3244)
|
||||
- The IPP and LPD backends needed print data before they would do an
|
||||
SNMP query.
|
||||
- Fixed a GNU TLS compatibility issue (STR #3231)
|
||||
- Fixed a HTML error in the add and modify printer web interface
|
||||
templates (STR #3229)
|
||||
- The scheduler did not minimize the number of printer state events that
|
||||
were generated by filter STATE: messages, which could lead to poor
|
||||
performance.
|
||||
- The USB backend on Mac OS X did not cleanly cancel a job.
|
||||
- The network backends now set the connecting-to-device printer-state-
|
||||
reasons value when looking up the address and copying the print data
|
||||
for consistency.
|
||||
- The scheduler now supports the com.apple.print.recoverable-warning
|
||||
reason on all platforms.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4rc1
|
||||
|
||||
- The PPD compiler documentation was missing information on localization
|
||||
(STR #3212)
|
||||
- The IPP backend now reconnects after every request when talking to
|
||||
printers that claim IPP support but only use HTTP/1.0.
|
||||
- The PPD compiler crashed when both "Resolution" and "Group foo Option
|
||||
Resolution" were specified in the .drv file.
|
||||
- The PPD compiler's #if/#elif/#else/#endif did not work for undefined
|
||||
variables (STR #3210)
|
||||
- Static libraries could not be installed by a non-root user on systems
|
||||
needing a ranlib program (STR #3209)
|
||||
- The scheduler incorrectly always tried to copy Kerberos credentials
|
||||
for print jobs.
|
||||
- Updated the Spanish localization (STR #3204)
|
||||
- The scheduler crashed when getting the default paper size from
|
||||
libpaper (STR #3205, STR #3206)
|
||||
- The PPD compiler now defines six variables: CUPS_VERSION,
|
||||
CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, CUPS_VERSION_PATCH,
|
||||
PLATFORM_NAME, and PLATFORM_ARCH (STR #3203)
|
||||
- Fixed a whitespace skipping bug in cupsRasterInterpretPPD.
|
||||
- The scheduler did not return HTTP 403 (Forbidden) for authenticated
|
||||
users that were not authorized to do IPP operations (STR #3193)
|
||||
- The scheduler did not report more than 8 Product strings from a PPD
|
||||
file. Some PPD files have as many as 24.
|
||||
- ppdOpen*() could crash if a keyword had no value string (something
|
||||
that cupstestppd looks for...)
|
||||
- cupsLangDefault() did not return the correct language on Mac OS X.
|
||||
- The Mac OS X USB backend did not handle aborted or stalled pipe
|
||||
conditions properly, which prevented drivers from ejecting partial
|
||||
pages when a job was canceled or held.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4b3
|
||||
|
||||
- Documentation fixes (STR #3044, STR #3057, STR #3153, STR #3158,
|
||||
STR #3173)
|
||||
- Added complete localizations for German, Japanese, Polish, and
|
||||
Russian and partial localizations for Chinese, Danish, Finnish,
|
||||
French, Italian, Korean, Norwegian, Portuguese, and Swedish
|
||||
(STR #3096, STR #3098, STR #3109, STR #3111, STR #3141)
|
||||
- Updated the configure check for -fstack-protector (STR #3198)
|
||||
- The network backends now correctly convert SNMP supply descriptions to
|
||||
UTF-8 encoding as needed.
|
||||
- The scheduler could crash when deleting an attribute (STR #3197)
|
||||
- The cups-driverd program did not detect symlink loops (STR #3185)
|
||||
- The EPSON 24-pin series driver should now feed the correct amount
|
||||
(STR #2624)
|
||||
- The scheduler now automatically logs the last N debug messages for
|
||||
failed print jobs.
|
||||
- You can now modify a raw print queue (STR #3133)
|
||||
- Fixed a number of ppdi issues and added a unit test to validate that
|
||||
ppdc + ppdi can generate and import the same data (STR #3152)
|
||||
- Moving jobs in the web interface now shows an error if you only have
|
||||
one printer or class added (STR #3094)
|
||||
- Since classes have never truly supported the printer-error-policy
|
||||
stuff added in CUPS 1.2, update the code to reflect the current
|
||||
reality and support only the retry-current-job policy for now
|
||||
(STR #3171)
|
||||
- Revised the password callback support (STR #2953)
|
||||
- ppdEmit*() did not choose between PageSize and PageRegion properly.
|
||||
- Make some fairly substantial changes to the Kerberos support code so
|
||||
that CUPS can work in multi-realm environments and does not require
|
||||
delegatable credentials. Shared printing still requires delegation,
|
||||
however "delegation by policy" can be enabled in the KDC to make this
|
||||
all work.
|
||||
- "AccessLogLevel actions" did not hide client-error-not-found errors.
|
||||
- AP_FIRST_InputSlot did not work with number-up.
|
||||
- cupsBackChannelRead() and cupsBackChannelWrite() could fail due to a
|
||||
lack of kernel buffers.
|
||||
- The IPP and LPD backends did not respond to side-channel requests
|
||||
while copying print data to a temporary file.
|
||||
- cupsWriteRequestData() flushed the output buffer unnecessarily,
|
||||
causing reduced performance in some situations.
|
||||
- If a CGI process died before sending its MIME headers, the request
|
||||
would hang on the client.
|
||||
- The printer/class/job search feature on the web interface did not
|
||||
work (STR #3132)
|
||||
- The scheduler did not write the printers out for classes.
|
||||
- CUPS-Get-PPDs did not work properly when filtering by language,
|
||||
product, or psversion (STR #3136)
|
||||
- The scheduler now kills job filters when it takes more than 30 seconds
|
||||
(configurable) to cancel or hold the job.
|
||||
- The cupstestppd program did not validate the capitalization of
|
||||
filenames in the PPD file.
|
||||
- The cupstestppd program did not validate the PageSize and PageRegion
|
||||
values.
|
||||
- The cups-deviced helper program could miss reporting some backend
|
||||
devices (STR #3108)
|
||||
- The cupsSideChannelSNMP* functions did not work.
|
||||
- The scheduler could consume 100% CPU when jobs were canceled.
|
||||
- Clicking on "Select Another Make/Manufacturer" in the web interface
|
||||
incorrectly added the printer (STR #3095)
|
||||
- The scheduler no longer uses programs with insecure file
|
||||
permissions.
|
||||
- httpAssembleURI*() did not escape backslashes in hostnames.
|
||||
- The dnssd backend did not unquote "full names" before creating the
|
||||
device URI.
|
||||
- The scheduler now supports JobRetryInterval values less than 10
|
||||
seconds.
|
||||
- Updated the Spanish localization (STR #3090)
|
||||
- The scheduler did not redo Bonjour/DNS-SD registrations when updating
|
||||
them failed.
|
||||
- The "authenticated" policy incorrectly required authentication for
|
||||
status operations.
|
||||
- ppdOpen*() incorrectly loaded PPDs with multiple JobPatchFile
|
||||
keywords.
|
||||
- The network backends no longer report the SNMP "offline" or
|
||||
maintenance status bits since they are inconsistently implemented and
|
||||
often unreliable.
|
||||
- The scheduler no longer logs child processes killed via SIGKILL as
|
||||
"crashed".
|
||||
- The printer link shown on the "job moved" template was bad (STR #3085)
|
||||
- Updated the HTML templates to use the final HTML 4 DOCTYPE (STR #3086)
|
||||
- The scheduler did not track the "paused" reason properly if a
|
||||
printer had other reasons associated with it.
|
||||
- cupsSendRequest() did not clear old local certificate auth data.
|
||||
- The PPD compiler did not search for localization files properly
|
||||
(STR #3084)
|
||||
- cupsGetNamedDest() did not use the fallback default like
|
||||
cupsGetDests*() (STR #3082)
|
||||
- The scheduler now provides a LogTimeFormat directive to enable
|
||||
microseconds in the date and time that are logged.
|
||||
- The scheduler now provides a MultipleOperationTimeout directive to
|
||||
control the timeout for multi-file print jobs.
|
||||
- The configure script incorrectly allowed Avahi to be used for DNS-SD
|
||||
printer discovery (STR #3065)
|
||||
- The web interface and scheduler did not support URIs up to 1024 bytes
|
||||
in length (STR #3072)
|
||||
- Fixed pdftops issues with page sizes (STR #3063)
|
||||
- Fixed pdftops issues with Ghostscript (STR #3062)
|
||||
- The scheduler incorrectly registered default profiles for PostScript
|
||||
printers with no specified colorspace.
|
||||
- The scheduler incorrectly created an empty org.cups.printers.plist
|
||||
file on Mac OS X.
|
||||
- cupsGetPPD3() did not look for local PPDs in the right directory.
|
||||
- SNMP lookups via side-channel did not work for NULL-VALUE and
|
||||
and OCTET-STRING OIDs containing nul characters.
|
||||
- The libusb-based USB backend did not work.
|
||||
- The scheduler did not set the printer-commands attribute correctly
|
||||
for some PPDs.
|
||||
- The ppdi utility did not work.
|
||||
- The web interface no longer uses multi-part output with old or broken
|
||||
web browsers (STR #3049)
|
||||
- CUPS now conforms to the draft IPP/2.0 and IPP/2.1 specification.
|
||||
- Added a new cupsGetConflicts() API to get a list of conflicting
|
||||
options.
|
||||
- The PPD compiler didn't localize options or choices that did not
|
||||
have associated translation text (STR #3045)
|
||||
- Updated the Spanish localization (STR #3043)
|
||||
- Fixed build problems (STR #3040, STR #3047)
|
||||
- cupsResolveConflicts() did not resolve using the default option
|
||||
choice in some cases due to the mirror UIConstraints that are
|
||||
present in most PPD files.
|
||||
- The scheduler did not honor MIME type priorities.
|
||||
- The commandtops filter incorrectly used the JCLBegin code to end
|
||||
its jobs.
|
||||
- The default BrowseLocalProtocols value was not set properly.
|
||||
- Since the commandtops filter does not actually support ReportLevels
|
||||
all on its own, don't list that printer command by default for PS
|
||||
- The CUPS library now supports per-connection HTTP timeouts and
|
||||
callbacks.
|
||||
- The CUPS library now supports (limited) SSL/TLS X.509 certificate
|
||||
validation and revocation (STR #1616)
|
||||
- Updated the PostScript filter to support IncludeFeature in more
|
||||
circumstances (STR #3417)
|
||||
- The schedule did not correctly parse some IPv6 addresses and masks in
|
||||
the cupsd.conf file (STR #3533)
|
||||
- Fixed a case-insensitive string comparison issue for locales that do
|
||||
not treat "I" and "i" as equivalent (STR #3800)
|
||||
- The scheduler reported an incorrect job-printer-uri value when sharing
|
||||
was not enabled (STR #3639)
|
||||
- The scheduler now allows the ServerAlias directive to contain multiple
|
||||
hostnames separated by spaces or commas (STR #3813)
|
||||
- The scheduler now sets the process group for child processes and
|
||||
manages the group (STR #2829)
|
||||
- Fixed some minor issues discovered by a Coverity scan (STR #3838)
|
||||
- The scheduler now more carefully creates and removes configuration,
|
||||
cache, and state files (STR #3715)
|
||||
- The lpadmin command now allows default option values to be deleted
|
||||
(STR #2959)
|
||||
- The lpadmin command now allows the cupsIPPSupplies and
|
||||
cupsSNMPSupplies keywords to be set in a PPD file (STR #3825)
|
||||
- Moving a held job no longer releases it (STR #3839)
|
||||
- Restored support for GNU TLS and OpenSSL with threading enabled
|
||||
(STR #3605)
|
||||
- Fixed a confusing error message from cups-polld (STR #3806)
|
||||
- Increased the default RIPCache value to 128MB (STR #3535)
|
||||
- MIME errors are now routed to the error_log file (STR #2410)
|
||||
- Updated PDF filter to support new Ghostscript ps2write device
|
||||
(STR #3766)
|
||||
- Updated PDF filter to support new Poppler option to preserve page
|
||||
sizes in PDF files when the user has not selected a particular media
|
||||
size (STR #3689)
|
||||
- Added new PWG Raster filter for IPP Everywhere printer support.
|
||||
- Added job-uuid, printer-uuid, and subscription-uuid attributes.
|
||||
- Added support for the cupsSingleFile PPD keyword.
|
||||
- Dropped support for the printer-state-history attribute (STR #3654)
|
||||
- Added support for a new cupsIPPSupplies keyword in PPD files to allow
|
||||
drivers to disable IPP supply level reporting.
|
||||
- Added support for a new cupsFilter2 keyword in PPD files to allow for
|
||||
the propagation of the actual MIME media type produced by a filter.
|
||||
- The scheduler did not always get the correct Kerberos username when
|
||||
authenticating (STR #3670)
|
||||
- Added new cupsRasterOpenIO function and CUPS_RASTER_WRITE_PWG to the
|
||||
CUPS imaging library to support printing to IPP Everywhere raster
|
||||
printers.
|
||||
- The scheduler did not give filters a chance to log errors or update
|
||||
printer attributes when a job was canceled.
|
||||
- The scheduler did not clear the "connecting-to-device" reason keyword
|
||||
when a job finished.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4b2
|
||||
|
||||
- Documentation updates (STR #2983, STR #2998, STR #3021)
|
||||
- The cupstestppd utility now validates the FileVersion and
|
||||
FormatVersion values in PPD files.
|
||||
- The default cupsd.conf file did not reflect the
|
||||
--with-local-protocols value set at compile-time (STR #3037)
|
||||
- The cupsGetPPD* APIs now create symlinks to local PPD files
|
||||
rather than copying them whenever possible.
|
||||
- Various performance optimizations in the string pool, dests, and
|
||||
options implementations.
|
||||
- The cupsGetDests* APIs now return the marker and printer-commands
|
||||
attributes.
|
||||
- Side-channel SNMP lookups would not work when cupsSNMPSupplies
|
||||
was set to False in the PPD file.
|
||||
- Localized the device descriptions for the SCSI, serial,
|
||||
and network backends (STR #3014)
|
||||
- Added a Spanish localization (STR #3015)
|
||||
- Added support for marker-low-levels and marker-high-levels
|
||||
attributes.
|
||||
- The scheduler could hang writing a long log line.
|
||||
- The cupsGetDevices() function now has an "include_schemes"
|
||||
parameter.
|
||||
- The lpinfo command now supports --include-schemes and
|
||||
--exclude-schemes options.
|
||||
- The CUPS-Get-PPDs operation now supports the include-schemes
|
||||
and exclude-schemes attributes.
|
||||
- The CUPS-Get-Devices operation now supports the include-schemes
|
||||
- The scheduler now provides default values for the pages-per-minute and
|
||||
pages-per-minute-color attributes for PPD files that lack a
|
||||
Throughput keyword.
|
||||
- Email notifications did not work on Mac OS X.
|
||||
- The cupstestppd program now shows an error for files missing a
|
||||
CloseGroup keyword (STR #3668)
|
||||
- Name resolution errors no longer cause queues to stop (STR #3719,
|
||||
STR #3753)
|
||||
- Added a new cups-exec helper program that applies security profiles
|
||||
to filters, port monitors, backends, CGI programs, and mini-daemons.
|
||||
- The web interface can now be disabled using the WebInterface directive
|
||||
in cupsd.conf (STR #2625)
|
||||
- The scheduler now provides privacy controls for jobs and subscriptions
|
||||
(STR #2969)
|
||||
- Added new cupsArrayNew3 API which offers memory management of array
|
||||
elements.
|
||||
- Added several new color spaces to the CUPS raster format (STR #3419)
|
||||
- The Validate-Job operation now uses the same policy as Print-Job by
|
||||
default.
|
||||
- CUPS now uses iconv to implement all of its character encoding
|
||||
support (STR #3097)
|
||||
- The scheduler now implements the Cancel-Jobs, Cancel-My-Jobs, and
|
||||
Close-Job operations along with the job-ids operation attribute from
|
||||
PWG 5100.11.
|
||||
- The main CUPS header (<cups/cups.h>) no longer includes the PPD header
|
||||
(<cups/ppd.h>).
|
||||
- The scheduler and CUPS API now support the print-quality job template
|
||||
attribute.
|
||||
- The print filters now support a replacement for the fitplot
|
||||
option called "fit-to-page".
|
||||
- The LPD backend no longer tries to collect page accounting
|
||||
information since the LPD protocol does not allow us to
|
||||
prevent race conditions.
|
||||
- The scheduler did not save the last marker-change-time value.
|
||||
- Fixed a problem with printing to some IPP printers, including
|
||||
CUPS 1.1.x.
|
||||
- Fixed a redirection problem with the printer web page (STR #3012)
|
||||
- Fixed a PPD compiler problem with the loading of message
|
||||
catalogs (STR #2990)
|
||||
- Fixed a PPD compiler problem with the loading of .strings files
|
||||
(STR #2989)
|
||||
- The cupsfilter utility did not set the CONTENT_TYPE environment
|
||||
variable when running filters.
|
||||
- The scheduler now waits to allow system sleep until the jobs
|
||||
have all stopped.
|
||||
- The IPP, LPD, and socket backends used different "connecting"
|
||||
progress messages.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4b1
|
||||
|
||||
- Documentation updates (STR #2567)
|
||||
- The PPD compiler now allows local message catalogs to
|
||||
override the standard CUPS translations (STR #2642)
|
||||
- The ppdmerge command did not merge custom option strings
|
||||
(STR #2863)
|
||||
- The scheduler now supports the Hold-New-Jobs and
|
||||
Release-Held-New-Jobs operations; these are exposed via the
|
||||
cupsdisable and cupsenable commands (STR #2332)
|
||||
- The lpstat command is now much faster when displaying the
|
||||
status of a single printer (STR #2843)
|
||||
- The scheduler now caches information from PPD files to provide
|
||||
significantly faster startup time with large numbers of PPDs
|
||||
(STR #1293)
|
||||
- CUPS-Get-Driver now provides much better driver matching based
|
||||
on the IEEE-1284 device ID and make/model strings (STR #2707)
|
||||
- Now support the cupsSNMPSupplies keyword to control whether
|
||||
the network backends query the SNMP Printer MIB for supply
|
||||
levels.
|
||||
- Now support and use a new banner file format for better text
|
||||
support and easier customization (STR #2490)
|
||||
- The scheduler now sets the PRINTER_INFO and PRINTER_LOCATION
|
||||
environment variables from the corresponding IPP attributes.
|
||||
- The ippRead*() and ippWrite*() functions no longer use a
|
||||
stack-based buffer (STR #2388)
|
||||
- The CUPS-Add-Modify-Printer operation now allows you to set
|
||||
the printer-state-reasons attribute.
|
||||
- The "set printer options" page now supports auto-configuration
|
||||
of printer options (STR #1440)
|
||||
- The web interface now provides an advanced server settings
|
||||
form.
|
||||
- The web interface's "modify printer" pages now make it
|
||||
easier to change just one setting (STR #1919)
|
||||
- The scheduler now supports a plist PrintcapFormat.
|
||||
- The scheduler now supports multiple addresses in Allow and
|
||||
Deny lines, just like Apache (STR #2947)
|
||||
- Added CUPS_JOBTYPE environment variable for job filters so
|
||||
they know whether they are printing a banner or document
|
||||
file (STR #2799)
|
||||
- Added support for printer filtering by the cupsfilter
|
||||
command (STR #2562)
|
||||
- Added a SSLOptions directive to allow Windows clients to
|
||||
talk to CUPS in FIPS mode (STR #2827)
|
||||
- Renamed the accept and reject commands to cupsaccept and
|
||||
cupsreject; the old names are still available (STR #2936)
|
||||
- The locale/translate utility needed an update to work with
|
||||
Google (STR #2882)
|
||||
- The lpstat command now supports a -H option to display the
|
||||
default server (STR #2833)
|
||||
- The scheduler now supports a FatalErrors directive to control
|
||||
which errors should cause the scheduler to exit (STR #2536)
|
||||
- The scheduler now uses the php-cgi program if it is available
|
||||
(STR #2923)
|
||||
- The scheduler now supports a DefaultPaperSize directive
|
||||
(STR #2848)
|
||||
- The scheduler now passes the job-originating-host-name
|
||||
value to filters in the options argument (STR #2558)
|
||||
- CUPS now supports job tickets in PDF files (STR #2903)
|
||||
- Added a DBUS notifier (STR #2529)
|
||||
- The LPD mini-daemon now passes the document name when queuing
|
||||
print jobs (STR #2482)
|
||||
- The IPP backend did not relay com.apple.print.recoverable-message
|
||||
values.
|
||||
- The scheduler now supports a job-media-progress attribute to
|
||||
track the progress of individual pages.
|
||||
- The sample HP driver now supports A5 (STR #2798)
|
||||
- The CUPS web interface menu item now uses the xdg-open
|
||||
command, when available (STR #2724)
|
||||
- The cups-lpd program now supports the -h option (STR #2794)
|
||||
- The scheduler now sets the PAM_TTY parameter and the
|
||||
PAM_ESTABLISH_CRED credential flag (STR #2745)
|
||||
- The scheduler now logs unsuccessful requests to the error_log
|
||||
file as errors (STR #2616)
|
||||
- Added support for a "retry-current-job" error policy that
|
||||
retries the current job immediately when the backend encounters
|
||||
an error (STR #2555)
|
||||
- The scheduler now returns a "forbidden" error when a user
|
||||
correctly authenticates but does not have permission to
|
||||
continue further (STR #2101)
|
||||
- The scheduler now loads both the server and CA certificates
|
||||
(if present) from the ServerCertificate file (STR #2146)
|
||||
- New RSS subscriptions now create their feed files immediately
|
||||
(STR #2853)
|
||||
- Added support for a device-location attribute which provides
|
||||
the physical location of a printer device.
|
||||
- Added a cupsBackendReport() API which handles quoting of the
|
||||
device data by a backend.
|
||||
- Added support for custom options in the web interface
|
||||
(STR #1729)
|
||||
- Added support for Mozilla LDAP, reconnection to LDAP servers,
|
||||
and improved LDAP performance (STR #1962)
|
||||
- Added Solaris SMF support (STR #1477)
|
||||
- Added optional support for using TCP wrappers to limit access
|
||||
to CUPS (STR #263)
|
||||
- Added ppdPageSizeLimits API.
|
||||
- Added support for new cupsMediaQualifier2, cupsMediaQualifier3,
|
||||
cupsMinSize, and cupsMaxSize attributes.
|
||||
- Added cupsResolveConflicts and ppdInstallableConflict APIs.
|
||||
- Added support for new cupsUIConstraints and cupsUIResolver
|
||||
attributes for better option conflict detection and
|
||||
resolution.
|
||||
- Increased the maximum size of 1284 device ID strings to
|
||||
256 bytes (STR #2877)
|
||||
- Added an AccessLogLevel directive to cupsd.conf to control
|
||||
what is logged to the access_log file.
|
||||
- The default LogLevel is now "warn" instead of "info" to reduce
|
||||
the amount of logging that is done to disk by default.
|
||||
- The PPD compiler did not include OID query keywords in PPD
|
||||
files (STR #2871)
|
||||
- The cups-driverd helper program now directly supports driver
|
||||
information files.
|
||||
- The USB backend now uses libusb when available (STR #1575)
|
||||
- Added ppdLocalizeAttr function to get the localized version
|
||||
of an attribute.
|
||||
- MIME types now support a priority() attribute (STR #2719)
|
||||
- The standard MIME types are now installed in
|
||||
DataDir/mime (STR #2719)
|
||||
- The lpoptions command now describes custom options and
|
||||
the necessary parameters (STR #2660)
|
||||
- The ppdmerge program did not support Simplified Chinese
|
||||
or Traditional Chinese language version strings (STR #2851)
|
||||
- The PPD compiler now supports localizable attributes
|
||||
(STR #2738)
|
||||
- The ppdpo utility now includes cupsIPPReasons values in
|
||||
the message catalogs it generates (STR #2754)
|
||||
- The PPD compiler now supports conditional directives
|
||||
(STR #2636)
|
||||
- The ppdc utility now supports a "-t" option to test PPD
|
||||
files (STR #2739)
|
||||
- The ppdc utility now supports a "-m" option to use the
|
||||
ModelName value as the output filename.
|
||||
- The ppdc utility now supports a FileName directive to
|
||||
set an alternate output filename (STR #2740)
|
||||
- The side-channel API now supports SNMP queries for the
|
||||
standard network backends.
|
||||
- Added a PageLogFormat directive to the cupsd.conf file to
|
||||
control the format of lines in the page_log file.
|
||||
- Filters can now send PPD: messages to stderr to set PPD
|
||||
keywords like DefaultPageSize while a job is printing.
|
||||
- Added a mdns backend for discovery and printing to printers
|
||||
that advertise themselves via DNS-SD (Bonjour)
|
||||
- The ipp, lpd, and socket backends now support DNS-SD service
|
||||
name resolution.
|
||||
- The scheduler now uses a single shared file descriptor for
|
||||
all DNS-SD registrations (STR #2674)
|
||||
- The ipp, lpd, and socket backends now support SNMP-based
|
||||
page accounting and supply level monitoring (STR #1655)
|
||||
- Added support for cupsPJLDisplay attribute to control what
|
||||
PJL commands are used to display the job information.
|
||||
- Driver information files can now be installed in
|
||||
/Library/Printers/PPDs.drv on Mac OS X.
|
||||
- The CUPS image library now supports reading images larger
|
||||
than 2GB.
|
||||
- The scheduler now delays writing config and state files to
|
||||
reduce disk activity (STR #2684)
|
||||
- The CUPS-Get-Devices operation now supports the
|
||||
exclude-schemes and timeout attributes to control which
|
||||
backends are polled and for how long.
|
||||
- The cups-deviced helper application now runs backends in
|
||||
parallel to get the list of devices faster.
|
||||
- Added --enable-pap configure option.
|
||||
- The default cupsd.conf file now includes an "authenticated"
|
||||
policy which requires authentication for remote print jobs.
|
||||
- Added support for Czech and Hungarian in PPD files
|
||||
(STR #2735, STR #2736)
|
||||
- The PPD compiler tools now support Mac OS X .strings files
|
||||
for localization (STR #2737)
|
||||
- ppdOpen*() now default the colorspace member to PPD_CS_N
|
||||
when no DefaultColorSpace attribute is present in the PPD
|
||||
file.
|
||||
- The build system has been updated to support separate
|
||||
installation of data, program, header, and library files.
|
||||
- All support libraries are now built as shared libraries
|
||||
by default.
|
||||
- The scheduler now manages ICC color profiles on Mac OS X.
|
||||
- The network backends (ipp, lpd, socket) now support
|
||||
SNMP-based supply and page count monitoring (STR #1655)
|
||||
- The lppasswd program is no longer installed setuid to
|
||||
root to make the default installation more secure.
|
||||
- Added a new ppdLocalizeMarkerName() function to get
|
||||
the localized version of a marker-names value.
|
||||
- The scheduler now provides the printer-dns-sd-name
|
||||
attribute for printers shared via DNS-SD/Bonjour.
|
||||
- The pdftops filter now executes the Xpdf or poppler
|
||||
pdftops utility to convert PDF files (STR #1471)
|
||||
- Bonjour printer registrations now advertise as local or
|
||||
global based on the current access policies for the
|
||||
printer.
|
||||
- cupsGetDests*() and cupsSetDests*() now track the last
|
||||
used printer preference on Mac OS X.
|
||||
- Added a new streaming request API (STR #2261)
|
||||
- Added a new cupsGetNamedDest() function to the CUPS
|
||||
library for faster printing with lp and lpr (STR #2638)
|
||||
- The scheduler now sets the PAM RHOST value on systems
|
||||
that support it (STR #2637)
|
||||
- The scheduler now sandboxes child processes when
|
||||
possible.
|
||||
- The Cancel-Job operation now supports a purge-job
|
||||
attriibute to purge a specified job.
|
||||
- ppdEmit* and ppdCollect* now use the NonUIOrderDependency
|
||||
attributes for custom option selections.
|
||||
- The web interface now enables/disables the printer
|
||||
sharing (formerly publishing) controls based on the
|
||||
server-is-sharing-printers state (STR #2233)
|
||||
- The scheduler now tracks printer sharing via the
|
||||
server-is-sharing-printers attribute, and manages LPD
|
||||
and SMB sharing as well (STR #2233)
|
||||
- The web interface now allows you to go back to the make/
|
||||
manufacturer page if there is no matching printer driver
|
||||
on the model page (STR #2436)
|
||||
- The printer list now shows the default media, banner, and
|
||||
duplex options as well as the color and duplex capabilities
|
||||
of printers (STR #1175)
|
||||
- The web interface look-n-feel has been updated (STR #2492)
|
||||
- The scheduler now supports a CUPS-Get-Document operation
|
||||
that returns the specified print job document (STR #118)
|
||||
- The cupsfilter utility now supports a "-J jobid" option
|
||||
to filter the document from the specified job.
|
||||
- The scheduler (cupsd) now supports a new option (-t) to
|
||||
do a syntax check of the cupsd.conf file (STR #2003)
|
||||
- Added new cupsGetPPD3() API to allow applications to
|
||||
cache PPDs safely (STR #1473)
|
||||
- Added generic PostScript and PCL printer driver PPDs.
|
||||
- The scheduler no longer supports the old Mac OS X Server quota
|
||||
plugin.
|
||||
- The scheduler now allows writing to /Users/Shared from print filters
|
||||
on Mac OS X.
|
||||
- CUPS no longer supports the old ~/.cupsrc or ~/.lpoptions files from
|
||||
CUPS 1.1.x. The ~/.cups/client.conf and ~/.cups/lpoptions files that
|
||||
were introduced in CUPS 1.2 must now be used.
|
||||
- The ipptest tool is now a first-class user program and has several
|
||||
improvements along with new documentation (STR #3484)
|
||||
- The cupstestppd tool now warns about non-unique filenames and
|
||||
provides a way to ignore all filename warnings.
|
||||
- Dropped support for the recoverable: and recovered: message prefixes.
|
||||
- The scheduler now requires that filters and backends have group write
|
||||
permissions disabled.
|
||||
- The PPD compiler now checks for overlapping filenames when writing
|
||||
PPD files.
|
||||
- The HP-GL/2 filter is no longer included with CUPS (STR #3322)
|
||||
- The SCSI backend is no longer included with CUPS (STR #3500)
|
||||
|
||||
+5
-5
@@ -1,13 +1,14 @@
|
||||
INSTALL - CUPS v1.4.5 - 2010-11-11
|
||||
INSTALL - CUPS v1.5b1 - 2011-05-20
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
information on CUPS see the file called "README.txt". A complete change log can
|
||||
be found in "CHANGES.txt".
|
||||
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT RUNNING MAC OS X, ****
|
||||
**** YOU WILL ALSO NEED TO INSTALL GPL GHOSTSCRIPT WITH THE "cups" DRIVER ****
|
||||
**** AFTER YOU INSTALL CUPS. ****
|
||||
**** IF YOU HAVE A NON-POSTSCRIPT PRINTER AND ARE NOT ****
|
||||
**** RUNNING MAC OS X, YOU WILL ALSO NEED TO INSTALL GPL ****
|
||||
**** GHOSTSCRIPT WITH THE "cups" DRIVER AFTER YOU INSTALL ****
|
||||
**** CUPS. ****
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
@@ -165,7 +166,6 @@ CREATING BINARY DISTRIBUTIONS WITH EPM
|
||||
deb - Builds a Debian package
|
||||
depot - Builds a HP-UX package (also swinstall)
|
||||
inst - Builds an IRIX package (also tardist)
|
||||
osx - Builds a MacOS X package
|
||||
pkg - Builds a Solaris package
|
||||
rpm - Builds a RPM package
|
||||
setld - Build a Tru64 UNIX package
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
IPPTOOL.txt - 2011-05-20
|
||||
------------------------
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
Starting with CUPS 1.5, CUPS now installs 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.
|
||||
|
||||
|
||||
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
|
||||
attribute values. Several standard files are included with CUPS, for example
|
||||
to show a list of pending print jobs on a CUPS printer called "myprinter"
|
||||
you'd run:
|
||||
|
||||
ipptool ipp://localhost/printers/myprinter get-jobs.test
|
||||
|
||||
which would produce something like this:
|
||||
|
||||
job-id job-state job-name job-originating-user-name
|
||||
------ ------------ ------------ -------------------------
|
||||
72 pending testfile.pdf msweet
|
||||
73 pending testfile.ps msweet
|
||||
74 pending-held testfile.jpg msweet
|
||||
75 pending-held testfile.txt msweet
|
||||
|
||||
To get output suitable for import into a spreadsheet, use the "-c" (CSV)
|
||||
option:
|
||||
|
||||
ipptool -c ipp://localhost/printers/myprinter get-jobs.test
|
||||
|
||||
which would produce something like this:
|
||||
|
||||
job-id,job-state,job-name,job-originating-user-name
|
||||
72,pending,testfile.pdf,msweet
|
||||
73,pending,testfile.ps,msweet
|
||||
74,pending-held,testfile.jpg,msweet
|
||||
75,pending-held,testfile.txt,msweet
|
||||
|
||||
|
||||
CONFORMANCE TESTS
|
||||
|
||||
We provide basic IPP conformance tests for IPP/1.1, IPP/2.0, and IPP/2.1.
|
||||
For a given printer URI, the following commands perform tests at each level:
|
||||
|
||||
ipptool -t printer-uri ipp-1.1.test
|
||||
ipptool -t -V 2.0 printer-uri ipp-2.0.test
|
||||
ipptool -t -V 2.1 printer-uri ipp-2.1.test
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide many
|
||||
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.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2011 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
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the "doc/help/license.html" or "LICENSE.txt" files for more information.
|
||||
+4
-6
@@ -1,6 +1,6 @@
|
||||
CUPS License Agreement
|
||||
|
||||
Copyright 2007-2009 by Apple Inc.
|
||||
Copyright 2007-2011 by Apple Inc.
|
||||
1 Infinite Loop
|
||||
Cupertino, CA 95014 USA
|
||||
|
||||
@@ -16,10 +16,8 @@ copy of the exceptions 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
|
||||
source distribution and in the "cups" include directory and
|
||||
library files in the binary distributions. The GNU GPL applies to
|
||||
the remainder of the CUPS distribution, including the "pdftops"
|
||||
filter which is based upon Xpdf.
|
||||
source distribution and the files in the "test" subdirectory. The
|
||||
GNU GPL applies to the remainder of the CUPS distribution.
|
||||
|
||||
For those not familiar with the GNU GPL, the license basically
|
||||
allows you to:
|
||||
@@ -131,7 +129,7 @@ redistribute it freely, subject to the following restrictions:
|
||||
software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
distribution.
|
||||
|
||||
|
||||
TRADEMARKS
|
||||
|
||||
+20
-5
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
# Copyright 2007-2010 by Apple Inc.
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -83,6 +83,7 @@ LIBCUPSDRIVER = @LIBCUPSDRIVER@
|
||||
LIBCUPSIMAGE = @LIBCUPSIMAGE@
|
||||
LIBCUPSMIME = @LIBCUPSMIME@
|
||||
LIBCUPSPPDC = @LIBCUPSPPDC@
|
||||
LIBCUPSSTATIC = @LIBCUPSSTATIC@
|
||||
LIBJPEG = @LIBJPEG@
|
||||
LIBLDAP = @LIBLDAP@
|
||||
LIBMALLOC = @LIBMALLOC@
|
||||
@@ -101,6 +102,18 @@ LIBZ = @LIBZ@
|
||||
|
||||
INSTALLSTATIC = @INSTALLSTATIC@
|
||||
|
||||
#
|
||||
# IPP backend aliases...
|
||||
#
|
||||
|
||||
IPPALIASES = @IPPALIASES@
|
||||
|
||||
#
|
||||
# Install XPC backends?
|
||||
#
|
||||
|
||||
INSTALLXPC = @INSTALLXPC@
|
||||
|
||||
#
|
||||
# Program options...
|
||||
#
|
||||
@@ -123,9 +136,9 @@ ARCHFLAGS = @ARCHFLAGS@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
BACKLIBS = @BACKLIBS@
|
||||
BANNERTOPS = @BANNERTOPS@
|
||||
BUILDDIRS = @BUILDDIRS@
|
||||
CFLAGS = @CPPFLAGS@ @CFLAGS@
|
||||
COMMONLIBS = @LIBS@
|
||||
CUPSDLIBS = @CUPSDLIBS@
|
||||
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DBUS_NOTIFIER = @DBUS_NOTIFIER@
|
||||
@@ -142,9 +155,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LEGACY_BACKENDS = @LEGACY_BACKENDS@
|
||||
LIBCUPSORDER = @LIBCUPSORDER@
|
||||
LIBCUPSIMAGEORDER = @LIBCUPSIMAGEORDER@
|
||||
LINKCUPS = @LINKCUPS@ $(SSLLIBS) $(DNSSDLIBS)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
OPTIM = @OPTIM@
|
||||
@@ -154,6 +165,7 @@ PAP = @PAP@
|
||||
PDFTOPS = @PDFTOPS@
|
||||
PHPDIR = @PHPDIR@
|
||||
PHPOPTIONS = @PHPOPTIONS@ -I../.. `$(PHPCONFIG) --includes`
|
||||
SERVERLIBS = @SERVERLIBS@
|
||||
SSLFLAGS = @SSLFLAGS@
|
||||
SSLLIBS = @SSLLIBS@
|
||||
TEXTTOPS = @TEXTTOPS@
|
||||
@@ -207,6 +219,7 @@ localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
privateinclude = @privateinclude@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
@@ -217,6 +230,7 @@ BUILDROOT = $(DSTROOT)
|
||||
|
||||
AMANDIR = $(BUILDROOT)@AMANDIR@
|
||||
BINDIR = $(BUILDROOT)@bindir@
|
||||
BUNDLEDIR = @CUPS_BUNDLEDIR@
|
||||
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
|
||||
DATADIR = $(BUILDROOT)@CUPS_DATADIR@
|
||||
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
|
||||
@@ -230,6 +244,7 @@ LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
|
||||
MANDIR = $(BUILDROOT)@mandir@
|
||||
MENUDIR = @MENUDIR@
|
||||
PMANDIR = $(BUILDROOT)@PMANDIR@
|
||||
PRIVATEINCLUDE = $(BUILDROOT)@PRIVATEINCLUDE@
|
||||
RCLEVELS = @RCLEVELS@
|
||||
RCSTART = @RCSTART@
|
||||
RCSTOP = @RCSTOP@
|
||||
|
||||
+21
-128
@@ -20,10 +20,7 @@ include Makedefs
|
||||
# Directories to make...
|
||||
#
|
||||
|
||||
DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \
|
||||
notifier ppdc scheduler systemv test \
|
||||
$(PHPDIR) \
|
||||
conf data doc examples $(FONTS) templates
|
||||
DIRS = cups test $(BUILDDIRS) $(PHPDIR) $(FONTS)
|
||||
|
||||
|
||||
#
|
||||
@@ -104,7 +101,6 @@ distclean: clean
|
||||
$(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) init/cups.sh init/cups-lpd init/org.cups.cups-lpd.plist
|
||||
$(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
|
||||
@@ -113,7 +109,8 @@ distclean: clean
|
||||
$(RM) packaging/cups-desc.plist packaging/cups-info.plist
|
||||
$(RM) templates/header.tmpl
|
||||
$(RM) desktop/cups.desktop
|
||||
$(RM) init/cups.xml
|
||||
$(RM) scheduler/cups.sh scheduler/cups-lpd.xinetd
|
||||
$(RM) scheduler/org.cups.cups-lpd.plist scheduler/cups.xml
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test
|
||||
@@ -163,6 +160,8 @@ install: install-data install-headers install-libs install-exec
|
||||
#
|
||||
|
||||
install-data:
|
||||
echo Making all in cups...
|
||||
(cd cups; $(MAKE) $(MFLAGS) all)
|
||||
for dir in $(DIRS); do\
|
||||
echo Installing data files in $$dir... ;\
|
||||
(cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
|
||||
@@ -170,73 +169,7 @@ install-data:
|
||||
echo Installing cups-config script...
|
||||
$(INSTALL_DIR) -m 755 $(BINDIR)
|
||||
$(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
|
||||
if test "x$(INITDIR)" != x; then \
|
||||
echo Installing init scripts...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
|
||||
for level in $(RCLEVELS); do \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
|
||||
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
|
||||
if test `uname` = HP-UX; then \
|
||||
level=`expr $$level - 1`; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
|
||||
fi; \
|
||||
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
|
||||
done; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
|
||||
$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
|
||||
fi
|
||||
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
|
||||
if test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
|
||||
echo Installing LaunchDaemons configuration files...; \
|
||||
$(INSTALL_DATA) init/org.cups.cupsd.plist $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
|
||||
$(INSTALL_DATA) init/org.cups.cups-lpd.plist $(BUILDROOT)/System/Library/LaunchDaemons; \
|
||||
case `uname -r` in \
|
||||
8.*) \
|
||||
$(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
|
||||
$(INSTALL_SCRIPT) init/PrintingServices.launchd $(BUILDROOT)/System/Library/StartupItems/PrintingServices/PrintingServices; \
|
||||
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)/System/Library/StartupItems/PrintingServices/StartupParameters.plist; \
|
||||
$(INSTALL_DIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj; \
|
||||
$(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)/System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings; \
|
||||
;; \
|
||||
esac \
|
||||
else \
|
||||
echo Installing RC script...; \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
|
||||
fi \
|
||||
fi
|
||||
if test "x$(SMFMANIFESTDIR)" != x; then \
|
||||
echo Installing SMF manifest in $(SMFMANIFESTDIR)...;\
|
||||
$(INSTALL_DIR) $(BUILDROOT)/$(SMFMANIFESTDIR); \
|
||||
$(INSTALL_SCRIPT) init/cups.xml $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
|
||||
fi
|
||||
if test "x$(DBUSDIR)" != x; then \
|
||||
echo Installing cups.conf in $(DBUSDIR)...;\
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(DBUSDIR)/system.d; \
|
||||
$(INSTALL_DATA) packaging/cups-dbus.conf $(BUILDROOT)$(DBUSDIR)/system.d/cups.conf; \
|
||||
fi
|
||||
if test "x$(XINETD)" != x; then \
|
||||
echo Installing xinetd configuration file for cups-lpd...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(XINETD); \
|
||||
$(INSTALL_DATA) init/cups-lpd $(BUILDROOT)$(XINETD)/cups-lpd; \
|
||||
fi
|
||||
if test "x$(MENUDIR)" != x; then \
|
||||
echo Installing desktop menu...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(MENUDIR); \
|
||||
$(INSTALL_DATA) desktop/cups.desktop $(BUILDROOT)$(MENUDIR); \
|
||||
fi
|
||||
if test "x$(ICONDIR)" != x; then \
|
||||
echo Installing desktop icons...; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-16.png $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-32.png $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-64.png $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps; \
|
||||
$(INSTALL_DATA) desktop/cups-128.png $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Install header files...
|
||||
@@ -247,6 +180,11 @@ install-headers:
|
||||
echo Installing header files in $$dir... ;\
|
||||
(cd $$dir; $(MAKE) $(MFLAGS) install-headers) || exit 1;\
|
||||
done
|
||||
if test "x$(privateinclude)" != x; then \
|
||||
echo Installing config.h into $(PRIVATEINCLUDE)...; \
|
||||
$(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
|
||||
$(INSTALL_DATA) config.h $(PRIVATEINCLUDE)/config.h; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
@@ -283,58 +221,6 @@ uninstall:
|
||||
echo Uninstalling cups-config script...
|
||||
$(RM) $(BINDIR)/cups-config
|
||||
-$(RMDIR) $(BINDIR)
|
||||
echo Uninstalling startup script...
|
||||
if test "x$(INITDIR)" != x; then \
|
||||
$(RM) $(BUILDROOT)$(INITDIR)/init.d/cups; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDIR)/init.d; \
|
||||
$(RM) $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc0.d; \
|
||||
$(RM) $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc2.d; \
|
||||
$(RM) $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc3.d; \
|
||||
$(RM) $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDIR)/rc5.d; \
|
||||
fi
|
||||
if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
|
||||
if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/PrintingServices; \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cupsd.plist; \
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/org.cups.cups-lpd.plist; \
|
||||
$(RMDIR) $(BUILDROOT)/System/Library/StartupItems/PrintingServices; \
|
||||
else \
|
||||
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
|
||||
fi \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDDIR); \
|
||||
fi
|
||||
if test "x$(SMFMANIFESTDIR)" != x; then \
|
||||
echo Uninstalling SMF manifest in $(SMFMANIFESTDIR)...;\
|
||||
$(RM) $(BUILDROOT)$(SMFMANIFESTDIR)/cups.xml; \
|
||||
fi
|
||||
if test "x$(DBUSDIR)" != x; then \
|
||||
echo Uninstalling cups.conf in $(DBUSDIR)...;\
|
||||
$(RM) $(BUILDROOT)$(DBUSDIR)/cups.conf; \
|
||||
$(RMDIR) $(BUILDROOT)$(DBUSDIR); \
|
||||
fi
|
||||
if test "x$(XINETD)" != x; then \
|
||||
echo Uninstalling xinetd configuration file for cups-lpd...; \
|
||||
$(RM) $(BUILDROOT)$(XINETD)/cups-lpd; \
|
||||
fi
|
||||
if test "x$(MENUDIR)" != x; then \
|
||||
echo Uninstalling desktop menu...; \
|
||||
$(RM) $(BUILDROOT)$(MENUDIR)/cups.desktop; \
|
||||
fi
|
||||
if test "x$(ICONDIR)" != x; then \
|
||||
echo Uninstalling desktop icons...; \
|
||||
$(RM) $(BUILDROOT)$(ICONDIR)/hicolor/16x16/apps/cups.png; \
|
||||
$(RM) $(BUILDROOT)$(ICONDIR)/hicolor/32x32/apps/cups.png; \
|
||||
$(RM) $(BUILDROOT)$(ICONDIR)/hicolor/64x64/apps/cups.png; \
|
||||
$(RM) $(BUILDROOT)$(ICONDIR)/hicolor/128x128/apps/cups.png; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
@@ -394,6 +280,16 @@ docset: apihelp
|
||||
org.cups.docset
|
||||
|
||||
|
||||
#
|
||||
# Lines of code computation...
|
||||
#
|
||||
|
||||
sloc:
|
||||
for dir in cups cupslite scheduler; do \
|
||||
(cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Make software distributions using EPM (http://www.epmhome.org/)...
|
||||
#
|
||||
@@ -406,9 +302,6 @@ aix bsd deb depot inst pkg setld slackware swinstall tardist:
|
||||
epm:
|
||||
epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
|
||||
|
||||
osx:
|
||||
epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
|
||||
|
||||
rpm:
|
||||
epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
README - CUPS v1.4.4 - 2010-11-11
|
||||
README - CUPS v1.5b1 - 2011-05-20
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
@@ -150,7 +150,7 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2010 by Apple Inc. CUPS and the CUPS logo are
|
||||
CUPS is Copyright 2007-2011 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
+97
-72
@@ -1,76 +1,101 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
ipp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/versioning.h
|
||||
ipp.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
ipp.o: ../cups/backend.h ../cups/sidechannel.h ../cups/ppd-private.h
|
||||
ipp.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
ipp.o: ../cups/language.h ../cups/debug.h ../cups/i18n.h ../cups/transcode.h
|
||||
ipp.o: ../cups/snmp-private.h ../cups/string.h
|
||||
lpd.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/versioning.h
|
||||
lpd.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h backend-private.h
|
||||
lpd.o: ../cups/backend.h ../cups/sidechannel.h ../cups/ppd-private.h
|
||||
lpd.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
lpd.o: ../cups/language.h ../cups/debug.h ../cups/i18n.h ../cups/transcode.h
|
||||
lpd.o: ../cups/snmp-private.h ../cups/string.h
|
||||
dnssd.o: backend-private.h ../cups/backend.h ../cups/versioning.h
|
||||
dnssd.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
|
||||
dnssd.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
|
||||
dnssd.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
|
||||
dnssd.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
|
||||
dnssd.o: ../config.h ../cups/array.h
|
||||
pap.o: ../config.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
pap.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
pap.o: ../cups/language.h ../cups/backend.h ../cups/sidechannel.h
|
||||
pap.o: ../cups/i18n.h ../cups/transcode.h
|
||||
parallel.o: backend-private.h ../cups/backend.h ../cups/versioning.h
|
||||
parallel.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
|
||||
parallel.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
|
||||
parallel.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
|
||||
parallel.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
|
||||
parallel.o: ../config.h
|
||||
scsi.o: ../cups/backend.h ../cups/versioning.h ../cups/cups.h ../cups/ipp.h
|
||||
scsi.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
scsi.o: ../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
scsi.o: ../cups/string.h ../config.h
|
||||
serial.o: backend-private.h ../cups/backend.h ../cups/versioning.h
|
||||
serial.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
|
||||
serial.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
|
||||
serial.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
|
||||
serial.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
|
||||
serial.o: ../config.h
|
||||
snmp.o: backend-private.h ../cups/backend.h ../cups/versioning.h
|
||||
snmp.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
|
||||
snmp.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
|
||||
snmp.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
|
||||
snmp.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
|
||||
snmp.o: ../config.h ../cups/array.h ../cups/file.h ../cups/http-private.h
|
||||
snmp.o: ../cups/md5.h ../cups/ipp-private.h
|
||||
ipp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
ipp.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
ipp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
ipp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
ipp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
ipp.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
ipp.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
ipp.o: ../cups/sidechannel.h ../cups/array-private.h
|
||||
lpd.o: ../cups/http-private.h ../config.h ../cups/http.h
|
||||
lpd.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
lpd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpd.o: ../cups/language.h ../cups/string-private.h ../cups/debug-private.h
|
||||
lpd.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
lpd.o: ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpd.o: ../cups/language-private.h ../cups/transcode.h
|
||||
lpd.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
lpd.o: ../cups/sidechannel.h
|
||||
dnssd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
dnssd.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
dnssd.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
dnssd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
dnssd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
dnssd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
dnssd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
dnssd.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
dnssd.o: ../cups/backend.h ../cups/sidechannel.h ../cups/array.h
|
||||
parallel.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
parallel.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
parallel.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
parallel.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
parallel.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
parallel.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
parallel.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
parallel.o: ../cups/transcode.h ../cups/thread-private.h
|
||||
parallel.o: ../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
serial.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
serial.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
serial.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
serial.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
serial.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
serial.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
serial.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
serial.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
serial.o: ../cups/backend.h ../cups/sidechannel.h
|
||||
snmp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
snmp.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
snmp.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
snmp.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h
|
||||
snmp.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h
|
||||
snmp.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h
|
||||
snmp.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h
|
||||
snmp.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h
|
||||
snmp.o: ../cups/backend.h ../cups/sidechannel.h ../cups/array.h
|
||||
snmp.o: ../cups/file.h ../cups/http-private.h
|
||||
socket.o: ../cups/http-private.h ../config.h ../cups/http.h
|
||||
socket.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h
|
||||
socket.o: ../cups/ipp.h backend-private.h ../cups/backend.h
|
||||
socket.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
|
||||
socket.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
socket.o: ../cups/debug.h ../cups/i18n.h ../cups/transcode.h
|
||||
socket.o: ../cups/snmp-private.h ../cups/string.h
|
||||
test1284.o: ../cups/string.h ../config.h ieee1284.c backend-private.h
|
||||
test1284.o: ../cups/backend.h ../cups/versioning.h ../cups/sidechannel.h
|
||||
test1284.o: ../cups/ppd-private.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
test1284.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
test1284.o: ../cups/debug.h ../cups/i18n.h ../cups/transcode.h
|
||||
test1284.o: ../cups/snmp-private.h
|
||||
testbackend.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
|
||||
testbackend.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h
|
||||
testbackend.o: ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
socket.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
socket.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
socket.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
socket.o: ../cups/array.h ../cups/language.h ../cups/string-private.h
|
||||
socket.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
socket.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
socket.o: ../cups/language-private.h ../cups/transcode.h
|
||||
socket.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
socket.o: ../cups/sidechannel.h
|
||||
test1284.o: ../cups/string-private.h ../config.h ieee1284.c backend-private.h
|
||||
test1284.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
test1284.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
test1284.o: ../cups/language.h ../cups/string-private.h
|
||||
test1284.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
test1284.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
test1284.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
test1284.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
test1284.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
test1284.o: ../cups/sidechannel.h
|
||||
testbackend.o: ../cups/string-private.h ../config.h ../cups/cups.h
|
||||
testbackend.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
testbackend.o: ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
testbackend.o: ../cups/sidechannel.h
|
||||
testsupplies.o: backend-private.h ../cups/backend.h ../cups/versioning.h
|
||||
testsupplies.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
|
||||
testsupplies.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
|
||||
testsupplies.o: ../cups/file.h ../cups/language.h ../cups/debug.h
|
||||
testsupplies.o: ../cups/i18n.h ../cups/transcode.h ../cups/snmp-private.h
|
||||
testsupplies.o: ../cups/string.h ../config.h
|
||||
usb.o: backend-private.h ../cups/backend.h ../cups/versioning.h
|
||||
usb.o: ../cups/sidechannel.h ../cups/ppd-private.h ../cups/cups.h
|
||||
usb.o: ../cups/ipp.h ../cups/http.h ../cups/ppd.h ../cups/array.h
|
||||
usb.o: ../cups/file.h ../cups/language.h ../cups/debug.h ../cups/i18n.h
|
||||
usb.o: ../cups/transcode.h ../cups/snmp-private.h ../cups/string.h
|
||||
usb.o: ../config.h
|
||||
testsupplies.o: backend-private.h ../cups/cups-private.h ../cups/cups.h
|
||||
testsupplies.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h
|
||||
testsupplies.o: ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
testsupplies.o: ../cups/string-private.h ../config.h ../cups/debug-private.h
|
||||
testsupplies.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h
|
||||
testsupplies.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h
|
||||
testsupplies.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h
|
||||
testsupplies.o: ../cups/language-private.h ../cups/transcode.h
|
||||
testsupplies.o: ../cups/thread-private.h ../cups/snmp-private.h
|
||||
testsupplies.o: ../cups/backend.h ../cups/sidechannel.h
|
||||
usb.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
usb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
usb.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
usb.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
usb.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
usb.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
usb.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
usb.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h
|
||||
usb.o: ../cups/sidechannel.h
|
||||
|
||||
+37
-34
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Backend makefile for the Common UNIX Printing System (CUPS).
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2009 by Apple Inc.
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -17,12 +17,16 @@
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
#
|
||||
# Object files...
|
||||
#
|
||||
|
||||
RBACKENDS = ipp lpd $(DNSSD_BACKEND)
|
||||
UBACKENDS = $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb
|
||||
UBACKENDS = $(LEGACY_BACKENDS) serial snmp socket usb
|
||||
UNITTESTS = test1284 testbackend testsupplies
|
||||
TARGETS = libbackend.a $(RBACKENDS) $(UBACKENDS)
|
||||
LIBOBJS = ieee1284.o network.o runloop.o snmp-supplies.o
|
||||
OBJS = ipp.o lpd.o dnssd.o pap.o parallel.o scsi.o serial.o snmp.o \
|
||||
OBJS = ipp.o lpd.o dnssd.o parallel.o serial.o snmp.o \
|
||||
socket.o test1284.o testbackend.o testsupplies.o usb.o
|
||||
|
||||
|
||||
@@ -81,7 +85,8 @@ install-data:
|
||||
# Install programs...
|
||||
#
|
||||
|
||||
install-exec:
|
||||
install-exec: $(INSTALLXPC)
|
||||
echo Installing backends in $(SERVERBIN)/backend
|
||||
$(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
|
||||
for file in $(RBACKENDS); do \
|
||||
$(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \
|
||||
@@ -89,8 +94,10 @@ install-exec:
|
||||
for file in $(UBACKENDS); do \
|
||||
$(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
|
||||
done
|
||||
$(RM) $(SERVERBIN)/backend/http
|
||||
$(LN) ipp $(SERVERBIN)/backend/http
|
||||
for file in $(IPPALIASES); do \
|
||||
$(RM) $(SERVERBIN)/backend/$$file; \
|
||||
$(LN) ipp $(SERVERBIN)/backend/$$file; \
|
||||
done
|
||||
if test "x$(DNSSD_BACKEND)" != x; then \
|
||||
$(RM) $(SERVERBIN)/backend/mdns; \
|
||||
$(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \
|
||||
@@ -102,6 +109,15 @@ install-exec:
|
||||
done \
|
||||
fi
|
||||
|
||||
install-xpc: ipp
|
||||
echo Installing XPC backends in $(SERVERBIN)/apple
|
||||
$(INSTALL_DIR) -m 755 $(SERVERBIN)/apple
|
||||
$(LIBTOOL) $(INSTALL_BIN) ipp $(SERVERBIN)/apple
|
||||
for file in $(IPPALIASES); do \
|
||||
$(RM) $(SERVERBIN)/apple/$$file; \
|
||||
$(LN) ipp $(SERVERBIN)/apple/$$file; \
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Install headers...
|
||||
@@ -122,10 +138,17 @@ install-libs:
|
||||
#
|
||||
|
||||
uninstall:
|
||||
$(RM) $(SERVERBIN)/apple/ipp
|
||||
for file in $(IPPALIASES); do \
|
||||
$(RM) $(SERVERBIN)/apple/$$file; \
|
||||
done
|
||||
-$(RMDIR) $(SERVERBIN)/apple
|
||||
for file in $(RBACKENDS) $(UBACKENDS); do \
|
||||
$(RM) $(SERVERBIN)/backend/$$file; \
|
||||
done
|
||||
$(RM) $(SERVERBIN)/backend/http
|
||||
for file in $(IPPALIASES); do \
|
||||
$(RM) $(SERVERBIN)/backend/$$file; \
|
||||
done
|
||||
-$(RMDIR) $(SERVERBIN)/backend
|
||||
-$(RMDIR) $(SERVERBIN)
|
||||
|
||||
@@ -134,9 +157,9 @@ uninstall:
|
||||
# test1284
|
||||
#
|
||||
|
||||
test1284: test1284.o ../cups/libcups.a
|
||||
test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/libcups.a \
|
||||
$(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -144,9 +167,9 @@ test1284: test1284.o ../cups/libcups.a
|
||||
# testbackend
|
||||
#
|
||||
|
||||
testbackend: testbackend.o ../cups/libcups.a
|
||||
testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/libcups.a \
|
||||
$(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -154,10 +177,10 @@ testbackend: testbackend.o ../cups/libcups.a
|
||||
# testsupplies
|
||||
#
|
||||
|
||||
testsupplies: testsupplies.o libbackend.a ../cups/libcups.a
|
||||
testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
|
||||
../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -203,15 +226,6 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
$(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# pap
|
||||
#
|
||||
|
||||
pap: pap.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o pap pap.o $(BACKLIBS) $(LIBS) -framework AppleTalk
|
||||
|
||||
|
||||
#
|
||||
# parallel
|
||||
#
|
||||
@@ -221,17 +235,6 @@ parallel: parallel.o ../cups/$(LIBCUPS) libbackend.a
|
||||
$(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# scsi
|
||||
#
|
||||
|
||||
scsi: scsi.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o scsi scsi.o $(LIBS)
|
||||
|
||||
scsi.o: scsi.c scsi-irix.c scsi-linux.c
|
||||
|
||||
|
||||
#
|
||||
# serial
|
||||
#
|
||||
|
||||
+17
-16
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Backend support definitions for the Common UNIX Printing System (CUPS).
|
||||
* Backend support definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -23,15 +23,10 @@
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
# include <cups/cups-private.h>
|
||||
# include <cups/snmp-private.h>
|
||||
# include <cups/backend.h>
|
||||
# include <cups/sidechannel.h>
|
||||
# include <cups/ppd-private.h>
|
||||
# include <cups/debug.h>
|
||||
# include <cups/i18n.h>
|
||||
# include <cups/snmp-private.h>
|
||||
# include <stdlib.h>
|
||||
# include <errno.h>
|
||||
# include <cups/string.h>
|
||||
# include <signal.h>
|
||||
|
||||
# ifdef __linux
|
||||
@@ -281,6 +276,14 @@ extern "C" {
|
||||
#define CUPS_TC_csUTF32LE 1019
|
||||
|
||||
|
||||
/*
|
||||
* Types...
|
||||
*/
|
||||
|
||||
typedef int (*_cups_sccb_t)(int print_fd, int device_fd, int snmp_fd,
|
||||
http_addr_t *addr, int use_bc);
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
@@ -300,16 +303,14 @@ extern int backendNetworkSideCB(int print_fd, int device_fd,
|
||||
int snmp_fd, http_addr_t *addr,
|
||||
int use_bc);
|
||||
extern ssize_t backendRunLoop(int print_fd, int device_fd, int snmp_fd,
|
||||
http_addr_t *addr, int use_bc,
|
||||
int update_state,
|
||||
int (*side_cb)(int print_fd,
|
||||
int device_fd,
|
||||
int snmp_fd,
|
||||
http_addr_t *addr,
|
||||
int use_bc));
|
||||
http_addr_t *addr, int use_bc,
|
||||
int update_state, _cups_sccb_t side_cb);
|
||||
extern int backendSNMPSupplies(int snmp_fd, http_addr_t *addr,
|
||||
int *page_count,
|
||||
int *printer_state);
|
||||
extern int backendWaitLoop(int snmp_fd, http_addr_t *addr,
|
||||
int use_bc, _cups_sccb_t side_cb);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
+33
-24
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* DNS-SD discovery backend for the Common UNIX Printing System (CUPS).
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2009 by Apple Inc.
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -167,8 +167,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
exec_backend(argv);
|
||||
else if (argc != 1)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s job user title copies options [filename(s)]\n",
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]"),
|
||||
argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -234,7 +235,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
"_printer._tcp", NULL, browse_local_callback, devices);
|
||||
|
||||
pdl_datastream_ref = main_ref;
|
||||
pdl_datastream_ref = main_ref;
|
||||
DNSServiceBrowse(&pdl_datastream_ref, kDNSServiceFlagsShareConnection, 0,
|
||||
"_pdl-datastream._tcp", NULL, browse_callback, devices);
|
||||
|
||||
@@ -324,8 +325,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (!best)
|
||||
best = device;
|
||||
else if (strcasecmp(best->name, device->name) ||
|
||||
strcasecmp(best->domain, device->domain))
|
||||
else if (_cups_strcasecmp(best->name, device->name) ||
|
||||
_cups_strcasecmp(best->domain, device->domain))
|
||||
{
|
||||
unquote(uriName, best->fullName, sizeof(uriName));
|
||||
|
||||
@@ -491,8 +492,14 @@ exec_backend(char **argv) /* I - Command-line arguments */
|
||||
|
||||
job_canceled = -1;
|
||||
|
||||
if ((resolved_uri = cupsBackendDeviceURI(argv)) == NULL)
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
while ((resolved_uri = cupsBackendDeviceURI(argv)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Unable to locate printer."));
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the scheme from the URI...
|
||||
@@ -566,12 +573,12 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
for (device = cupsArrayFind(devices, &key);
|
||||
device;
|
||||
device = cupsArrayNext(devices))
|
||||
if (strcasecmp(device->name, key.name))
|
||||
if (_cups_strcasecmp(device->name, key.name))
|
||||
break;
|
||||
else if (device->type == key.type)
|
||||
{
|
||||
if (!strcasecmp(device->domain, "local.") &&
|
||||
strcasecmp(device->domain, replyDomain))
|
||||
if (!_cups_strcasecmp(device->domain, "local.") &&
|
||||
_cups_strcasecmp(device->domain, replyDomain))
|
||||
{
|
||||
/*
|
||||
* Update the .local listing to use the "global" domain name instead.
|
||||
@@ -689,8 +696,8 @@ query_callback(
|
||||
device;
|
||||
device = cupsArrayNext(devices))
|
||||
{
|
||||
if (strcasecmp(device->name, dkey.name) ||
|
||||
strcasecmp(device->domain, dkey.domain))
|
||||
if (_cups_strcasecmp(device->name, dkey.name) ||
|
||||
_cups_strcasecmp(device->domain, dkey.domain))
|
||||
{
|
||||
device = NULL;
|
||||
break;
|
||||
@@ -751,7 +758,7 @@ query_callback(
|
||||
else
|
||||
continue;
|
||||
|
||||
if (!strncasecmp(key, "usb_", 4))
|
||||
if (!_cups_strncasecmp(key, "usb_", 4))
|
||||
{
|
||||
/*
|
||||
* Add USB device ID information...
|
||||
@@ -762,12 +769,12 @@ query_callback(
|
||||
key + 4, value);
|
||||
}
|
||||
|
||||
if (!strcasecmp(key, "usb_MFG") || !strcasecmp(key, "usb_MANU") ||
|
||||
!strcasecmp(key, "usb_MANUFACTURER"))
|
||||
if (!_cups_strcasecmp(key, "usb_MFG") || !_cups_strcasecmp(key, "usb_MANU") ||
|
||||
!_cups_strcasecmp(key, "usb_MANUFACTURER"))
|
||||
strcpy(make_and_model, value);
|
||||
else if (!strcasecmp(key, "usb_MDL") || !strcasecmp(key, "usb_MODEL"))
|
||||
else if (!_cups_strcasecmp(key, "usb_MDL") || !_cups_strcasecmp(key, "usb_MODEL"))
|
||||
strcpy(model, value);
|
||||
else if (!strcasecmp(key, "product") && !strstr(value, "Ghostscript"))
|
||||
else if (!_cups_strcasecmp(key, "product") && !strstr(value, "Ghostscript"))
|
||||
{
|
||||
if (value[0] == '(')
|
||||
{
|
||||
@@ -783,18 +790,18 @@ query_callback(
|
||||
else
|
||||
strcpy(model, value);
|
||||
}
|
||||
else if (!strcasecmp(key, "ty"))
|
||||
else if (!_cups_strcasecmp(key, "ty"))
|
||||
{
|
||||
strcpy(model, value);
|
||||
|
||||
if ((ptr = strchr(model, ',')) != NULL)
|
||||
*ptr = '\0';
|
||||
}
|
||||
else if (!strcasecmp(key, "priority"))
|
||||
else if (!_cups_strcasecmp(key, "priority"))
|
||||
device->priority = atoi(value);
|
||||
else if ((device->type == CUPS_DEVICE_IPP ||
|
||||
device->type == CUPS_DEVICE_PRINTER) &&
|
||||
!strcasecmp(key, "printer-type"))
|
||||
!_cups_strcasecmp(key, "printer-type"))
|
||||
{
|
||||
/*
|
||||
* This is a CUPS printer!
|
||||
@@ -815,9 +822,9 @@ query_callback(
|
||||
if (make_and_model[0])
|
||||
snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
make_and_model, model);
|
||||
else if (!strncasecmp(model, "designjet ", 10))
|
||||
else if (!_cups_strncasecmp(model, "designjet ", 10))
|
||||
snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s", model + 10);
|
||||
else if (!strncasecmp(model, "stylus ", 7))
|
||||
else if (!_cups_strncasecmp(model, "stylus ", 7))
|
||||
snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s", model + 7);
|
||||
else if ((ptr = strchr(model, ' ')) != NULL)
|
||||
{
|
||||
@@ -866,6 +873,8 @@ query_callback(
|
||||
static void
|
||||
sigterm_handler(int sig) /* I - Signal number (unused) */
|
||||
{
|
||||
(void)sig;
|
||||
|
||||
if (job_canceled)
|
||||
exit(CUPS_BACKEND_OK);
|
||||
else
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
Preliminary Design for CUPS Firewire Printer Backend - 03/19/2002
|
||||
-----------------------------------------------------------------
|
||||
|
||||
OVERVIEW
|
||||
|
||||
Easy Software Products will develop an IEEE-1394, a.k.a.
|
||||
Firewire, printing interface for its Common UNIX Printing
|
||||
System ("CUPS") for initial use under the Linux operating
|
||||
system. A follow-on implementation for MacOS X is
|
||||
anticipated as well.
|
||||
|
||||
The operating system interfaces for IEEE-1394 ports vary
|
||||
widely; the CUPS printing interface will abstract the OS
|
||||
layer to a simpler interface geared towards discovering,
|
||||
opening, reading from, writing to, and closing IEEE-1394
|
||||
printers.
|
||||
|
||||
The initial development of the CUPS backend will be targeted
|
||||
at the EPSON Stylus Pro 10000 large format printer, which
|
||||
requires the bandwidth provided by Firewire in order to
|
||||
print at full speed. This printer supports printing via
|
||||
Serial Bus Protocol 2 (SBP-2) using the SCSI and PWG command
|
||||
sets. The CUPS backend will implement the PWG command set on
|
||||
LUN 0 only.
|
||||
|
||||
|
||||
OS ABSTRACTION LAYER
|
||||
|
||||
The OS abstraction layer will be a thin client library that
|
||||
implements the following functions:
|
||||
|
||||
ieee1394_list
|
||||
ieee1394_open
|
||||
ieee1394_close
|
||||
ieee1394_read
|
||||
ieee1394_write
|
||||
ieee1394_error
|
||||
|
||||
The "ieee1394_list" function will list all of the available
|
||||
printer devices on the bus. The device information will
|
||||
consist of the device URI (ieee1394:/something) used to
|
||||
access the device and the make and model information, if
|
||||
available, for the device ("EPSON Stylus Printer").
|
||||
|
||||
The "ieee1394_open" and "ieee1394_close" functions will open
|
||||
and close a connection to the printer, respectively.
|
||||
|
||||
The "ieee1394_read" and "ieee1394_write" functions will read
|
||||
and write data to and from the printer, respectively. The
|
||||
read function will be non-blocking, returning data only if
|
||||
there is data coming back from the printer.
|
||||
|
||||
The "ieee1394_error" function will return a string
|
||||
describing the last error or NULL if no error occurred.
|
||||
|
||||
The library will be responsible for creating any background
|
||||
threads that are needed to monitor the connection to the
|
||||
printer.
|
||||
|
||||
|
||||
CUPS BACKEND
|
||||
|
||||
The CUPS backend will use the OS abstraction layer to list
|
||||
and access the Firewire printers. The "main" function will
|
||||
read and write printer data, while the "list_devices"
|
||||
function will be called as necessary to identify the
|
||||
available devices.
|
||||
|
||||
The CUPS 1.1 backend will record any status information in
|
||||
the error log file, while the 1.2 backend will supply it to
|
||||
the printer driver process.
|
||||
@@ -1,35 +0,0 @@
|
||||
Easy Software Products
|
||||
44141 Airport View Drive
|
||||
Suite 204
|
||||
Hollywood, Maryland 20636
|
||||
+1.301.373.9600
|
||||
March 8, 2002
|
||||
|
||||
|
||||
Subject: EPSON Firewire Printer Driver for Linux
|
||||
|
||||
Currently, no Firewire printer support exists for Linux. Since
|
||||
the latest EPSON printer products depend on the Firewire
|
||||
interface to print at full speed, a solution is needed to
|
||||
support customers using Linux as their server platform.
|
||||
|
||||
The Linux Firewire subsystem provides a user-mode driver
|
||||
interface that allows driver programs to access Firewire
|
||||
devices. Easy Software Products will utilize this interface to
|
||||
develop a "backend" program for the Common UNIX Printing System
|
||||
that will allow users to print to EPSON printers using the
|
||||
Firewire interface.
|
||||
|
||||
After examining the Linux interface, we estimate that it will
|
||||
require approximately 30 hours of development time to write,
|
||||
test, and document the Firewire backend, for a total cost of
|
||||
$3,000. The new backend will become a standard part of the CUPS
|
||||
software distribution and will be included with at least the
|
||||
following Linux distributions:
|
||||
|
||||
- Caldera Linux
|
||||
- Mandrake Linux
|
||||
- Red Hat Linux
|
||||
- SuSE Linux
|
||||
|
||||
ESP will provide EPSON with binaries for Red Hat Linux 7.2.
|
||||
+19
-12
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
|
||||
* IEEE-1284 support functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -45,6 +46,15 @@ backendGetDeviceID(
|
||||
int uri_size) /* I - Size of buffer */
|
||||
{
|
||||
#ifdef __APPLE__ /* This function is a no-op */
|
||||
(void)fd;
|
||||
(void)device_id;
|
||||
(void)device_id_size;
|
||||
(void)make_model;
|
||||
(void)make_model_size;
|
||||
(void)scheme;
|
||||
(void)uri;
|
||||
(void)uri_size;
|
||||
|
||||
return (-1);
|
||||
|
||||
#else /* Get the device ID from the specified file descriptor... */
|
||||
@@ -280,7 +290,7 @@ backendGetDeviceID(
|
||||
* Get the make, model, and serial numbers...
|
||||
*/
|
||||
|
||||
num_values = _ppdGet1284Values(device_id, &values);
|
||||
num_values = _cupsGet1284Values(device_id, &values);
|
||||
|
||||
if ((sern = cupsGetOption("SERIALNUMBER", num_values, values)) == NULL)
|
||||
if ((sern = cupsGetOption("SERN", num_values, values)) == NULL)
|
||||
@@ -294,9 +304,9 @@ backendGetDeviceID(
|
||||
|
||||
if (mfg)
|
||||
{
|
||||
if (!strcasecmp(mfg, "Hewlett-Packard"))
|
||||
if (!_cups_strcasecmp(mfg, "Hewlett-Packard"))
|
||||
mfg = "HP";
|
||||
else if (!strcasecmp(mfg, "Lexmark International"))
|
||||
else if (!_cups_strcasecmp(mfg, "Lexmark International"))
|
||||
mfg = "Lexmark";
|
||||
}
|
||||
else
|
||||
@@ -312,7 +322,7 @@ backendGetDeviceID(
|
||||
if (!mdl)
|
||||
mdl = "";
|
||||
|
||||
if (!strncasecmp(mdl, mfg, strlen(mfg)))
|
||||
if (!_cups_strncasecmp(mdl, mfg, strlen(mfg)))
|
||||
{
|
||||
mdl += strlen(mfg);
|
||||
|
||||
@@ -373,7 +383,7 @@ backendGetMakeModel(
|
||||
* Look for the description field...
|
||||
*/
|
||||
|
||||
num_values = _ppdGet1284Values(device_id, &values);
|
||||
num_values = _cupsGet1284Values(device_id, &values);
|
||||
|
||||
if ((mdl = cupsGetOption("MODEL", num_values, values)) == NULL)
|
||||
mdl = cupsGetOption("MDL", num_values, values);
|
||||
@@ -387,7 +397,7 @@ backendGetMakeModel(
|
||||
if ((mfg = cupsGetOption("MANUFACTURER", num_values, values)) == NULL)
|
||||
mfg = cupsGetOption("MFG", num_values, values);
|
||||
|
||||
if (!mfg || !strncasecmp(mdl, mfg, strlen(mfg)))
|
||||
if (!mfg || !_cups_strncasecmp(mdl, mfg, strlen(mfg)))
|
||||
{
|
||||
/*
|
||||
* Just copy the model string, since it has the manufacturer...
|
||||
@@ -403,10 +413,7 @@ backendGetMakeModel(
|
||||
|
||||
char temp[1024]; /* Temporary make and model */
|
||||
|
||||
if (mfg)
|
||||
snprintf(temp, sizeof(temp), "%s %s", mfg, mdl);
|
||||
else
|
||||
snprintf(temp, sizeof(temp), "%s", mdl);
|
||||
snprintf(temp, sizeof(temp), "%s %s", mfg, mdl);
|
||||
|
||||
_ppdNormalizeMakeAndModel(temp, make_model, make_model_size);
|
||||
}
|
||||
|
||||
+1773
-745
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+214
-252
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef WIN32
|
||||
# include <winsock.h>
|
||||
@@ -87,11 +88,12 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
|
||||
*/
|
||||
|
||||
static int lpd_command(int lpd_fd, int timeout, char *format, ...);
|
||||
static int lpd_queue(const char *hostname, int port, const char *printer,
|
||||
int print_fd, int mode, const char *user,
|
||||
const char *title, int copies, int banner,
|
||||
int format, int order, int reserve,
|
||||
int manual_copies, int timeout, int contimeout);
|
||||
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
|
||||
const char *printer, int print_fd, int snmp_fd,
|
||||
int mode, const char *user, const char *title,
|
||||
int copies, int banner, int format, int order,
|
||||
int reserve, int manual_copies, int timeout,
|
||||
int contimeout);
|
||||
static void lpd_timeout(int sig);
|
||||
static int lpd_write(int lpd_fd, char *buffer, int length);
|
||||
#ifndef HAVE_RRESVPORT_AF
|
||||
@@ -124,6 +126,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*filename, /* File to print */
|
||||
title[256]; /* Title string */
|
||||
int port; /* Port number */
|
||||
char portname[256]; /* Port name (string) */
|
||||
http_addrlist_t *addrlist; /* List of addresses for printer */
|
||||
int snmp_fd; /* SNMP socket */
|
||||
int fd; /* Print file */
|
||||
int status; /* Status of LPD job */
|
||||
int mode; /* Print mode */
|
||||
@@ -136,6 +141,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
timeout, /* Timeout */
|
||||
contimeout, /* Connection timeout */
|
||||
copies; /* Number of copies */
|
||||
ssize_t bytes = 0; /* Initial bytes read */
|
||||
char buffer[16384]; /* Initial print buffer */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -181,7 +188,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
_("Usage: %s job-id user title copies options [file]"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -190,8 +197,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Extract the hostname and printer name from the URI...
|
||||
*/
|
||||
|
||||
if ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
while ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Unable to locate printer."));
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
httpSeparateURI(HTTP_URI_CODING_ALL, device_uri, scheme, sizeof(scheme),
|
||||
username, sizeof(username), hostname, sizeof(hostname), &port,
|
||||
@@ -224,36 +237,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* We want to pass utf-8 characters, not re-map them (3071945)
|
||||
* We want to pass UTF-8 characters by default, not re-map them (3071945)
|
||||
*/
|
||||
|
||||
sanitize_title = 0;
|
||||
|
||||
#else
|
||||
/*
|
||||
* Get the default timeout from a system preference...
|
||||
* Otherwise we want to re-map UTF-8 to "safe" characters by default...
|
||||
*/
|
||||
|
||||
{
|
||||
CFPropertyListRef pvalue; /* Preference value */
|
||||
SInt32 toval; /* Timeout value */
|
||||
|
||||
|
||||
pvalue = CFPreferencesCopyValue(CFSTR("timeout"),
|
||||
CFSTR("com.apple.print.backends"),
|
||||
kCFPreferencesAnyUser,
|
||||
kCFPreferencesCurrentHost);
|
||||
if (pvalue)
|
||||
{
|
||||
if (CFGetTypeID(pvalue) == CFNumberGetTypeID())
|
||||
{
|
||||
CFNumberGetValue(pvalue, kCFNumberSInt32Type, &toval);
|
||||
contimeout = (int)toval;
|
||||
}
|
||||
|
||||
CFRelease(pvalue);
|
||||
}
|
||||
}
|
||||
#else
|
||||
sanitize_title = 1;
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
@@ -305,16 +297,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(name, "banner"))
|
||||
if (!_cups_strcasecmp(name, "banner"))
|
||||
{
|
||||
/*
|
||||
* Set the banner...
|
||||
*/
|
||||
|
||||
banner = !value[0] || !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") || !strcasecmp(value, "true");
|
||||
banner = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!strcasecmp(name, "format") && value[0])
|
||||
else if (!_cups_strcasecmp(name, "format") && value[0])
|
||||
{
|
||||
/*
|
||||
* Set output format...
|
||||
@@ -323,71 +315,72 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (strchr("cdfglnoprtv", value[0]))
|
||||
format = value[0];
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown format character \"%c\"\n"),
|
||||
value[0]);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unknown format character: \"%c\"."),
|
||||
value[0]);
|
||||
}
|
||||
else if (!strcasecmp(name, "mode") && value[0])
|
||||
else if (!_cups_strcasecmp(name, "mode") && value[0])
|
||||
{
|
||||
/*
|
||||
* Set control/data order...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(value, "standard"))
|
||||
if (!_cups_strcasecmp(value, "standard"))
|
||||
mode = MODE_STANDARD;
|
||||
else if (!strcasecmp(value, "stream"))
|
||||
else if (!_cups_strcasecmp(value, "stream"))
|
||||
mode = MODE_STREAM;
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown print mode \"%s\"\n"),
|
||||
value);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unknown print mode: \"%s\"."), value);
|
||||
}
|
||||
else if (!strcasecmp(name, "order") && value[0])
|
||||
else if (!_cups_strcasecmp(name, "order") && value[0])
|
||||
{
|
||||
/*
|
||||
* Set control/data order...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(value, "control,data"))
|
||||
if (!_cups_strcasecmp(value, "control,data"))
|
||||
order = ORDER_CONTROL_DATA;
|
||||
else if (!strcasecmp(value, "data,control"))
|
||||
else if (!_cups_strcasecmp(value, "data,control"))
|
||||
order = ORDER_DATA_CONTROL;
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unknown file order \"%s\"\n"),
|
||||
value);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unknown file order: \"%s\"."), value);
|
||||
}
|
||||
else if (!strcasecmp(name, "reserve"))
|
||||
else if (!_cups_strcasecmp(name, "reserve"))
|
||||
{
|
||||
/*
|
||||
* Set port reservation mode...
|
||||
*/
|
||||
|
||||
if (!value[0] || !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") || !strcasecmp(value, "true") ||
|
||||
!strcasecmp(value, "rfc1179"))
|
||||
if (!value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true") ||
|
||||
!_cups_strcasecmp(value, "rfc1179"))
|
||||
reserve = RESERVE_RFC1179;
|
||||
else if (!strcasecmp(value, "any"))
|
||||
else if (!_cups_strcasecmp(value, "any"))
|
||||
reserve = RESERVE_ANY;
|
||||
else
|
||||
reserve = RESERVE_NONE;
|
||||
}
|
||||
else if (!strcasecmp(name, "manual_copies"))
|
||||
else if (!_cups_strcasecmp(name, "manual_copies"))
|
||||
{
|
||||
/*
|
||||
* Set manual copies...
|
||||
*/
|
||||
|
||||
manual_copies = !value[0] || !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") || !strcasecmp(value, "true");
|
||||
manual_copies = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!strcasecmp(name, "sanitize_title"))
|
||||
else if (!_cups_strcasecmp(name, "sanitize_title"))
|
||||
{
|
||||
/*
|
||||
* Set sanitize title...
|
||||
*/
|
||||
|
||||
sanitize_title = !value[0] || !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") || !strcasecmp(value, "true");
|
||||
sanitize_title = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!strcasecmp(name, "timeout"))
|
||||
else if (!_cups_strcasecmp(name, "timeout"))
|
||||
{
|
||||
/*
|
||||
* Set the timeout...
|
||||
@@ -396,7 +389,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (atoi(value) > 0)
|
||||
timeout = atoi(value);
|
||||
}
|
||||
else if (!strcasecmp(name, "contimeout"))
|
||||
else if (!_cups_strcasecmp(name, "contimeout"))
|
||||
{
|
||||
/*
|
||||
* Set the connection timeout...
|
||||
@@ -411,6 +404,43 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (mode == MODE_STREAM)
|
||||
order = ORDER_CONTROL_DATA;
|
||||
|
||||
/*
|
||||
* Find the printer...
|
||||
*/
|
||||
|
||||
snprintf(portname, sizeof(portname), "%d", port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
|
||||
|
||||
/*
|
||||
* Wait for data from the filter...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
if (!backendWaitLoop(snmp_fd, &(addrlist->addr), 0, backendNetworkSideCB))
|
||||
return (CUPS_BACKEND_OK);
|
||||
else if (mode == MODE_STANDARD &&
|
||||
(bytes = read(0, buffer, sizeof(buffer))) <= 0)
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, copy stdin to a temporary file and print the temporary
|
||||
@@ -423,37 +453,19 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Copy stdin to a temporary file...
|
||||
*/
|
||||
|
||||
http_addrlist_t *addrlist; /* Address list */
|
||||
int snmp_fd; /* SNMP socket */
|
||||
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, "1")) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
|
||||
|
||||
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to create temporary file"));
|
||||
perror("DEBUG: Unable to create temporary file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPuts(stderr, _("INFO: Copying print data...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Copying print data."));
|
||||
|
||||
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
|
||||
if (bytes > 0)
|
||||
write(fd, buffer, bytes);
|
||||
|
||||
backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
|
||||
backendNetworkSideCB);
|
||||
|
||||
if (snmp_fd >= 0)
|
||||
_cupsSNMPClose(snmp_fd);
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
}
|
||||
else if (argc == 6)
|
||||
{
|
||||
@@ -471,8 +483,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s: %s\n"),
|
||||
filename, strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open print file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -514,18 +525,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
status = lpd_queue(hostname, port, resource + 1, fd, mode,
|
||||
username, title, copies,
|
||||
banner, format, order, reserve, manual_copies,
|
||||
timeout, contimeout);
|
||||
status = lpd_queue(hostname, addrlist, resource + 1, fd, snmp_fd, mode,
|
||||
username, title, copies, banner, format, order, reserve,
|
||||
manual_copies, timeout, contimeout);
|
||||
|
||||
if (!status)
|
||||
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
|
||||
}
|
||||
else
|
||||
status = lpd_queue(hostname, port, resource + 1, fd, mode,
|
||||
username, title, 1,
|
||||
banner, format, order, reserve, 1,
|
||||
status = lpd_queue(hostname, addrlist, resource + 1, fd, snmp_fd, mode,
|
||||
username, title, 1, banner, format, order, reserve, 1,
|
||||
timeout, contimeout);
|
||||
|
||||
/*
|
||||
@@ -538,6 +547,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (fd)
|
||||
close(fd);
|
||||
|
||||
if (snmp_fd >= 0)
|
||||
_cupsSNMPClose(snmp_fd);
|
||||
|
||||
/*
|
||||
* Return the queue status...
|
||||
*/
|
||||
@@ -563,7 +575,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
|
||||
|
||||
/*
|
||||
* Don't try to send commands if the job has been cancelled...
|
||||
* Don't try to send commands if the job has been canceled...
|
||||
*/
|
||||
|
||||
if (abort_job)
|
||||
@@ -587,7 +599,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
|
||||
if (lpd_write(fd, buf, bytes) < bytes)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to send LPD command"));
|
||||
perror("DEBUG: Unable to send LPD command");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -601,9 +613,9 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with command "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -620,21 +632,22 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
*/
|
||||
|
||||
static int /* O - Zero on success, non-zero on failure */
|
||||
lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
int port, /* I - Port to connect on */
|
||||
const char *printer, /* I - Printer/queue name */
|
||||
int print_fd, /* I - File to print */
|
||||
int mode, /* I - Print mode */
|
||||
const char *user, /* I - Requesting user */
|
||||
const char *title, /* I - Job title */
|
||||
int copies, /* I - Number of copies */
|
||||
int banner, /* I - Print LPD banner? */
|
||||
int format, /* I - Format specifier */
|
||||
int order, /* I - Order of data/control files */
|
||||
int reserve, /* I - Reserve ports? */
|
||||
int manual_copies, /* I - Do copies by hand... */
|
||||
int timeout, /* I - Timeout... */
|
||||
int contimeout) /* I - Connection timeout */
|
||||
lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
http_addrlist_t *addrlist, /* I - List of host addresses */
|
||||
const char *printer, /* I - Printer/queue name */
|
||||
int print_fd, /* I - File to print */
|
||||
int snmp_fd, /* I - SNMP socket */
|
||||
int mode, /* I - Print mode */
|
||||
const char *user, /* I - Requesting user */
|
||||
const char *title, /* I - Job title */
|
||||
int copies, /* I - Number of copies */
|
||||
int banner, /* I - Print LPD banner? */
|
||||
int format, /* I - Format specifier */
|
||||
int order, /* I - Order of data/control files */
|
||||
int reserve, /* I - Reserve ports? */
|
||||
int manual_copies,/* I - Do copies by hand... */
|
||||
int timeout, /* I - Timeout... */
|
||||
int contimeout) /* I - Connection timeout */
|
||||
{
|
||||
char localhost[255]; /* Local host name */
|
||||
int error; /* Error number */
|
||||
@@ -644,16 +657,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
char control[10240], /* LPD control 'file' */
|
||||
*cptr; /* Pointer into control file string */
|
||||
char status; /* Status byte from command */
|
||||
char portname[255]; /* Port name */
|
||||
int delay; /* Delay for retries... */
|
||||
char addrname[256]; /* Address name */
|
||||
http_addrlist_t *addrlist, /* Address list */
|
||||
*addr; /* Socket address */
|
||||
int snmp_fd, /* SNMP socket */
|
||||
have_supplies; /* Printer supports supply levels? */
|
||||
http_addrlist_t *addr; /* Socket address */
|
||||
int have_supplies; /* Printer supports supply levels? */
|
||||
int copy; /* Copies written */
|
||||
time_t start_time; /* Time of first connect */
|
||||
int recoverable; /* Recoverable error shown? */
|
||||
size_t nbytes; /* Number of bytes written */
|
||||
off_t tbytes; /* Total bytes written */
|
||||
char buffer[32768]; /* Output buffer */
|
||||
@@ -678,28 +687,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
signal(SIGALRM, lpd_timeout);
|
||||
#endif /* HAVE_SIGSET */
|
||||
|
||||
/*
|
||||
* Find the printer...
|
||||
*/
|
||||
|
||||
sprintf(portname, "%d", port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remember when we started trying to connect to the printer...
|
||||
*/
|
||||
|
||||
recoverable = 0;
|
||||
start_time = time(NULL);
|
||||
start_time = time(NULL);
|
||||
|
||||
/*
|
||||
* Loop forever trying to print the file...
|
||||
@@ -712,23 +704,19 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Connecting to %s:%d for printer %s\n", hostname,
|
||||
port, printer);
|
||||
_cupsLangPuts(stderr, _("INFO: Connecting to printer...\n"));
|
||||
_httpAddrPort(&(addrlist->addr)), printer);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connecting to printer."));
|
||||
|
||||
for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist,
|
||||
delay = 5;;
|
||||
addr = addr->next)
|
||||
{
|
||||
/*
|
||||
* Stop if this job has been cancelled...
|
||||
* Stop if this job has been canceled...
|
||||
*/
|
||||
|
||||
if (abort_job)
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
* Choose the next priviledged port...
|
||||
@@ -756,7 +744,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if ((fd = socket(addr->addr.addr.sa_family, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to create socket"));
|
||||
perror("DEBUG: Unable to create socket");
|
||||
sleep(1);
|
||||
|
||||
continue;
|
||||
@@ -773,7 +761,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if ((fd = rresvport_af(&lport, addr->addr.addr.sa_family)) < 0)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to reserve port"));
|
||||
perror("DEBUG: Unable to reserve port");
|
||||
sleep(1);
|
||||
|
||||
continue;
|
||||
@@ -786,8 +774,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (abort_job)
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
close(fd);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -811,11 +797,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to contact printer, queuing on next "
|
||||
"printer in class."));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -826,20 +810,38 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error));
|
||||
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("The printer is not responding."));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
switch (error)
|
||||
{
|
||||
case EHOSTDOWN :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer may not exist or "
|
||||
"is unavailable at this time."));
|
||||
break;
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"), hostname, delay);
|
||||
case EHOSTUNREACH :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is unreachable at "
|
||||
"this time."));
|
||||
break;
|
||||
|
||||
case ECONNREFUSED :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is busy."));
|
||||
break;
|
||||
}
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -856,49 +858,26 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
else
|
||||
{
|
||||
recoverable = 1;
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("The printer is not responding."));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
|
||||
if (recoverable)
|
||||
{
|
||||
/*
|
||||
* If we've shown a recoverable error make sure the printer proxies
|
||||
* have a chance to see the recovered message. Not pretty but
|
||||
* necessary for now...
|
||||
*/
|
||||
|
||||
fputs("INFO: recovered: \n", stderr);
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Connected to printer...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connected to printer."));
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6) (local port %d)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv6.sin6_port), lport);
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4) (local port %d)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv4.sin_port), lport);
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (local port %d)...\n",
|
||||
httpAddrString(&(addr->addr), addrname, sizeof(addrname)),
|
||||
_httpAddrPort(&(addr->addr)), lport);
|
||||
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
*/
|
||||
|
||||
if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
|
||||
have_supplies = !backendSNMPSupplies(snmp_fd, &(addr->addr), NULL, NULL);
|
||||
if (snmp_fd >= 0)
|
||||
have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr), NULL,
|
||||
NULL);
|
||||
else
|
||||
have_supplies = 0;
|
||||
|
||||
@@ -906,7 +885,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Check for side-channel requests...
|
||||
*/
|
||||
|
||||
backendCheckSideChannel(snmp_fd, &(addr->addr));
|
||||
backendCheckSideChannel(snmp_fd, &(addrlist->addr));
|
||||
|
||||
/*
|
||||
* Next, open the print file and figure out its size...
|
||||
@@ -920,10 +899,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (fstat(print_fd, &filestats))
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
_cupsLangPrintError(_("ERROR: unable to stat print file"));
|
||||
perror("DEBUG: unable to stat print file");
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -951,7 +929,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
if (lpd_command(fd, timeout, "\002%s\n",
|
||||
printer)) /* Receive print job(s) */
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -1004,19 +981,19 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%u bytes)\n"),
|
||||
(unsigned)strlen(control));
|
||||
fprintf(stderr, "DEBUG: Sending control file (%u bytes)\n",
|
||||
(unsigned)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
status = errno;
|
||||
_cupsLangPrintError(_("ERROR: Unable to write control file"));
|
||||
perror("DEBUG: Unable to write control file");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1024,9 +1001,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -1034,11 +1011,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Remote host did not accept control file (%d)."),
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Control file sent successfully."));
|
||||
}
|
||||
else
|
||||
status = 0;
|
||||
@@ -1059,19 +1037,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
CUPS_LLCAST filestats.st_size, (int)getpid() % 1000,
|
||||
localhost))
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sending data file (%lld bytes)\n"),
|
||||
#else
|
||||
_("INFO: Sending data file (%ld bytes)\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
fprintf(stderr, "DEBUG: Sending data file (" CUPS_LLFMT " bytes)\n",
|
||||
CUPS_LLCAST filestats.st_size);
|
||||
|
||||
tbytes = 0;
|
||||
for (copy = 0; copy < manual_copies; copy ++)
|
||||
@@ -1080,13 +1052,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("INFO: Spooling LPR job, %.0f%% complete...\n"),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Spooling job, %.0f%% complete."),
|
||||
100.0 * tbytes / filestats.st_size);
|
||||
|
||||
if (lpd_write(fd, buffer, nbytes) < nbytes)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to send print file to printer"));
|
||||
perror("DEBUG: Unable to send print file to printer");
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -1100,7 +1072,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
status = errno;
|
||||
else if (lpd_write(fd, "", 1) < 1)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to send trailing nul to printer"));
|
||||
perror("DEBUG: Unable to send trailing nul to printer");
|
||||
status = errno;
|
||||
}
|
||||
else
|
||||
@@ -1116,9 +1088,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (recv(fd, &status, 1, 0) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with data "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
status = 0;
|
||||
}
|
||||
|
||||
@@ -1129,11 +1101,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
status = 0;
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept data file (%d)\n"),
|
||||
status);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Remote host did not accept data file (%d)."),
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Data file sent successfully\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Data file sent successfully."));
|
||||
}
|
||||
|
||||
if (status == 0 && order == ORDER_DATA_CONTROL)
|
||||
@@ -1151,19 +1124,18 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
close(fd);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
_cupsLangPrintf(stderr, _("INFO: Sending control file (%lu bytes)\n"),
|
||||
(unsigned long)strlen(control));
|
||||
fprintf(stderr, "DEBUG: Sending control file (%lu bytes)\n",
|
||||
(unsigned long)strlen(control));
|
||||
|
||||
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
|
||||
{
|
||||
status = errno;
|
||||
_cupsLangPrintError(_("ERROR: Unable to write control file"));
|
||||
perror("DEBUG: Unable to write control file");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1171,9 +1143,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
if (read(fd, &status, 1) < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Remote host did not respond with control "
|
||||
"status byte after %d seconds!\n"), timeout);
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Printer did not respond after %d seconds."),
|
||||
timeout);
|
||||
status = errno;
|
||||
}
|
||||
|
||||
@@ -1181,11 +1153,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
}
|
||||
|
||||
if (status != 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Remote host did not accept control file "
|
||||
"(%d)\n"), status);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Remote host did not accept control file (%d)."),
|
||||
status);
|
||||
else
|
||||
_cupsLangPuts(stderr, _("INFO: Control file sent successfully\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Control file sent successfully."));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1202,11 +1175,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
close(fd);
|
||||
|
||||
if (status == 0)
|
||||
{
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Waiting for a retry...
|
||||
@@ -1215,10 +1184,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
sleep(30);
|
||||
}
|
||||
|
||||
httpAddrFreeList(addrlist);
|
||||
|
||||
/*
|
||||
* If we get here, then the job has been cancelled...
|
||||
* If we get here, then the job has been canceled...
|
||||
*/
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -1310,12 +1277,7 @@ rresvport_af(int *port, /* IO - Port number to bind to */
|
||||
* Set the port number...
|
||||
*/
|
||||
|
||||
# ifdef AF_INET6
|
||||
if (family == AF_INET6)
|
||||
addr.ipv6.sin6_port = htons(*port);
|
||||
else
|
||||
# endif /* AF_INET6 */
|
||||
addr.ipv4.sin_port = htons(*port);
|
||||
_httpAddrSetPort(&addr, *port);
|
||||
|
||||
/*
|
||||
* Try binding the port to the socket; return if all is OK...
|
||||
|
||||
+8
-2
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Common network APIs for the Common UNIX Printing System (CUPS).
|
||||
* Common backend network APIs for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -279,6 +279,12 @@ 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;
|
||||
|
||||
-1696
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+16
-26
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Parallel port backend for the Common UNIX Printing System (CUPS).
|
||||
* Parallel port backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -85,7 +85,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
device_fd, /* Parallel device */
|
||||
use_bc; /* Read back-channel data? */
|
||||
int copies; /* Number of copies to print */
|
||||
size_t tbytes; /* Total number of bytes written */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
struct termios opts; /* Parallel port options */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
@@ -124,7 +124,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
_("Usage: %s job-id user title copies options [file]"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -147,9 +147,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open print file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -217,9 +215,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to contact printer, queuing on next "
|
||||
"printer in class."));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -232,22 +230,20 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer busy; will retry in 30 seconds."));
|
||||
sleep(30);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer not connected; will retry in 30 "
|
||||
"seconds."));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open device file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -287,13 +283,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, 1, side_cb);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Print file sent."));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -305,7 +295,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Arquivo executável
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Psuedo-backend for CUPS testing purposes.
|
||||
#
|
||||
# Copyright 2011 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/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
|
||||
if test $# = 0; then
|
||||
echo 'direct pseudo:///deskjet "HP DeskJet" "HP DeskJet (pseudo)" "MFG:HP;MDL:DeskJet;CMD:PCL;" "Nowhere"'
|
||||
echo 'direct pseudo:///laserjet "HP LaserJet" "HP LaserJet (pseudo)" "MFG:HP;MDL:LaserJet;CMD:PCL;" "Nowhere"'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cat $6 >/dev/null
|
||||
sleep 5
|
||||
exit 0
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
+122
-22
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Common run loop APIs for CUPS.
|
||||
* Common run loop APIs for CUPS backends.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,6 +18,8 @@
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -90,7 +92,7 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
{
|
||||
perror("ERROR: Unable to read print data");
|
||||
_cupsLangPrintError("ERROR", _("Unable to read print data"));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -119,8 +121,7 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
if (errno != ENOSPC && errno != ENXIO && errno != EAGAIN &&
|
||||
errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to write print data"));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -142,14 +143,13 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
|
||||
ssize_t /* O - Total bytes on success, -1 on error */
|
||||
backendRunLoop(
|
||||
int print_fd, /* I - Print file descriptor */
|
||||
int device_fd, /* I - Device file descriptor */
|
||||
int snmp_fd, /* I - SNMP socket or -1 if none */
|
||||
http_addr_t *addr, /* I - Address of device */
|
||||
int use_bc, /* I - Use back-channel? */
|
||||
int update_state, /* I - Update printer-state-reasons? */
|
||||
int (*side_cb)(int, int, int, http_addr_t *, int))
|
||||
/* I - Side-channel callback */
|
||||
int print_fd, /* I - Print file descriptor */
|
||||
int device_fd, /* I - Device file descriptor */
|
||||
int snmp_fd, /* I - SNMP socket or -1 if none */
|
||||
http_addr_t *addr, /* I - Address of device */
|
||||
int use_bc, /* I - Use back-channel? */
|
||||
int update_state, /* I - Update printer-state-reasons? */
|
||||
_cups_sccb_t side_cb) /* I - Side-channel callback */
|
||||
{
|
||||
int nfds; /* Maximum file descriptor value + 1 */
|
||||
fd_set input, /* Input set for reading */
|
||||
@@ -249,13 +249,14 @@ backendRunLoop(
|
||||
if (errno == ENXIO && offline != 1 && update_state)
|
||||
{
|
||||
fputs("STATE: +offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently offline.\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer is not currently connected."));
|
||||
offline = 1;
|
||||
}
|
||||
else if (errno == EINTR && total_bytes == 0)
|
||||
{
|
||||
fputs("DEBUG: Received an interrupt before any bytes were "
|
||||
"written, aborting!\n", stderr);
|
||||
"written, aborting.\n", stderr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -289,7 +290,7 @@ backendRunLoop(
|
||||
if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
|
||||
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data\n",
|
||||
CUPS_LLCAST bc_bytes);
|
||||
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
|
||||
}
|
||||
@@ -318,7 +319,7 @@ backendRunLoop(
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
{
|
||||
perror("ERROR: Unable to read print data");
|
||||
_cupsLangPrintError("ERROR", _("Unable to read print data"));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -357,7 +358,7 @@ backendRunLoop(
|
||||
if (paperout != 1 && update_state)
|
||||
{
|
||||
fputs("STATE: +media-empty-warning\n", stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Out of paper!\n"));
|
||||
fputs("DEBUG: Out of paper\n", stderr);
|
||||
paperout = 1;
|
||||
}
|
||||
}
|
||||
@@ -366,14 +367,14 @@ backendRunLoop(
|
||||
if (offline != 1 && update_state)
|
||||
{
|
||||
fputs("STATE: +offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is currently off-line.\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer is not currently connected."));
|
||||
offline = 1;
|
||||
}
|
||||
}
|
||||
else if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
fprintf(stderr, _("ERROR: Unable to write print data: %s\n"),
|
||||
strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to write print data"));
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -388,7 +389,7 @@ backendRunLoop(
|
||||
if (offline && update_state)
|
||||
{
|
||||
fputs("STATE: -offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now online.\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Printer is now connected."));
|
||||
offline = 0;
|
||||
}
|
||||
|
||||
@@ -421,6 +422,105 @@ backendRunLoop(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'backendWaitLoop()' - Wait for input from stdin while handling side-channel
|
||||
* queries.
|
||||
*/
|
||||
|
||||
int /* O - 1 if data is ready, 0 if not */
|
||||
backendWaitLoop(
|
||||
int snmp_fd, /* I - SNMP socket or -1 if none */
|
||||
http_addr_t *addr, /* I - Address of device */
|
||||
int use_bc, /* I - Use back-channel? */
|
||||
_cups_sccb_t side_cb) /* I - Side-channel callback */
|
||||
{
|
||||
fd_set input; /* Input set for reading */
|
||||
time_t curtime, /* Current time */
|
||||
snmp_update = 0;
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: backendWaitLoop(snmp_fd=%d, addr=%p, side_cb=%p)\n",
|
||||
snmp_fd, addr, side_cb);
|
||||
|
||||
/*
|
||||
* Now loop until we receive data from stdin...
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/*
|
||||
* Use select() to determine whether we have data to copy around...
|
||||
*/
|
||||
|
||||
FD_ZERO(&input);
|
||||
FD_SET(0, &input);
|
||||
if (side_cb)
|
||||
FD_SET(CUPS_SC_FD, &input);
|
||||
|
||||
if (select(CUPS_SC_FD + 1, &input, NULL, NULL, NULL) < 0)
|
||||
{
|
||||
/*
|
||||
* Pause printing to clear any pending errors...
|
||||
*/
|
||||
|
||||
if (errno == EINTR)
|
||||
{
|
||||
fputs("DEBUG: Received an interrupt before any bytes were "
|
||||
"written, aborting.\n", stderr);
|
||||
return (0);
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for input on stdin...
|
||||
*/
|
||||
|
||||
if (FD_ISSET(0, &input))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Check if we have a side-channel request ready...
|
||||
*/
|
||||
|
||||
if (side_cb && FD_ISSET(CUPS_SC_FD, &input))
|
||||
{
|
||||
/*
|
||||
* Do the side-channel request, then start back over in the select
|
||||
* loop since it may have read from print_fd...
|
||||
*/
|
||||
|
||||
if ((*side_cb)(0, -1, snmp_fd, addr, use_bc))
|
||||
side_cb = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Do SNMP updates periodically...
|
||||
*/
|
||||
|
||||
if (snmp_fd >= 0 && time(&curtime) >= snmp_update)
|
||||
{
|
||||
if (backendSNMPSupplies(snmp_fd, addr, NULL, NULL))
|
||||
snmp_update = INT_MAX;
|
||||
else
|
||||
snmp_update = curtime + 5;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Return with success...
|
||||
*/
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IRIX SCSI printer support for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2003-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* list_devices() - List the available SCSI printer devices.
|
||||
* print_device() - Print a file to a SCSI device.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <bstring.h> /* memcpy() and friends */
|
||||
#include <sys/dsreq.h> /* SCSI interface stuff */
|
||||
|
||||
|
||||
/*
|
||||
* 'list_devices()' - List the available SCSI printer devices.
|
||||
*/
|
||||
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
printf("direct scsi \"Unknown\" \"%s\"\n",
|
||||
_cupsLangString(cupsLangDefault(), _("SCSI Printer")));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'print_device()' - Print a file to a SCSI device.
|
||||
*/
|
||||
|
||||
int /* O - Print status */
|
||||
print_device(const char *resource, /* I - SCSI device */
|
||||
int fd, /* I - File to print */
|
||||
int copies) /* I - Number of copies to print */
|
||||
{
|
||||
int scsi_fd; /* SCSI file descriptor */
|
||||
char buffer[8192]; /* Data buffer */
|
||||
int bytes; /* Number of bytes */
|
||||
int try; /* Current try */
|
||||
dsreq_t scsi_req; /* SCSI request */
|
||||
char scsi_cmd[6]; /* SCSI command data */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
/*
|
||||
* Make sure we have a valid resource name...
|
||||
*/
|
||||
|
||||
if (strncmp(resource, "/dev/scsi/", 10) != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the SCSI device file...
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
do
|
||||
{
|
||||
if ((scsi_fd = open(resource, O_RDWR | O_EXCL)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
/*
|
||||
* If the CLASS environment variable is set, the job was submitted
|
||||
* to a class and not to a specific queue. In this case, we want
|
||||
* to abort immediately so that the job can be requeued on the next
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
*/
|
||||
|
||||
sleep(5);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (scsi_fd == -1);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* Now that we are "connected" to the port, ignore SIGTERM so that we
|
||||
* can finish out any page data the driver sends (e.g. to eject the
|
||||
* current page... Only ignore SIGTERM if we are printing data from
|
||||
* stdin (otherwise you can't cancel raw jobs...)
|
||||
*/
|
||||
|
||||
if (fd != 0)
|
||||
{
|
||||
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
|
||||
sigset(SIGTERM, SIG_IGN);
|
||||
#elif defined(HAVE_SIGACTION)
|
||||
memset(&action, 0, sizeof(action));
|
||||
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
#else
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
#endif /* HAVE_SIGSET */
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the print file to the device...
|
||||
*/
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
if (fd != 0)
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
|
||||
while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
memset(&scsi_req, 0, sizeof(scsi_req));
|
||||
|
||||
scsi_req.ds_flags = DSRQ_WRITE;
|
||||
scsi_req.ds_time = 60 * 1000;
|
||||
scsi_req.ds_cmdbuf = scsi_cmd;
|
||||
scsi_req.ds_cmdlen = 6;
|
||||
scsi_req.ds_databuf = buffer;
|
||||
scsi_req.ds_datalen = bytes;
|
||||
|
||||
scsi_cmd[0] = 0x0a; /* Group 0 print command */
|
||||
scsi_cmd[1] = 0x00;
|
||||
scsi_cmd[2] = bytes / 65536;
|
||||
scsi_cmd[3] = bytes / 256;
|
||||
scsi_cmd[4] = bytes;
|
||||
scsi_cmd[5] = 0x00;
|
||||
|
||||
for (try = 0; try < 10; try ++)
|
||||
if (ioctl(scsi_fd, DS_ENTER, &scsi_req) < 0 ||
|
||||
scsi_req.ds_status != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.ds_status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.ds_status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
copies --;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the device and return...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,260 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Linux SCSI printer support for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2003-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* list_devices() - List the available SCSI printer devices.
|
||||
* print_device() - Print a file to a SCSI device.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <scsi/sg.h>
|
||||
#include <cups/i18n.h>
|
||||
|
||||
|
||||
/*
|
||||
* We currently only support the Linux 2.4 generic SCSI interface.
|
||||
*/
|
||||
|
||||
#ifndef SG_DXFER_TO_DEV
|
||||
/*
|
||||
* Dummy functions that do nothing on unsupported platforms...
|
||||
*/
|
||||
void list_devices(void) {}
|
||||
int print_device(const char *resource, int fd, int copies) { return (1); }
|
||||
#else
|
||||
|
||||
|
||||
/*
|
||||
* 'list_devices()' - List the available SCSI printer devices.
|
||||
*/
|
||||
|
||||
void
|
||||
list_devices(void)
|
||||
{
|
||||
printf("direct scsi \"Unknown\" \"%s\"\n",
|
||||
_cupsLangString(cupsLangDefault(), _("SCSI Printer")));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'print_device()' - Print a file to a SCSI device.
|
||||
*/
|
||||
|
||||
int /* O - Print status */
|
||||
print_device(const char *resource, /* I - SCSI device */
|
||||
int fd, /* I - File to print */
|
||||
int copies) /* I - Number of copies to print */
|
||||
{
|
||||
int scsi_fd; /* SCSI file descriptor */
|
||||
char buffer[8192]; /* Data buffer */
|
||||
int bytes; /* Number of bytes */
|
||||
int try; /* Current try */
|
||||
sg_io_hdr_t scsi_req; /* SCSI request */
|
||||
unsigned char scsi_cmd[6], /* SCSI command data */
|
||||
scsi_sense[32]; /* SCSI sense data */
|
||||
# if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
# endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
/*
|
||||
* Make sure we have a valid resource name...
|
||||
*/
|
||||
|
||||
if (strncmp(resource, "/dev/sg", 7) != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Bad SCSI device file \"%s\"!\n"),
|
||||
resource);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the SCSI device file...
|
||||
*/
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
do
|
||||
{
|
||||
if ((scsi_fd = open(resource, O_RDWR | O_EXCL)) == -1)
|
||||
{
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
/*
|
||||
* If the CLASS environment variable is set, the job was submitted
|
||||
* to a class and not to a specific queue. In this case, we want
|
||||
* to abort immediately so that the job can be requeued on the next
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
*/
|
||||
|
||||
sleep(5);
|
||||
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
if (errno != EAGAIN && errno != EBUSY)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (scsi_fd == -1);
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* Now that we are "connected" to the port, ignore SIGTERM so that we
|
||||
* can finish out any page data the driver sends (e.g. to eject the
|
||||
* current page... Only ignore SIGTERM if we are printing data from
|
||||
* stdin (otherwise you can't cancel raw jobs...)
|
||||
*/
|
||||
|
||||
if (fd != 0)
|
||||
{
|
||||
# ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
|
||||
sigset(SIGTERM, SIG_IGN);
|
||||
# elif defined(HAVE_SIGACTION)
|
||||
memset(&action, 0, sizeof(action));
|
||||
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
# else
|
||||
signal(SIGTERM, SIG_IGN);
|
||||
# endif /* HAVE_SIGSET */
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the print file to the device...
|
||||
*/
|
||||
|
||||
while (copies > 0)
|
||||
{
|
||||
if (fd != 0)
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
|
||||
while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
memset(&scsi_req, 0, sizeof(scsi_req));
|
||||
|
||||
scsi_req.interface_id = 'S';
|
||||
scsi_req.dxfer_direction = SG_DXFER_TO_DEV;
|
||||
scsi_req.cmd_len = 6;
|
||||
scsi_req.mx_sb_len = sizeof(scsi_sense);
|
||||
scsi_req.iovec_count = 0;
|
||||
scsi_req.dxfer_len = bytes;
|
||||
scsi_req.dxferp = buffer;
|
||||
scsi_req.cmdp = scsi_cmd;
|
||||
scsi_req.sbp = scsi_sense;
|
||||
scsi_req.timeout = 60 * 1000;
|
||||
|
||||
scsi_cmd[0] = 0x0a; /* Group 0 print command */
|
||||
scsi_cmd[1] = 0x00;
|
||||
scsi_cmd[2] = bytes / 65536;
|
||||
scsi_cmd[3] = bytes / 256;
|
||||
scsi_cmd[4] = bytes;
|
||||
scsi_cmd[5] = 0x00;
|
||||
|
||||
for (try = 0; try < 10; try ++)
|
||||
if (ioctl(scsi_fd, SG_IO, &scsi_req) < 0 ||
|
||||
scsi_req.status != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: SCSI command timed out (%d); "
|
||||
"retrying...\n"), scsi_req.status);
|
||||
sleep(try + 1);
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
if (try >= 10)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to send print data (%d)\n"),
|
||||
scsi_req.status);
|
||||
close(scsi_fd);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
copies --;
|
||||
}
|
||||
|
||||
/*
|
||||
* Close the device and return...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
#endif /* !SG_DXFER_TO_DEV */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
@@ -1,231 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* SCSI printer backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2003-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the
|
||||
* following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the
|
||||
* above copyright notice, this list of conditions and
|
||||
* the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use
|
||||
* of this software must display the following
|
||||
* acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Easy
|
||||
* Software Products.
|
||||
*
|
||||
* 4. The name of Easy Software Products may not be used to
|
||||
* endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* main() - Send a file to the specified SCSI printer.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/backend.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
# endif /* HAVE_SYS_IOCTL_H */
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
void list_devices(void);
|
||||
int print_device(const char *resource, int fd, int copies);
|
||||
|
||||
|
||||
#if defined(__linux__) && defined(HAVE_SCSI_SG_H)
|
||||
# include "scsi-linux.c"
|
||||
#elif defined(__sgi)
|
||||
# include "scsi-irix.c"
|
||||
#else
|
||||
/*
|
||||
* Dummy functions that do nothing on unsupported platforms...
|
||||
*/
|
||||
void list_devices(void) {}
|
||||
int print_device(const char *resource, int fd, int copies) { return (CUPS_BACKEND_FAILED); }
|
||||
#endif /* __linux && HAVE_SCSI_SG_H */
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Send a file to the specified SCSI printer.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* printer-uri job-id user title copies options [file]
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
char method[255], /* Method in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
*options; /* Pointer to options */
|
||||
int port; /* Port number (not used) */
|
||||
int fp; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
int status; /* Exit status */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
|
||||
|
||||
/*
|
||||
* Make sure status messages are not buffered...
|
||||
*/
|
||||
|
||||
setbuf(stderr, NULL);
|
||||
|
||||
/*
|
||||
* Ignore SIGPIPE signals...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SIGSET
|
||||
sigset(SIGPIPE, SIG_IGN);
|
||||
#elif defined(HAVE_SIGACTION)
|
||||
memset(&action, 0, sizeof(action));
|
||||
action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &action, NULL);
|
||||
#else
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
#endif /* HAVE_SIGSET */
|
||||
|
||||
/*
|
||||
* Check command-line...
|
||||
*/
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
list_devices();
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have 7 arguments, print the file named on the command-line.
|
||||
* Otherwise, send stdin instead...
|
||||
*/
|
||||
|
||||
if (argc == 6)
|
||||
{
|
||||
fp = 0;
|
||||
copies = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Try to open the print file...
|
||||
*/
|
||||
|
||||
if ((fp = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract the device name and options from the URI...
|
||||
*/
|
||||
|
||||
httpSeparateURI(HTTP_URI_CODING_ALL, cupsBackendDeviceURI(argv),
|
||||
method, sizeof(method), username, sizeof(username),
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource));
|
||||
|
||||
/*
|
||||
* See if there are any options...
|
||||
*/
|
||||
|
||||
if ((options = strchr(resource, '?')) != NULL)
|
||||
{
|
||||
/*
|
||||
* Yup, terminate the device name string and move to the first
|
||||
* character of the options...
|
||||
*/
|
||||
|
||||
*options++ = '\0';
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
*/
|
||||
|
||||
status = print_device(resource, fp, copies);
|
||||
|
||||
/*
|
||||
* Close input file and return...
|
||||
*/
|
||||
|
||||
if (fp != 0)
|
||||
close(fp);
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+36
-39
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Serial port backend for the Common UNIX Printing System (CUPS).
|
||||
* Serial port backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "backend-private.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __hpux
|
||||
# include <sys/modem.h>
|
||||
@@ -163,7 +164,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
_("Usage: %s job-id user title copies options [file]"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -186,9 +187,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open print file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -238,9 +237,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to contact printer, queuing on next "
|
||||
"printer in class."));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -253,15 +252,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 30 seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer busy; will retry in 30 seconds."));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open device file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -321,7 +318,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(name, "baud"))
|
||||
if (!_cups_strcasecmp(name, "baud"))
|
||||
{
|
||||
/*
|
||||
* Set the baud rate...
|
||||
@@ -378,13 +375,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
# endif /* B230400 */
|
||||
default :
|
||||
_cupsLangPrintf(stderr, _("WARNING: Unsupported baud rate %s!\n"),
|
||||
value);
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Unsupported baud rate: %s"), value);
|
||||
break;
|
||||
}
|
||||
#endif /* B19200 == 19200 */
|
||||
}
|
||||
else if (!strcasecmp(name, "bits"))
|
||||
else if (!_cups_strcasecmp(name, "bits"))
|
||||
{
|
||||
/*
|
||||
* Set number of data bits...
|
||||
@@ -405,25 +402,25 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(name, "parity"))
|
||||
else if (!_cups_strcasecmp(name, "parity"))
|
||||
{
|
||||
/*
|
||||
* Set parity checking...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(value, "even"))
|
||||
if (!_cups_strcasecmp(value, "even"))
|
||||
{
|
||||
opts.c_cflag |= PARENB;
|
||||
opts.c_cflag &= ~PARODD;
|
||||
}
|
||||
else if (!strcasecmp(value, "odd"))
|
||||
else if (!_cups_strcasecmp(value, "odd"))
|
||||
{
|
||||
opts.c_cflag |= PARENB;
|
||||
opts.c_cflag |= PARODD;
|
||||
}
|
||||
else if (!strcasecmp(value, "none"))
|
||||
else if (!_cups_strcasecmp(value, "none"))
|
||||
opts.c_cflag &= ~PARENB;
|
||||
else if (!strcasecmp(value, "space"))
|
||||
else if (!_cups_strcasecmp(value, "space"))
|
||||
{
|
||||
/*
|
||||
* Note: we only support space parity with 7 bits per character...
|
||||
@@ -433,7 +430,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
opts.c_cflag |= CS8;
|
||||
opts.c_cflag &= ~PARENB;
|
||||
}
|
||||
else if (!strcasecmp(value, "mark"))
|
||||
else if (!_cups_strcasecmp(value, "mark"))
|
||||
{
|
||||
/*
|
||||
* Note: we only support mark parity with 7 bits per character
|
||||
@@ -446,29 +443,29 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
opts.c_cflag |= CSTOPB;
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(name, "flow"))
|
||||
else if (!_cups_strcasecmp(name, "flow"))
|
||||
{
|
||||
/*
|
||||
* Set flow control...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(value, "none"))
|
||||
if (!_cups_strcasecmp(value, "none"))
|
||||
{
|
||||
opts.c_iflag &= ~(IXON | IXOFF);
|
||||
opts.c_cflag &= ~CRTSCTS;
|
||||
}
|
||||
else if (!strcasecmp(value, "soft"))
|
||||
else if (!_cups_strcasecmp(value, "soft"))
|
||||
{
|
||||
opts.c_iflag |= IXON | IXOFF;
|
||||
opts.c_cflag &= ~CRTSCTS;
|
||||
}
|
||||
else if (!strcasecmp(value, "hard") ||
|
||||
!strcasecmp(value, "rtscts"))
|
||||
else if (!_cups_strcasecmp(value, "hard") ||
|
||||
!_cups_strcasecmp(value, "rtscts"))
|
||||
{
|
||||
opts.c_iflag &= ~(IXON | IXOFF);
|
||||
opts.c_cflag |= CRTSCTS;
|
||||
}
|
||||
else if (!strcasecmp(value, "dtrdsr"))
|
||||
else if (!_cups_strcasecmp(value, "dtrdsr"))
|
||||
{
|
||||
opts.c_iflag &= ~(IXON | IXOFF);
|
||||
opts.c_cflag &= ~CRTSCTS;
|
||||
@@ -476,7 +473,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
dtrdsr = 1;
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(name, "stop"))
|
||||
else if (!_cups_strcasecmp(name, "stop"))
|
||||
{
|
||||
switch (atoi(value))
|
||||
{
|
||||
@@ -594,7 +591,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if ((bc_bytes = read(device_fd, bc_buffer, sizeof(bc_buffer))) > 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data!\n",
|
||||
"DEBUG: Received " CUPS_LLFMT " bytes of back-channel data\n",
|
||||
CUPS_LLCAST bc_bytes);
|
||||
cupsBackChannelWrite(bc_buffer, bc_bytes, 1.0);
|
||||
}
|
||||
@@ -614,7 +611,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to read print data"));
|
||||
perror("DEBUG: Unable to read print data");
|
||||
|
||||
tcsetattr(device_fd, TCSADRAIN, &origopts);
|
||||
|
||||
@@ -690,7 +687,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
|
||||
{
|
||||
_cupsLangPrintError(_("ERROR: Unable to write print data"));
|
||||
perror("DEBUG: Unable to write print data");
|
||||
|
||||
tcsetattr(device_fd, TCSADRAIN, &origopts);
|
||||
|
||||
@@ -725,7 +722,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
|
||||
return (total_bytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1220,11 +1217,11 @@ list_devices(void)
|
||||
|
||||
|
||||
/* Check if hidden... */
|
||||
hiddenVal = IORegistryEntrySearchCFProperty(serialService,
|
||||
hiddenVal = IORegistryEntrySearchCFProperty(serialService,
|
||||
kIOServicePlane,
|
||||
CFSTR("HiddenPort"),
|
||||
kCFAllocatorDefault,
|
||||
kIORegistryIterateRecursively |
|
||||
kIORegistryIterateRecursively |
|
||||
kIORegistryIterateParents);
|
||||
if (hiddenVal)
|
||||
CFRelease(hiddenVal); /* This interface should not be used */
|
||||
@@ -1240,7 +1237,7 @@ list_devices(void)
|
||||
sizeof(serialName),
|
||||
kCFStringEncodingASCII);
|
||||
CFRelease(serialNameAsCFString);
|
||||
|
||||
|
||||
if (result)
|
||||
{
|
||||
bsdPathAsCFString =
|
||||
@@ -1253,7 +1250,7 @@ list_devices(void)
|
||||
sizeof(bsdPath),
|
||||
kCFStringEncodingASCII);
|
||||
CFRelease(bsdPathAsCFString);
|
||||
|
||||
|
||||
if (result)
|
||||
printf("serial serial:%s?baud=115200 \"Unknown\" \"%s\"\n",
|
||||
bsdPath, serialName);
|
||||
|
||||
+107
-11
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* SNMP supplies functions for the Common UNIX Printing System (CUPS).
|
||||
* SNMP supplies functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2009 by Apple Inc.
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -36,6 +36,15 @@
|
||||
#define CUPS_MAX_SUPPLIES 32 /* Maximum number of supplies for a printer */
|
||||
#define CUPS_SUPPLY_TIMEOUT 2.0 /* Timeout for SNMP lookups */
|
||||
|
||||
#define CUPS_DEVELOPER_LOW 1
|
||||
#define CUPS_DEVELOPER_EMPTY 2
|
||||
#define CUPS_MARKER_SUPPLY_LOW 4
|
||||
#define CUPS_MARKER_SUPPLY_EMPTY 8
|
||||
#define CUPS_OPC_NEAR_EOL 16
|
||||
#define CUPS_OPC_LIFE_OVER 32
|
||||
#define CUPS_TONER_LOW 64
|
||||
#define CUPS_TONER_EMPTY 128
|
||||
|
||||
|
||||
/*
|
||||
* Local structures...
|
||||
@@ -70,6 +79,8 @@ static int num_supplies = 0;
|
||||
/* Number of supplies found */
|
||||
static backend_supplies_t supplies[CUPS_MAX_SUPPLIES];
|
||||
/* Supply information */
|
||||
static int supply_state = -1;
|
||||
/* Supply state info */
|
||||
|
||||
static const int hrDeviceDescr[] =
|
||||
{ CUPS_OID_hrDeviceDescr, 1, -1 };
|
||||
@@ -140,8 +151,8 @@ static const backend_state_t const printer_states[] =
|
||||
{
|
||||
{ CUPS_TC_lowPaper, "media-low-report" },
|
||||
{ CUPS_TC_noPaper | CUPS_TC_inputTrayEmpty, "media-empty-warning" },
|
||||
{ CUPS_TC_lowToner, "toner-low-report" },
|
||||
{ CUPS_TC_noToner, "toner-empty-warning" },
|
||||
/* { CUPS_TC_lowToner, "toner-low-report" }, */ /* now use prtMarkerSupplies */
|
||||
/* { CUPS_TC_noToner, "toner-empty-warning" }, */ /* now use prtMarkerSupplies */
|
||||
{ CUPS_TC_doorOpen, "door-open-report" },
|
||||
{ CUPS_TC_jammed, "media-jam-warning" },
|
||||
/* { CUPS_TC_offline, "offline-report" }, */ /* unreliable */
|
||||
@@ -153,6 +164,18 @@ static const backend_state_t const printer_states[] =
|
||||
{ CUPS_TC_outputFull, "output-area-full-warning" }
|
||||
};
|
||||
|
||||
static const backend_state_t const supply_states[] =
|
||||
{
|
||||
{ CUPS_DEVELOPER_LOW, "developer-low-report" },
|
||||
{ CUPS_DEVELOPER_EMPTY, "developer-empty-warning" },
|
||||
{ CUPS_MARKER_SUPPLY_LOW, "marker-supply-low-report" },
|
||||
{ CUPS_MARKER_SUPPLY_EMPTY, "marker-supply-empty-warning" },
|
||||
{ CUPS_OPC_NEAR_EOL, "opc-near-eol-report" },
|
||||
{ CUPS_OPC_LIFE_OVER, "opc-life-over-warning" },
|
||||
{ CUPS_TONER_LOW, "toner-low-report" },
|
||||
{ CUPS_TONER_EMPTY, "toner-empty-warning" }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -191,13 +214,14 @@ backendSNMPSupplies(
|
||||
if (num_supplies > 0)
|
||||
{
|
||||
int i, /* Looping var */
|
||||
percent, /* Percent full */
|
||||
new_state, /* New state value */
|
||||
change_state; /* State change */
|
||||
change_state, /* State change */
|
||||
new_supply_state = 0; /* Supply state */
|
||||
char value[CUPS_MAX_SUPPLIES * 4],
|
||||
/* marker-levels value string */
|
||||
*ptr; /* Pointer into value string */
|
||||
cups_snmp_t packet; /* SNMP response packet */
|
||||
|
||||
|
||||
/*
|
||||
* Generate the marker-levels value string...
|
||||
@@ -205,17 +229,84 @@ backendSNMPSupplies(
|
||||
|
||||
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
|
||||
{
|
||||
if (supplies[i].max_capacity > 0)
|
||||
percent = 100 * supplies[i].level / supplies[i].max_capacity;
|
||||
else
|
||||
percent = 50;
|
||||
|
||||
if (percent <= 10)
|
||||
{
|
||||
switch (supplies[i].type)
|
||||
{
|
||||
case CUPS_TC_toner :
|
||||
case CUPS_TC_tonerCartridge :
|
||||
if (percent <= 1)
|
||||
new_supply_state |= CUPS_TONER_EMPTY;
|
||||
else
|
||||
new_supply_state |= CUPS_TONER_LOW;
|
||||
break;
|
||||
case CUPS_TC_wasteToner :
|
||||
case CUPS_TC_wasteInk :
|
||||
break;
|
||||
case CUPS_TC_ink :
|
||||
case CUPS_TC_inkCartridge :
|
||||
case CUPS_TC_inkRibbon :
|
||||
case CUPS_TC_solidWax :
|
||||
case CUPS_TC_ribbonWax :
|
||||
if (percent <= 1)
|
||||
new_supply_state |= CUPS_MARKER_SUPPLY_EMPTY;
|
||||
else
|
||||
new_supply_state |= CUPS_MARKER_SUPPLY_LOW;
|
||||
break;
|
||||
case CUPS_TC_developer :
|
||||
if (percent <= 1)
|
||||
new_supply_state |= CUPS_DEVELOPER_EMPTY;
|
||||
else
|
||||
new_supply_state |= CUPS_DEVELOPER_LOW;
|
||||
break;
|
||||
case CUPS_TC_coronaWire :
|
||||
case CUPS_TC_fuser :
|
||||
case CUPS_TC_opc :
|
||||
case CUPS_TC_transferUnit :
|
||||
if (percent <= 1)
|
||||
new_supply_state |= CUPS_OPC_LIFE_OVER;
|
||||
else
|
||||
new_supply_state |= CUPS_OPC_NEAR_EOL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i)
|
||||
*ptr++ = ',';
|
||||
|
||||
if (supplies[i].max_capacity > 0)
|
||||
sprintf(ptr, "%d", 100 * supplies[i].level / supplies[i].max_capacity);
|
||||
sprintf(ptr, "%d", percent);
|
||||
else
|
||||
strcpy(ptr, "-1");
|
||||
}
|
||||
|
||||
fprintf(stderr, "ATTR: marker-levels=%s\n", value);
|
||||
|
||||
if (supply_state < 0)
|
||||
change_state = 0xffff;
|
||||
else
|
||||
change_state = supply_state ^ new_supply_state;
|
||||
|
||||
fprintf(stderr, "DEBUG: new_supply_state=%x, change_state=%x\n",
|
||||
new_supply_state, change_state);
|
||||
|
||||
for (i = 0;
|
||||
i < (int)(sizeof(supply_states) / sizeof(supply_states[0]));
|
||||
i ++)
|
||||
if (change_state & supply_states[i].bit)
|
||||
{
|
||||
fprintf(stderr, "STATE: %c%s\n",
|
||||
(new_supply_state & supply_states[i].bit) ? '+' : '-',
|
||||
supply_states[i].keyword);
|
||||
}
|
||||
|
||||
supply_state = new_supply_state;
|
||||
|
||||
/*
|
||||
* Get the current printer status bits...
|
||||
*/
|
||||
@@ -242,13 +333,18 @@ backendSNMPSupplies(
|
||||
else
|
||||
change_state = current_state ^ new_state;
|
||||
|
||||
fprintf(stderr, "DEBUG: new_state=%x, change_state=%x\n", new_state,
|
||||
change_state);
|
||||
|
||||
for (i = 0;
|
||||
i < (int)(sizeof(printer_states) / sizeof(printer_states[0]));
|
||||
i ++)
|
||||
if (change_state & printer_states[i].bit)
|
||||
{
|
||||
fprintf(stderr, "STATE: %c%s\n",
|
||||
(new_state & printer_states[i].bit) ? '+' : '-',
|
||||
(new_state & printer_states[i].bit) ? '+' : '-',
|
||||
printer_states[i].keyword);
|
||||
}
|
||||
|
||||
current_state = new_state;
|
||||
|
||||
@@ -373,9 +469,9 @@ backend_init_supplies(
|
||||
* See if we should be getting supply levels via SNMP...
|
||||
*/
|
||||
|
||||
if ((ppd = ppdOpenFile(getenv("PPD"))) != NULL &&
|
||||
(ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
|
||||
ppdattr->value && strcasecmp(ppdattr->value, "true"))
|
||||
if ((ppd = ppdOpenFile(getenv("PPD"))) == NULL ||
|
||||
((ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
|
||||
ppdattr->value && _cups_strcasecmp(ppdattr->value, "true")))
|
||||
{
|
||||
ppdClose(ppd);
|
||||
return;
|
||||
|
||||
+77
-43
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* SNMP discovery backend for the Common UNIX Printing System (CUPS).
|
||||
* SNMP discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -140,13 +140,6 @@ typedef struct snmp_cache_s /**** SNMP scan cache ****/
|
||||
} snmp_cache_t;
|
||||
|
||||
|
||||
/*
|
||||
* Private CUPS API to set the last error...
|
||||
*/
|
||||
|
||||
extern void _cupsSetError(ipp_status_t status, const char *message);
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
@@ -171,7 +164,7 @@ static void probe_device(snmp_cache_t *device);
|
||||
static void read_snmp_conf(const char *address);
|
||||
static void read_snmp_response(int fd);
|
||||
static double run_time(void);
|
||||
static void scan_devices(int fd);
|
||||
static void scan_devices(int ipv4, int ipv6);
|
||||
static int try_connect(http_addr_t *addr, const char *addrname,
|
||||
int port);
|
||||
static void update_cache(snmp_cache_t *device, const char *uri,
|
||||
@@ -209,7 +202,8 @@ int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int fd; /* SNMP socket */
|
||||
int ipv4, /* SNMP IPv4 socket */
|
||||
ipv6; /* SNMP IPv6 socket */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -221,7 +215,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
fputs(_("Usage: snmp [host-or-ip-address]\n"), stderr);
|
||||
_cupsLangPuts(stderr, _("Usage: snmp [host-or-ip-address]"));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -252,9 +246,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Open the SNMP socket...
|
||||
*/
|
||||
|
||||
if ((fd = _cupsSNMPOpen(AF_INET)) < 0)
|
||||
if ((ipv4 = _cupsSNMPOpen(AF_INET)) < 0)
|
||||
return (1);
|
||||
|
||||
#ifdef AF_INET6
|
||||
if ((ipv6 = _cupsSNMPOpen(AF_INET6)) < 0)
|
||||
return (1);
|
||||
#else
|
||||
ipv6 = -1;
|
||||
#endif /* AF_INET6 */
|
||||
|
||||
/*
|
||||
* Read the configuration file and any cache data...
|
||||
*/
|
||||
@@ -269,13 +270,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Scan for devices...
|
||||
*/
|
||||
|
||||
scan_devices(fd);
|
||||
scan_devices(ipv4, ipv6);
|
||||
|
||||
/*
|
||||
* Close, free, and return with no errors...
|
||||
*/
|
||||
|
||||
_cupsSNMPClose(fd);
|
||||
_cupsSNMPClose(ipv4);
|
||||
if (ipv6 >= 0)
|
||||
_cupsSNMPClose(ipv6);
|
||||
|
||||
free_array(Addresses);
|
||||
free_array(Communities);
|
||||
@@ -464,7 +467,7 @@ static int /* O - Result of comparison */
|
||||
compare_cache(snmp_cache_t *a, /* I - First cache entry */
|
||||
snmp_cache_t *b) /* I - Second cache entry */
|
||||
{
|
||||
return (strcasecmp(a->addrname, b->addrname));
|
||||
return (_cups_strcasecmp(a->addrname, b->addrname));
|
||||
}
|
||||
|
||||
|
||||
@@ -506,7 +509,7 @@ fix_make_model(
|
||||
* that printer driver detection works better...
|
||||
*/
|
||||
|
||||
if (!strncasecmp(old_make_model, "Hewlett-Packard", 15))
|
||||
if (!_cups_strncasecmp(old_make_model, "Hewlett-Packard", 15))
|
||||
{
|
||||
/*
|
||||
* Strip leading Hewlett-Packard and hp prefixes and replace
|
||||
@@ -518,7 +521,7 @@ fix_make_model(
|
||||
while (isspace(*mmptr & 255))
|
||||
mmptr ++;
|
||||
|
||||
if (!strncasecmp(mmptr, "hp", 2))
|
||||
if (!_cups_strncasecmp(mmptr, "hp", 2))
|
||||
{
|
||||
mmptr += 2;
|
||||
|
||||
@@ -531,11 +534,11 @@ fix_make_model(
|
||||
make_model[2] = ' ';
|
||||
strlcpy(make_model + 3, mmptr, make_model_size - 3);
|
||||
}
|
||||
else if (!strncasecmp(old_make_model, "deskjet", 7))
|
||||
else if (!_cups_strncasecmp(old_make_model, "deskjet", 7))
|
||||
snprintf(make_model, make_model_size, "HP DeskJet%s", old_make_model + 7);
|
||||
else if (!strncasecmp(old_make_model, "officejet", 9))
|
||||
else if (!_cups_strncasecmp(old_make_model, "officejet", 9))
|
||||
snprintf(make_model, make_model_size, "HP OfficeJet%s", old_make_model + 9);
|
||||
else if (!strncasecmp(old_make_model, "stylus_pro_", 11))
|
||||
else if (!_cups_strncasecmp(old_make_model, "stylus_pro_", 11))
|
||||
snprintf(make_model, make_model_size, "EPSON Stylus Pro %s",
|
||||
old_make_model + 11);
|
||||
else
|
||||
@@ -715,7 +718,7 @@ probe_device(snmp_cache_t *device) /* I - Device */
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* TODO: Try an mDNS query first, and then fallback on direct probes...
|
||||
* If the printer supports Bonjour/mDNS, don't report it from the SNMP backend.
|
||||
*/
|
||||
|
||||
if (!try_connect(&(device->address), device->addrname, 5353))
|
||||
@@ -841,16 +844,16 @@ read_snmp_conf(const char *address) /* I - Single address to probe */
|
||||
if (!value)
|
||||
fprintf(stderr, "ERROR: Missing value on line %d of %s!\n", linenum,
|
||||
filename);
|
||||
else if (!strcasecmp(line, "Address"))
|
||||
else if (!_cups_strcasecmp(line, "Address"))
|
||||
{
|
||||
if (!address)
|
||||
add_array(Addresses, value);
|
||||
}
|
||||
else if (!strcasecmp(line, "Community"))
|
||||
else if (!_cups_strcasecmp(line, "Community"))
|
||||
add_array(Communities, value);
|
||||
else if (!strcasecmp(line, "DebugLevel"))
|
||||
else if (!_cups_strcasecmp(line, "DebugLevel"))
|
||||
DebugLevel = atoi(value);
|
||||
else if (!strcasecmp(line, "DeviceURI"))
|
||||
else if (!_cups_strcasecmp(line, "DeviceURI"))
|
||||
{
|
||||
if (*value != '\"')
|
||||
fprintf(stderr,
|
||||
@@ -859,12 +862,12 @@ read_snmp_conf(const char *address) /* I - Single address to probe */
|
||||
else
|
||||
add_device_uri(value);
|
||||
}
|
||||
else if (!strcasecmp(line, "HostNameLookups"))
|
||||
HostNameLookups = !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
!strcasecmp(value, "true") ||
|
||||
!strcasecmp(value, "double");
|
||||
else if (!strcasecmp(line, "MaxRunTime"))
|
||||
else if (!_cups_strcasecmp(line, "HostNameLookups"))
|
||||
HostNameLookups = !_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true") ||
|
||||
!_cups_strcasecmp(value, "double");
|
||||
else if (!_cups_strcasecmp(line, "MaxRunTime"))
|
||||
MaxRunTime = atoi(value);
|
||||
else
|
||||
fprintf(stderr, "ERROR: Unknown directive %s on line %d of %s!\n",
|
||||
@@ -1153,8 +1156,11 @@ run_time(void)
|
||||
*/
|
||||
|
||||
static void
|
||||
scan_devices(int fd) /* I - SNMP socket */
|
||||
scan_devices(int ipv4, /* I - SNMP IPv4 socket */
|
||||
int ipv6) /* I - SNMP IPv6 socket */
|
||||
{
|
||||
int fd, /* File descriptor for this address */
|
||||
busy; /* Are we busy processing something? */
|
||||
char *address, /* Current address */
|
||||
*community; /* Current community */
|
||||
fd_set input; /* Input set for select() */
|
||||
@@ -1163,6 +1169,7 @@ scan_devices(int fd) /* I - SNMP socket */
|
||||
http_addrlist_t *addrs, /* List of addresses */
|
||||
*addr; /* Current address */
|
||||
snmp_cache_t *device; /* Current device */
|
||||
char temp[1024]; /* Temporary address string */
|
||||
|
||||
|
||||
gettimeofday(&StartTime, NULL);
|
||||
@@ -1181,7 +1188,6 @@ scan_devices(int fd) /* I - SNMP socket */
|
||||
{
|
||||
char ifname[255]; /* Interface name */
|
||||
|
||||
|
||||
strlcpy(ifname, address + 4, sizeof(ifname));
|
||||
if (ifname[0])
|
||||
ifname[strlen(ifname) - 1] = '\0';
|
||||
@@ -1189,7 +1195,7 @@ scan_devices(int fd) /* I - SNMP socket */
|
||||
addrs = get_interface_addresses(ifname);
|
||||
}
|
||||
else
|
||||
addrs = httpAddrGetList(address, AF_INET, NULL);
|
||||
addrs = httpAddrGetList(address, AF_UNSPEC, NULL);
|
||||
|
||||
if (!addrs)
|
||||
{
|
||||
@@ -1205,8 +1211,20 @@ scan_devices(int fd) /* I - SNMP socket */
|
||||
community, address);
|
||||
|
||||
for (addr = addrs; addr; addr = addr->next)
|
||||
{
|
||||
#ifdef AF_INET6
|
||||
if (_httpAddrFamily(&(addr->addr)) == AF_INET6)
|
||||
fd = ipv6;
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
fd = ipv4;
|
||||
|
||||
debug_printf("DEBUG: Sending get request to %s...\n",
|
||||
httpAddrString(&(addr->addr), temp, sizeof(temp)));
|
||||
|
||||
_cupsSNMPWrite(fd, &(addr->addr), CUPS_SNMP_VERSION_1, community,
|
||||
CUPS_ASN1_GET_REQUEST, DEVICE_TYPE, DeviceTypeOID);
|
||||
}
|
||||
}
|
||||
|
||||
httpAddrFreeList(addrs);
|
||||
@@ -1225,17 +1243,33 @@ scan_devices(int fd) /* I - SNMP socket */
|
||||
timeout.tv_sec = 2;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
FD_SET(fd, &input);
|
||||
FD_SET(ipv4, &input);
|
||||
if (ipv6 >= 0)
|
||||
FD_SET(ipv6, &input);
|
||||
|
||||
fd = ipv4 > ipv6 ? ipv4 : ipv6;
|
||||
if (select(fd + 1, &input, NULL, NULL, &timeout) < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: %.3f select() for %d failed: %s\n", run_time(),
|
||||
fd, strerror(errno));
|
||||
fprintf(stderr, "ERROR: %.3f select() for %d/%d failed: %s\n", run_time(),
|
||||
ipv4, ipv6, strerror(errno));
|
||||
break;
|
||||
}
|
||||
|
||||
if (FD_ISSET(fd, &input))
|
||||
read_snmp_response(fd);
|
||||
else
|
||||
busy = 0;
|
||||
|
||||
if (FD_ISSET(ipv4, &input))
|
||||
{
|
||||
read_snmp_response(ipv4);
|
||||
busy = 1;
|
||||
}
|
||||
|
||||
if (ipv6 >= 0 && FD_ISSET(ipv6, &input))
|
||||
{
|
||||
read_snmp_response(ipv6);
|
||||
busy = 1;
|
||||
}
|
||||
|
||||
if (!busy)
|
||||
{
|
||||
/*
|
||||
* List devices with complete information...
|
||||
@@ -1281,14 +1315,14 @@ 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(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||
if ((fd = socket(_httpAddrFamily(addr), SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to create socket: %s\n",
|
||||
strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
addr->ipv4.sin_port = htons(port);
|
||||
_httpAddrSetPort(addr, port);
|
||||
|
||||
alarm(1);
|
||||
|
||||
|
||||
+108
-92
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* AppSocket backend for the Common UNIX Printing System (CUPS).
|
||||
* AppSocket backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -72,10 +72,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
sep; /* Option separator */
|
||||
int print_fd; /* Print file */
|
||||
int copies; /* Number of copies to print */
|
||||
time_t start_time, /* Time of first connect */
|
||||
current_time, /* Current time */
|
||||
time_t start_time; /* Time of first connect */
|
||||
#ifdef __APPLE__
|
||||
time_t current_time, /* Current time */
|
||||
wait_time; /* Time to wait before shutting down socket */
|
||||
int recoverable; /* Recoverable error shown? */
|
||||
#endif /* __APPLE__ */
|
||||
int contimeout; /* Connection timeout */
|
||||
int waiteof; /* Wait for end-of-file? */
|
||||
int port; /* Port number */
|
||||
@@ -90,7 +91,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
start_count, /* Page count via SNMP at start */
|
||||
page_count, /* Page count via SNMP */
|
||||
have_supplies; /* Printer supports supply levels? */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
ssize_t bytes = 0, /* Initial bytes read */
|
||||
tbytes; /* Total number of bytes written */
|
||||
char buffer[1024]; /* Initial print buffer */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@@ -129,7 +132,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
_("Usage: %s job-id user title copies options [file]"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -152,9 +155,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open print file \"%s\": %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open print file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
@@ -165,8 +166,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Extract the hostname and port number from the URI...
|
||||
*/
|
||||
|
||||
if ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
while ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Unable to locate printer."));
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
httpSeparateURI(HTTP_URI_CODING_ALL, device_uri, scheme, sizeof(scheme),
|
||||
username, sizeof(username), hostname, sizeof(hostname), &port,
|
||||
@@ -230,16 +237,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(name, "waiteof"))
|
||||
if (!_cups_strcasecmp(name, "waiteof"))
|
||||
{
|
||||
/*
|
||||
* Set the wait-for-eof value...
|
||||
*/
|
||||
|
||||
waiteof = !value[0] || !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") || !strcasecmp(value, "true");
|
||||
waiteof = !value[0] || !_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!strcasecmp(name, "contimeout"))
|
||||
else if (!_cups_strcasecmp(name, "contimeout"))
|
||||
{
|
||||
/*
|
||||
* Set the connection timeout...
|
||||
@@ -252,26 +259,59 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
|
||||
/*
|
||||
* Then try to connect to the remote host...
|
||||
* Then try finding the remote host...
|
||||
*/
|
||||
|
||||
recoverable = 0;
|
||||
start_time = time(NULL);
|
||||
start_time = time(NULL);
|
||||
|
||||
sprintf(portname, "%d", port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
|
||||
hostname);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
*/
|
||||
|
||||
if ((snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family)) >= 0)
|
||||
{
|
||||
have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr),
|
||||
&start_count, NULL);
|
||||
}
|
||||
else
|
||||
have_supplies = start_count = 0;
|
||||
|
||||
/*
|
||||
* Wait for data from the filter...
|
||||
*/
|
||||
|
||||
if (print_fd == 0)
|
||||
{
|
||||
if (!backendWaitLoop(snmp_fd, &(addrlist->addr), 1, backendNetworkSideCB))
|
||||
return (CUPS_BACKEND_OK);
|
||||
else if ((bytes = read(0, buffer, sizeof(buffer))) <= 0)
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Connect to the printer...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Connecting to %s:%d\n", hostname, port);
|
||||
_cupsLangPuts(stderr, _("INFO: Connecting to printer...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connecting to printer."));
|
||||
|
||||
for (delay = 5;;)
|
||||
{
|
||||
@@ -289,9 +329,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to contact printer, queuing on next "
|
||||
"printer in class."));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -302,21 +342,38 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error));
|
||||
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Printer not responding!\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("The printer is not responding."));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
recoverable = 1;
|
||||
switch (error)
|
||||
{
|
||||
case EHOSTDOWN :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer may not exist or "
|
||||
"is unavailable at this time."));
|
||||
break;
|
||||
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: recoverable: Network host \'%s\' is busy; "
|
||||
"will retry in %d seconds...\n"),
|
||||
hostname, delay);
|
||||
case EHOSTUNREACH :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is unreachable at this "
|
||||
"time."));
|
||||
break;
|
||||
|
||||
case ECONNREFUSED :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is busy."));
|
||||
break;
|
||||
}
|
||||
|
||||
sleep(delay);
|
||||
|
||||
@@ -325,13 +382,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
}
|
||||
else
|
||||
{
|
||||
recoverable = 1;
|
||||
|
||||
_cupsLangPrintf(stderr, "DEBUG: Connection error: %s\n",
|
||||
strerror(errno));
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: recoverable: Unable to connect to printer; "
|
||||
"will retry in 30 seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("The printer is not responding."));
|
||||
sleep(30);
|
||||
}
|
||||
}
|
||||
@@ -339,43 +391,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
}
|
||||
|
||||
if (recoverable)
|
||||
{
|
||||
/*
|
||||
* If we've shown a recoverable error make sure the printer proxies have a
|
||||
* chance to see the recovered message. Not pretty but necessary for now...
|
||||
*/
|
||||
|
||||
fputs("INFO: recovered: \n", stderr);
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Connected to printer...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connected to printer."));
|
||||
|
||||
#ifdef AF_INET6
|
||||
if (addr->addr.addr.sa_family == AF_INET6)
|
||||
fprintf(stderr, "DEBUG: Connected to [%s]:%d (IPv6)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv6.sin6_port));
|
||||
else
|
||||
#endif /* AF_INET6 */
|
||||
if (addr->addr.addr.sa_family == AF_INET)
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d (IPv4)...\n",
|
||||
httpAddrString(&addr->addr, addrname, sizeof(addrname)),
|
||||
ntohs(addr->addr.ipv4.sin_port));
|
||||
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
*/
|
||||
|
||||
if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
|
||||
{
|
||||
have_supplies = !backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
have_supplies = start_count = 0;
|
||||
fprintf(stderr, "DEBUG: Connected to %s:%d...\n",
|
||||
httpAddrString(&(addr->addr), addrname, sizeof(addrname)),
|
||||
_httpAddrPort(&(addr->addr)));
|
||||
|
||||
/*
|
||||
* Print everything...
|
||||
@@ -383,6 +404,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
tbytes = 0;
|
||||
|
||||
if (bytes > 0)
|
||||
tbytes += write(device_fd, buffer, bytes);
|
||||
|
||||
while (copies > 0 && tbytes >= 0)
|
||||
{
|
||||
copies --;
|
||||
@@ -393,17 +417,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addr->addr), 1, 0,
|
||||
backendNetworkSideCB);
|
||||
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addrlist->addr), 1,
|
||||
0, backendNetworkSideCB);
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Print file sent."));
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
@@ -423,8 +441,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Shutdown the socket and wait for the other end to finish...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Print file sent, waiting for printer to finish...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for printer to finish."));
|
||||
|
||||
shutdown(device_fd, 1);
|
||||
|
||||
@@ -435,8 +452,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Collect the final page count as needed...
|
||||
*/
|
||||
|
||||
if (have_supplies &&
|
||||
!backendSNMPSupplies(snmp_fd, &(addr->addr), &page_count, NULL) &&
|
||||
if (have_supplies &&
|
||||
!backendSNMPSupplies(snmp_fd, &(addrlist->addr), &page_count, NULL) &&
|
||||
page_count > start_count)
|
||||
fprintf(stderr, "PAGE: total %d\n", page_count - start_count);
|
||||
|
||||
@@ -455,10 +472,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
|
||||
if (tbytes >= 0)
|
||||
_cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Ready to print."));
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -494,7 +510,7 @@ wait_bc(int device_fd, /* I - Socket */
|
||||
|
||||
if ((bytes = read(device_fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n",
|
||||
fprintf(stderr, "DEBUG: Received %d bytes of back-channel data\n",
|
||||
(int)bytes);
|
||||
cupsBackChannelWrite(buffer, bytes, 1.0);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* IEEE-1284 support functions test program for the Common UNIX Printing
|
||||
* System (CUPS).
|
||||
* IEEE-1284 support functions test program for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -24,9 +23,7 @@
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <cups/string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <cups/string-private.h>
|
||||
#ifdef WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Backend test program for the Common UNIX Printing System (CUPS).
|
||||
* Backend test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -26,14 +26,11 @@
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/string-private.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/sidechannel.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <sys/wait.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* SNMP supplies test program for the Common UNIX Printing System (CUPS).
|
||||
* SNMP supplies test program for CUPS.
|
||||
*
|
||||
* Copyright 2008 by Apple Inc.
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
|
||||
+161
-124
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Copyright 2005-2010 Apple Inc. All rights reserved.
|
||||
* Copyright 2005-2011 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
|
||||
@@ -43,33 +43,32 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* list_devices() - List all USB devices.
|
||||
* print_device() - Print a file to a USB device.
|
||||
* sidechannel_thread() - Thread to handle side-channel requests.
|
||||
* read_thread() - Thread to read the backchannel data on.
|
||||
* list_device_cb() - list_device iterator callback.
|
||||
* find_device_cb() - print_device iterator callback.
|
||||
* status_timer_cb() - Status timer callback.
|
||||
* iterate_printers() - Iterate over all the printers.
|
||||
* device_added() - Device added notifier.
|
||||
* 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.
|
||||
* setup_cfLanguage() - Create AppleLanguages array from LANG environment var.
|
||||
* run_legacy_backend() - Re-exec backend as ppc or i386.
|
||||
* sigterm_handler() - SIGTERM handler.
|
||||
* next_line() - Find the next line in a buffer.
|
||||
* parse_pserror() - Scan the backchannel data for postscript errors.
|
||||
* get_device_id() - Return IEEE-1284 device ID.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -89,11 +88,11 @@
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_error.h>
|
||||
#include <mach/mach_time.h>
|
||||
#include <cups/debug.h>
|
||||
#include <cups/debug-private.h>
|
||||
#include <cups/file-private.h>
|
||||
#include <cups/sidechannel.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/language-private.h>
|
||||
#include "backend-private.h"
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
@@ -132,7 +131,7 @@ extern char **environ;
|
||||
|
||||
#define kUSBClassDriverProperty CFSTR("USB Printing Class")
|
||||
|
||||
#define kUSBGenericTOPrinterClassDriver CFSTR("/System/Library/Printers/Libraries/USBGenericTOPrintingClass.plugin")
|
||||
#define kUSBGenericTOPrinterClassDriver CFSTR("/System/Library/Printers/Libraries/USBGenericPrintingClass.plugin")
|
||||
#define kUSBPrinterClassDeviceNotOpen -9664 /*kPMInvalidIOMContext*/
|
||||
|
||||
|
||||
@@ -270,11 +269,11 @@ static Boolean find_device_cb(void *refcon, io_service_t obj);
|
||||
static Boolean list_device_cb(void *refcon, io_service_t obj);
|
||||
static CFStringRef cfstr_create_trim(const char *cstr);
|
||||
static CFStringRef copy_value_for_key(CFStringRef deviceID, CFStringRef *keys);
|
||||
static kern_return_t load_classdriver(CFStringRef driverPath, printer_interface_t intf, classdriver_t ***printerDriver);
|
||||
static kern_return_t load_classdriver(CFStringRef driverPath, printer_interface_t interface, classdriver_t ***printerDriver);
|
||||
static kern_return_t load_printerdriver(CFStringRef *driverBundlePath);
|
||||
static kern_return_t registry_close();
|
||||
static kern_return_t registry_close(void);
|
||||
static kern_return_t registry_open(CFStringRef *driverBundlePath);
|
||||
static kern_return_t unload_classdriver();
|
||||
static kern_return_t unload_classdriver(classdriver_t ***classdriver);
|
||||
static OSStatus copy_deviceid(classdriver_t **printer, CFStringRef *deviceID);
|
||||
static void *read_thread(void *reference);
|
||||
static void *sidechannel_thread(void *reference);
|
||||
@@ -286,7 +285,7 @@ static void iterate_printers(iterator_callback_t callBack, void *userdata);
|
||||
static void parse_options(char *options, char *serial, int serial_size, UInt32 *location, Boolean *wait_eof);
|
||||
static void release_deviceinfo(CFStringRef *make, CFStringRef *model, CFStringRef *serial);
|
||||
static void setup_cfLanguage(void);
|
||||
static void soft_reset();
|
||||
static void soft_reset(void);
|
||||
static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
@@ -343,10 +342,12 @@ print_device(const char *uri, /* I - Device URI */
|
||||
ssize_t total_bytes; /* Total bytes written */
|
||||
UInt32 bytes; /* Bytes written */
|
||||
struct timeval *timeout, /* Timeout pointer */
|
||||
stimeout; /* Timeout for select() */
|
||||
tv; /* Time value */
|
||||
struct timespec cond_timeout; /* pthread condition timeout */
|
||||
|
||||
|
||||
(void)uri;
|
||||
|
||||
/*
|
||||
* See if the side-channel descriptor is valid...
|
||||
*/
|
||||
@@ -373,7 +374,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (!g.make || !g.model)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
fprintf(stderr, "DEBUG: Fatal USB error.\n");
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("There was an unrecoverable USB error."));
|
||||
|
||||
if (!g.make)
|
||||
fputs("DEBUG: USB make string is NULL\n", stderr);
|
||||
@@ -431,7 +434,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
strlcpy(print_buffer, "USB class driver", sizeof(print_buffer));
|
||||
|
||||
fputs("STATE: +apple-missing-usbclassdriver-error\n", stderr);
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("There was an unrecoverable USB error."));
|
||||
fprintf(stderr, "DEBUG: Could not load %s\n", print_buffer);
|
||||
|
||||
if (driverBundlePath)
|
||||
@@ -449,8 +453,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
countdown -= PRINTER_POLLING_INTERVAL;
|
||||
if (countdown <= 0)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Waiting for printer to become available...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Waiting for printer to become available."));
|
||||
fprintf(stderr, "DEBUG: USB printer status: 0x%08x\n", (int)status);
|
||||
countdown = SUBSEQUENT_LOG_INTERVAL; /* subsequent log entries, every 15 seconds */
|
||||
}
|
||||
@@ -496,7 +500,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&sidechannel_thread_id, NULL, sidechannel_thread, NULL))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
fprintf(stderr, "DEBUG: Fatal USB error.\n");
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("There was an unrecoverable USB error."));
|
||||
fputs("DEBUG: Couldn't create side-channel thread\n", stderr);
|
||||
registry_close();
|
||||
return (CUPS_BACKEND_STOP);
|
||||
@@ -515,7 +521,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (pthread_create(&read_thread_id, NULL, read_thread, NULL))
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Fatal USB error\n"));
|
||||
fprintf(stderr, "DEBUG: Fatal USB error.\n");
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("There was an unrecoverable USB error."));
|
||||
fputs("DEBUG: Couldn't create read thread\n", stderr);
|
||||
registry_close();
|
||||
return (CUPS_BACKEND_STOP);
|
||||
@@ -532,7 +540,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
while (status == noErr && copies-- > 0)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("INFO: Sending print data...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Sending data to printer."));
|
||||
|
||||
if (print_fd != STDIN_FILENO)
|
||||
{
|
||||
@@ -556,15 +564,15 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (g.print_bytes)
|
||||
{
|
||||
stimeout.tv_sec = 0;
|
||||
stimeout.tv_usec = 100000; /* 100ms */
|
||||
timeout = &stimeout;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100000; /* 100ms */
|
||||
timeout = &tv;
|
||||
}
|
||||
else if (g.drain_output)
|
||||
{
|
||||
stimeout.tv_sec = 0;
|
||||
stimeout.tv_usec = 0;
|
||||
timeout = &stimeout;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
timeout = &tv;
|
||||
}
|
||||
else
|
||||
timeout = NULL;
|
||||
@@ -601,7 +609,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
else if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to read print data\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to read print data."));
|
||||
perror("DEBUG: select");
|
||||
registry_close();
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -644,7 +653,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to read print data\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to read print data."));
|
||||
perror("DEBUG: read");
|
||||
registry_close();
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
@@ -715,13 +725,14 @@ print_device(const char *uri, /* I - Device URI */
|
||||
iostatus = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
|
||||
}
|
||||
|
||||
if (iostatus || bytes < 0)
|
||||
if (iostatus)
|
||||
{
|
||||
/*
|
||||
* Write error - bail if we don't see an error we can retry...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr, _("ERROR: Unable to send print data\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to send data to printer."));
|
||||
fprintf(stderr, "DEBUG: USB class driver WritePipe returned %x\n",
|
||||
iostatus);
|
||||
|
||||
@@ -755,7 +766,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
/*
|
||||
* Re-enable the SIGTERM handler so pthread_kill() will work...
|
||||
*/
|
||||
|
||||
|
||||
struct sigaction action; /* POSIX signal action */
|
||||
|
||||
memset(&action, 0, sizeof(action));
|
||||
@@ -780,17 +791,22 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
g.sidechannel_thread_stop = 1;
|
||||
pthread_mutex_lock(&g.sidechannel_thread_mutex);
|
||||
|
||||
if (!g.sidechannel_thread_done)
|
||||
{
|
||||
/*
|
||||
* Wait for the side-channel thread to exit...
|
||||
*/
|
||||
gettimeofday(&tv, NULL);
|
||||
cond_timeout.tv_sec = tv.tv_sec + WAIT_SIDE_DELAY;
|
||||
cond_timeout.tv_nsec = tv.tv_usec * 1000;
|
||||
|
||||
cond_timeout.tv_sec = time(NULL) + WAIT_SIDE_DELAY;
|
||||
cond_timeout.tv_nsec = 0;
|
||||
if (pthread_cond_timedwait(&g.sidechannel_thread_cond,
|
||||
&g.sidechannel_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
while (!g.sidechannel_thread_done)
|
||||
{
|
||||
if (pthread_cond_timedwait(&g.sidechannel_thread_cond,
|
||||
&g.sidechannel_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!g.sidechannel_thread_done)
|
||||
{
|
||||
/*
|
||||
* Force the side-channel thread to exit...
|
||||
@@ -800,6 +816,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
pthread_kill(sidechannel_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_join(sidechannel_thread_id, NULL);
|
||||
@@ -826,11 +843,18 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (!g.read_thread_done)
|
||||
{
|
||||
cond_timeout.tv_sec = time(NULL) + WAIT_EOF_DELAY;
|
||||
cond_timeout.tv_nsec = 0;
|
||||
gettimeofday(&tv, NULL);
|
||||
cond_timeout.tv_sec = tv.tv_sec + WAIT_EOF_DELAY;
|
||||
cond_timeout.tv_nsec = tv.tv_usec * 1000;
|
||||
|
||||
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
while (!g.read_thread_done)
|
||||
{
|
||||
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!g.read_thread_done)
|
||||
{
|
||||
/*
|
||||
* Force the read thread to exit...
|
||||
@@ -841,6 +865,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
pthread_kill(read_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g.read_thread_mutex);
|
||||
|
||||
pthread_join(read_thread_id, NULL); /* wait for the read thread to return */
|
||||
@@ -886,6 +911,9 @@ static void *read_thread(void *reference)
|
||||
uint64_t start,
|
||||
delay;
|
||||
|
||||
|
||||
(void)reference;
|
||||
|
||||
/* Calculate what 250 milliSeconds are in mach absolute time...
|
||||
*/
|
||||
mach_timebase_info(&timeBaseInfo);
|
||||
@@ -961,6 +989,8 @@ sidechannel_thread(void *reference)
|
||||
int datalen; /* Request/response data size */
|
||||
|
||||
|
||||
(void)reference;
|
||||
|
||||
do
|
||||
{
|
||||
datalen = sizeof(data);
|
||||
@@ -1152,6 +1182,9 @@ static Boolean list_device_cb(void *refcon,
|
||||
{
|
||||
Boolean keepRunning = (obj != 0x0);
|
||||
|
||||
|
||||
(void)refcon;
|
||||
|
||||
if (keepRunning)
|
||||
{
|
||||
CFStringRef deviceIDString = NULL;
|
||||
@@ -1278,7 +1311,7 @@ static Boolean find_device_cb(void *refcon,
|
||||
if (!keepLooking && g.status_timer != NULL)
|
||||
{
|
||||
fputs("STATE: -offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is now online.\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Printer is now online."));
|
||||
CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), g.status_timer, kCFRunLoopDefaultMode);
|
||||
CFRelease(g.status_timer);
|
||||
g.status_timer = NULL;
|
||||
@@ -1295,8 +1328,11 @@ static Boolean find_device_cb(void *refcon,
|
||||
static void status_timer_cb(CFRunLoopTimerRef timer,
|
||||
void *info)
|
||||
{
|
||||
(void)timer;
|
||||
(void)info;
|
||||
|
||||
fputs("STATE: +offline-report\n", stderr);
|
||||
_cupsLangPuts(stderr, _("INFO: Printer is offline.\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Printer is offline."));
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
@@ -1375,14 +1411,13 @@ static void release_deviceinfo(CFStringRef *make,
|
||||
*/
|
||||
|
||||
static kern_return_t load_classdriver(CFStringRef driverPath,
|
||||
printer_interface_t intf,
|
||||
printer_interface_t interface,
|
||||
classdriver_t ***printerDriver)
|
||||
{
|
||||
kern_return_t kr = kUSBPrinterClassDeviceNotOpen;
|
||||
classdriver_t **driver = NULL;
|
||||
CFStringRef bundle = driverPath ? driverPath : kUSBGenericTOPrinterClassDriver;
|
||||
char bundlestr[1024]; /* Bundle path */
|
||||
struct stat bundleinfo; /* File information for bundle */
|
||||
CFURLRef url; /* URL for driver */
|
||||
CFPlugInRef plugin = NULL; /* Plug-in address */
|
||||
|
||||
@@ -1393,21 +1428,14 @@ static kern_return_t load_classdriver(CFStringRef driverPath,
|
||||
* Validate permissions for the class driver...
|
||||
*/
|
||||
|
||||
if (stat(bundlestr, &bundleinfo))
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": %s\n",
|
||||
bundlestr, strerror(errno));
|
||||
if (errno == ENOENT)
|
||||
return (load_classdriver(NULL, intf, printerDriver));
|
||||
else
|
||||
return (kr);
|
||||
}
|
||||
else if (bundleinfo.st_mode & S_IWOTH)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": insecure file "
|
||||
"permissions (0%o)\n", bundlestr, bundleinfo.st_mode);
|
||||
_cups_fc_result_t result = _cupsFileCheck(bundlestr,
|
||||
_CUPS_FILE_CHECK_DIRECTORY, 1,
|
||||
_cupsFileCheckFilter, NULL);
|
||||
|
||||
if (result && driverPath)
|
||||
return (load_classdriver(NULL, interface, printerDriver));
|
||||
else if (result)
|
||||
return (kr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try loading the class driver...
|
||||
@@ -1437,15 +1465,15 @@ static kern_return_t load_classdriver(CFStringRef driverPath,
|
||||
{
|
||||
classdriver_t **genericDriver = NULL;
|
||||
if (driverPath != NULL && CFStringCompare(driverPath, kUSBGenericTOPrinterClassDriver, 0) != kCFCompareEqualTo)
|
||||
kr = load_classdriver(NULL, intf, &genericDriver);
|
||||
kr = load_classdriver(NULL, interface, &genericDriver);
|
||||
|
||||
if (kr == kIOReturnSuccess)
|
||||
{
|
||||
(*driver)->interface = intf;
|
||||
(*driver)->interface = interface;
|
||||
(*driver)->Initialize(driver, genericDriver);
|
||||
|
||||
(*driver)->plugin = plugin;
|
||||
(*driver)->interface = intf;
|
||||
(*driver)->interface = interface;
|
||||
*printerDriver = driver;
|
||||
}
|
||||
}
|
||||
@@ -1488,20 +1516,20 @@ static kern_return_t load_printerdriver(CFStringRef *driverBundlePath)
|
||||
IOCFPlugInInterface **iodev = NULL;
|
||||
SInt32 score;
|
||||
kern_return_t kr;
|
||||
printer_interface_t intf;
|
||||
printer_interface_t interface;
|
||||
HRESULT res;
|
||||
|
||||
kr = IOCreatePlugInInterfaceForService(g.printer_obj, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &iodev, &score);
|
||||
if (kr == kIOReturnSuccess)
|
||||
{
|
||||
if ((res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &intf)) == noErr)
|
||||
if ((res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &interface)) == noErr)
|
||||
{
|
||||
*driverBundlePath = IORegistryEntryCreateCFProperty(g.printer_obj, kUSBClassDriverProperty, NULL, kNilOptions);
|
||||
|
||||
kr = load_classdriver(*driverBundlePath, intf, &g.classdriver);
|
||||
kr = load_classdriver(*driverBundlePath, interface, &g.classdriver);
|
||||
|
||||
if (kr != kIOReturnSuccess)
|
||||
(*intf)->Release(intf);
|
||||
(*interface)->Release(interface);
|
||||
}
|
||||
IODestroyPlugInInterface(iodev);
|
||||
}
|
||||
@@ -1552,7 +1580,7 @@ static kern_return_t registry_open(CFStringRef *driverBundlePath)
|
||||
* 'registry_close()' - Close the connection to the printer.
|
||||
*/
|
||||
|
||||
static kern_return_t registry_close()
|
||||
static kern_return_t registry_close(void)
|
||||
{
|
||||
if (g.classdriver != NULL)
|
||||
(*g.classdriver)->Close(g.classdriver);
|
||||
@@ -1659,7 +1687,7 @@ static void copy_devicestring(io_service_t usbInterface,
|
||||
IOCFPlugInInterface **iodev = NULL;
|
||||
SInt32 score;
|
||||
kern_return_t kr;
|
||||
printer_interface_t intf;
|
||||
printer_interface_t interface;
|
||||
HRESULT res;
|
||||
classdriver_t **klassDriver = NULL;
|
||||
CFStringRef driverBundlePath;
|
||||
@@ -1670,19 +1698,19 @@ static void copy_devicestring(io_service_t usbInterface,
|
||||
&iodev, &score)) == kIOReturnSuccess)
|
||||
{
|
||||
if ((res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *)
|
||||
&intf)) == noErr)
|
||||
&interface)) == noErr)
|
||||
{
|
||||
(*intf)->GetLocationID(intf, deviceLocation);
|
||||
(*intf)->GetInterfaceNumber(intf, interfaceNumber);
|
||||
(*interface)->GetLocationID(interface, deviceLocation);
|
||||
(*interface)->GetInterfaceNumber(interface, interfaceNumber);
|
||||
|
||||
driverBundlePath = IORegistryEntryCreateCFProperty(usbInterface,
|
||||
kUSBClassDriverProperty,
|
||||
NULL, kNilOptions);
|
||||
|
||||
kr = load_classdriver(driverBundlePath, intf, &klassDriver);
|
||||
kr = load_classdriver(driverBundlePath, interface, &klassDriver);
|
||||
|
||||
if (kr != kIOReturnSuccess && driverBundlePath != NULL)
|
||||
kr = load_classdriver(NULL, intf, &klassDriver);
|
||||
kr = load_classdriver(NULL, interface, &klassDriver);
|
||||
|
||||
if (kr == kIOReturnSuccess && klassDriver != NULL)
|
||||
kr = copy_deviceid(klassDriver, deviceID);
|
||||
@@ -1692,7 +1720,7 @@ static void copy_devicestring(io_service_t usbInterface,
|
||||
if (driverBundlePath != NULL)
|
||||
CFRelease(driverBundlePath);
|
||||
|
||||
/* (*intf)->Release(intf); */
|
||||
/* (*interface)->Release(interface); */
|
||||
}
|
||||
IODestroyPlugInInterface(iodev);
|
||||
}
|
||||
@@ -1831,24 +1859,24 @@ static void parse_options(char *options,
|
||||
* Process the option...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(name, "waiteof"))
|
||||
if (!_cups_strcasecmp(name, "waiteof"))
|
||||
{
|
||||
if (!strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "yes") ||
|
||||
!strcasecmp(value, "true"))
|
||||
if (!_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "yes") ||
|
||||
!_cups_strcasecmp(value, "true"))
|
||||
*wait_eof = true;
|
||||
else if (!strcasecmp(value, "off") ||
|
||||
!strcasecmp(value, "no") ||
|
||||
!strcasecmp(value, "false"))
|
||||
else if (!_cups_strcasecmp(value, "off") ||
|
||||
!_cups_strcasecmp(value, "no") ||
|
||||
!_cups_strcasecmp(value, "false"))
|
||||
*wait_eof = false;
|
||||
else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("WARNING: Boolean expected for waiteof option "
|
||||
"\"%s\"\n"), value);
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("Boolean expected for waiteof option \"%s\"."),
|
||||
value);
|
||||
}
|
||||
else if (!strcasecmp(name, "serial"))
|
||||
else if (!_cups_strcasecmp(name, "serial"))
|
||||
strlcpy(serial, value, serial_size);
|
||||
else if (!strcasecmp(name, "location") && location)
|
||||
else if (!_cups_strcasecmp(name, "location") && location)
|
||||
*location = strtol(value, NULL, 16);
|
||||
}
|
||||
}
|
||||
@@ -1981,7 +2009,8 @@ static void run_legacy_backend(int argc,
|
||||
# else
|
||||
perror("DEBUG: Unable to set binary preference to ppc");
|
||||
# endif /* __x86_64__ */
|
||||
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to use legacy USB class driver."));
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
@@ -2004,7 +2033,8 @@ static void run_legacy_backend(int argc,
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to exec %s: %s\n", usbpath,
|
||||
strerror(err));
|
||||
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to use legacy USB class driver."));
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
@@ -2145,9 +2175,9 @@ static void parse_pserror(char *sockBuffer,
|
||||
pCommentEnd += 3; /* Skip past "]%%" */
|
||||
*pCommentEnd = '\0'; /* There's always room for the nul */
|
||||
|
||||
if (strncasecmp(pCommentBegin, "%%[ Error:", 10) == 0)
|
||||
if (_cups_strncasecmp(pCommentBegin, "%%[ Error:", 10) == 0)
|
||||
logLevel = "DEBUG";
|
||||
else if (strncasecmp(pCommentBegin, "%%[ Flushing", 12) == 0)
|
||||
else if (_cups_strncasecmp(pCommentBegin, "%%[ Flushing", 12) == 0)
|
||||
logLevel = "DEBUG";
|
||||
else
|
||||
logLevel = "INFO";
|
||||
@@ -2174,10 +2204,10 @@ static void parse_pserror(char *sockBuffer,
|
||||
* 'soft_reset()' - Send a soft reset to the device.
|
||||
*/
|
||||
|
||||
static void soft_reset()
|
||||
static void soft_reset(void)
|
||||
{
|
||||
fd_set input_set; /* Input set for select() */
|
||||
struct timeval stimeout; /* Timeout for select() */
|
||||
struct timeval tv; /* Time value */
|
||||
char buffer[2048]; /* Buffer */
|
||||
struct timespec cond_timeout; /* pthread condition timeout */
|
||||
|
||||
@@ -2190,10 +2220,17 @@ static void soft_reset()
|
||||
{
|
||||
(*g.classdriver)->Abort(g.classdriver);
|
||||
|
||||
cond_timeout.tv_sec = time(NULL) + 1;
|
||||
cond_timeout.tv_nsec = 0;
|
||||
gettimeofday(&tv, NULL);
|
||||
cond_timeout.tv_sec = tv.tv_sec + 1;
|
||||
cond_timeout.tv_nsec = tv.tv_usec * 1000;
|
||||
|
||||
pthread_cond_timedwait(&g.readwrite_lock_cond, &g.readwrite_lock_mutex, &cond_timeout);
|
||||
while (g.readwrite_lock)
|
||||
{
|
||||
if (pthread_cond_timedwait(&g.readwrite_lock_cond,
|
||||
&g.readwrite_lock_mutex,
|
||||
&cond_timeout) != 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g.readwrite_lock = 1;
|
||||
@@ -2208,10 +2245,10 @@ static void soft_reset()
|
||||
FD_ZERO(&input_set);
|
||||
FD_SET(g.print_fd, &input_set);
|
||||
|
||||
stimeout.tv_sec = 0;
|
||||
stimeout.tv_usec = 0;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
while (select(g.print_fd+1, &input_set, NULL, NULL, &stimeout) > 0)
|
||||
while (select(g.print_fd+1, &input_set, NULL, NULL, &tv) > 0)
|
||||
if (read(g.print_fd, buffer, sizeof(buffer)) <= 0)
|
||||
break;
|
||||
|
||||
|
||||
+16
-15
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Libusb interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <usb.h>
|
||||
#include <poll.h>
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -100,7 +101,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
usb_printer_t *printer; /* Printer */
|
||||
ssize_t bytes, /* Bytes read/written */
|
||||
tbytes; /* Total bytes written */
|
||||
char buffer[8192]; /* Print data buffer */
|
||||
char buffer[512]; /* Print data buffer */
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
struct pollfd pfds[2]; /* Poll descriptors */
|
||||
|
||||
@@ -113,8 +114,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
while ((printer = find_device(print_cb, uri)) == NULL)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Waiting for printer to become available...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Waiting for printer to become available."));
|
||||
sleep(5);
|
||||
}
|
||||
|
||||
@@ -174,9 +175,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
if (usb_bulk_write(printer->handle, printer->write_endp, buffer,
|
||||
bytes, 3600000) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to write %d bytes to printer!\n"),
|
||||
(int)bytes);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to send data to printer."));
|
||||
tbytes = -1;
|
||||
break;
|
||||
}
|
||||
@@ -411,7 +411,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
|
||||
|
||||
if (usb_control_msg(printer->handle,
|
||||
USB_TYPE_CLASS | USB_ENDPOINT_IN | USB_RECIP_INTERFACE,
|
||||
0, printer->conf, printer->iface,
|
||||
0, printer->conf, (printer->iface << 8) | printer->altset,
|
||||
buffer, bufsize, 5000) < 0)
|
||||
{
|
||||
*buffer = '\0';
|
||||
@@ -514,7 +514,7 @@ make_device_uri(
|
||||
* Get the make, model, and serial numbers...
|
||||
*/
|
||||
|
||||
num_values = _ppdGet1284Values(device_id, &values);
|
||||
num_values = _cupsGet1284Values(device_id, &values);
|
||||
|
||||
if ((sern = cupsGetOption("SERIALNUMBER", num_values, values)) == NULL)
|
||||
if ((sern = cupsGetOption("SERN", num_values, values)) == NULL)
|
||||
@@ -558,9 +558,9 @@ make_device_uri(
|
||||
|
||||
if (mfg)
|
||||
{
|
||||
if (!strcasecmp(mfg, "Hewlett-Packard"))
|
||||
if (!_cups_strcasecmp(mfg, "Hewlett-Packard"))
|
||||
mfg = "HP";
|
||||
else if (!strcasecmp(mfg, "Lexmark International"))
|
||||
else if (!_cups_strcasecmp(mfg, "Lexmark International"))
|
||||
mfg = "Lexmark";
|
||||
}
|
||||
else
|
||||
@@ -675,6 +675,7 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
goto error;
|
||||
}
|
||||
|
||||
#if 0 /* STR #3801: Claiming interface 0 causes problems with some printers */
|
||||
if (number != 0)
|
||||
while (usb_claim_interface(printer->handle, 0) < 0)
|
||||
{
|
||||
@@ -685,6 +686,7 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
|
||||
goto error;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
/*
|
||||
* Set alternate setting...
|
||||
@@ -748,7 +750,7 @@ side_cb(usb_printer_t *printer, /* I - Printer */
|
||||
{
|
||||
ssize_t bytes, /* Bytes read/written */
|
||||
tbytes; /* Total bytes written */
|
||||
char buffer[8192]; /* Print data buffer */
|
||||
char buffer[512]; /* Print data buffer */
|
||||
struct pollfd pfd; /* Poll descriptor */
|
||||
cups_sc_command_t command; /* Request command */
|
||||
cups_sc_status_t status; /* Request/response status */
|
||||
@@ -775,9 +777,8 @@ side_cb(usb_printer_t *printer, /* I - Printer */
|
||||
while (usb_bulk_write(printer->handle, printer->write_endp, buffer,
|
||||
bytes, 5000) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to write %d bytes to printer!\n"),
|
||||
(int)bytes);
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to send data to printer."));
|
||||
tbytes = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
+22
-30
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* USB port backend for the Common UNIX Printing System (CUPS).
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -56,7 +56,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
{
|
||||
int use_bc; /* Use backchannel path? */
|
||||
int device_fd; /* USB device */
|
||||
size_t tbytes; /* Total number of bytes written */
|
||||
ssize_t tbytes; /* Total number of bytes written */
|
||||
struct termios opts; /* Parallel port options */
|
||||
|
||||
|
||||
@@ -96,10 +96,10 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* a read request...
|
||||
*/
|
||||
|
||||
use_bc = strcasecmp(hostname, "Brother") &&
|
||||
strcasecmp(hostname, "Canon") &&
|
||||
strncasecmp(hostname, "Konica", 6) &&
|
||||
strncasecmp(hostname, "Minolta", 7);
|
||||
use_bc = _cups_strcasecmp(hostname, "Brother") &&
|
||||
_cups_strcasecmp(hostname, "Canon") &&
|
||||
_cups_strncasecmp(hostname, "Konica", 6) &&
|
||||
_cups_strncasecmp(hostname, "Minolta", 7);
|
||||
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
@@ -113,9 +113,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* available printer in the class.
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Unable to contact printer, queuing on next "
|
||||
"printer in class...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to contact printer, queuing on next "
|
||||
"printer in class."));
|
||||
|
||||
/*
|
||||
* Sleep 5 seconds to keep the job from requeuing too rapidly...
|
||||
@@ -128,23 +128,21 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (errno == EBUSY)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 10 seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer busy, will retry in 10 seconds."));
|
||||
sleep(10);
|
||||
}
|
||||
else if (errno == ENXIO || errno == EIO || errno == ENOENT ||
|
||||
errno == ENODEV)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer not connected; will retry in 30 "
|
||||
"seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer not connected, will retry in 30 "
|
||||
"seconds."));
|
||||
sleep(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("ERROR: Unable to open device file \"%s\": %s\n"),
|
||||
resource, strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open device file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
@@ -194,13 +192,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
#endif /* __sun */
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintf(stderr,
|
||||
#ifdef HAVE_LONG_LONG
|
||||
_("INFO: Sent print file, %lld bytes...\n"),
|
||||
#else
|
||||
_("INFO: Sent print file, %ld bytes...\n"),
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
CUPS_LLCAST tbytes);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Print file sent."));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -209,7 +201,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
close(device_fd);
|
||||
|
||||
return (tbytes < 0 ? CUPS_BACKEND_FAILED : CUPS_BACKEND_OK);
|
||||
return (CUPS_BACKEND_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -433,8 +425,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
*/
|
||||
|
||||
if (busy)
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer busy; will retry in 5 seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer is busy, will retry in 5 seconds."));
|
||||
|
||||
sleep(5);
|
||||
}
|
||||
@@ -517,8 +509,8 @@ open_device(const char *uri, /* I - Device URI */
|
||||
|
||||
if (busy)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("INFO: Printer is busy; will retry in 5 seconds...\n"));
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Printer is busy, will retry in 5 seconds."));
|
||||
sleep(5);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-8
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* USB port backend for the Common UNIX Printing System (CUPS).
|
||||
* USB port backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -180,7 +180,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
else if (argc < 6 || argc > 7)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("Usage: %s job-id user title copies options [file]\n"),
|
||||
_("Usage: %s job-id user title copies options [file]"),
|
||||
argv[0]);
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
@@ -196,9 +196,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) < HTTP_URI_OK)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("ERROR: No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable!\n"));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("No device URI found in argv[0] or in DEVICE_URI "
|
||||
"environment variable."));
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -234,8 +234,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if ((print_fd = open(argv[6], O_RDONLY)) < 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("ERROR: Unable to open print file %s - %s\n"),
|
||||
argv[6], strerror(errno));
|
||||
_cupsLangPrintError("ERROR", _("Unable to open print file"));
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
+32
-14
@@ -1,16 +1,34 @@
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h
|
||||
lpc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
lpc.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h ../cups/string.h
|
||||
lpc.o: ../config.h
|
||||
lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
|
||||
lpq.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h ../cups/array.h
|
||||
lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
lpq.o: ../cups/debug.h
|
||||
lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h
|
||||
lpr.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h ../cups/array.h
|
||||
lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h
|
||||
lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/versioning.h
|
||||
lprm.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
|
||||
lprm.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
lpc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpc.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lpc.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lpc.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpc.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lpc.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lpc.o: ../cups/thread-private.h
|
||||
lpq.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpq.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpq.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lpq.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lpq.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpq.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lpq.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lpq.o: ../cups/thread-private.h
|
||||
lpr.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lpr.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lpr.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lpr.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lpr.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lpr.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lpr.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lpr.o: ../cups/thread-private.h
|
||||
lprm.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h
|
||||
lprm.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
lprm.o: ../cups/language.h ../cups/string-private.h ../config.h
|
||||
lprm.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h
|
||||
lprm.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h
|
||||
lprm.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h
|
||||
lprm.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h
|
||||
lprm.o: ../cups/thread-private.h
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Berkeley commands makefile for the Common UNIX Printing System (CUPS).
|
||||
# Berkeley commands makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2009 by Apple Inc.
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
|
||||
+20
-25
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lpc" command for the Common UNIX Printing System (CUPS).
|
||||
* "lpc" command for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -25,12 +25,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/debug.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -78,7 +73,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* Do the command prompt thing...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stdout, _("lpc> "));
|
||||
_cupsLangPuts(stdout, _("lpc> ")); /* TODO: Need no-newline version */
|
||||
while (fgets(line, sizeof(line), stdin) != NULL)
|
||||
{
|
||||
/*
|
||||
@@ -106,7 +101,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* Nothing left, just show a prompt...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stdout, _("lpc> "));
|
||||
_cupsLangPuts(stdout, _("lpc> ")); /* TODO: Need no newline version */
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -142,7 +137,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* Put another prompt out to the user...
|
||||
*/
|
||||
|
||||
_cupsLangPuts(stdout, _("lpc> "));
|
||||
_cupsLangPuts(stdout, _("lpc> ")); /* TODO: Need no newline version */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +186,7 @@ do_command(http_t *http, /* I - HTTP connection to server */
|
||||
show_help(params);
|
||||
else
|
||||
_cupsLangPrintf(stdout,
|
||||
_("%s is not implemented by the CUPS version of lpc.\n"),
|
||||
_("%s is not implemented by the CUPS version of lpc."),
|
||||
command);
|
||||
}
|
||||
|
||||
@@ -208,14 +203,14 @@ show_help(const char *command) /* I - Command to describe or NULL */
|
||||
_cupsLangPrintf(stdout,
|
||||
_("Commands may be abbreviated. Commands are:\n"
|
||||
"\n"
|
||||
"exit help quit status ?\n"));
|
||||
"exit help quit status ?"));
|
||||
}
|
||||
else if (!compare_strings(command, "help", 1) || !strcmp(command, "?"))
|
||||
_cupsLangPrintf(stdout, _("help\t\tget help on commands\n"));
|
||||
_cupsLangPrintf(stdout, _("help\t\tGet help on commands."));
|
||||
else if (!compare_strings(command, "status", 4))
|
||||
_cupsLangPrintf(stdout, _("status\t\tshow status of daemon and queue\n"));
|
||||
_cupsLangPrintf(stdout, _("status\t\tShow status of daemon and queue."));
|
||||
else
|
||||
_cupsLangPrintf(stdout, _("?Invalid help command unknown\n"));
|
||||
_cupsLangPrintf(stdout, _("?Invalid help command unknown."));
|
||||
}
|
||||
|
||||
|
||||
@@ -405,7 +400,7 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
printf("%s:\n", printer);
|
||||
if (!strncmp(device, "file:", 5))
|
||||
_cupsLangPrintf(stdout,
|
||||
_("\tprinter is on device \'%s\' speed -1\n"),
|
||||
_("\tprinter is on device \'%s\' speed -1"),
|
||||
device + 5);
|
||||
else
|
||||
{
|
||||
@@ -417,27 +412,27 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
{
|
||||
*delimiter = '\0';
|
||||
_cupsLangPrintf(stdout,
|
||||
_("\tprinter is on device \'%s\' speed -1\n"),
|
||||
_("\tprinter is on device \'%s\' speed -1"),
|
||||
device);
|
||||
}
|
||||
}
|
||||
|
||||
if (accepting)
|
||||
_cupsLangPuts(stdout, _("\tqueuing is enabled\n"));
|
||||
_cupsLangPuts(stdout, _("\tqueuing is enabled"));
|
||||
else
|
||||
_cupsLangPuts(stdout, _("\tqueuing is disabled\n"));
|
||||
_cupsLangPuts(stdout, _("\tqueuing is disabled"));
|
||||
|
||||
if (pstate != IPP_PRINTER_STOPPED)
|
||||
_cupsLangPuts(stdout, _("\tprinting is enabled\n"));
|
||||
_cupsLangPuts(stdout, _("\tprinting is enabled"));
|
||||
else
|
||||
_cupsLangPuts(stdout, _("\tprinting is disabled\n"));
|
||||
_cupsLangPuts(stdout, _("\tprinting is disabled"));
|
||||
|
||||
if (jobcount == 0)
|
||||
_cupsLangPuts(stdout, _("\tno entries\n"));
|
||||
_cupsLangPuts(stdout, _("\tno entries"));
|
||||
else
|
||||
_cupsLangPrintf(stdout, _("\t%d entries\n"), jobcount);
|
||||
_cupsLangPrintf(stdout, _("\t%d entries"), jobcount);
|
||||
|
||||
_cupsLangPuts(stdout, _("\tdaemon present\n"));
|
||||
_cupsLangPuts(stdout, _("\tdaemon present"));
|
||||
}
|
||||
|
||||
if (attr == NULL)
|
||||
|
||||
+31
-39
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lpq" command for the Common UNIX Printing System (CUPS).
|
||||
* "lpq" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -28,12 +28,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/debug.h>
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -99,8 +94,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (http)
|
||||
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
|
||||
#else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Sorry, no encryption support compiled in!\n"),
|
||||
_cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."),
|
||||
argv[0]);
|
||||
#endif /* HAVE_SSL */
|
||||
break;
|
||||
@@ -115,15 +109,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected username after "
|
||||
"\'-U\' option!\n"),
|
||||
argv[0]);
|
||||
"\"-U\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsSetUser(argv[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'P' : /* Printer */
|
||||
if (argv[i][2])
|
||||
dest = argv[i] + 2;
|
||||
@@ -135,7 +128,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
httpClose(http);
|
||||
cupsFreeDests(num_dests, dests);
|
||||
|
||||
|
||||
usage();
|
||||
}
|
||||
|
||||
@@ -154,11 +147,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
if (instance)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown destination \"%s/%s\"!\n"),
|
||||
_("%s: Error - unknown destination \"%s/%s\"."),
|
||||
argv[0], dest, instance);
|
||||
else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Unknown destination \"%s\"!\n"),
|
||||
_cupsLangPrintf(stderr, _("%s: Unknown destination \"%s\"."),
|
||||
argv[0], dest);
|
||||
|
||||
return (1);
|
||||
@@ -186,8 +178,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected hostname after "
|
||||
"\'-h\' option!\n"),
|
||||
argv[0]);
|
||||
"\"-h\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
@@ -242,12 +233,12 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (dest && !cupsGetDest(dest, NULL, num_dests, dests))
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: error - %s environment variable names "
|
||||
"non-existent destination \"%s\"!\n"),
|
||||
argv[0], val, dest);
|
||||
_("%s: Error - %s environment variable names "
|
||||
"non-existent destination \"%s\"."), argv[0], val,
|
||||
dest);
|
||||
else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: error - no default destination available.\n"),
|
||||
_("%s: Error - no default destination available."),
|
||||
argv[0]);
|
||||
httpClose(http);
|
||||
cupsFreeDests(num_dests, dests);
|
||||
@@ -301,7 +292,7 @@ connect_server(const char *command, /* I - Command name */
|
||||
|
||||
if (http == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Unable to connect to server\n"), command);
|
||||
_cupsLangPrintf(stderr, _("%s: Unable to connect to server."), command);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -423,7 +414,7 @@ show_jobs(const char *command, /* I - Command name */
|
||||
{
|
||||
if (response->request.status.status_code > IPP_OK_CONFLICT)
|
||||
{
|
||||
_cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, "%s: %s", command, cupsLastErrorString());
|
||||
ippDelete(response);
|
||||
return (0);
|
||||
}
|
||||
@@ -516,12 +507,13 @@ 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\n"));
|
||||
" Total Size"));
|
||||
#else
|
||||
_cupsLangPuts(stdout,
|
||||
_("Rank Owner Job File(s)"
|
||||
" Total Size\n"));
|
||||
" Total Size"));
|
||||
#endif /* __osf__ */
|
||||
|
||||
jobcount ++;
|
||||
@@ -557,20 +549,20 @@ show_jobs(const char *command, /* I - Command name */
|
||||
else
|
||||
strlcpy(namestr, jobname, sizeof(namestr));
|
||||
|
||||
_cupsLangPrintf(stdout, _("%s: %-33.33s [job %d localhost]\n"),
|
||||
_cupsLangPrintf(stdout, _("%s: %-33.33s [job %d localhost]"),
|
||||
jobuser, rankstr, jobid);
|
||||
_cupsLangPrintf(stdout, _(" %-39.39s %.0f bytes\n"),
|
||||
_cupsLangPrintf(stdout, _(" %-39.39s %.0f bytes"),
|
||||
namestr, 1024.0 * jobsize);
|
||||
}
|
||||
else
|
||||
#ifdef __osf__
|
||||
_cupsLangPrintf(stdout,
|
||||
_("%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n"),
|
||||
_("%-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\n"),
|
||||
_("%-7s %-7.7s %-7d %-31.31s %.0f bytes"),
|
||||
rankstr, jobuser, jobid, jobname, 1024.0 * jobsize);
|
||||
#endif /* __osf */
|
||||
|
||||
@@ -582,12 +574,12 @@ show_jobs(const char *command, /* I - Command name */
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, "%s: %s", command, cupsLastErrorString());
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (jobcount == 0)
|
||||
_cupsLangPuts(stdout, _("no entries\n"));
|
||||
_cupsLangPuts(stdout, _("no entries"));
|
||||
|
||||
return (jobcount);
|
||||
}
|
||||
@@ -636,7 +628,7 @@ show_printer(const char *command, /* I - Command name */
|
||||
{
|
||||
if (response->request.status.status_code > IPP_OK_CONFLICT)
|
||||
{
|
||||
_cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, "%s: %s", command, cupsLastErrorString());
|
||||
ippDelete(response);
|
||||
return;
|
||||
}
|
||||
@@ -649,21 +641,21 @@ show_printer(const char *command, /* I - Command name */
|
||||
switch (state)
|
||||
{
|
||||
case IPP_PRINTER_IDLE :
|
||||
_cupsLangPrintf(stdout, _("%s is ready\n"), dest);
|
||||
_cupsLangPrintf(stdout, _("%s is ready"), dest);
|
||||
break;
|
||||
case IPP_PRINTER_PROCESSING :
|
||||
_cupsLangPrintf(stdout, _("%s is ready and printing\n"),
|
||||
_cupsLangPrintf(stdout, _("%s is ready and printing"),
|
||||
dest);
|
||||
break;
|
||||
case IPP_PRINTER_STOPPED :
|
||||
_cupsLangPrintf(stdout, _("%s is not ready\n"), dest);
|
||||
_cupsLangPrintf(stdout, _("%s is not ready"), dest);
|
||||
break;
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
}
|
||||
else
|
||||
_cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, "%s: %s", command, cupsLastErrorString());
|
||||
}
|
||||
|
||||
|
||||
@@ -676,7 +668,7 @@ usage(void)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("Usage: lpq [-P dest] [-U username] [-h hostname[:port]] "
|
||||
"[-l] [+interval]\n"));
|
||||
"[-l] [+interval]"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
+28
-42
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lpr" command for the Common UNIX Printing System (CUPS).
|
||||
* "lpr" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -21,13 +21,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <cups/string.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -73,8 +67,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
#ifdef HAVE_SSL
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
#else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Sorry, no encryption support compiled in!\n"),
|
||||
_cupsLangPrintf(stderr, _("%s: Sorry, no encryption support."),
|
||||
argv[0]);
|
||||
#endif /* HAVE_SSL */
|
||||
break;
|
||||
@@ -89,8 +82,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected username after "
|
||||
"\'-U\' option!\n"),
|
||||
argv[0]);
|
||||
"\"-U\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -109,8 +101,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected hostname after "
|
||||
"\'-H\' option!\n"),
|
||||
argv[0]);
|
||||
"\"-H\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
else
|
||||
@@ -131,8 +122,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected value after \'-%c\' "
|
||||
"option!\n"), argv[0], ch);
|
||||
_("%s: Error - expected value after \"-%c\" "
|
||||
"option."), argv[0], ch);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
@@ -145,8 +136,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
case 't' : /* Troff */
|
||||
case 'v' : /* Raster image */
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Warning - \'%c\' format modifier not "
|
||||
"supported - output may not be correct!\n"),
|
||||
_("%s: Warning - \"%c\" format modifier not "
|
||||
"supported - output may not be correct."),
|
||||
argv[0], ch);
|
||||
break;
|
||||
|
||||
@@ -159,9 +150,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: error - expected option=value after "
|
||||
"\'-o\' option!\n"),
|
||||
argv[0]);
|
||||
_("%s: Error - expected option=value after "
|
||||
"\"-o\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -217,8 +207,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected destination after "
|
||||
"\'-P\' option!\n"),
|
||||
argv[0]);
|
||||
"\"-P\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -248,9 +237,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected copy count after "
|
||||
"\'-#\' option!\n"),
|
||||
argv[0]);
|
||||
_("%s: Error - expected copies after "
|
||||
"\"-#\" option."), argv[0]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -272,8 +260,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected name after \'-%c\' "
|
||||
"option!\n"), argv[0], ch);
|
||||
_("%s: Error - expected name after \"-%c\" "
|
||||
"option."), argv[0], ch);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -283,8 +271,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
default :
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown option \'%c\'!\n"),
|
||||
argv[0], argv[i][1]);
|
||||
_("%s: Error - unknown option \"%c\"."), argv[0],
|
||||
argv[i][1]);
|
||||
return (1);
|
||||
}
|
||||
else if (num_files < 1000)
|
||||
@@ -296,7 +284,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (access(argv[i], R_OK) != 0)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unable to access \"%s\" - %s\n"),
|
||||
_("%s: Error - unable to access \"%s\" - %s"),
|
||||
argv[0], argv[i], strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
@@ -314,8 +302,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - too many files - \"%s\"\n"),
|
||||
argv[0], argv[i]);
|
||||
_("%s: Error - too many files - \"%s\"."), argv[0],
|
||||
argv[i]);
|
||||
/*
|
||||
* See if we have any files to print; if not, print from stdin...
|
||||
*/
|
||||
@@ -354,15 +342,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (printer && !cupsGetNamedDest(NULL, printer, NULL))
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - %s environment variable names "
|
||||
"non-existent destination \"%s\"!\n"),
|
||||
argv[0], val, printer);
|
||||
"non-existent destination \"%s\"."), argv[0], val,
|
||||
printer);
|
||||
else if (cupsLastError() == IPP_NOT_FOUND)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - no default destination available.\n"),
|
||||
_("%s: Error - no default destination available."),
|
||||
argv[0]);
|
||||
else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - scheduler not responding!\n"),
|
||||
_cupsLangPrintf(stderr, _("%s: Error - scheduler not responding."),
|
||||
argv[0]);
|
||||
|
||||
return (1);
|
||||
@@ -406,8 +393,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (status != HTTP_CONTINUE)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unable to queue from stdin - %s\n"),
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unable to queue from stdin - %s."),
|
||||
argv[0], httpStatus(status));
|
||||
return (1);
|
||||
}
|
||||
@@ -418,7 +404,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (job_id < 1)
|
||||
{
|
||||
_cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, "%s: %s", argv[0], cupsLastErrorString());
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
+11
-21
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* "lprm" command for the Common UNIX Printing System (CUPS).
|
||||
* "lprm" command for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -21,12 +21,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -69,8 +64,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
#else
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Sorry, no encryption support compiled in!\n"),
|
||||
argv[0]);
|
||||
_("%s: Sorry, no encryption support."), argv[0]);
|
||||
#endif /* HAVE_SSL */
|
||||
break;
|
||||
|
||||
@@ -90,7 +84,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
NULL)) == NULL)
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown destination \"%s\"!\n"),
|
||||
_("%s: Error - unknown destination \"%s\"."),
|
||||
argv[0], name);
|
||||
goto error;
|
||||
}
|
||||
@@ -108,8 +102,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected username after "
|
||||
"\'-U\' option!\n"),
|
||||
argv[0]);
|
||||
"\"-U\" option."), argv[0]);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -128,8 +121,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected hostname after "
|
||||
"\'-h\' option!\n"),
|
||||
argv[0]);
|
||||
"\"-h\" option."), argv[0]);
|
||||
goto error;
|
||||
}
|
||||
else
|
||||
@@ -144,8 +136,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
break;
|
||||
|
||||
default :
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown option \'%c\'!\n"),
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown option \"%c\"."),
|
||||
argv[0], argv[i][1]);
|
||||
goto error;
|
||||
}
|
||||
@@ -178,15 +169,14 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
else
|
||||
{
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - unknown destination \"%s\"!\n"),
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown destination \"%s\"."),
|
||||
argv[0], argv[i]);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (cupsCancelJob2(CUPS_HTTP_DEFAULT, name, job_id, 0) != IPP_OK)
|
||||
{
|
||||
_cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, "%s: %s", argv[0], cupsLastErrorString());
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -200,7 +190,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (!did_cancel && cupsCancelJob2(CUPS_HTTP_DEFAULT, name, 0, 0) != IPP_OK)
|
||||
{
|
||||
_cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString());
|
||||
_cupsLangPrintf(stderr, "%s: %s", argv[0], cupsLastErrorString());
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
+73
-62
@@ -1,64 +1,75 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
help-index.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h
|
||||
help-index.o: ../cups/file.h ../cups/language.h ../cups/array.h help-index.h
|
||||
help-index.o: ../cups/debug.h ../cups/i18n.h ../cups/transcode.h
|
||||
help-index.o: ../cups/string.h ../config.h ../cups/dir.h
|
||||
html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
html.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
html.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
html.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
ipp-var.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
ipp-var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
search.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
search.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
search.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
template.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
template.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
template.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
var.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
admin.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
admin.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
admin.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/file.h
|
||||
classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
classes.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
classes.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
classes.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
help.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
help.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
help.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
jobs.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
jobs.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
jobs.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
makedocset.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
makedocset.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h
|
||||
makedocset.o: ../cups/file.h ../cups/language.h ../cups/array.h help-index.h
|
||||
printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
printers.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
printers.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h
|
||||
printers.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
|
||||
testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
testcgi.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
testcgi.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
testhi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
testhi.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h ../cups/file.h
|
||||
testhi.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
testtemplate.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
testtemplate.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h
|
||||
testtemplate.o: ../cups/file.h ../cups/language.h ../cups/array.h
|
||||
testtemplate.o: help-index.h
|
||||
websearch.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
|
||||
websearch.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h
|
||||
websearch.o: ../cups/file.h ../cups/language.h ../cups/array.h help-index.h
|
||||
help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
help-index.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h
|
||||
help-index.o: ../cups/array.h ../cups/language.h ../cups/array.h help-index.h
|
||||
help-index.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
help-index.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
help-index.o: ../cups/dir.h
|
||||
html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
html.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
html.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
html.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
html.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
ipp-var.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
ipp-var.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
ipp-var.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
ipp-var.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
search.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
search.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
search.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
search.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
template.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
template.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
template.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
template.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
var.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
var.o: ../cups/array.h help-index.h ../cups/debug-private.h
|
||||
var.o: ../cups/language-private.h ../cups/transcode.h
|
||||
var.o: ../cups/string-private.h ../config.h ../cups/http.h
|
||||
var.o: ../cups/md5-private.h
|
||||
admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
admin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
admin.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
admin.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
admin.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/ppd.h
|
||||
classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
classes.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
classes.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
classes.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
help.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
help.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
help.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
help.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
jobs.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
jobs.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
jobs.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
jobs.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
makedocset.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
makedocset.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
makedocset.o: ../cups/array.h help-index.h
|
||||
printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h
|
||||
printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
printers.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
printers.o: ../cups/debug-private.h ../cups/language-private.h
|
||||
printers.o: ../cups/transcode.h ../cups/string-private.h ../config.h
|
||||
testcgi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
testcgi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
testcgi.o: ../cups/array.h help-index.h
|
||||
testhi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
testhi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
testhi.o: ../cups/array.h help-index.h
|
||||
testtemplate.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
testtemplate.o: ../cups/ipp.h ../cups/http.h ../cups/array.h
|
||||
testtemplate.o: ../cups/language.h ../cups/array.h help-index.h
|
||||
websearch.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h
|
||||
websearch.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h
|
||||
websearch.o: ../cups/array.h help-index.h
|
||||
|
||||
+10
-10
@@ -307,10 +307,10 @@ jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
# makedocset
|
||||
#
|
||||
|
||||
makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
|
||||
../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
@@ -327,10 +327,10 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
# testcgi
|
||||
#
|
||||
|
||||
testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
|
||||
../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
echo Testing CGI API...
|
||||
./testcgi
|
||||
@@ -340,10 +340,10 @@ testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
# testhi
|
||||
#
|
||||
|
||||
testhi: testhi.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
|
||||
../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
echo Testing help index API...
|
||||
./testhi
|
||||
@@ -353,9 +353,9 @@ testhi: testhi.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
# testtemplate
|
||||
#
|
||||
|
||||
testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/libcups.a \
|
||||
$(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
|
||||
$(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
@@ -363,10 +363,10 @@ testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
# websearch
|
||||
#
|
||||
|
||||
websearch: websearch.o ../Makedefs libcupscgi.a ../cups/libcups.a
|
||||
websearch: websearch.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \
|
||||
../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
|
||||
|
||||
|
||||
+105
-63
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Administration CGI for the Common UNIX Printing System (CUPS).
|
||||
* Administration CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#include "cgi-private.h"
|
||||
#include <cups/adminutil.h>
|
||||
#include <cups/file.h>
|
||||
#include <cups/ppd.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
@@ -145,7 +145,30 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
fprintf(stderr, "DEBUG: op=\"%s\"...\n", op);
|
||||
|
||||
if (!strcmp(op, "set-allowed-users"))
|
||||
if (!*op)
|
||||
{
|
||||
const char *printer = getenv("PRINTER_NAME"),
|
||||
/* Printer or class name */
|
||||
*server_port = getenv("SERVER_PORT");
|
||||
/* Port number string */
|
||||
int port = atoi(server_port ? server_port : "0");
|
||||
/* Port number */
|
||||
char uri[1024]; /* URL */
|
||||
|
||||
if (printer)
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri),
|
||||
getenv("HTTPS") ? "https" : "http", NULL,
|
||||
getenv("SERVER_NAME"), port, "/%s/%s",
|
||||
cgiGetVariable("IS_CLASS") ? "classes" : "printers",
|
||||
printer);
|
||||
else
|
||||
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri),
|
||||
getenv("HTTPS") ? "https" : "http", NULL,
|
||||
getenv("SERVER_NAME"), port, "/admin");
|
||||
|
||||
printf("Location: %s\n\n", uri);
|
||||
}
|
||||
else if (!strcmp(op, "set-allowed-users"))
|
||||
do_set_allowed_users(http);
|
||||
else if (!strcmp(op, "set-as-default"))
|
||||
do_set_default(http);
|
||||
@@ -473,7 +496,7 @@ do_add_rss_subscription(http_t *http) /* I - HTTP connection */
|
||||
|
||||
request = ippNewRequest(IPP_CREATE_PRINTER_SUBSCRIPTION);
|
||||
|
||||
if (!strcasecmp(printer_uri, "#ALL#"))
|
||||
if (!_cups_strcasecmp(printer_uri, "#ALL#"))
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, "ipp://localhost/");
|
||||
else
|
||||
@@ -588,7 +611,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
|
||||
if (attr->name && !strcmp(attr->name, "printer-uri-supported"))
|
||||
{
|
||||
if ((ptr = strrchr(attr->values[0].string.text, '/')) != NULL &&
|
||||
(!name || strcasecmp(name, ptr + 1)))
|
||||
(!name || _cups_strcasecmp(name, ptr + 1)))
|
||||
{
|
||||
/*
|
||||
* Don't show the current class...
|
||||
@@ -604,7 +627,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
|
||||
attr = attr->next)
|
||||
if (attr->name && !strcmp(attr->name, "printer-name"))
|
||||
{
|
||||
if (!name || strcasecmp(name, attr->values[0].string.text))
|
||||
if (!name || _cups_strcasecmp(name, attr->values[0].string.text))
|
||||
{
|
||||
/*
|
||||
* Don't show the current class...
|
||||
@@ -665,7 +688,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
|
||||
{
|
||||
for (j = 0; j < num_printers; j ++)
|
||||
{
|
||||
if (!strcasecmp(attr->values[i].string.text,
|
||||
if (!_cups_strcasecmp(attr->values[i].string.text,
|
||||
cgiGetArray("MEMBER_NAMES", j)))
|
||||
{
|
||||
cgiSetArray("MEMBER_SELECTED", j, "SELECTED");
|
||||
@@ -711,7 +734,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
|
||||
if (!name)
|
||||
{
|
||||
cgiStartHTML(title);
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
return;
|
||||
@@ -937,13 +960,13 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
*makeptr = '\0';
|
||||
else if ((makeptr = strchr(make, '-')) != NULL)
|
||||
*makeptr = '\0';
|
||||
else if (!strncasecmp(make, "laserjet", 8) ||
|
||||
!strncasecmp(make, "deskjet", 7) ||
|
||||
!strncasecmp(make, "designjet", 9))
|
||||
else if (!_cups_strncasecmp(make, "laserjet", 8) ||
|
||||
!_cups_strncasecmp(make, "deskjet", 7) ||
|
||||
!_cups_strncasecmp(make, "designjet", 9))
|
||||
strcpy(make, "HP");
|
||||
else if (!strncasecmp(make, "phaser", 6))
|
||||
else if (!_cups_strncasecmp(make, "phaser", 6))
|
||||
strcpy(make, "Xerox");
|
||||
else if (!strncasecmp(make, "stylus", 6))
|
||||
else if (!_cups_strncasecmp(make, "stylus", 6))
|
||||
strcpy(make, "Epson");
|
||||
else
|
||||
strcpy(make, "Generic");
|
||||
@@ -1003,7 +1026,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
fputs("DEBUG: Getting list of devices...\n", stderr);
|
||||
|
||||
current_device = 0;
|
||||
if (cupsGetDevices(http, 30, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
|
||||
if (cupsGetDevices(http, 5, CUPS_INCLUDE_ALL, CUPS_EXCLUDE_NONE,
|
||||
(cups_device_cb_t)choose_device_cb,
|
||||
(void *)title) == IPP_OK)
|
||||
{
|
||||
@@ -1040,7 +1063,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strchr(var, '/') == NULL)
|
||||
else if (!strchr(var, '/') ||
|
||||
(!strncmp(var, "lpd://", 6) && !strchr(var + 6, '/')))
|
||||
{
|
||||
if ((attr = ippFindAttribute(oldinfo, "device-uri", IPP_TAG_URI)) != NULL)
|
||||
{
|
||||
@@ -1458,7 +1482,7 @@ do_cancel_subscription(http_t *http)/* I - HTTP connection */
|
||||
|
||||
if (id <= 0)
|
||||
{
|
||||
cgiSetVariable("ERROR", cgiText(_("Bad subscription ID!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Bad subscription ID")));
|
||||
cgiStartHTML(_("Cancel RSS Subscription"));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -1701,7 +1725,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
val = cupsGetOption("DefaultAuthType", num_settings, settings);
|
||||
|
||||
if (!val || !strcasecmp(val, "Negotiate"))
|
||||
if (!val || !_cups_strcasecmp(val, "Negotiate"))
|
||||
strlcpy(default_auth_type, "Basic", sizeof(default_auth_type));
|
||||
else
|
||||
strlcpy(default_auth_type, val, sizeof(default_auth_type));
|
||||
@@ -1769,14 +1793,14 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
num_settings, settings));
|
||||
|
||||
if (advanced && !changed)
|
||||
changed = strcasecmp(local_protocols, current_local_protocols) ||
|
||||
strcasecmp(remote_protocols, current_remote_protocols) ||
|
||||
strcasecmp(browse_web_if, current_browse_web_if) ||
|
||||
strcasecmp(preserve_job_history, current_preserve_job_history) ||
|
||||
strcasecmp(preserve_job_files, current_preserve_job_files) ||
|
||||
strcasecmp(max_clients, current_max_clients) ||
|
||||
strcasecmp(max_jobs, current_max_jobs) ||
|
||||
strcasecmp(max_log_size, current_max_log_size);
|
||||
changed = _cups_strcasecmp(local_protocols, current_local_protocols) ||
|
||||
_cups_strcasecmp(remote_protocols, current_remote_protocols) ||
|
||||
_cups_strcasecmp(browse_web_if, current_browse_web_if) ||
|
||||
_cups_strcasecmp(preserve_job_history, current_preserve_job_history) ||
|
||||
_cups_strcasecmp(preserve_job_files, current_preserve_job_files) ||
|
||||
_cups_strcasecmp(max_clients, current_max_clients) ||
|
||||
_cups_strcasecmp(max_jobs, current_max_jobs) ||
|
||||
_cups_strcasecmp(max_log_size, current_max_log_size);
|
||||
|
||||
if (changed)
|
||||
{
|
||||
@@ -1810,29 +1834,29 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
* Add advanced settings...
|
||||
*/
|
||||
|
||||
if (strcasecmp(local_protocols, current_local_protocols))
|
||||
if (_cups_strcasecmp(local_protocols, current_local_protocols))
|
||||
num_settings = cupsAddOption("BrowseLocalProtocols", local_protocols,
|
||||
num_settings, &settings);
|
||||
if (strcasecmp(remote_protocols, current_remote_protocols))
|
||||
if (_cups_strcasecmp(remote_protocols, current_remote_protocols))
|
||||
num_settings = cupsAddOption("BrowseRemoteProtocols", remote_protocols,
|
||||
num_settings, &settings);
|
||||
if (strcasecmp(browse_web_if, current_browse_web_if))
|
||||
if (_cups_strcasecmp(browse_web_if, current_browse_web_if))
|
||||
num_settings = cupsAddOption("BrowseWebIF", browse_web_if,
|
||||
num_settings, &settings);
|
||||
if (strcasecmp(preserve_job_history, current_preserve_job_history))
|
||||
if (_cups_strcasecmp(preserve_job_history, current_preserve_job_history))
|
||||
num_settings = cupsAddOption("PreserveJobHistory",
|
||||
preserve_job_history, num_settings,
|
||||
&settings);
|
||||
if (strcasecmp(preserve_job_files, current_preserve_job_files))
|
||||
if (_cups_strcasecmp(preserve_job_files, current_preserve_job_files))
|
||||
num_settings = cupsAddOption("PreserveJobFiles", preserve_job_files,
|
||||
num_settings, &settings);
|
||||
if (strcasecmp(max_clients, current_max_clients))
|
||||
if (_cups_strcasecmp(max_clients, current_max_clients))
|
||||
num_settings = cupsAddOption("MaxClients", max_clients, num_settings,
|
||||
&settings);
|
||||
if (strcasecmp(max_jobs, current_max_jobs))
|
||||
if (_cups_strcasecmp(max_jobs, current_max_jobs))
|
||||
num_settings = cupsAddOption("MaxJobs", max_jobs, num_settings,
|
||||
&settings);
|
||||
if (strcasecmp(max_log_size, current_max_log_size))
|
||||
if (_cups_strcasecmp(max_log_size, current_max_log_size))
|
||||
num_settings = cupsAddOption("MaxLogSize", max_log_size, num_settings,
|
||||
&settings);
|
||||
}
|
||||
@@ -2022,7 +2046,7 @@ do_config_server(http_t *http) /* I - HTTP connection */
|
||||
cgiText(_("Unable to access cupsd.conf file:")));
|
||||
cgiSetVariable("ERROR",
|
||||
cgiText(_("Unable to edit cupsd.conf files larger than "
|
||||
"1MB!")));
|
||||
"1MB")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
|
||||
@@ -2153,7 +2177,7 @@ do_delete_class(http_t *http) /* I - HTTP connection */
|
||||
else
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Delete Class")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
return;
|
||||
@@ -2238,7 +2262,7 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
|
||||
else
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Delete Printer")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
return;
|
||||
@@ -2355,7 +2379,7 @@ do_export(http_t *http) /* I - HTTP connection */
|
||||
dest = cgiGetArray("PRINTER_NAME", i);
|
||||
|
||||
for (j = 0; j < export_count; j ++)
|
||||
if (!strcasecmp(dest, cgiGetArray("EXPORT_NAME", j)))
|
||||
if (!_cups_strcasecmp(dest, cgiGetArray("EXPORT_NAME", j)))
|
||||
break;
|
||||
|
||||
cgiSetArray("PRINTER_EXPORT", i, j < export_count ? "Y" : "");
|
||||
@@ -2413,11 +2437,11 @@ do_export(http_t *http) /* I - HTTP connection */
|
||||
else if (username && !*username)
|
||||
cgiSetVariable("ERROR",
|
||||
cgiText(_("A Samba username is required to export "
|
||||
"printer drivers!")));
|
||||
"printer drivers")));
|
||||
else if (username && (!password || !*password))
|
||||
cgiSetVariable("ERROR",
|
||||
cgiText(_("A Samba password is required to export "
|
||||
"printer drivers!")));
|
||||
"printer drivers")));
|
||||
|
||||
/*
|
||||
* Show form...
|
||||
@@ -2543,7 +2567,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
if (device_info && device_make_and_model && device_uri &&
|
||||
strcasecmp(device_make_and_model, "unknown") &&
|
||||
_cups_strcasecmp(device_make_and_model, "unknown") &&
|
||||
strchr(device_uri, ':'))
|
||||
{
|
||||
/*
|
||||
@@ -2570,7 +2594,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
|
||||
* suitable name.
|
||||
*/
|
||||
|
||||
if (strncasecmp(device_info, "unknown", 7))
|
||||
if (_cups_strncasecmp(device_info, "unknown", 7))
|
||||
ptr = device_info;
|
||||
else if ((ptr = strstr(device_uri, "://")) != NULL)
|
||||
ptr += 3;
|
||||
@@ -2583,7 +2607,8 @@ do_list_printers(http_t *http) /* I - HTTP connection */
|
||||
if (isalnum(*ptr & 255) || *ptr == '_' || *ptr == '-' ||
|
||||
*ptr == '.')
|
||||
*option_ptr++ = *ptr;
|
||||
else if ((*ptr == ' ' || *ptr == '/') && option_ptr[-1] != '_')
|
||||
else if ((*ptr == ' ' || *ptr == '/') && option_ptr > option &&
|
||||
option_ptr[-1] != '_')
|
||||
*option_ptr++ = '_';
|
||||
else if (*ptr == '?' || *ptr == '(')
|
||||
break;
|
||||
@@ -2687,7 +2712,7 @@ do_menu(http_t *http) /* I - HTTP connection */
|
||||
cgiSetVariable("HAVE_GSSAPI", "1");
|
||||
|
||||
if ((val = cupsGetOption("DefaultAuthType", num_settings,
|
||||
settings)) != NULL && !strcasecmp(val, "Negotiate"))
|
||||
settings)) != NULL && !_cups_strcasecmp(val, "Negotiate"))
|
||||
cgiSetVariable("KERBEROS", "CHECKED");
|
||||
else
|
||||
#endif /* HAVE_GSSAPI */
|
||||
@@ -2744,16 +2769,16 @@ do_menu(http_t *http) /* I - HTTP connection */
|
||||
settings)) == NULL)
|
||||
val = "No";
|
||||
|
||||
if (!strcasecmp(val, "yes") || !strcasecmp(val, "on") ||
|
||||
!strcasecmp(val, "true"))
|
||||
if (!_cups_strcasecmp(val, "yes") || !_cups_strcasecmp(val, "on") ||
|
||||
!_cups_strcasecmp(val, "true"))
|
||||
cgiSetVariable("BROWSE_WEB_IF", "CHECKED");
|
||||
|
||||
if ((val = cupsGetOption("PreserveJobHistory", num_settings,
|
||||
settings)) == NULL)
|
||||
val = "Yes";
|
||||
|
||||
if (!strcasecmp(val, "yes") || !strcasecmp(val, "on") ||
|
||||
!strcasecmp(val, "true"))
|
||||
if (!_cups_strcasecmp(val, "yes") || !_cups_strcasecmp(val, "on") ||
|
||||
!_cups_strcasecmp(val, "true"))
|
||||
{
|
||||
cgiSetVariable("PRESERVE_JOB_HISTORY", "CHECKED");
|
||||
|
||||
@@ -2761,8 +2786,8 @@ do_menu(http_t *http) /* I - HTTP connection */
|
||||
settings)) == NULL)
|
||||
val = "No";
|
||||
|
||||
if (!strcasecmp(val, "yes") || !strcasecmp(val, "on") ||
|
||||
!strcasecmp(val, "true"))
|
||||
if (!_cups_strcasecmp(val, "yes") || !_cups_strcasecmp(val, "on") ||
|
||||
!_cups_strcasecmp(val, "true"))
|
||||
cgiSetVariable("PRESERVE_JOB_FILES", "CHECKED");
|
||||
}
|
||||
|
||||
@@ -2876,7 +2901,7 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
|
||||
|
||||
if (!printer)
|
||||
{
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable")));
|
||||
cgiStartHTML(cgiText(_("Set Allowed Users")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -3130,7 +3155,7 @@ do_set_default(http_t *http) /* I - HTTP connection */
|
||||
|
||||
if (!printer)
|
||||
{
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable")));
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -3241,7 +3266,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
printer);
|
||||
else
|
||||
{
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable")));
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -3439,6 +3464,20 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
i > 0;
|
||||
i --, group ++)
|
||||
{
|
||||
for (j = group->num_options, option = group->options;
|
||||
j > 0;
|
||||
j --, option ++)
|
||||
{
|
||||
if (!strcmp(option->keyword, "PageRegion"))
|
||||
continue;
|
||||
|
||||
if (option->num_choices > 1)
|
||||
break;
|
||||
}
|
||||
|
||||
if (j == 0)
|
||||
continue;
|
||||
|
||||
cgiSetVariable("GROUP_ID", group->name);
|
||||
|
||||
if (!strcmp(group->name, "InstallableOptions"))
|
||||
@@ -3452,7 +3491,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
j > 0;
|
||||
j --, option ++)
|
||||
{
|
||||
if (!strcmp(option->keyword, "PageRegion"))
|
||||
if (!strcmp(option->keyword, "PageRegion") || option->num_choices < 2)
|
||||
continue;
|
||||
|
||||
cgiSetVariable("KEYWORD", option->keyword);
|
||||
@@ -3485,16 +3524,15 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
{
|
||||
const char *units = NULL; /* Units value, if any */
|
||||
|
||||
|
||||
cgiSetVariable("ISCUSTOM", "1");
|
||||
|
||||
for (cparam = ppdFirstCustomParam(coption), m = 0;
|
||||
cparam;
|
||||
cparam = ppdNextCustomParam(coption), m ++)
|
||||
{
|
||||
if (!strcasecmp(option->keyword, "PageSize") &&
|
||||
strcasecmp(cparam->name, "Width") &&
|
||||
strcasecmp(cparam->name, "Height"))
|
||||
if (!_cups_strcasecmp(option->keyword, "PageSize") &&
|
||||
_cups_strcasecmp(cparam->name, "Width") &&
|
||||
_cups_strcasecmp(cparam->name, "Height"))
|
||||
{
|
||||
m --;
|
||||
continue;
|
||||
@@ -3507,7 +3545,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_POINTS :
|
||||
if (!strncasecmp(option->defchoice, "Custom.", 7))
|
||||
if (!_cups_strncasecmp(option->defchoice, "Custom.", 7))
|
||||
{
|
||||
units = option->defchoice + strlen(option->defchoice) - 2;
|
||||
|
||||
@@ -3628,14 +3666,18 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
attr = ippFindAttribute(response, "job-sheets-default", IPP_TAG_ZERO);
|
||||
|
||||
cgiSetVariable("KEYWORD", "job_sheets_start");
|
||||
cgiSetVariable("KEYTEXT", cgiText(_("Starting Banner")));
|
||||
cgiSetVariable("KEYTEXT",
|
||||
/* TRANSLATORS: Banner/cover sheet before the print job. */
|
||||
cgiText(_("Starting Banner")));
|
||||
cgiSetVariable("DEFCHOICE", attr != NULL ?
|
||||
attr->values[0].string.text : "");
|
||||
|
||||
cgiCopyTemplateLang("option-pickone.tmpl");
|
||||
|
||||
cgiSetVariable("KEYWORD", "job_sheets_end");
|
||||
cgiSetVariable("KEYTEXT", cgiText(_("Ending Banner")));
|
||||
cgiSetVariable("KEYTEXT",
|
||||
/* TRANSLATORS: Banner/cover sheet after the print job. */
|
||||
cgiText(_("Ending Banner")));
|
||||
cgiSetVariable("DEFCHOICE", attr != NULL && attr->num_values > 1 ?
|
||||
attr->values[1].string.text : "");
|
||||
|
||||
@@ -3934,7 +3976,7 @@ do_set_sharing(http_t *http) /* I - HTTP connection */
|
||||
|
||||
if (!printer || !shared)
|
||||
{
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable!")));
|
||||
cgiSetVariable("ERROR", cgiText(_("Missing form variable")));
|
||||
cgiStartHTML(cgiText(_("Set Publishing")));
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
cgiEndHTML();
|
||||
@@ -4043,7 +4085,7 @@ get_option_value(
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
else if (strcasecmp(val, "Custom") ||
|
||||
else if (_cups_strcasecmp(val, "Custom") ||
|
||||
(coption = ppdFindCustomOption(ppd, name)) == NULL)
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Private CGI definitions for the Common UNIX Printing System (CUPS).
|
||||
* Private CGI definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
#include "cgi.h"
|
||||
#include <cups/debug.h>
|
||||
#include <cups/i18n.h>
|
||||
#include <cups/string.h>
|
||||
#include <cups/debug-private.h>
|
||||
#include <cups/language-private.h>
|
||||
#include <cups/string-private.h>
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+20
-6
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Class status CGI for the Common UNIX Printing System (CUPS).
|
||||
* Class status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -147,7 +147,21 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
else if (pclass)
|
||||
{
|
||||
if (!strcmp(op, "start-class"))
|
||||
if (!*op)
|
||||
{
|
||||
const char *server_port = getenv("SERVER_PORT");
|
||||
/* Port number string */
|
||||
int port = atoi(server_port ? server_port : "0");
|
||||
/* Port number */
|
||||
char uri[1024]; /* URL */
|
||||
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri),
|
||||
getenv("HTTPS") ? "https" : "http", NULL,
|
||||
getenv("SERVER_NAME"), port, "/classes/%s", pclass);
|
||||
|
||||
printf("Location: %s\n\n", uri);
|
||||
}
|
||||
else if (!strcmp(op, "start-class"))
|
||||
do_class_op(http, pclass, IPP_RESUME_PRINTER, cgiText(_("Resume Class")));
|
||||
else if (!strcmp(op, "stop-class"))
|
||||
do_class_op(http, pclass, IPP_PAUSE_PRINTER, cgiText(_("Pause Class")));
|
||||
@@ -157,9 +171,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
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 (!strcasecmp(op, "print-test-page"))
|
||||
else if (!_cups_strcasecmp(op, "print-test-page"))
|
||||
cgiPrintTestPage(http, pclass);
|
||||
else if (!strcasecmp(op, "move-jobs"))
|
||||
else if (!_cups_strcasecmp(op, "move-jobs"))
|
||||
cgiMoveJobs(http, pclass, 0);
|
||||
else
|
||||
{
|
||||
@@ -367,7 +381,7 @@ show_all_classes(http_t *http, /* I - Connection to server */
|
||||
cgiSetVariable("TOTAL", val);
|
||||
|
||||
if ((var = cgiGetVariable("ORDER")) != NULL)
|
||||
ascending = !strcasecmp(var, "asc");
|
||||
ascending = !_cups_strcasecmp(var, "asc");
|
||||
else
|
||||
ascending = 1;
|
||||
|
||||
|
||||
+11
-11
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Online help index routines for the Common UNIX Printing System (CUPS).
|
||||
* Online help index routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -599,7 +599,7 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
|
||||
|
||||
search->nodes = cupsArrayNew((cups_array_func_t)help_sort_by_name, NULL);
|
||||
search->sorted = cupsArrayNew((cups_array_func_t)help_sort_by_score, NULL);
|
||||
|
||||
|
||||
if (!search->nodes || !search->sorted)
|
||||
{
|
||||
cupsArrayDelete(search->nodes);
|
||||
@@ -639,8 +639,8 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
|
||||
|
||||
node->score = matches;
|
||||
|
||||
cupsArrayAdd(search->nodes, node);
|
||||
cupsArrayAdd(search->sorted, node);
|
||||
cupsArrayAdd(search->nodes, node);
|
||||
cupsArrayAdd(search->sorted, node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -919,7 +919,7 @@ help_load_file(
|
||||
* Look for "<TITLE>", "<A NAME", or "<!-- SECTION:" prefix...
|
||||
*/
|
||||
|
||||
if (!strncasecmp(line, "<!-- SECTION:", 13))
|
||||
if (!_cups_strncasecmp(line, "<!-- SECTION:", 13))
|
||||
{
|
||||
/*
|
||||
* Got section line, copy it!
|
||||
@@ -946,7 +946,7 @@ help_load_file(
|
||||
{
|
||||
ptr ++;
|
||||
|
||||
if (!strncasecmp(ptr, "TITLE>", 6))
|
||||
if (!_cups_strncasecmp(ptr, "TITLE>", 6))
|
||||
{
|
||||
/*
|
||||
* Found the title...
|
||||
@@ -955,7 +955,7 @@ help_load_file(
|
||||
anchor = NULL;
|
||||
ptr += 6;
|
||||
}
|
||||
else if (!strncasecmp(ptr, "A NAME=", 7))
|
||||
else if (!_cups_strncasecmp(ptr, "A NAME=", 7))
|
||||
{
|
||||
/*
|
||||
* Found an anchor...
|
||||
@@ -1192,7 +1192,7 @@ help_load_file(
|
||||
sizeof(help_common_words[0])),
|
||||
sizeof(help_common_words[0]),
|
||||
(int (*)(const void *, const void *))
|
||||
strcasecmp))
|
||||
_cups_strcasecmp))
|
||||
help_add_word(node, temp);
|
||||
}
|
||||
}
|
||||
@@ -1307,7 +1307,7 @@ help_sort_by_score(help_node_t *n1, /* I - First node */
|
||||
(diff = strcmp(n1->section, n2->section)) != 0)
|
||||
return (diff);
|
||||
|
||||
return (strcasecmp(n1->text, n2->text));
|
||||
return (_cups_strcasecmp(n1->text, n2->text));
|
||||
}
|
||||
|
||||
|
||||
@@ -1322,7 +1322,7 @@ help_sort_words(help_word_t *w1, /* I - Second word */
|
||||
DEBUG_printf(("help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))\n",
|
||||
w1, w1->text, w2, w2->text));
|
||||
|
||||
return (strcasecmp(w1->text, w2->text));
|
||||
return (_cups_strcasecmp(w1->text, w2->text));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Online help index definitions for the Common UNIX Printing System (CUPS).
|
||||
* Online help index definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Online help CGI for the Common UNIX Printing System (CUPS).
|
||||
* Online help CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -342,12 +342,12 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
if (inbody)
|
||||
{
|
||||
if (!strncasecmp(line, "</BODY>", 7))
|
||||
if (!_cups_strncasecmp(line, "</BODY>", 7))
|
||||
break;
|
||||
|
||||
printf("%s\n", line);
|
||||
}
|
||||
else if (!strncasecmp(line, "<BODY", 5))
|
||||
else if (!_cups_strncasecmp(line, "<BODY", 5))
|
||||
inbody = 1;
|
||||
}
|
||||
|
||||
|
||||
+8
-26
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* HTML support functions for the Common UNIX Printing System (CUPS).
|
||||
* HTML support functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -208,31 +208,13 @@ cgiStartMultipart(void)
|
||||
int /* O - 1 if multi-part supported, 0 otherwise */
|
||||
cgiSupportsMultipart(void)
|
||||
{
|
||||
const char *user_agent; /* User-Agent string */
|
||||
static int supports_multipart = -1;/* Cached value */
|
||||
/*
|
||||
* Too many bug reports for browsers that don't support it, and too much pain
|
||||
* to whitelist known-good browsers, so for now we just punt on multi-part
|
||||
* support... :(
|
||||
*/
|
||||
|
||||
|
||||
if (supports_multipart < 0)
|
||||
{
|
||||
/*
|
||||
* CUPS STR #3049: Apparently some browsers don't support multi-part
|
||||
* documents, which makes them useless for many web sites. Rather than
|
||||
* abandoning those users, we'll offer a degraded single-part mode...
|
||||
*
|
||||
* Currently we know that anything based on Gecko, MSIE, and Safari all
|
||||
* work. We'll add more as they are reported/tested.
|
||||
*/
|
||||
|
||||
if ((user_agent = getenv("HTTP_USER_AGENT")) != NULL &&
|
||||
(strstr(user_agent, " Gecko/") != NULL ||
|
||||
strstr(user_agent, " MSIE ") != NULL ||
|
||||
strstr(user_agent, " Safari/") != NULL))
|
||||
supports_multipart = 1;
|
||||
else
|
||||
supports_multipart = 0;
|
||||
}
|
||||
|
||||
return (supports_multipart);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+15
-15
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
|
||||
* CGI <-> IPP variable routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -362,7 +362,7 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
|
||||
*/
|
||||
|
||||
cgiStartHTML(cgiText(_("Move Job")));
|
||||
cgiShowIPPError(_("Unable to find destination for job!"));
|
||||
cgiShowIPPError(_("Unable to find destination for job"));
|
||||
cgiEndHTML();
|
||||
return;
|
||||
}
|
||||
@@ -404,7 +404,7 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
|
||||
* If the name is not the same as the current destination, add it!
|
||||
*/
|
||||
|
||||
if (strcasecmp(name, dest))
|
||||
if (_cups_strcasecmp(name, dest))
|
||||
{
|
||||
cgiSetArray("JOB_PRINTER_URI", i, attr->values[0].string.text);
|
||||
cgiSetArray("JOB_PRINTER_NAME", i, name);
|
||||
@@ -595,7 +595,7 @@ cgiPrintCommand(http_t *http, /* I - Connection to server */
|
||||
if ((job_id = cupsCreateJob(http, dest, title,
|
||||
1, &hold_option)) < 1)
|
||||
{
|
||||
cgiSetVariable("MESSAGE", cgiText(_("Unable to send command to printer driver!")));
|
||||
cgiSetVariable("MESSAGE", cgiText(_("Unable to send command to printer driver")));
|
||||
cgiSetVariable("ERROR", cupsLastErrorString());
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
@@ -615,7 +615,7 @@ cgiPrintCommand(http_t *http, /* I - Connection to server */
|
||||
|
||||
if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
|
||||
{
|
||||
cgiSetVariable("MESSAGE", cgiText(_("Unable to send command to printer driver!")));
|
||||
cgiSetVariable("MESSAGE", cgiText(_("Unable to send command to printer driver")));
|
||||
cgiSetVariable("ERROR", cupsLastErrorString());
|
||||
cgiStartHTML(title);
|
||||
cgiCopyTemplateLang("error.tmpl");
|
||||
@@ -906,12 +906,12 @@ cgiRewriteURL(const char *uri, /* I - Current URI */
|
||||
* Map local access to a local URI...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(hostname, "127.0.0.1") ||
|
||||
!strcasecmp(hostname, "[::1]") ||
|
||||
!strcasecmp(hostname, "localhost") ||
|
||||
!strncasecmp(hostname, "localhost.", 10) ||
|
||||
!strcasecmp(hostname, server) ||
|
||||
!strcasecmp(hostname, servername))
|
||||
if (!_cups_strcasecmp(hostname, "127.0.0.1") ||
|
||||
!_cups_strcasecmp(hostname, "[::1]") ||
|
||||
!_cups_strcasecmp(hostname, "localhost") ||
|
||||
!_cups_strncasecmp(hostname, "localhost.", 10) ||
|
||||
!_cups_strcasecmp(hostname, server) ||
|
||||
!_cups_strcasecmp(hostname, servername))
|
||||
{
|
||||
/*
|
||||
* Make URI relative to the current server...
|
||||
@@ -1347,7 +1347,7 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */
|
||||
(filter->value_tag >= IPP_TAG_TEXTLANG &&
|
||||
filter->value_tag <= IPP_TAG_MIMETYPE)) &&
|
||||
filter->values[0].string.text != NULL &&
|
||||
!strcasecmp(filter->values[0].string.text, filter_value))
|
||||
!_cups_strcasecmp(filter->values[0].string.text, filter_value))
|
||||
break;
|
||||
|
||||
if (!filter)
|
||||
@@ -1481,9 +1481,9 @@ cgiShowJobs(http_t *http, /* I - Connection to server */
|
||||
first = 0;
|
||||
|
||||
if ((var = cgiGetVariable("ORDER")) != NULL)
|
||||
ascending = !strcasecmp(var, "asc");
|
||||
ascending = !_cups_strcasecmp(var, "asc");
|
||||
else
|
||||
ascending = !which_jobs || !strcasecmp(which_jobs, "not-completed");
|
||||
ascending = !which_jobs || !_cups_strcasecmp(which_jobs, "not-completed");
|
||||
|
||||
section = cgiGetVariable("SECTION");
|
||||
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Job status CGI for the Common UNIX Printing System (CUPS).
|
||||
* Job status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Xcode documentation set generator.
|
||||
*
|
||||
* Copyright 2007-2009 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -171,7 +171,7 @@ static int /* O - Result of comparison */
|
||||
compare_html(_cups_html_t *a, /* I - First file */
|
||||
_cups_html_t *b) /* I - Second file */
|
||||
{
|
||||
return (strcasecmp(a->title, b->title));
|
||||
return (_cups_strcasecmp(a->title, b->title));
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ static int /* O - Result of comparison */
|
||||
compare_sections(_cups_section_t *a, /* I - First section */
|
||||
_cups_section_t *b) /* I - Second section */
|
||||
{
|
||||
return (strcasecmp(a->name, b->name));
|
||||
return (_cups_strcasecmp(a->name, b->name));
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ compare_sections_files(
|
||||
if (ret)
|
||||
return (ret);
|
||||
else
|
||||
return (strcasecmp(a->name, b->name));
|
||||
return (_cups_strcasecmp(a->name, b->name));
|
||||
}
|
||||
|
||||
|
||||
@@ -442,7 +442,7 @@ write_nodes(const char *path, /* I - File to write */
|
||||
cupsFilePuts(fp, "<Subnodes>\n");
|
||||
subnodes = 1;
|
||||
}
|
||||
|
||||
|
||||
cupsFilePrintf(fp, "<Node id=\"%d\">\n"
|
||||
"<Path>Documentation/%s</Path>\n"
|
||||
"<Anchor>%s</Anchor>\n"
|
||||
|
||||
+22
-8
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Printer status CGI for the Common UNIX Printing System (CUPS).
|
||||
* Printer status CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -148,7 +148,21 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
else if (printer)
|
||||
{
|
||||
if (!strcmp(op, "start-printer"))
|
||||
if (!*op)
|
||||
{
|
||||
const char *server_port = getenv("SERVER_PORT");
|
||||
/* Port number string */
|
||||
int port = atoi(server_port ? server_port : "0");
|
||||
/* Port number */
|
||||
char uri[1024]; /* URL */
|
||||
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri),
|
||||
getenv("HTTPS") ? "https" : "http", NULL,
|
||||
getenv("SERVER_NAME"), port, "/printers/%s", printer);
|
||||
|
||||
printf("Location: %s\n\n", uri);
|
||||
}
|
||||
else if (!strcmp(op, "start-printer"))
|
||||
do_printer_op(http, printer, IPP_RESUME_PRINTER,
|
||||
cgiText(_("Resume Printer")));
|
||||
else if (!strcmp(op, "stop-printer"))
|
||||
@@ -160,15 +174,15 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
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 (!strcasecmp(op, "print-self-test-page"))
|
||||
else if (!_cups_strcasecmp(op, "print-self-test-page"))
|
||||
cgiPrintCommand(http, printer, "PrintSelfTestPage",
|
||||
cgiText(_("Print Self-Test Page")));
|
||||
else if (!strcasecmp(op, "clean-print-heads"))
|
||||
else if (!_cups_strcasecmp(op, "clean-print-heads"))
|
||||
cgiPrintCommand(http, printer, "Clean all",
|
||||
cgiText(_("Clean Print Heads")));
|
||||
else if (!strcasecmp(op, "print-test-page"))
|
||||
else if (!_cups_strcasecmp(op, "print-test-page"))
|
||||
cgiPrintTestPage(http, printer);
|
||||
else if (!strcasecmp(op, "move-jobs"))
|
||||
else if (!_cups_strcasecmp(op, "move-jobs"))
|
||||
cgiMoveJobs(http, printer, 0);
|
||||
else
|
||||
{
|
||||
@@ -384,7 +398,7 @@ show_all_printers(http_t *http, /* I - Connection to server */
|
||||
cgiSetVariable("TOTAL", val);
|
||||
|
||||
if ((var = cgiGetVariable("ORDER")) != NULL)
|
||||
ascending = !strcasecmp(var, "asc");
|
||||
ascending = !_cups_strcasecmp(var, "asc");
|
||||
else
|
||||
ascending = 1;
|
||||
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Search routines for the Common UNIX Printing System (CUPS).
|
||||
* Search routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2008 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -145,7 +145,7 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
* Look for logic words: AND, OR
|
||||
*/
|
||||
|
||||
if (wlen == 3 && !strncasecmp(qptr, "AND", 3))
|
||||
if (wlen == 3 && !_cups_strncasecmp(qptr, "AND", 3))
|
||||
{
|
||||
/*
|
||||
* Logical AND with the following text...
|
||||
@@ -156,7 +156,7 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
|
||||
qptr = qend;
|
||||
}
|
||||
else if (wlen == 2 && !strncasecmp(qptr, "OR", 2))
|
||||
else if (wlen == 2 && !_cups_strncasecmp(qptr, "OR", 2))
|
||||
{
|
||||
/*
|
||||
* Logical OR with the following text...
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* CGI template function.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -423,7 +423,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
{
|
||||
if (uriencode)
|
||||
cgi_puturi(outptr, out);
|
||||
else if (!strcasecmp(name, "?cupsdconf_default"))
|
||||
else if (!_cups_strcasecmp(name, "?cupsdconf_default"))
|
||||
fputs(outptr, stdout);
|
||||
else
|
||||
cgi_puts(outptr, out);
|
||||
@@ -536,16 +536,16 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
switch (op)
|
||||
{
|
||||
case '<' :
|
||||
result = strcasecmp(outptr, compare) < 0;
|
||||
result = _cups_strcasecmp(outptr, compare) < 0;
|
||||
break;
|
||||
case '>' :
|
||||
result = strcasecmp(outptr, compare) > 0;
|
||||
result = _cups_strcasecmp(outptr, compare) > 0;
|
||||
break;
|
||||
case '=' :
|
||||
result = strcasecmp(outptr, compare) == 0;
|
||||
result = _cups_strcasecmp(outptr, compare) == 0;
|
||||
break;
|
||||
case '!' :
|
||||
result = strcasecmp(outptr, compare) != 0;
|
||||
result = _cups_strcasecmp(outptr, compare) != 0;
|
||||
break;
|
||||
case '~' :
|
||||
fprintf(stderr, "DEBUG: Regular expression \"%s\"\n", compare);
|
||||
@@ -664,7 +664,7 @@ cgi_puts(const char *s, /* I - String to output */
|
||||
* Pass <A HREF="url"> and </A>, otherwise quote it...
|
||||
*/
|
||||
|
||||
if (!strncasecmp(s, "<A HREF=\"", 9))
|
||||
if (!_cups_strncasecmp(s, "<A HREF=\"", 9))
|
||||
{
|
||||
fputs("<A HREF=\"", out);
|
||||
s += 9;
|
||||
@@ -684,7 +684,7 @@ cgi_puts(const char *s, /* I - String to output */
|
||||
|
||||
fputs("\">", out);
|
||||
}
|
||||
else if (!strncasecmp(s, "</A>", 4))
|
||||
else if (!_cups_strncasecmp(s, "</A>", 4))
|
||||
{
|
||||
fputs("</A>", out);
|
||||
s += 3;
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* CGI test program for the Common UNIX Printing System (CUPS).
|
||||
* CGI test program for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -61,7 +61,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
else
|
||||
puts("FAIL (init)");
|
||||
|
||||
|
||||
/*
|
||||
* Return with no errors...
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Help index test program for the Common UNIX Printing System (CUPS).
|
||||
* Help index test program for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* CGI template test program for the Common UNIX Printing System (CUPS).
|
||||
* CGI template test program for CUPS.
|
||||
*
|
||||
* Copyright 2007 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
|
||||
+9
-10
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* CGI form variable and array functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -48,9 +48,8 @@
|
||||
|
||||
/*#define DEBUG*/
|
||||
#include "cgi-private.h"
|
||||
#include <errno.h>
|
||||
#include <cups/http.h>
|
||||
#include <cups/md5.h>
|
||||
#include <cups/md5-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -329,9 +328,9 @@ cgiInitialize(void)
|
||||
* Grab form data from the corresponding location...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(method, "GET"))
|
||||
if (!_cups_strcasecmp(method, "GET"))
|
||||
return (cgi_initialize_get());
|
||||
else if (!strcasecmp(method, "POST") && content_type)
|
||||
else if (!_cups_strcasecmp(method, "POST") && content_type)
|
||||
{
|
||||
const char *boundary = strstr(content_type, "boundary=");
|
||||
|
||||
@@ -608,7 +607,7 @@ cgi_compare_variables(
|
||||
const _cgi_var_t *v1, /* I - First variable */
|
||||
const _cgi_var_t *v2) /* I - Second variable */
|
||||
{
|
||||
return (strcasecmp(v1->name, v2->name));
|
||||
return (_cups_strcasecmp(v1->name, v2->name));
|
||||
}
|
||||
|
||||
|
||||
@@ -825,7 +824,7 @@ cgi_initialize_multipart(
|
||||
/*
|
||||
* Copy file data to the temp file...
|
||||
*/
|
||||
|
||||
|
||||
ptr = line;
|
||||
|
||||
while ((ch = getchar()) != EOF)
|
||||
@@ -929,7 +928,7 @@ cgi_initialize_multipart(
|
||||
filename[0] = '\0';
|
||||
mimetype[0] = '\0';
|
||||
}
|
||||
else if (!strncasecmp(line, "Content-Disposition:", 20))
|
||||
else if (!_cups_strncasecmp(line, "Content-Disposition:", 20))
|
||||
{
|
||||
if ((ptr = strstr(line + 20, " name=\"")) != NULL)
|
||||
{
|
||||
@@ -947,7 +946,7 @@ cgi_initialize_multipart(
|
||||
*ptr = '\0';
|
||||
}
|
||||
}
|
||||
else if (!strncasecmp(line, "Content-Type:", 13))
|
||||
else if (!_cups_strncasecmp(line, "Content-Type:", 13))
|
||||
{
|
||||
for (ptr = line + 13; isspace(*ptr & 255); ptr ++);
|
||||
|
||||
@@ -1235,7 +1234,7 @@ cgi_set_sid(void)
|
||||
_cupsMD5Init(&md5);
|
||||
_cupsMD5Append(&md5, (unsigned char *)buffer, (int)strlen(buffer));
|
||||
_cupsMD5Finish(&md5, sum);
|
||||
|
||||
|
||||
cgiSetCookie(CUPS_SID, httpMD5String(sum, sid), "/", NULL, 0, 0);
|
||||
|
||||
return (cupsGetOption(CUPS_SID, num_cookies, cookies));
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# "$Id$"
|
||||
#
|
||||
# Configuration file makefile for the Common UNIX Printing System (CUPS).
|
||||
# Configuration file makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2008 by Apple Inc.
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1993-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
|
||||
+19
-4
@@ -26,6 +26,9 @@ BrowseLocalProtocols @CUPS_BROWSE_LOCAL_PROTOCOLS@
|
||||
# Default authentication type, when authentication is required...
|
||||
DefaultAuthType Basic
|
||||
|
||||
# Web interface setting...
|
||||
WebInterface @CUPS_WEBIF@
|
||||
|
||||
# Restrict access to the server...
|
||||
<Location />
|
||||
Order allow,deny
|
||||
@@ -45,12 +48,18 @@ DefaultAuthType Basic
|
||||
|
||||
# Set the default printer/job policies...
|
||||
<Policy default>
|
||||
# Job/subscription privacy...
|
||||
JobPrivateAccess default
|
||||
JobPrivateValues default
|
||||
SubscriptionPrivateAccess default
|
||||
SubscriptionPrivateValues default
|
||||
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
<Limit Create-Job Print-Job Print-URI Validate-Job>
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
@@ -63,7 +72,7 @@ DefaultAuthType Basic
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
|
||||
Order deny,allow
|
||||
@@ -82,13 +91,19 @@ DefaultAuthType Basic
|
||||
|
||||
# Set the authenticated printer/job policies...
|
||||
<Policy authenticated>
|
||||
# Job/subscription privacy...
|
||||
JobPrivateAccess default
|
||||
JobPrivateValues default
|
||||
SubscriptionPrivateAccess default
|
||||
SubscriptionPrivateValues default
|
||||
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
<Limit Create-Job Print-Job Print-URI Validate-Job>
|
||||
AuthType Default
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
AuthType Default
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
@@ -102,7 +117,7 @@ DefaultAuthType Basic
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
|
||||
Order deny,allow
|
||||
|
||||
+41
-44
@@ -5,9 +5,9 @@
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# MIME converts file for the Common UNIX Printing System (CUPS).
|
||||
# Base MIME conversions file for CUPS.
|
||||
#
|
||||
# Copyright 2007-2009 by Apple Inc.
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -38,56 +38,53 @@
|
||||
# PostScript filters
|
||||
#
|
||||
|
||||
application/pdf application/vnd.cups-postscript 66 pdftops
|
||||
@DEFAULT_PDFTOPS@application/pdf application/vnd.cups-postscript 66 pdftops
|
||||
application/postscript application/vnd.cups-postscript 66 pstops
|
||||
application/vnd.hp-HPGL application/postscript 66 hpgltops
|
||||
application/x-cshell application/postscript 33 texttops
|
||||
application/x-csource application/postscript 33 texttops
|
||||
application/x-perl application/postscript 33 texttops
|
||||
application/x-shell application/postscript 33 texttops
|
||||
text/plain application/postscript 33 texttops
|
||||
text/css application/postscript 33 texttops
|
||||
text/html application/postscript 33 texttops
|
||||
image/gif application/vnd.cups-postscript 66 imagetops
|
||||
image/png application/vnd.cups-postscript 66 imagetops
|
||||
image/jpeg application/vnd.cups-postscript 66 imagetops
|
||||
image/tiff application/vnd.cups-postscript 66 imagetops
|
||||
image/x-bitmap application/vnd.cups-postscript 66 imagetops
|
||||
image/x-photocd application/vnd.cups-postscript 66 imagetops
|
||||
image/x-portable-anymap application/vnd.cups-postscript 66 imagetops
|
||||
image/x-portable-bitmap application/vnd.cups-postscript 66 imagetops
|
||||
image/x-portable-graymap application/vnd.cups-postscript 66 imagetops
|
||||
image/x-portable-pixmap application/vnd.cups-postscript 66 imagetops
|
||||
image/x-sgi-rgb application/vnd.cups-postscript 66 imagetops
|
||||
image/x-xbitmap application/vnd.cups-postscript 66 imagetops
|
||||
image/x-xpixmap application/vnd.cups-postscript 66 imagetops
|
||||
#image/x-xwindowdump application/vnd.cups-postscript 66 imagetops
|
||||
image/x-sun-raster application/vnd.cups-postscript 66 imagetops
|
||||
application/vnd.cups-banner application/postscript 33 bannertops
|
||||
@DEFAULT_TEXTTOPS@application/x-cshell application/postscript 33 texttops
|
||||
@DEFAULT_TEXTTOPS@application/x-csource application/postscript 33 texttops
|
||||
@DEFAULT_TEXTTOPS@application/x-perl application/postscript 33 texttops
|
||||
@DEFAULT_TEXTTOPS@application/x-shell application/postscript 33 texttops
|
||||
@DEFAULT_TEXTTOPS@text/plain application/postscript 33 texttops
|
||||
@DEFAULT_TEXTTOPS@text/css application/postscript 33 texttops
|
||||
@DEFAULT_TEXTTOPS@text/html application/postscript 33 texttops
|
||||
@DEFAULT_IMAGEFILTERS@image/gif application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/png application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/jpeg application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/tiff application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-bitmap application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-photocd application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-anymap application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-bitmap application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-graymap application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-pixmap application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-sgi-rgb application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-xbitmap application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-xpixmap application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_IMAGEFILTERS@image/x-sun-raster application/vnd.cups-postscript 66 imagetops
|
||||
@DEFAULT_BANNERTOPS@application/vnd.cups-banner application/postscript 33 bannertops
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Raster filters...
|
||||
#
|
||||
|
||||
image/gif application/vnd.cups-raster 100 imagetoraster
|
||||
image/png application/vnd.cups-raster 100 imagetoraster
|
||||
image/jpeg application/vnd.cups-raster 100 imagetoraster
|
||||
image/tiff application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-bitmap application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-photocd application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-portable-anymap application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-portable-bitmap application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-portable-graymap application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-portable-pixmap application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-sgi-rgb application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-xbitmap application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
|
||||
#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
|
||||
image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/gif application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/png application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/jpeg application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/tiff application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-bitmap application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-photocd application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-anymap application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-bitmap application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-graymap application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-portable-pixmap application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-sgi-rgb application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-xbitmap application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
|
||||
@DEFAULT_IMAGEFILTERS@image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
|
||||
# pstoraster is part of GPL Ghostscript...
|
||||
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
|
||||
# PWG Raster filter for IPP Everywhere...
|
||||
application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
|
||||
########################################################################
|
||||
#
|
||||
|
||||
+5
-12
@@ -1,13 +1,13 @@
|
||||
#
|
||||
# "$Id: mime.types 8783 2009-08-28 17:51:05Z mike $"
|
||||
# "$Id: mime.types 9667 2011-04-01 04:48:21Z mike $"
|
||||
#
|
||||
# MIME types file for the Common UNIX Printing System (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.
|
||||
#
|
||||
# Copyright 2007-2009 by Apple Inc.
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -79,14 +79,6 @@ application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
contains(0,4096,"LANGUAGE = POSTSCRIPT") \
|
||||
(contains(0,4096,<0a>%!) + \
|
||||
!contains(0,4096,"ENTER LANGUAGE")))
|
||||
application/vnd.hp-HPGL hpgl \
|
||||
string(0,<1B>E<1B>%0B) \
|
||||
string(0,<1B>%-1B) string(0,<201B>)\
|
||||
string(0,BP;) string(0,IN;) string(0,DF;) \
|
||||
string(0,BPINPS;) \
|
||||
(contains(0,128,<1B>%-12345X) + \
|
||||
(contains(0,4096,"LANGUAGE=HPGL") \
|
||||
contains(0,4096,"LANGUAGE = HPGL")))
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -100,6 +92,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(356,<0000000000000000>) priority(100)
|
||||
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
|
||||
@@ -177,5 +170,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 8783 2009-08-28 17:51:05Z mike $".
|
||||
# End of "$Id: mime.types 9667 2011-04-01 04:48:21Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-3264.m4 8524 2009-04-19 21:18:45Z mike $"
|
||||
dnl "$Id: cups-3264.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl 32/64-bit library support stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl 32/64-bit library support stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -136,5 +136,5 @@ case "$uname" in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-3264.m4 8524 2009-04-19 21:18:45Z mike $".
|
||||
dnl End of "$Id: cups-3264.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 9259 2010-08-13 04:11:46Z mike $"
|
||||
dnl "$Id: cups-common.m4 9793 2011-05-20 03:49:49Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2010 by Apple Inc.
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -20,7 +20,7 @@ dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.4.5"
|
||||
CUPS_VERSION="1.5b1"
|
||||
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'`"
|
||||
@@ -88,6 +88,9 @@ fi
|
||||
|
||||
AC_SUBST(INSTALLSTATIC)
|
||||
|
||||
dnl Check for pkg-config, which is used for some other tests later on...
|
||||
AC_PATH_PROG(PKGCONFIG, pkg-config)
|
||||
|
||||
dnl Check for libraries...
|
||||
AC_SEARCH_LIBS(crypt, crypt)
|
||||
AC_SEARCH_LIBS(getspent, sec gen)
|
||||
@@ -133,6 +136,15 @@ 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,
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(iconv_open,iconv,
|
||||
AC_DEFINE(HAVE_ICONV_H)
|
||||
SAVELIBS="$SAVELIBS $LIBS")
|
||||
LIBS="$SAVELIBS")
|
||||
|
||||
dnl Checks for statfs and its many headers...
|
||||
AC_CHECK_HEADER(sys/mount.h,AC_DEFINE(HAVE_SYS_MOUNT_H))
|
||||
AC_CHECK_HEADER(sys/statfs.h,AC_DEFINE(HAVE_SYS_STATFS_H))
|
||||
@@ -141,7 +153,7 @@ AC_CHECK_HEADER(sys/vfs.h,AC_DEFINE(HAVE_SYS_VFS_H))
|
||||
AC_CHECK_FUNCS(statfs statvfs)
|
||||
|
||||
dnl Checks for string functions.
|
||||
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
|
||||
AC_CHECK_FUNCS(strdup strlcat strlcpy)
|
||||
if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
|
||||
echo Forcing snprintf emulation for HP-UX.
|
||||
else
|
||||
@@ -154,6 +166,9 @@ AC_CHECK_FUNCS(random lrand48 arc4random)
|
||||
dnl Check for geteuid function.
|
||||
AC_CHECK_FUNCS(geteuid)
|
||||
|
||||
dnl Check for setpgid function.
|
||||
AC_CHECK_FUNCS(setpgid)
|
||||
|
||||
dnl Check for vsyslog function.
|
||||
AC_CHECK_FUNCS(vsyslog)
|
||||
|
||||
@@ -207,7 +222,7 @@ else
|
||||
fi
|
||||
|
||||
if test $check_libusb = yes; then
|
||||
AC_CHECK_LIB(usb, usb_init,[
|
||||
AC_CHECK_LIB(usb, usb_get_string_simple,[
|
||||
AC_CHECK_HEADER(usb.h,
|
||||
AC_DEFINE(HAVE_USB_H)
|
||||
LIBUSB="-lusb")])
|
||||
@@ -240,9 +255,9 @@ AC_SUBST(ARFLAGS)
|
||||
|
||||
dnl Prep libraries specifically for cupsd and backends...
|
||||
BACKLIBS=""
|
||||
CUPSDLIBS=""
|
||||
SERVERLIBS=""
|
||||
AC_SUBST(BACKLIBS)
|
||||
AC_SUBST(CUPSDLIBS)
|
||||
AC_SUBST(SERVERLIBS)
|
||||
|
||||
dnl See if we have POSIX ACL support...
|
||||
SAVELIBS="$LIBS"
|
||||
@@ -250,7 +265,7 @@ LIBS=""
|
||||
AC_ARG_ENABLE(acl, [ --enable-acl build with POSIX ACL support])
|
||||
if test "x$enable_acl" != xno; then
|
||||
AC_SEARCH_LIBS(acl_init, acl, AC_DEFINE(HAVE_ACL_INIT))
|
||||
CUPSDLIBS="$CUPSDLIBS $LIBS"
|
||||
SERVERLIBS="$SERVERLIBS $LIBS"
|
||||
fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
@@ -268,24 +283,22 @@ AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
if test "x$enable_dbus" != xno; then
|
||||
AC_PATH_PROG(PKGCONFIG, pkg-config)
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DBUS)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
|
||||
CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`"
|
||||
DBUS_NOTIFIER="dbus"
|
||||
DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs dbus-1`"
|
||||
AC_CHECK_LIB(dbus-1,
|
||||
dbus_message_iter_init_append,
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),,
|
||||
`$PKGCONFIG --libs dbus-1`)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DBUS)
|
||||
CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
|
||||
SERVERLIBS="$SERVERLIBS `$PKGCONFIG --libs dbus-1`"
|
||||
DBUS_NOTIFIER="dbus"
|
||||
DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs dbus-1`"
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS $DBUS_NOTIFIERLIBS"
|
||||
AC_CHECK_FUNC(dbus_message_iter_init_append,
|
||||
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
|
||||
LIBS="$SAVELIBS"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -296,14 +309,14 @@ AC_SUBST(DBUS_NOTIFIERLIBS)
|
||||
dnl Extra platform-specific libraries...
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@SYSTEM"
|
||||
CUPS_SYSTEM_AUTHKEY=""
|
||||
FONTS="fonts"
|
||||
LEGACY_BACKENDS="parallel scsi"
|
||||
INSTALLXPC=""
|
||||
LEGACY_BACKENDS="parallel"
|
||||
|
||||
case $uname in
|
||||
Darwin*)
|
||||
LEGACY_BACKENDS=""
|
||||
BACKLIBS="$BACKLIBS -framework IOKit"
|
||||
CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration -weak_framework ApplicationServices"
|
||||
SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices"
|
||||
LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS"
|
||||
|
||||
dnl Check for framework headers...
|
||||
@@ -311,10 +324,17 @@ 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)
|
||||
|
||||
dnl Check for new ColorSync APIs...
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS -framework ApplicationServices"
|
||||
AC_CHECK_FUNCS(ColorSyncRegisterDevice)
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for the new membership functions in MacOSX 10.4...
|
||||
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
|
||||
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
|
||||
@@ -337,7 +357,7 @@ case $uname in
|
||||
AC_ARG_WITH(operkey, [ --with-operkey set the default operator @AUTHKEY value],
|
||||
default_operkey="$withval",
|
||||
default_operkey="default")
|
||||
|
||||
|
||||
AC_CHECK_HEADER(Security/Authorization.h, [
|
||||
AC_DEFINE(HAVE_AUTHORIZATION_H)
|
||||
|
||||
@@ -359,16 +379,47 @@ case $uname in
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
|
||||
dnl Check for sandbox/Seatbelt support
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
if test $uversion -ge 100; then
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
fi
|
||||
|
||||
dnl Check for XPC support
|
||||
AC_CHECK_HEADER(xpc/xpc.h,
|
||||
AC_DEFINE(HAVE_XPC)
|
||||
INSTALLXPC="install-xpc")
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(CUPS_DEFAULT_PRINTOPERATOR_AUTH)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTOPERATOR_AUTH, "$CUPS_DEFAULT_PRINTOPERATOR_AUTH")
|
||||
AC_SUBST(CUPS_SYSTEM_AUTHKEY)
|
||||
AC_SUBST(FONTS)
|
||||
AC_SUBST(INSTALLXPC)
|
||||
AC_SUBST(LEGACY_BACKENDS)
|
||||
|
||||
dnl Check for build components
|
||||
COMPONENTS="all"
|
||||
|
||||
AC_ARG_WITH(components, [ --with-components set components to build:
|
||||
- "all" (default) builds everything
|
||||
- "core" builds libcups and ipptool],
|
||||
COMPONENTS="$withval")
|
||||
|
||||
case "$COMPONENTS" in
|
||||
all)
|
||||
BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data locale man doc examples templates"
|
||||
;;
|
||||
|
||||
core)
|
||||
BUILDDIRS="data locale"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([Bad build component "$COMPONENT" specified!])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(BUILDDIRS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 9259 2010-08-13 04:11:46Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 9793 2011-05-20 03:49:49Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 8655 2009-05-17 00:13:47Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 9770 2011-05-12 04:51:01Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -100,21 +100,6 @@ AC_SUBST(PIEFLAGS)
|
||||
RELROFLAGS=""
|
||||
AC_SUBST(RELROFLAGS)
|
||||
|
||||
LIBCUPSORDER="libcups.order"
|
||||
AC_ARG_WITH(libcupsorder, [ --with-libcupsorder set libcups secorder file, default=libcups.order],
|
||||
if test -f "$withval"; then
|
||||
LIBCUPSORDER="$withval"
|
||||
fi)
|
||||
AC_SUBST(LIBCUPSORDER)
|
||||
|
||||
LIBCUPSIMAGEORDER="libcupsimage.order"
|
||||
AC_ARG_WITH(libcupsimageorder, [ --with-libcupsimagesorder
|
||||
set libcupsimage secorder file, default=libcupsimage.order],
|
||||
if test -f "$withval"; then
|
||||
LIBCUPSIMAGEORDER="$withval"
|
||||
fi)
|
||||
AC_SUBST(LIBCUPSIMAGEORDER)
|
||||
|
||||
PHPOPTIONS=""
|
||||
AC_SUBST(PHPOPTIONS)
|
||||
|
||||
@@ -146,24 +131,24 @@ if test -n "$GCC"; then
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
# The -pie option is available with some versions of GCC and adds
|
||||
# The -fPIE option is available with some versions of GCC and adds
|
||||
# randomization of addresses, which avoids another class of exploits
|
||||
# that depend on a fixed address for common functions.
|
||||
AC_MSG_CHECKING(if GCC supports -pie)
|
||||
AC_MSG_CHECKING(if GCC supports -fPIE)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -pie -fPIE"
|
||||
CFLAGS="$CFLAGS -fPIE"
|
||||
AC_TRY_COMPILE(,,
|
||||
PIEFLAGS="-pie -fPIE"
|
||||
AC_MSG_RESULT(yes),
|
||||
[PIEFLAGS="-fPIE -Wl,-pie"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k $OPTIM"
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Wshadow -Wunused $OPTIM"
|
||||
OPTIM="-Wshadow $OPTIM"
|
||||
CFLAGS="-Werror-implicit-function-declaration $CFLAGS"
|
||||
PHPOPTIONS="-Wno-shadow"
|
||||
fi
|
||||
@@ -175,7 +160,7 @@ if test -n "$GCC"; then
|
||||
# checking, basically wrapping all string functions
|
||||
# with buffer-limited ones. Not strictly needed for
|
||||
# CUPS since we already use buffer-limited calls, but
|
||||
# this will catch any additions that are broken.
|
||||
# this will catch any additions that are broken.
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
|
||||
if test x$enable_pie = xyes; then
|
||||
@@ -563,5 +548,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 8655 2009-05-17 00:13:47Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 9770 2011-05-12 04:51:01Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 8929 2009-12-15 22:40:37Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 9750 2011-05-06 22:53:53Z mike $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -25,6 +24,21 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
|
||||
esac])
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl Mac OS X bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set Mac OS X localization bundle directory ],
|
||||
CUPS_BUNDLEDIR="$withval",
|
||||
if test "x$uname" = xDarwin -a $uversion -ge 100; then
|
||||
CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
|
||||
LANGUAGES=""
|
||||
else
|
||||
CUPS_BUNDLEDIR=""
|
||||
fi)
|
||||
|
||||
AC_SUBST(CUPS_BUNDLEDIR)
|
||||
if test "x$CUPS_BUNDLEDIR" != x; then
|
||||
AC_DEFINE_UNQUOTED(CUPS_BUNDLEDIR, "$CUPS_BUNDLEDIR")
|
||||
fi
|
||||
|
||||
dnl Default ConfigFilePerm
|
||||
AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
|
||||
CUPS_CONFIG_FILE_PERM="$withval",
|
||||
@@ -426,27 +440,71 @@ AC_ARG_ENABLE(texttops, [ --enable-texttops always build the text filter
|
||||
|
||||
if test "x$enable_bannertops" = xno; then
|
||||
BANNERTOPS=""
|
||||
DEFAULT_BANNERTOPS="#"
|
||||
elif test "x$enable_bannertops" = xyes; then
|
||||
BANNERTOPS="bannertops"
|
||||
DEFAULT_BANNERTOPS=""
|
||||
elif test $uname = Darwin; then
|
||||
BANNERTOPS=""
|
||||
DEFAULT_BANNERTOPS="#"
|
||||
else
|
||||
BANNERTOPS="bannertops"
|
||||
DEFAULT_BANNERTOPS=""
|
||||
fi
|
||||
|
||||
if test "x$enable_texttops" = xno; then
|
||||
TEXTTOPS=""
|
||||
DEFAULT_TEXTTOPS="#"
|
||||
elif test "x$enable_texttops" = xyes; then
|
||||
TEXTTOPS="texttops"
|
||||
DEFAULT_TEXTTOPS=""
|
||||
elif test $uname = Darwin; then
|
||||
TEXTTOPS=""
|
||||
DEFAULT_TEXTTOPS="#"
|
||||
else
|
||||
TEXTTOPS="texttops"
|
||||
DEFAULT_TEXTTOPS=""
|
||||
fi
|
||||
|
||||
AC_SUBST(BANNERTOPS)
|
||||
AC_SUBST(DEFAULT_BANNERTOPS)
|
||||
AC_SUBST(DEFAULT_TEXTTOPS)
|
||||
AC_SUBST(TEXTTOPS)
|
||||
|
||||
dnl Fonts
|
||||
if test "x$BANNERTOPS" = x -a "x$TEXTTOPS" = x; then
|
||||
FONTS=""
|
||||
else
|
||||
FONTS="fonts"
|
||||
fi
|
||||
|
||||
AC_SUBST(FONTS)
|
||||
|
||||
dnl Web interface...
|
||||
AC_ARG_ENABLE(webif, [ --enable-webif enable the web interface by default, default=no for Mac OS X])
|
||||
case "x$enable_webif" in
|
||||
xno)
|
||||
CUPS_WEBIF=No
|
||||
CUPS_DEFAULT_WEBIF=0
|
||||
;;
|
||||
xyes)
|
||||
CUPS_WEBIF=Yes
|
||||
CUPS_DEFAULT_WEBIF=1
|
||||
;;
|
||||
*)
|
||||
if test $uname = Darwin; then
|
||||
CUPS_WEBIF=No
|
||||
CUPS_DEFAULT_WEBIF=0
|
||||
else
|
||||
CUPS_WEBIF=Yes
|
||||
CUPS_DEFAULT_WEBIF=1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(CUPS_WEBIF)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 8929 2009-12-15 22:40:37Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 9750 2011-05-06 22:53:53Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-directories.m4 8497 2009-04-12 23:04:51Z mike $"
|
||||
dnl "$Id: cups-directories.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Directory stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Directory stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -118,6 +118,17 @@ if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl Setup private include directory...
|
||||
AC_ARG_WITH(privateinclude, [ --with-privateinclude set path for private include files, default=none],privateinclude="$withval",privateinclude="")
|
||||
if test "x$privateinclude" != x -a "x$privateinclude" != xnone; then
|
||||
PRIVATEINCLUDE="$privateinclude/cups"
|
||||
else
|
||||
privateinclude=""
|
||||
PRIVATEINCLUDE=""
|
||||
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")
|
||||
@@ -142,7 +153,7 @@ if test x$rcdir = x; then
|
||||
# Darwin and MacOS X...
|
||||
if test -x /sbin/launchd; then
|
||||
INITDDIR="/System/Library/LaunchDaemons"
|
||||
else
|
||||
else
|
||||
INITDDIR="/System/Library/StartupItems/PrintingServices"
|
||||
fi
|
||||
;;
|
||||
@@ -425,5 +436,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$CUPS_STATEDIR")
|
||||
AC_SUBST(CUPS_STATEDIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-directories.m4 8497 2009-04-12 23:04:51Z mike $".
|
||||
dnl End of "$Id: cups-directories.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-dnssd.m4 8789 2009-08-28 22:54:34Z mike $"
|
||||
dnl "$Id: cups-dnssd.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
dnl http://www.dns-sd.org
|
||||
dnl http://www.multicastdns.org/
|
||||
dnl http://developer.apple.com/networking/bonjour/
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -64,5 +60,5 @@ AC_SUBST(DNSSDLIBS)
|
||||
AC_SUBST(DNSSD_BACKEND)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-dnssd.m4 8789 2009-08-28 22:54:34Z mike $".
|
||||
dnl End of "$Id: cups-dnssd.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-gssapi.m4 8659 2009-05-18 22:03:04Z mike $"
|
||||
dnl "$Id: cups-gssapi.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection.
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products.
|
||||
dnl
|
||||
dnl This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -28,19 +28,26 @@ if test x$enable_gssapi != xno; then
|
||||
Darwin)
|
||||
# Mac OS X weak-links to the Kerberos framework...
|
||||
LIBGSSAPI="-weak_framework Kerberos"
|
||||
AC_MSG_CHECKING(for GSS framework)
|
||||
if test -d /System/Library/Frameworks/GSS.framework; then
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBGSSAPI="$LIBGSSAPI -weak_framework GSS"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
;;
|
||||
SunOS*)
|
||||
# Solaris has a non-standard krb5-config, don't use it!
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
CFLAGS="`$KRB5CONFIG --cflags` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags` $CPPFLAGS"
|
||||
CFLAGS="`$KRB5CONFIG --cflags` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags` $CPPFLAGS"
|
||||
LIBGSSAPI="-lgss `$KRB5CONFIG --libs`")
|
||||
;;
|
||||
*)
|
||||
# Other platforms just ask for GSSAPI
|
||||
CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS"
|
||||
CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS"
|
||||
CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS"
|
||||
LIBGSSAPI="`$KRB5CONFIG --libs gssapi`"
|
||||
;;
|
||||
esac
|
||||
@@ -63,26 +70,37 @@ if test x$enable_gssapi != xno; then
|
||||
|
||||
if test "x$LIBGSSAPI" != x; then
|
||||
AC_CHECK_HEADER(krb5.h, AC_DEFINE(HAVE_KRB5_H))
|
||||
AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_GENERIC_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_KRB5_H))
|
||||
if test -d /System/Library/Frameworks/GSS.framework; then
|
||||
AC_CHECK_HEADER(GSS/gssapi.h, AC_DEFINE(HAVE_GSS_GSSAPI_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GENERIC_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_KRB5_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))
|
||||
AC_CHECK_HEADER(gssapi/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GENERIC_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_KRB5_H))
|
||||
fi
|
||||
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBGSSAPI"
|
||||
|
||||
AC_CHECK_FUNC(gsskrb5_register_acceptor_identity,
|
||||
AC_DEFINE(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY))
|
||||
AC_CHECK_FUNC(krb5_cc_new_unique, AC_DEFINE(HAVE_KRB5_CC_NEW_UNIQUE))
|
||||
AC_CHECK_FUNC(krb5_ipc_client_set_target_uid, AC_DEFINE(HAVE_KRB5_IPC_CLIENT_SET_TARGET_UID))
|
||||
AC_CHECK_FUNC(__ApplePrivate_gss_acquire_cred_ex_f,
|
||||
AC_DEFINE(HAVE_GSS_ACQUIRE_CRED_EX_F))
|
||||
|
||||
AC_MSG_CHECKING(for GSS_C_NT_HOSTBASED_SERVICE)
|
||||
if test $ac_cv_header_gssapi_gssapi_h = yes; then
|
||||
if test x$ac_cv_header_gssapi_gssapi_h = xyes; then
|
||||
AC_TRY_COMPILE([ #include <gssapi/gssapi.h> ],
|
||||
[ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ],
|
||||
AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
elif test x$ac_cv_header_gss_gssapi_h = xyes; then
|
||||
AC_TRY_COMPILE([ #include <GSS/gssapi.h> ],
|
||||
[ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ],
|
||||
AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
else
|
||||
AC_TRY_COMPILE([ #include <gssapi.h> ],
|
||||
[ gss_OID foo = GSS_C_NT_HOSTBASED_SERVICE; ],
|
||||
@@ -92,13 +110,6 @@ if test x$enable_gssapi != xno; then
|
||||
fi
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
AC_MSG_CHECKING(for Heimdal Kerberos)
|
||||
AC_TRY_COMPILE([ #include <krb5.h> ],
|
||||
[ char *tmp = heimdal_version; ],
|
||||
AC_DEFINE(HAVE_HEIMDAL)
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no))
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -120,5 +131,5 @@ fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-gssapi.m4 8659 2009-05-18 22:03:04Z mike $".
|
||||
dnl End of "$Id: cups-gssapi.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-image.m4 8344 2009-02-10 17:05:35Z mike $"
|
||||
dnl "$Id: cups-image.m4 9750 2011-05-06 22:53:53Z mike $"
|
||||
dnl
|
||||
dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Image library/filter stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -16,17 +16,20 @@ dnl
|
||||
dnl See if we want the image filters included at all...
|
||||
AC_ARG_ENABLE(image, [ --enable-image always build the image filters])
|
||||
|
||||
DEFAULT_IMAGEFILTERS="#"
|
||||
IMGFILTERS=""
|
||||
if test "x$enable_image" != xno; then
|
||||
AC_MSG_CHECKING(whether to build image filters)
|
||||
if test "x$enable_image" = xyes -o $uname != Darwin; then
|
||||
IMGFILTERS="imagetops imagetoraster"
|
||||
DEFAULT_IMAGEFILTERS=""
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(DEFAULT_IMAGEFILTERS)
|
||||
AC_SUBST(IMGFILTERS)
|
||||
|
||||
dnl Check for image libraries...
|
||||
@@ -105,5 +108,5 @@ AC_SUBST(EXPORT_LIBZ)
|
||||
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-image.m4 8344 2009-02-10 17:05:35Z mike $".
|
||||
dnl End of "$Id: cups-image.m4 9750 2011-05-06 22:53:53Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-largefile.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Large file support stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Large file support stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -48,5 +48,5 @@ fi
|
||||
AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-largefile.m4 6649 2007-07-11 21:46:42Z mike $".
|
||||
dnl End of "$Id: cups-largefile.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-launchd.m4 9120 2010-04-23 18:56:34Z mike $"
|
||||
dnl "$Id: cups-launchd.m4 8983 2010-02-13 02:20:23Z mike $"
|
||||
dnl
|
||||
dnl launchd stuff for CUPS.
|
||||
dnl
|
||||
@@ -39,5 +39,5 @@ AC_SUBST(DEFAULT_LAUNCHD_CONF)
|
||||
AC_SUBST(LAUNCHDLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-launchd.m4 9120 2010-04-23 18:56:34Z mike $".
|
||||
dnl End of "$Id: cups-launchd.m4 8983 2010-02-13 02:20:23Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ldap.m4 8344 2009-02-10 17:05:35Z mike $"
|
||||
dnl "$Id: cups-ldap.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl LDAP configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl LDAP configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2003-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -48,5 +48,5 @@ AC_SUBST(LIBLDAP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ldap.m4 8344 2009-02-10 17:05:35Z mike $".
|
||||
dnl End of "$Id: cups-ldap.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-libtool.m4 8344 2009-02-10 17:05:35Z mike $"
|
||||
dnl "$Id: cups-libtool.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Libtool stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Libtool stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -35,5 +35,5 @@ if test x$LIBTOOL != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-libtool.m4 8344 2009-02-10 17:05:35Z mike $".
|
||||
dnl End of "$Id: cups-libtool.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-manpages.m4 8230 2009-01-12 19:17:09Z mike $"
|
||||
dnl "$Id: cups-manpages.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Manpage stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Manpage stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -92,5 +92,5 @@ AC_SUBST(MAN8EXT)
|
||||
AC_SUBST(MAN8DIR)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-manpages.m4 8230 2009-01-12 19:17:09Z mike $".
|
||||
dnl End of "$Id: cups-manpages.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 7918 2008-09-08 22:03:01Z mike $"
|
||||
dnl "$Id: cups-network.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Networking stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Networking stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2008 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -70,5 +70,5 @@ AC_CHECK_HEADERS(AppleTalk/at_proto.h,AC_DEFINE(HAVE_APPLETALK_AT_PROTO_H),,
|
||||
[#include <netat/appletalk.h>])
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 7918 2008-09-08 22:03:01Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Operating system stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -31,5 +31,5 @@ case "$uname" in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 6649 2007-07-11 21:46:42Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pam.m4 8825 2009-09-22 21:53:31Z mike $"
|
||||
dnl "$Id: cups-pam.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl PAM stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl PAM stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -98,5 +98,5 @@ AC_SUBST(PAMMOD)
|
||||
AC_SUBST(PAMMODAUTH)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pam.m4 8825 2009-09-22 21:53:31Z mike $".
|
||||
dnl End of "$Id: cups-pam.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pap.m4 8524 2009-04-19 21:18:45Z mike $"
|
||||
dnl
|
||||
dnl PAP (AppleTalk) stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 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
|
||||
|
||||
# Currently the PAP backend is only supported on MacOS X with the AppleTalk
|
||||
# SDK installed...
|
||||
AC_ARG_ENABLE(pap, [ --enable-pap build with AppleTalk support])
|
||||
|
||||
PAP=""
|
||||
AC_SUBST(PAP)
|
||||
|
||||
if test x$enable_pap = xyes -a $uname = Darwin; then
|
||||
AC_CHECK_HEADER(netat/appletalk.h,[
|
||||
PAP="pap"
|
||||
AC_CHECK_HEADER(AppleTalk/at_proto.h)])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pap.m4 8524 2009-04-19 21:18:45Z mike $".
|
||||
dnl
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-pdf.m4 8760 2009-08-07 22:30:30Z mike $"
|
||||
dnl "$Id: cups-pdf.m4 9750 2011-05-06 22:53:53Z mike $"
|
||||
dnl
|
||||
dnl PDF filter configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl PDF filter configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -79,10 +79,35 @@ case "x$with_pdftops" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$CUPS_PDFTOPS" != x; then
|
||||
AC_MSG_CHECKING(whether pdftops supports -origpagesizes)
|
||||
if ($CUPS_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes); then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PDFTOPS_WITH_ORIGPAGESIZES)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
DEFAULT_PDFTOPS=""
|
||||
elif test "x$CUPS_GHOSTSCRIPT" != x; then
|
||||
AC_MSG_CHECKING(whether gs supports the ps2write device)
|
||||
if ($CUPS_GHOSTSCRIPT -h 2>&1 | grep -q ps2write); then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GHOSTSCRIPT_PS2WRITE)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
DEFAULT_PDFTOPS=""
|
||||
else
|
||||
DEFAULT_PDFTOPS="#"
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS")
|
||||
AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT")
|
||||
AC_SUBST(DEFAULT_PDFTOPS)
|
||||
AC_SUBST(PDFTOPS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-pdf.m4 8760 2009-08-07 22:30:30Z mike $".
|
||||
dnl End of "$Id: cups-pdf.m4 9750 2011-05-06 22:53:53Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-poll.m4 8524 2009-04-19 21:18:45Z mike $"
|
||||
dnl "$Id: cups-poll.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Select/poll stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Select/poll stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
@@ -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: cups-poll.m4 8524 2009-04-19 21:18:45Z mike $".
|
||||
dnl End of "$Id: cups-poll.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-scripting.m4 7915 2008-09-07 22:18:29Z mike $"
|
||||
dnl "$Id: cups-scripting.m4 9099 2010-04-11 07:16:05Z mike $"
|
||||
dnl
|
||||
dnl Scripting configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Scripting configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2008 by Apple Inc.
|
||||
dnl Copyright 2007-2010 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
|
||||
@@ -96,5 +96,5 @@ if test "x$CUPS_PYTHON" != x; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-scripting.m4 7915 2008-09-07 22:18:29Z mike $".
|
||||
dnl End of "$Id: cups-scripting.m4 9099 2010-04-11 07:16:05Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-sharedlibs.m4 9154 2010-06-16 00:49:01Z mike $"
|
||||
dnl "$Id: cups-sharedlibs.m4 9153 2010-06-16 00:48:25Z mike $"
|
||||
dnl
|
||||
dnl Shared library support for the Common UNIX Printing System (CUPS).
|
||||
dnl Shared library support for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
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
|
||||
@@ -18,10 +18,14 @@ DSOFLAGS="${DSOFLAGS:=}"
|
||||
|
||||
AC_ARG_ENABLE(shared, [ --disable-shared do not create shared libraries])
|
||||
|
||||
cupsbase="cups"
|
||||
LIBCUPSBASE="lib$cupsbase"
|
||||
LIBCUPSSTATIC="lib$cupsbase.a"
|
||||
|
||||
if test x$enable_shared != xno; then
|
||||
case "$uname" in
|
||||
SunOS*)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSDRIVER="libcupsdriver.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -32,7 +36,7 @@ if test x$enable_shared != xno; then
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
|
||||
;;
|
||||
UNIX_S*)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSDRIVER="libcupsdriver.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -45,7 +49,7 @@ if test x$enable_shared != xno; then
|
||||
HP-UX*)
|
||||
case "$uarch" in
|
||||
ia64)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSDRIVER="libcupsdriver.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -56,7 +60,7 @@ if test x$enable_shared != xno; then
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-b,-z,+h,\`basename \$@\`"
|
||||
;;
|
||||
*)
|
||||
LIBCUPS="libcups.sl.2"
|
||||
LIBCUPS="lib$cupsbase.sl.2"
|
||||
LIBCUPSCGI="libcupscgi.sl.1"
|
||||
LIBCUPSDRIVER="libcupsdriver.sl.1"
|
||||
LIBCUPSIMAGE="libcupsimage.sl.2"
|
||||
@@ -69,7 +73,7 @@ if test x$enable_shared != xno; then
|
||||
esac
|
||||
;;
|
||||
IRIX)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSDRIVER="libcupsdriver.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -80,7 +84,7 @@ if test x$enable_shared != xno; then
|
||||
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
;;
|
||||
OSF1* | Linux | GNU | *BSD*)
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSDRIVER="libcupsdriver.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -91,7 +95,7 @@ if test x$enable_shared != xno; then
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
;;
|
||||
Darwin*)
|
||||
LIBCUPS="libcups.2.dylib"
|
||||
LIBCUPS="lib$cupsbase.2.dylib"
|
||||
LIBCUPSCGI="libcupscgi.1.dylib"
|
||||
LIBCUPSDRIVER="libcupsdriver.1.dylib"
|
||||
LIBCUPSIMAGE="libcupsimage.2.dylib"
|
||||
@@ -102,7 +106,8 @@ if test x$enable_shared != xno; then
|
||||
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
|
||||
;;
|
||||
AIX*)
|
||||
LIBCUPS="libcups_s.a"
|
||||
LIBCUPS="lib${cupsbase}_s.a"
|
||||
LIBCUPSBASE="${cupsbase}_s"
|
||||
LIBCUPSCGI="libcupscgi_s.a"
|
||||
LIBCUPSDRIVER="libcupsdriver_s.a"
|
||||
LIBCUPSIMAGE="libcupsimage_s.a"
|
||||
@@ -115,7 +120,7 @@ if test x$enable_shared != xno; then
|
||||
*)
|
||||
echo "Warning: shared libraries may not be supported. Trying -shared"
|
||||
echo " option with compiler."
|
||||
LIBCUPS="libcups.so.2"
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSDRIVER="libcupsdriver.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
@@ -128,7 +133,7 @@ if test x$enable_shared != xno; then
|
||||
esac
|
||||
else
|
||||
PICFLAG=0
|
||||
LIBCUPS="libcups.a"
|
||||
LIBCUPS="lib$cupsbase.a"
|
||||
LIBCUPSCGI="libcupscgi.a"
|
||||
LIBCUPSDRIVER="libcupsdriver.a"
|
||||
LIBCUPSIMAGE="libcupsimage.a"
|
||||
@@ -149,14 +154,16 @@ AC_SUBST(DSOFLAGS)
|
||||
AC_SUBST(DSO32FLAGS)
|
||||
AC_SUBST(DSO64FLAGS)
|
||||
AC_SUBST(LIBCUPS)
|
||||
AC_SUBST(LIBCUPSBASE)
|
||||
AC_SUBST(LIBCUPSCGI)
|
||||
AC_SUBST(LIBCUPSDRIVER)
|
||||
AC_SUBST(LIBCUPSIMAGE)
|
||||
AC_SUBST(LIBCUPSMIME)
|
||||
AC_SUBST(LIBCUPSPPDC)
|
||||
AC_SUBST(LIBCUPSSTATIC)
|
||||
|
||||
if test x$enable_shared = xno; then
|
||||
LINKCUPS="../cups/libcups.a"
|
||||
LINKCUPS="../cups/lib$cupsbase.a"
|
||||
LINKCUPSIMAGE="../filter/libcupsimage.a"
|
||||
|
||||
EXTLINKCUPS="-lcups"
|
||||
@@ -164,14 +171,14 @@ if test x$enable_shared = xno; then
|
||||
EXTLINKCUPSIMAGE="-lcupsimage"
|
||||
else
|
||||
if test $uname = AIX; then
|
||||
LINKCUPS="-lcups_s"
|
||||
LINKCUPS="-l${cupsbase}_s"
|
||||
LINKCUPSIMAGE="-lcupsimage_s"
|
||||
|
||||
EXTLINKCUPS="-lcups_s"
|
||||
EXTLINKCUPSDRIVER="-lcupsdriver_s"
|
||||
EXTLINKCUPSIMAGE="-lcupsimage_s"
|
||||
else
|
||||
LINKCUPS="-lcups"
|
||||
LINKCUPS="-l${cupsbase}"
|
||||
LINKCUPSIMAGE="-lcupsimage"
|
||||
|
||||
EXTLINKCUPS="-lcups"
|
||||
@@ -259,5 +266,5 @@ AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-sharedlibs.m4 9154 2010-06-16 00:49:01Z mike $".
|
||||
dnl End of "$Id: cups-sharedlibs.m4 9153 2010-06-16 00:48:25Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-slp.m4 8344 2009-02-10 17:05:35Z mike $"
|
||||
dnl "$Id: cups-slp.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl OpenSLP configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl OpenSLP configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -34,5 +34,5 @@ AC_SUBST(LIBSLP)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-slp.m4 8344 2009-02-10 17:05:35Z mike $".
|
||||
dnl End of "$Id: cups-slp.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 9203 2010-07-14 23:58:04Z mike $"
|
||||
dnl "$Id: cups-ssl.m4 9756 2011-05-11 00:52:08Z mike $"
|
||||
dnl
|
||||
dnl OpenSSL/GNUTLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2010 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -30,7 +30,7 @@ have_ssl=0
|
||||
|
||||
if test x$enable_ssl != xno; then
|
||||
dnl Look for CDSA...
|
||||
if test $have_ssl = 0 -a "x${enable_cdsassl}" != "xno"; then
|
||||
if test $have_ssl = 0 -a "x$enable_cdsassl" != "xno"; then
|
||||
if test $uname = Darwin; then
|
||||
AC_CHECK_HEADER(Security/SecureTransport.h, [
|
||||
have_ssl=1
|
||||
@@ -38,8 +38,15 @@ if test x$enable_ssl != xno; then
|
||||
AC_DEFINE(HAVE_CDSASSL)
|
||||
|
||||
dnl Check for the various security headers...
|
||||
AC_CHECK_HEADER(Security/SecureTransportPriv.h,
|
||||
AC_DEFINE(HAVE_SECURETRANSPORTPRIV_H))
|
||||
AC_CHECK_HEADER(Security/SecCertificate.h,
|
||||
AC_DEFINE(HAVE_SECCERTIFICATE_H))
|
||||
AC_CHECK_HEADER(Security/SecItem.h,
|
||||
AC_DEFINE(HAVE_SECITEM_H))
|
||||
AC_CHECK_HEADER(Security/SecItemPriv.h,
|
||||
AC_DEFINE(HAVE_SECITEMPRIV_H))
|
||||
AC_DEFINE(HAVE_SECITEMPRIV_H),,
|
||||
[#include <Security/SecItem.h>])
|
||||
AC_CHECK_HEADER(Security/SecPolicy.h,
|
||||
AC_DEFINE(HAVE_SECPOLICY_H))
|
||||
AC_CHECK_HEADER(Security/SecPolicyPriv.h,
|
||||
@@ -49,6 +56,15 @@ if test x$enable_ssl != xno; then
|
||||
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
|
||||
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
|
||||
|
||||
dnl Check for SecCertificateCopyData..
|
||||
AC_MSG_CHECKING(for SecCertificateCopyData)
|
||||
if test $uversion -ge 100; then
|
||||
AC_DEFINE(HAVE_SECCERTIFICATECOPYDATA)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
dnl Check for SecIdentitySearchCreateWithPolicy...
|
||||
AC_MSG_CHECKING(for SecIdentitySearchCreateWithPolicy)
|
||||
if test $uversion -ge 80; then
|
||||
@@ -66,33 +82,27 @@ if test x$enable_ssl != xno; then
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi])
|
||||
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Then look for GNU TLS...
|
||||
if test $have_ssl = 0 -a "x${enable_gnutls}" != "xno" -a "x$PKGCONFIG" != x; then
|
||||
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)
|
||||
if $PKGCONFIG --exists gnutls; then
|
||||
if test "x$have_pthread" = xyes; then
|
||||
AC_MSG_WARN([The current version of GNU TLS cannot be made thread-safe.])
|
||||
else
|
||||
have_ssl=1
|
||||
SSLLIBS=`$PKGCONFIG --libs gnutls`
|
||||
SSLFLAGS=`$PKGCONFIG --cflags gnutls`
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_GNUTLS)
|
||||
fi
|
||||
have_ssl=1
|
||||
SSLLIBS=`$PKGCONFIG --libs gnutls`
|
||||
SSLFLAGS=`$PKGCONFIG --cflags gnutls`
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_GNUTLS)
|
||||
elif test "x$LIBGNUTLSCONFIG" != x; then
|
||||
if test "x$have_pthread" = xyes; then
|
||||
AC_MSG_WARN([The current version of GNU TLS cannot be made thread-safe.])
|
||||
else
|
||||
have_ssl=1
|
||||
SSLLIBS=`$LIBGNUTLSCONFIG --libs`
|
||||
SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_GNUTLS)
|
||||
fi
|
||||
have_ssl=1
|
||||
SSLLIBS=`$LIBGNUTLSCONFIG --libs`
|
||||
SSLFLAGS=`$LIBGNUTLSCONFIG --cflags`
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_GNUTLS)
|
||||
fi
|
||||
|
||||
if test $have_ssl = 1; then
|
||||
@@ -107,7 +117,7 @@ if test x$enable_ssl != xno; then
|
||||
fi
|
||||
|
||||
dnl Check for the OpenSSL library last...
|
||||
if test $have_ssl = 0 -a "x${enable_openssl}" != "xno"; then
|
||||
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...
|
||||
@@ -141,11 +151,16 @@ if test x$enable_ssl != xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
IPPALIASES="http"
|
||||
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
|
||||
AC_MSG_ERROR([Unable to enable SSL support.])
|
||||
fi
|
||||
|
||||
AC_SUBST(IPPALIASES)
|
||||
AC_SUBST(SSLFLAGS)
|
||||
AC_SUBST(SSLLIBS)
|
||||
|
||||
@@ -154,5 +169,5 @@ AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ssl.m4 9203 2010-07-14 23:58:04Z mike $".
|
||||
dnl End of "$Id: cups-ssl.m4 9756 2011-05-11 00:52:08Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id: cups-threads.m4 8344 2009-02-10 17:05:35Z mike $"
|
||||
dnl "$Id: cups-threads.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl
|
||||
dnl Threading stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl Threading stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2009 by Apple Inc.
|
||||
dnl Copyright 2007-2011 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
|
||||
@@ -50,5 +50,5 @@ fi
|
||||
AC_SUBST(PTHREAD_FLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-threads.m4 8344 2009-02-10 17:05:35Z mike $".
|
||||
dnl End of "$Id: cups-threads.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl
|
||||
|
||||
+91
-23
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Configuration file for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -100,12 +100,19 @@
|
||||
|
||||
|
||||
/*
|
||||
* Do we have domain socket support?
|
||||
* Do we have domain socket support, and if so what is the default one?
|
||||
*/
|
||||
|
||||
#undef CUPS_DEFAULT_DOMAINSOCKET
|
||||
|
||||
|
||||
/*
|
||||
* Default WebInterface value...
|
||||
*/
|
||||
|
||||
#undef CUPS_DEFAULT_WEBIF
|
||||
|
||||
|
||||
/*
|
||||
* Where are files stored?
|
||||
*
|
||||
@@ -179,6 +186,7 @@
|
||||
#undef HAVE_STRINGS_H
|
||||
#undef HAVE_BSTRING_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the long long type?
|
||||
*/
|
||||
@@ -193,6 +201,7 @@
|
||||
# define CUPS_LLCAST (long)
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the strtoll() function?
|
||||
*/
|
||||
@@ -203,13 +212,12 @@
|
||||
# define strtoll(nptr,endptr,base) strtol((nptr), (endptr), (base))
|
||||
#endif /* !HAVE_STRTOLL */
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the strXXX() functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_STRDUP
|
||||
#undef HAVE_STRCASECMP
|
||||
#undef HAVE_STRNCASECMP
|
||||
#undef HAVE_STRLCAT
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
@@ -221,6 +229,13 @@
|
||||
#undef HAVE_GETEUID
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the setpgid() function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SETPGID
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the vsyslog() function?
|
||||
*/
|
||||
@@ -289,11 +304,21 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_AUTHORIZATION_H
|
||||
#undef HAVE_SECBASEPRIV_H
|
||||
#undef HAVE_SECCERTIFICATE_H
|
||||
#undef HAVE_SECIDENTITYSEARCHPRIV_H
|
||||
#undef HAVE_SECITEM_H
|
||||
#undef HAVE_SECITEMPRIV_H
|
||||
#undef HAVE_SECPOLICY_H
|
||||
#undef HAVE_SECPOLICYPRIV_H
|
||||
#undef HAVE_SECBASEPRIV_H
|
||||
#undef HAVE_SECIDENTITYSEARCHPRIV_H
|
||||
#undef HAVE_SECURETRANSPORTPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecCertificateCopyData function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECCERTIFICATECOPYDATA
|
||||
|
||||
|
||||
/*
|
||||
@@ -310,6 +335,20 @@
|
||||
#undef HAVE_SECPOLICYCREATESSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecPolicyCreateSSL function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECPOLICYCREATESSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the cssmErrorString function?
|
||||
*/
|
||||
|
||||
#undef HAVE_CSSMERRORSTRING
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SLP library?
|
||||
*/
|
||||
@@ -468,6 +507,7 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_PDFTOPS
|
||||
#undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES
|
||||
#define CUPS_PDFTOPS "/usr/bin/pdftops"
|
||||
|
||||
|
||||
@@ -476,6 +516,7 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_GHOSTSCRIPT
|
||||
#undef HAVE_GHOSTSCRIPT_PS2WRITE
|
||||
#define CUPS_GHOSTSCRIPT "/usr/bin/gs"
|
||||
|
||||
|
||||
@@ -511,7 +552,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Do we have MacOSX 10.4's mbr_XXX functions?
|
||||
* Do we have Mac OS X 10.4's mbr_XXX functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_MEMBERSHIP_H
|
||||
@@ -527,6 +568,13 @@
|
||||
#undef HAVE_NOTIFY_POST
|
||||
|
||||
|
||||
/*
|
||||
* Do we have Darwin's IOKit private headers?
|
||||
*/
|
||||
|
||||
#undef HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have DBUS?
|
||||
*/
|
||||
@@ -535,28 +583,20 @@
|
||||
#undef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the AppleTalk/at_proto.h header?
|
||||
*/
|
||||
|
||||
#undef HAVE_APPLETALK_AT_PROTO_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the GSSAPI support library (for Kerberos support)?
|
||||
*/
|
||||
|
||||
#undef HAVE_GSSAPI
|
||||
#undef HAVE_GSSAPI_H
|
||||
#undef HAVE_GSSAPI_GSSAPI_H
|
||||
#undef HAVE_GSSAPI_GSSAPI_GENERIC_H
|
||||
#undef HAVE_GSSAPI_GSSAPI_KRB5_H
|
||||
#undef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
|
||||
#undef HAVE_GSS_ACQUIRE_CRED_EX_F
|
||||
#undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
|
||||
#undef HAVE_KRB5_CC_NEW_UNIQUE
|
||||
#undef HAVE_KRB5_IPC_CLIENT_SET_TARGET_UID
|
||||
#undef HAVE_GSS_GSSAPI_H
|
||||
#undef HAVE_GSS_GSSAPI_SPI_H
|
||||
#undef HAVE_GSSAPI
|
||||
#undef HAVE_GSSAPI_GENERIC_H
|
||||
#undef HAVE_GSSAPI_GSSAPI_H
|
||||
#undef HAVE_GSSAPI_H
|
||||
#undef HAVE_GSSAPI_KRB5_H
|
||||
#undef HAVE_KRB5_H
|
||||
#undef HAVE_HEIMDAL
|
||||
|
||||
|
||||
/*
|
||||
@@ -654,6 +694,13 @@
|
||||
#undef HAVE_TCPD_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have <iconv.h>?
|
||||
*/
|
||||
|
||||
#undef HAVE_ICONV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have statfs or statvfs and one of the corresponding headers?
|
||||
*/
|
||||
@@ -666,6 +713,27 @@
|
||||
#undef HAVE_SYS_VFS_H
|
||||
|
||||
|
||||
/*
|
||||
* Location of Mac OS X localization bundle, if any.
|
||||
*/
|
||||
|
||||
#undef CUPS_BUNDLEDIR
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the ColorSyncRegisterDevice function?
|
||||
*/
|
||||
|
||||
#undef HAVE_COLORSYNCREGISTERDEVICE
|
||||
|
||||
|
||||
/*
|
||||
* Do we have XPC?
|
||||
*/
|
||||
|
||||
#undef HAVE_XPC
|
||||
|
||||
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+28
-11
@@ -1,9 +1,9 @@
|
||||
dnl
|
||||
dnl "$Id$"
|
||||
dnl
|
||||
dnl Configuration script for the Common UNIX Printing System (CUPS).
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007 by Apple Inc.
|
||||
dnl Copyright 2007-2010 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
|
||||
@@ -38,7 +38,6 @@ sinclude(config-scripts/cups-largefile.m4)
|
||||
sinclude(config-scripts/cups-dnssd.m4)
|
||||
sinclude(config-scripts/cups-launchd.m4)
|
||||
sinclude(config-scripts/cups-defaults.m4)
|
||||
sinclude(config-scripts/cups-pap.m4)
|
||||
sinclude(config-scripts/cups-pdf.m4)
|
||||
sinclude(config-scripts/cups-scripting.m4)
|
||||
|
||||
@@ -57,21 +56,39 @@ if test "x$LANGUAGES" != x; then
|
||||
LANGFILES="$LANGFILES templates/$lang/header.tmpl"
|
||||
fi
|
||||
done
|
||||
elif test "x$CUPS_BUNDLEDIR" != ""; then
|
||||
INSTALL_LANGUAGES="install-langbundle"
|
||||
UNINSTALL_LANGUAGES="uninstall-langbundle"
|
||||
fi
|
||||
|
||||
AC_SUBST(INSTALL_LANGUAGES)
|
||||
AC_SUBST(UNINSTALL_LANGUAGES)
|
||||
|
||||
AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
|
||||
conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
|
||||
AC_OUTPUT(Makedefs
|
||||
conf/cupsd.conf
|
||||
conf/mime.convs
|
||||
conf/pam.std
|
||||
conf/snmp.conf
|
||||
cups-config
|
||||
data/testprint
|
||||
desktop/cups.desktop
|
||||
doc/index.html doc/help/ref-cupsd-conf.html doc/help/standard.html
|
||||
init/org.cups.cups-lpd.plist init/cups.xml
|
||||
man/client.conf.man man/cups-deviced.man man/cups-driverd.man
|
||||
man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
|
||||
man/cupsd.conf.man man/lpoptions.man
|
||||
templates/header.tmpl
|
||||
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-lpd.man
|
||||
man/cupsaddsmb.man
|
||||
man/cupsd.conf.man
|
||||
man/cupsd.man
|
||||
man/lpoptions.man
|
||||
scheduler/cups-lpd.xinetd
|
||||
scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
scheduler/org.cups.cups-lpd.plist
|
||||
templates/header.tmpl
|
||||
packaging/cups.list
|
||||
$LANGFILES)
|
||||
|
||||
chmod +x cups-config
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
#
|
||||
|
||||
VERSION="@CUPS_VERSION@"
|
||||
APIVERSION="1.4"
|
||||
APIVERSION="1.5"
|
||||
BUILD="@CUPS_BUILD@"
|
||||
|
||||
prefix=@prefix@
|
||||
|
||||
+726
-444
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+78
-42
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# API library Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2010 by Apple Inc.
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -56,15 +56,15 @@ LIBOBJS = \
|
||||
options.o \
|
||||
page.o \
|
||||
ppd.o \
|
||||
pwg-file.o \
|
||||
ppd-cache.o \
|
||||
pwg-media.o \
|
||||
pwg-ppd.o \
|
||||
request.o \
|
||||
sidechannel.o \
|
||||
snmp.o \
|
||||
snprintf.o \
|
||||
string.o \
|
||||
tempfile.o \
|
||||
thread.o \
|
||||
transcode.o \
|
||||
usersys.o \
|
||||
util.o
|
||||
@@ -109,16 +109,31 @@ HEADERS = \
|
||||
transcode.h \
|
||||
versioning.h
|
||||
|
||||
HEADERSPRIV = \
|
||||
array-private.h \
|
||||
cups-private.h \
|
||||
debug-private.h \
|
||||
file-private.h \
|
||||
http-private.h \
|
||||
ipp-private.h \
|
||||
language-private.h \
|
||||
md5-private.h \
|
||||
ppd-private.h \
|
||||
pwg-private.h \
|
||||
snmp-private.h \
|
||||
string-private.h \
|
||||
thread-private.h
|
||||
|
||||
|
||||
#
|
||||
# Targets in this directory...
|
||||
#
|
||||
|
||||
LIBTARGETS = \
|
||||
$(LIBCUPSSTATIC) \
|
||||
$(LIBCUPS) \
|
||||
$(LIB32CUPS) \
|
||||
$(LIB64CUPS) \
|
||||
libcups.a
|
||||
$(LIB64CUPS)
|
||||
|
||||
UNITTARGETS = \
|
||||
testadmin \
|
||||
@@ -143,7 +158,7 @@ TARGETS = \
|
||||
# Make all targets...
|
||||
#
|
||||
|
||||
all: $(TARGETS)
|
||||
all: $(TARGETS)
|
||||
|
||||
|
||||
#
|
||||
@@ -215,6 +230,13 @@ install-headers:
|
||||
for file in $(HEADERS); do \
|
||||
$(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
|
||||
done
|
||||
if test "x$(privateinclude)" != x; then \
|
||||
echo Installing private header files into $(PRIVATEINCLUDE)...; \
|
||||
$(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
|
||||
for file in $(HEADERSPRIV); do \
|
||||
$(INSTALL_DATA) $$file $(PRIVATEINCLUDE)/$$file; \
|
||||
done; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
@@ -240,9 +262,9 @@ install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
|
||||
|
||||
installstatic:
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
$(INSTALL_LIB) -m 755 libcups.a $(LIBDIR)
|
||||
$(RANLIB) $(LIBDIR)/libcups.a
|
||||
$(CHMOD) 555 $(LIBDIR)/libcups.a
|
||||
$(INSTALL_LIB) -m 755 $(LIBCUPSSTATIC) $(LIBDIR)
|
||||
$(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
|
||||
$(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
|
||||
|
||||
install32bit:
|
||||
echo Installing libraries in $(LIB32DIR)...
|
||||
@@ -263,7 +285,7 @@ install64bit:
|
||||
|
||||
uninstall: $(UNINSTALL32) $(UNINSTALL64)
|
||||
$(RM) $(LIBDIR)/libcups.2.dylib
|
||||
$(RM) $(LIBDIR)/libcups.a
|
||||
$(RM) $(LIBDIR)/$(LIBCUPSSTATIC)
|
||||
$(RM) $(LIBDIR)/libcups.dylib
|
||||
$(RM) $(LIBDIR)/libcups_s.a
|
||||
$(RM) $(LIBDIR)/libcups.sl
|
||||
@@ -329,17 +351,20 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS)
|
||||
# libcups.2.dylib
|
||||
#
|
||||
|
||||
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
|
||||
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
echo Creating export list for $@...
|
||||
nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}' | \
|
||||
grep -v -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
|
||||
sort >t.exp
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.8.0 \
|
||||
-current_version 2.9.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
-exported_symbols_list libcups.exp \
|
||||
-sectorder __TEXT __text $(LIBCUPSORDER) \
|
||||
-exported_symbols_list t.exp \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(RM) libcups.dylib
|
||||
$(RM) libcups.dylib t.exp
|
||||
$(LN) $@ libcups.dylib
|
||||
|
||||
|
||||
@@ -363,7 +388,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:8 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
-rpath $(LIBDIR) -version-info 2:9 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -382,9 +407,9 @@ libcups.a: $(LIBOBJS)
|
||||
# testadmin (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testadmin: testadmin.o libcups.a
|
||||
testadmin: testadmin.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
|
||||
$(CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -392,9 +417,9 @@ testadmin: testadmin.o libcups.a
|
||||
# testarray (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testarray: testarray.o libcups.a
|
||||
testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running array API tests...
|
||||
./testarray
|
||||
@@ -404,9 +429,9 @@ testarray: testarray.o libcups.a
|
||||
# testconflicts (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testconflicts: testconflicts.o libcups.a
|
||||
testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testconflicts.o libcups.a \
|
||||
$(CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -414,9 +439,9 @@ testconflicts: testconflicts.o libcups.a
|
||||
# testcups (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testcups: testcups.o libcups.a
|
||||
testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
|
||||
$(CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -424,9 +449,9 @@ testcups: testcups.o libcups.a
|
||||
# testfile (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testfile: testfile.o libcups.a
|
||||
testfile: testfile.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running file API tests...
|
||||
./testfile
|
||||
@@ -436,9 +461,9 @@ testfile: testfile.o libcups.a
|
||||
# testhttp (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testhttp: testhttp.o libcups.a
|
||||
testhttp: testhttp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running HTTP API tests...
|
||||
./testhttp
|
||||
@@ -448,9 +473,9 @@ testhttp: testhttp.o libcups.a
|
||||
# testipp (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testipp: testipp.o libcups.a
|
||||
testipp: testipp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running IPP API tests...
|
||||
./testipp
|
||||
@@ -460,9 +485,9 @@ testipp: testipp.o libcups.a
|
||||
# testi18n (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testi18n: testi18n.o libcups.a
|
||||
testi18n: testi18n.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running internationalization API tests...
|
||||
./testi18n
|
||||
@@ -472,9 +497,9 @@ testi18n: testi18n.o libcups.a
|
||||
# testlang (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testlang: testlang.o libcups.a
|
||||
testlang: testlang.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running language API tests...
|
||||
./testlang
|
||||
@@ -484,9 +509,9 @@ testlang: testlang.o libcups.a
|
||||
# testoptions (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testoptions: testoptions.o libcups.a
|
||||
testoptions: testoptions.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running option API tests...
|
||||
./testoptions
|
||||
@@ -496,9 +521,9 @@ testoptions: testoptions.o libcups.a
|
||||
# testppd (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testppd: testppd.o libcups.a test.ppd test2.ppd
|
||||
testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running PPD API tests...
|
||||
./testppd
|
||||
@@ -508,9 +533,9 @@ testppd: testppd.o libcups.a test.ppd test2.ppd
|
||||
# testpwg (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testpwg: testpwg.o libcups.a test.ppd
|
||||
testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o libcups.a \
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
echo Running PWG API tests...
|
||||
./testpwg test.ppd
|
||||
@@ -520,9 +545,9 @@ testpwg: testpwg.o libcups.a test.ppd
|
||||
# testsnmp (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testsnmp: testsnmp.o libcups.a
|
||||
testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
|
||||
$(CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -632,6 +657,17 @@ framedhelp:
|
||||
backchannel.c backend.h backend.c sidechannel.c sidechannel.h
|
||||
|
||||
|
||||
#
|
||||
# Lines of code computation...
|
||||
#
|
||||
|
||||
sloc:
|
||||
echo "libcupslite: \c"
|
||||
sloccount $(LITEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
echo "libcups: \c"
|
||||
sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
|
||||
|
||||
#
|
||||
# Dependencies...
|
||||
#
|
||||
|
||||
+148
-124
@@ -1,10 +1,9 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Administration utility API definitions for the Common UNIX Printing
|
||||
* System (CUPS).
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -17,26 +16,22 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsAdminCreateWindowsPPD() - Create the Windows PPD file for a printer.
|
||||
* cupsAdminExportSamba() - Export a printer to Samba.
|
||||
* cupsAdminGetServerSettings() - Get settings from the server.
|
||||
* _cupsAdminGetServerSettings() - Get settings from the server (private).
|
||||
* cupsAdminSetServerSettings() - Set settings on the server.
|
||||
* _cupsAdminSetServerSettings() - Set settings on the server (private).
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "adminutil.h"
|
||||
#include "globals.h"
|
||||
#include "debug.h"
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef WIN32
|
||||
@@ -50,12 +45,6 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
extern int _cupsAdminGetServerSettings(http_t *http,
|
||||
int *num_settings,
|
||||
cups_option_t **settings);
|
||||
extern int _cupsAdminSetServerSettings(http_t *http,
|
||||
int num_settings,
|
||||
cups_option_t *settings);
|
||||
static int do_samba_command(const char *command,
|
||||
const char *address,
|
||||
const char *subcommand,
|
||||
@@ -262,7 +251,7 @@ cupsAdminCreateWindowsPPD(
|
||||
if ((ptr = strchr(line, ':')) == NULL)
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language, _("Missing value on line %d!")),
|
||||
_cupsLangString(language, _("Missing value on line %d.")),
|
||||
linenum);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line, 0);
|
||||
|
||||
@@ -281,7 +270,7 @@ cupsAdminCreateWindowsPPD(
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language,
|
||||
_("Missing double quote on line %d!")),
|
||||
_("Missing double quote on line %d.")),
|
||||
linenum);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line, 0);
|
||||
|
||||
@@ -300,7 +289,7 @@ cupsAdminCreateWindowsPPD(
|
||||
{
|
||||
snprintf(line, sizeof(line),
|
||||
_cupsLangString(language,
|
||||
_("Bad option + choice on line %d!")),
|
||||
_("Bad option + choice on line %d.")),
|
||||
linenum);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, line, 0);
|
||||
|
||||
@@ -345,7 +334,7 @@ cupsAdminCreateWindowsPPD(
|
||||
|
||||
if (linenum == 0)
|
||||
{
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, _("Empty PPD file!"), 1);
|
||||
_cupsSetError(IPP_DOCUMENT_FORMAT_ERROR, _("Empty PPD file."), 1);
|
||||
|
||||
cupsFileClose(dstfp);
|
||||
unlink(buffer);
|
||||
@@ -496,12 +485,12 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to copy Windows 2000 printer "
|
||||
"driver files (%d)!")), status);
|
||||
"driver files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
@@ -531,18 +520,18 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to copy CUPS printer driver "
|
||||
"files (%d)!")), status);
|
||||
"files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do the rpcclient command needed for the CUPS drivers...
|
||||
*/
|
||||
@@ -574,12 +563,12 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to install Windows 2000 printer "
|
||||
"driver files (%d)!")), status);
|
||||
"driver files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
@@ -619,12 +608,12 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to copy Windows 9x printer "
|
||||
"driver files (%d)!")), status);
|
||||
"driver files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
@@ -648,12 +637,12 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to install Windows 9x printer "
|
||||
"driver files (%d)!")), status);
|
||||
"driver files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
@@ -700,12 +689,12 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to copy 64-bit Windows printer "
|
||||
"driver files (%d)!")), status);
|
||||
"driver files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
@@ -735,18 +724,18 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to copy 64-bit CUPS printer driver "
|
||||
"files (%d)!")), status);
|
||||
"files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do the rpcclient command needed for the CUPS drivers...
|
||||
*/
|
||||
@@ -778,12 +767,12 @@ cupsAdminExportSamba(
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to install Windows 2000 printer "
|
||||
"driver files (%d)!")), status);
|
||||
"driver files (%d).")), status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
@@ -796,17 +785,17 @@ cupsAdminExportSamba(
|
||||
if (!have_drivers)
|
||||
strlcpy(message,
|
||||
_cupsLangString(language,
|
||||
_("No Windows printer drivers are installed!")),
|
||||
_("No Windows printer drivers are installed.")),
|
||||
sizeof(message));
|
||||
else
|
||||
strlcpy(message,
|
||||
_cupsLangString(language,
|
||||
_("Warning, no Windows 2000 printer drivers "
|
||||
"are installed!")),
|
||||
"are installed.")),
|
||||
sizeof(message));
|
||||
|
||||
_cupsSetError(IPP_NOT_FOUND, message, 0);
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
}
|
||||
|
||||
if (have_drivers == 0)
|
||||
@@ -829,13 +818,13 @@ cupsAdminExportSamba(
|
||||
{
|
||||
snprintf(message, sizeof(message),
|
||||
_cupsLangString(language,
|
||||
_("Unable to set Windows printer driver (%d)!")),
|
||||
_("Unable to set Windows printer driver (%d).")),
|
||||
status);
|
||||
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, message, 0);
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, "%s\n", message);
|
||||
_cupsLangPuts(logfile, message);
|
||||
|
||||
unlink(authfile);
|
||||
|
||||
@@ -912,8 +901,8 @@ cupsAdminGetServerSettings(
|
||||
|
||||
if (!cg->http)
|
||||
{
|
||||
if ((cg->http = _httpCreate(cupsServer(), ippPort(),
|
||||
cupsEncryption())) == NULL)
|
||||
if ((cg->http = _httpCreate(cupsServer(), ippPort(), NULL,
|
||||
cupsEncryption(), AF_UNSPEC)) == NULL)
|
||||
{
|
||||
if (errno)
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
@@ -1002,7 +991,7 @@ cupsAdminGetServerSettings(
|
||||
if (!value && strncmp(line, "</", 2))
|
||||
value = line + strlen(line);
|
||||
|
||||
if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) && value)
|
||||
if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")) && value)
|
||||
{
|
||||
char *port; /* Pointer to port number, if any */
|
||||
|
||||
@@ -1019,46 +1008,46 @@ cupsAdminGetServerSettings(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1")
|
||||
if (_cups_strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1")
|
||||
#ifdef AF_LOCAL
|
||||
&& *value != '/'
|
||||
#endif /* AF_LOCAL */
|
||||
#ifdef AF_INET6
|
||||
&& strcmp(value, "::1")
|
||||
&& strcmp(value, "[::1]")
|
||||
#endif /* AF_INET6 */
|
||||
)
|
||||
remote_access = 1;
|
||||
}
|
||||
else if (!strcasecmp(line, "Browsing"))
|
||||
else if (!_cups_strcasecmp(line, "Browsing"))
|
||||
{
|
||||
browsing = !strcasecmp(value, "yes") || !strcasecmp(value, "on") ||
|
||||
!strcasecmp(value, "true");
|
||||
browsing = !_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "on") ||
|
||||
!_cups_strcasecmp(value, "true");
|
||||
}
|
||||
else if (!strcasecmp(line, "BrowseAddress"))
|
||||
else if (!_cups_strcasecmp(line, "BrowseAddress"))
|
||||
{
|
||||
browse_address = 1;
|
||||
}
|
||||
else if (!strcasecmp(line, "BrowseAllow"))
|
||||
else if (!_cups_strcasecmp(line, "BrowseAllow"))
|
||||
{
|
||||
browse_allow = 1;
|
||||
}
|
||||
else if (!strcasecmp(line, "BrowseOrder"))
|
||||
else if (!_cups_strcasecmp(line, "BrowseOrder"))
|
||||
{
|
||||
browse_allow = !strncasecmp(value, "deny,", 5);
|
||||
browse_allow = !_cups_strncasecmp(value, "deny,", 5);
|
||||
}
|
||||
else if (!strcasecmp(line, "LogLevel"))
|
||||
else if (!_cups_strcasecmp(line, "LogLevel"))
|
||||
{
|
||||
debug_logging = !strncasecmp(value, "debug", 5);
|
||||
debug_logging = !_cups_strncasecmp(value, "debug", 5);
|
||||
}
|
||||
else if (!strcasecmp(line, "<Policy") && !strcasecmp(value, "default"))
|
||||
else if (!_cups_strcasecmp(line, "<Policy") && !_cups_strcasecmp(value, "default"))
|
||||
{
|
||||
in_policy = 1;
|
||||
}
|
||||
else if (!strcasecmp(line, "</Policy>"))
|
||||
else if (!_cups_strcasecmp(line, "</Policy>"))
|
||||
{
|
||||
in_policy = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "<Limit") && in_policy && value)
|
||||
else if (!_cups_strcasecmp(line, "<Limit") && in_policy && value)
|
||||
{
|
||||
/*
|
||||
* See if the policy limit is for the Cancel-Job operation...
|
||||
@@ -1074,7 +1063,7 @@ cupsAdminGetServerSettings(
|
||||
if (*valptr)
|
||||
*valptr++ = '\0';
|
||||
|
||||
if (!strcasecmp(value, "cancel-job") || !strcasecmp(value, "all"))
|
||||
if (!_cups_strcasecmp(value, "cancel-job") || !_cups_strcasecmp(value, "all"))
|
||||
{
|
||||
in_cancel_job = 1;
|
||||
break;
|
||||
@@ -1083,26 +1072,26 @@ cupsAdminGetServerSettings(
|
||||
for (value = valptr; _cups_isspace(*value); value ++);
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(line, "</Limit>"))
|
||||
else if (!_cups_strcasecmp(line, "</Limit>"))
|
||||
{
|
||||
in_cancel_job = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "Require") && in_cancel_job)
|
||||
else if (!_cups_strcasecmp(line, "Require") && in_cancel_job)
|
||||
{
|
||||
cancel_policy = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "<Location") && value)
|
||||
else if (!_cups_strcasecmp(line, "<Location") && value)
|
||||
{
|
||||
in_admin_location = !strcasecmp(value, "/admin");
|
||||
in_admin_location = !_cups_strcasecmp(value, "/admin");
|
||||
in_location = 1;
|
||||
}
|
||||
else if (!strcasecmp(line, "</Location>"))
|
||||
else if (!_cups_strcasecmp(line, "</Location>"))
|
||||
{
|
||||
in_admin_location = 0;
|
||||
in_location = 0;
|
||||
}
|
||||
else if (!strcasecmp(line, "Allow") && value &&
|
||||
strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1")
|
||||
else if (!_cups_strcasecmp(line, "Allow") && value &&
|
||||
_cups_strcasecmp(value, "localhost") && _cups_strcasecmp(value, "127.0.0.1")
|
||||
#ifdef AF_LOCAL
|
||||
&& *value != '/'
|
||||
#endif /* AF_LOCAL */
|
||||
@@ -1113,16 +1102,16 @@ cupsAdminGetServerSettings(
|
||||
{
|
||||
if (in_admin_location)
|
||||
remote_admin = 1;
|
||||
else if (!strcasecmp(value, "all"))
|
||||
else if (!_cups_strcasecmp(value, "all"))
|
||||
remote_any = 1;
|
||||
}
|
||||
else if (line[0] != '<' && !in_location && !in_policy &&
|
||||
strcasecmp(line, "Allow") &&
|
||||
strcasecmp(line, "AuthType") &&
|
||||
strcasecmp(line, "Deny") &&
|
||||
strcasecmp(line, "Order") &&
|
||||
strcasecmp(line, "Require") &&
|
||||
strcasecmp(line, "Satisfy"))
|
||||
_cups_strcasecmp(line, "Allow") &&
|
||||
_cups_strcasecmp(line, "AuthType") &&
|
||||
_cups_strcasecmp(line, "Deny") &&
|
||||
_cups_strcasecmp(line, "Order") &&
|
||||
_cups_strcasecmp(line, "Require") &&
|
||||
_cups_strcasecmp(line, "Satisfy"))
|
||||
cg->cupsd_num_settings = cupsAddOption(line, value,
|
||||
cg->cupsd_num_settings,
|
||||
&(cg->cupsd_settings));
|
||||
@@ -1284,12 +1273,18 @@ cupsAdminSetServerSettings(
|
||||
else
|
||||
old_debug_logging = 0;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: old debug_logging=%d",
|
||||
old_debug_logging));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_remote_admin = atoi(val);
|
||||
else
|
||||
old_remote_admin = 0;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_admin=%d",
|
||||
old_remote_admin));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
remote_any = atoi(val);
|
||||
@@ -1305,18 +1300,27 @@ cupsAdminSetServerSettings(
|
||||
else
|
||||
old_remote_printers = 1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_printers=%d",
|
||||
old_remote_printers));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_share_printers = atoi(val);
|
||||
else
|
||||
old_share_printers = 0;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: old share_printers=%d",
|
||||
old_share_printers));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
old_user_cancel_any = atoi(val);
|
||||
else
|
||||
old_user_cancel_any = 0;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: old user_cancel_any=%d",
|
||||
old_user_cancel_any));
|
||||
|
||||
cupsFreeOptions(cupsd_num_settings, cupsd_settings);
|
||||
|
||||
/*
|
||||
@@ -1340,16 +1344,22 @@ cupsAdminSetServerSettings(
|
||||
else
|
||||
debug_logging = -1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: debug_logging=%d",
|
||||
debug_logging));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings,
|
||||
settings)) != NULL)
|
||||
remote_any = atoi(val);
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d",
|
||||
remote_any));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
remote_admin = atoi(val);
|
||||
|
||||
if (remote_admin == old_remote_admin && remote_any < 0)
|
||||
if (remote_admin == old_remote_admin)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
@@ -1361,6 +1371,9 @@ cupsAdminSetServerSettings(
|
||||
else
|
||||
remote_admin = -1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: remote_admin=%d",
|
||||
remote_admin));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
@@ -1378,12 +1391,15 @@ cupsAdminSetServerSettings(
|
||||
else
|
||||
remote_printers = -1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: remote_printers=%d",
|
||||
remote_printers));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
share_printers = atoi(val);
|
||||
|
||||
if (share_printers == old_share_printers && remote_any < 0)
|
||||
if (share_printers == old_share_printers)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
@@ -1395,6 +1411,9 @@ cupsAdminSetServerSettings(
|
||||
else
|
||||
share_printers = -1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: share_printers=%d",
|
||||
share_printers));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings,
|
||||
settings)) != NULL)
|
||||
{
|
||||
@@ -1412,6 +1431,9 @@ cupsAdminSetServerSettings(
|
||||
else
|
||||
user_cancel_any = -1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: user_cancel_any=%d",
|
||||
user_cancel_any));
|
||||
|
||||
/*
|
||||
* Create a temporary file for the new cupsd.conf file...
|
||||
*/
|
||||
@@ -1462,8 +1484,8 @@ cupsAdminSetServerSettings(
|
||||
|
||||
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) &&
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")) &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
{
|
||||
if (!wrote_port_listen)
|
||||
{
|
||||
@@ -1494,13 +1516,13 @@ cupsAdminSetServerSettings(
|
||||
)
|
||||
cupsFilePrintf(temp, "Listen %s\n", value);
|
||||
}
|
||||
else if ((!strcasecmp(line, "Browsing") ||
|
||||
!strcasecmp(line, "BrowseAddress") ||
|
||||
!strcasecmp(line, "BrowseAllow") ||
|
||||
!strcasecmp(line, "BrowseDeny") ||
|
||||
!strcasecmp(line, "BrowseLocalProtocols") ||
|
||||
!strcasecmp(line, "BrowseRemoteProtocols") ||
|
||||
!strcasecmp(line, "BrowseOrder")) &&
|
||||
else if ((!_cups_strcasecmp(line, "Browsing") ||
|
||||
!_cups_strcasecmp(line, "BrowseAddress") ||
|
||||
!_cups_strcasecmp(line, "BrowseAllow") ||
|
||||
!_cups_strcasecmp(line, "BrowseDeny") ||
|
||||
!_cups_strcasecmp(line, "BrowseLocalProtocols") ||
|
||||
!_cups_strcasecmp(line, "BrowseRemoteProtocols") ||
|
||||
!_cups_strcasecmp(line, "BrowseOrder")) &&
|
||||
(remote_printers >= 0 || share_printers >= 0))
|
||||
{
|
||||
if (!wrote_browsing)
|
||||
@@ -1582,7 +1604,7 @@ cupsAdminSetServerSettings(
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(line, "LogLevel") && debug_logging >= 0)
|
||||
else if (!_cups_strcasecmp(line, "LogLevel") && debug_logging >= 0)
|
||||
{
|
||||
wrote_loglevel = 1;
|
||||
|
||||
@@ -1598,15 +1620,15 @@ cupsAdminSetServerSettings(
|
||||
cupsFilePuts(temp, "LogLevel " CUPS_DEFAULT_LOG_LEVEL "\n");
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(line, "<Policy"))
|
||||
else if (!_cups_strcasecmp(line, "<Policy"))
|
||||
{
|
||||
in_default_policy = !strcasecmp(value, "default");
|
||||
in_default_policy = !_cups_strcasecmp(value, "default");
|
||||
in_policy = 1;
|
||||
|
||||
cupsFilePrintf(temp, "%s %s>\n", line, value);
|
||||
indent += 2;
|
||||
}
|
||||
else if (!strcasecmp(line, "</Policy>"))
|
||||
else if (!_cups_strcasecmp(line, "</Policy>"))
|
||||
{
|
||||
indent -= 2;
|
||||
if (!wrote_policy && in_default_policy)
|
||||
@@ -1628,7 +1650,7 @@ cupsAdminSetServerSettings(
|
||||
|
||||
cupsFilePuts(temp, "</Policy>\n");
|
||||
}
|
||||
else if (!strcasecmp(line, "<Location"))
|
||||
else if (!_cups_strcasecmp(line, "<Location"))
|
||||
{
|
||||
in_location = 1;
|
||||
indent += 2;
|
||||
@@ -1641,7 +1663,7 @@ cupsAdminSetServerSettings(
|
||||
|
||||
cupsFilePrintf(temp, "%s %s>\n", line, value);
|
||||
}
|
||||
else if (!strcasecmp(line, "</Location>"))
|
||||
else if (!_cups_strcasecmp(line, "</Location>"))
|
||||
{
|
||||
in_location = 0;
|
||||
indent -= 2;
|
||||
@@ -1678,7 +1700,7 @@ cupsAdminSetServerSettings(
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
}
|
||||
else if (in_root_location &&
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
{
|
||||
wrote_root_location = 1;
|
||||
|
||||
@@ -1707,50 +1729,50 @@ cupsAdminSetServerSettings(
|
||||
|
||||
cupsFilePuts(temp, "</Location>\n");
|
||||
}
|
||||
else if (!strcasecmp(line, "<Limit"))
|
||||
else if (!_cups_strcasecmp(line, "<Limit"))
|
||||
{
|
||||
if (in_default_policy)
|
||||
{
|
||||
/*
|
||||
* See if the policy limit is for the Cancel-Job operation...
|
||||
*/
|
||||
|
||||
|
||||
char *valptr; /* Pointer into value */
|
||||
|
||||
|
||||
if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
|
||||
|
||||
|
||||
if (!_cups_strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
|
||||
{
|
||||
/*
|
||||
* Don't write anything for this limit section...
|
||||
*/
|
||||
|
||||
|
||||
in_cancel_job = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsFilePrintf(temp, "%*s%s", indent, "", line);
|
||||
|
||||
|
||||
while (*value)
|
||||
{
|
||||
for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++);
|
||||
|
||||
|
||||
if (*valptr)
|
||||
*valptr++ = '\0';
|
||||
|
||||
if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
|
||||
|
||||
if (!_cups_strcasecmp(value, "cancel-job") && user_cancel_any >= 0)
|
||||
{
|
||||
/*
|
||||
* Write everything except for this definition...
|
||||
*/
|
||||
|
||||
|
||||
in_cancel_job = 1;
|
||||
}
|
||||
else
|
||||
cupsFilePrintf(temp, " %s", value);
|
||||
|
||||
|
||||
for (value = valptr; _cups_isspace(*value); value ++);
|
||||
}
|
||||
|
||||
|
||||
cupsFilePuts(temp, ">\n");
|
||||
}
|
||||
}
|
||||
@@ -1759,7 +1781,7 @@ cupsAdminSetServerSettings(
|
||||
|
||||
indent += 2;
|
||||
}
|
||||
else if (!strcasecmp(line, "</Limit>") && in_cancel_job)
|
||||
else if (!_cups_strcasecmp(line, "</Limit>") && in_cancel_job)
|
||||
{
|
||||
indent -= 2;
|
||||
|
||||
@@ -1780,10 +1802,10 @@ cupsAdminSetServerSettings(
|
||||
in_cancel_job = 0;
|
||||
}
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location) &&
|
||||
(remote_admin >= 0 || remote_any >= 0)) ||
|
||||
(remote_admin >= 0 || remote_any > 0)) ||
|
||||
(in_root_location && share_printers >= 0)) &&
|
||||
(!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
|
||||
!strcasecmp(line, "Order")))
|
||||
(!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") ||
|
||||
!_cups_strcasecmp(line, "Order")))
|
||||
continue;
|
||||
else if (in_cancel_job == 2)
|
||||
continue;
|
||||
@@ -1826,7 +1848,7 @@ cupsAdminSetServerSettings(
|
||||
/*
|
||||
* Record the non-policy, non-location directives that we find
|
||||
* in the server settings, since we cache this info and record it
|
||||
* in _cupsAdminGetServerSettings()...
|
||||
* in cupsAdminGetServerSettings()...
|
||||
*/
|
||||
|
||||
cupsd_num_settings = cupsAddOption(line, value, cupsd_num_settings,
|
||||
@@ -1885,7 +1907,7 @@ cupsAdminSetServerSettings(
|
||||
}
|
||||
|
||||
if (!wrote_port_listen &&
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
{
|
||||
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
|
||||
{
|
||||
@@ -1906,7 +1928,7 @@ cupsAdminSetServerSettings(
|
||||
}
|
||||
|
||||
if (!wrote_root_location &&
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
{
|
||||
if (remote_admin > 0 && share_printers > 0)
|
||||
cupsFilePuts(temp,
|
||||
@@ -2012,6 +2034,8 @@ cupsAdminSetServerSettings(
|
||||
|
||||
for (i = num_settings, setting = settings; i > 0; i --, setting ++)
|
||||
if (setting->name[0] != '_' &&
|
||||
_cups_strcasecmp(setting->name, "Listen") &&
|
||||
_cups_strcasecmp(setting->name, "Port") &&
|
||||
!cupsGetOption(setting->name, cupsd_num_settings, cupsd_settings))
|
||||
{
|
||||
/*
|
||||
@@ -2142,7 +2166,7 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile,
|
||||
_("Running command: %s %s -N -A %s -c \'%s\'\n"),
|
||||
_("Running command: %s %s -N -A %s -c \'%s\'"),
|
||||
command, address, authfile, subcmd);
|
||||
|
||||
if ((pid = fork()) == 0)
|
||||
@@ -2178,7 +2202,7 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
status = -1;
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPrintf(logfile, _("Unable to run \"%s\": %s\n"),
|
||||
_cupsLangPrintf(logfile, _("Unable to run \"%s\": %s"),
|
||||
command, strerror(errno));
|
||||
}
|
||||
else
|
||||
@@ -2191,7 +2215,7 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
}
|
||||
|
||||
if (logfile)
|
||||
_cupsLangPuts(logfile, "\n");
|
||||
_cupsLangPuts(logfile, "");
|
||||
|
||||
DEBUG_printf(("9do_samba_command: status=%d", status));
|
||||
|
||||
@@ -2230,14 +2254,14 @@ get_cupsd_conf(
|
||||
|
||||
httpGetHostname(http, host, sizeof(host));
|
||||
|
||||
if (strcasecmp(cg->cupsd_hostname, host))
|
||||
if (_cups_strcasecmp(cg->cupsd_hostname, host))
|
||||
invalidate_cupsd_cache(cg);
|
||||
|
||||
snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot);
|
||||
*remote = 0;
|
||||
|
||||
#ifndef WIN32
|
||||
if (!strcasecmp(host, "localhost") && !access(name, R_OK))
|
||||
if (!_cups_strcasecmp(host, "localhost") && !access(name, R_OK))
|
||||
{
|
||||
/*
|
||||
* Read the local file rather than using HTTP...
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include "cups.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
"$Id: api-array.header 8627 2009-05-13 21:39:17Z mike $"
|
||||
"$Id: api-array.header 9771 2011-05-12 05:21:56Z mike $"
|
||||
|
||||
Array API header for the Common UNIX Printing System (CUPS).
|
||||
Array API header for CUPS.
|
||||
|
||||
Copyright 2008-2009 by Apple Inc.
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
|
||||
+27
-8
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
"$Id: api-array.shtml 7616 2008-05-28 00:34:13Z mike $"
|
||||
"$Id: api-array.shtml 9727 2011-04-28 21:20:12Z mike $"
|
||||
|
||||
Array API introduction for the Common UNIX Printing System (CUPS).
|
||||
Array API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2008 by Apple Inc.
|
||||
Copyright 2007-2011 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
@@ -31,8 +31,9 @@ data.</p>
|
||||
<h3><a name='MANAGING_ARRAYS'>Managing Arrays</a></h3>
|
||||
|
||||
<p>Arrays are created using either the
|
||||
<a href='#cupsArrayNew'><code>cupsArrayNew</code></a> or
|
||||
<a href='#cupsArrayNew2'><code>cupsArrayNew2</code></a> functions. The
|
||||
<a href='#cupsArrayNew'><code>cupsArrayNew</code></a>,
|
||||
<a href='#cupsArrayNew2'><code>cupsArrayNew2</code></a>, or
|
||||
<a href='#cupsArrayNew2'><code>cupsArrayNew3</code></a> functions. The
|
||||
first function creates a new array with the specified callback function
|
||||
and user data pointer:</p>
|
||||
|
||||
@@ -69,7 +70,7 @@ static int compare_func(void *first, void *second, void *user_data);
|
||||
static int hash_func(void *element, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew2'>cupsArrayNew2</a>(compare_func, user_data, hash_func, HASH_SIZE);
|
||||
<a href='#cups_array_t'>cups_array_t</a> *hash_array = <a href='#cupsArrayNew2'>cupsArrayNew2</a>(compare_func, user_data, hash_func, HASH_SIZE);
|
||||
</pre>
|
||||
|
||||
<p>The hash function (type
|
||||
@@ -80,6 +81,25 @@ element and is called whenever you look up an element in the array with
|
||||
only limited by available memory, but generally should not be larger than
|
||||
16384 to realize any performance improvement.</p>
|
||||
|
||||
<p>The <a href='#cupsArrayNew3'><code>cupsArrayNew3</code></a> function adds
|
||||
copy and free callbacks to support basic memory management of elements:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
#define HASH_SIZE 512 /* Size of hash table */
|
||||
|
||||
static int compare_func(void *first, void *second, void *user_data);
|
||||
static void *copy_func(void *element, void *user_data);
|
||||
static void free_func(void *element, void *user_data);
|
||||
static int hash_func(void *element, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew3'>cupsArrayNew3</a>(compare_func, user_data, NULL, 0, copy_func, free_func);
|
||||
|
||||
<a href='#cups_array_t'>cups_array_t</a> *hash_array = <a href='#cupsArrayNew3'>cupsArrayNew3</a>(compare_func, user_data, hash_func, HASH_SIZE, copy_func, free_func);
|
||||
</pre>
|
||||
|
||||
<p>Once you have created the array, you add elements using the
|
||||
<a href='#cupsArrayAdd'><code>cupsArrayAdd</code></a>
|
||||
<a href='#cupsArrayInsert'><code>cupsArrayInsert</code></a> functions.
|
||||
@@ -128,8 +148,7 @@ example:</p>
|
||||
<p>Finally, you free the memory used by the array using the
|
||||
<a href='#cupsArrayDelete'><code>cupsArrayDelete</code></a> function. All
|
||||
of the memory for the array and hash table (if any) is freed, however <em>CUPS
|
||||
does not free the elements</em> - if necessary, you must allocate and free the
|
||||
elements yourself.</p>
|
||||
does not free the elements unless you provide copy and free functions</em>.</p>
|
||||
|
||||
<h3><a name='FINDING_AND_ENUMERATING'>Finding and Enumerating Elements</a></h3>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
"$Id: api-cups.header 8627 2009-05-13 21:39:17Z mike $"
|
||||
"$Id: api-cups.header 9771 2011-05-12 05:21:56Z mike $"
|
||||
|
||||
CUPS API header for the Common UNIX Printing System (CUPS).
|
||||
CUPS API header for CUPS.
|
||||
|
||||
Copyright 2008-2009 by Apple Inc.
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
"$Id: api-cups.shtml 9061 2010-03-30 22:07:33Z mike $"
|
||||
"$Id: api-cups.shtml 9727 2011-04-28 21:20:12Z mike $"
|
||||
|
||||
CUPS API introduction for the Common UNIX Printing System (CUPS).
|
||||
API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2010 by Apple Inc.
|
||||
Copyright 2007-2011 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
@@ -50,7 +50,7 @@ specific destination for printing:</p>
|
||||
int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests);
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests);
|
||||
|
||||
/* do something wiith dest */
|
||||
/* do something with dest */
|
||||
|
||||
<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
|
||||
</pre>
|
||||
|
||||
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