Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 849ae853e6 |
@@ -1,6 +1,90 @@
|
||||
CHANGES.txt - 2007-03-19
|
||||
CHANGES.txt - 2007-05-08
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.2.11
|
||||
|
||||
- Updated the launchd support on Mac OS X to better
|
||||
support reconfiguration.
|
||||
- "make distclean" didn't remove all generated files
|
||||
(STR #2366)
|
||||
- Fixed a bug in the advertisement of classes (STR
|
||||
#2373)
|
||||
- The IPP backend now stays running until the job is
|
||||
actually printed by the remote server; previously
|
||||
it would stop monitoring the job if it was held or
|
||||
temporarily stopped (STR #2352)
|
||||
- PDF files were not always printed using the correct
|
||||
orientation (STR #2348)
|
||||
- The scheduler could crash if you specified a bad file:
|
||||
URI for a printer (STR #2351)
|
||||
- The Renew-Subscription operation now returns the
|
||||
notify-lease-duration value that was used (STR #2346)
|
||||
- The IPP backend sent job options to IPP printers,
|
||||
however some printers tried to override the options
|
||||
embedded in the PS/PCL stream with those job options
|
||||
(STR #2349)
|
||||
- ppdLocalize() now also tries a country-specific
|
||||
localization for when localizing to a generic locale
|
||||
name.
|
||||
- The cupstestppd program now allows for partial
|
||||
localizations to reduce the size of universal PPD
|
||||
files.
|
||||
- Chinese PPD files were incorrectly tagged with the
|
||||
"cn" locale (should have been "zh")
|
||||
- The backends now manage the printer-state-reasons
|
||||
attribute more accurately (STR #2345)
|
||||
- Java, PHP, Perl, and Python scripts did not work
|
||||
properly (STR #2342)
|
||||
- The scheduler would take forever to start if the
|
||||
maximum number of file descriptors was set to
|
||||
"unlimited" (STR #2329)
|
||||
- The page-ranges option was incorrectly applied to the
|
||||
banner pages (STR #2336)
|
||||
- Fixed some GCC compile warnings (STR #2340)
|
||||
- The DBUS notification code was broken for older
|
||||
versions of DBUS (STR #2327)
|
||||
- The IPv6 code did not compile on HP-UX 11.23 (STR
|
||||
#2331)
|
||||
- PPD constraints did not work properly with custom
|
||||
options.
|
||||
- Regular PPD options with the name "CustomFoo" did
|
||||
not work.
|
||||
- The USB backend did not work on NetBSD (STR #2324)
|
||||
- The printer-state-reasons attribute was incorrectly
|
||||
cleared after a job completed (STR #2323)
|
||||
- The scheduler did not set the printer operation policy
|
||||
on startup, only on soft reload (STR #2319)
|
||||
- The AP_FIRSTPAGE_InputSlot option did not clear any
|
||||
ManualFeed setting that was made, which caused problems
|
||||
with some PPD files (STR #2318)
|
||||
- cupsDoFileRequest() and cupsDoRequest() did not abort
|
||||
when getting an error in the response (STR #2315)
|
||||
- The scheduler did not schedule jobs properly to remote
|
||||
or nested classes (STR #2317)
|
||||
- Updated the mime.types and mime.convs headers to warn
|
||||
that the files are overwritten when CUPS is installed.
|
||||
Local changes should go in local.types or local.convs,
|
||||
respectively (STR #2310)
|
||||
- The scheduler could get in an infinite loop if a
|
||||
printer in an implicit class disappeared (STR #2311)
|
||||
- The pstops filter did not handle %%EndFeature comments
|
||||
properly (STR #2306)
|
||||
- Fixed a problem with the Polish web page printer icons
|
||||
(STR #2305)
|
||||
- ppdLocalize() now also localizes the cupsICCProfile
|
||||
attributes.
|
||||
- The scheduler still had a reference to the incorrect
|
||||
"notify-recipient" attribute (STR #2307)
|
||||
- The "make check" and "make test" subscription tests did
|
||||
not set the locale (STR #2307)
|
||||
- The "make check" and "make test" subscription tests
|
||||
incorrectly used the notify-recipient attribute instead
|
||||
of notify-recipient-uri (STR #2307)
|
||||
- cupsRasterInterpretPPD() incorrectly limited the
|
||||
cupsBorderlessScalingFactor when specified in the
|
||||
job options.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.2.10
|
||||
|
||||
- ppdLocalize() now supports localizing for Japanese
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.2.10 - 2007-03-19
|
||||
INSTALL - CUPS v1.2.11 - 2007-05-08
|
||||
-----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Top-level Makefile for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
@@ -66,6 +66,7 @@ distclean: clean
|
||||
$(RM) cups-config conf/cupsd.conf conf/pam.std
|
||||
$(RM) doc/help/standard.html doc/index.html
|
||||
$(RM) init/cups.sh init/cups-lpd
|
||||
$(RM) man/client.conf.man
|
||||
$(RM) man/cups-deviced.man man/cups-driverd.man
|
||||
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
|
||||
$(RM) man/cupsd.conf.man man/lpoptions.man
|
||||
@@ -121,12 +122,21 @@ install: installhdrs
|
||||
echo Installing StartupItems files...; \
|
||||
$(INSTALL_SCRIPT) init/PrintingServices $(BUILDROOT)$(INITDDIR)/PrintingServices; \
|
||||
$(INSTALL_DATA) init/StartupParameters.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \
|
||||
$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
$(INSTALL_DATA) init/Localizable.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
|
||||
elif 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; \
|
||||
@@ -201,7 +211,9 @@ uninstall:
|
||||
$(RM) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \
|
||||
$(RMDIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \
|
||||
elif test "$(INITDDIR)" = "/System/Library/LaunchDaemons"; then \
|
||||
$(RM) $(BUILDROOT)$(DEFAULT_LAUNCHD_CONF); \
|
||||
$(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 \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README - CUPS v1.2.10 - 2007-03-19
|
||||
README - CUPS v1.2.11 - 2007-05-08
|
||||
----------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
|
||||
@@ -101,6 +101,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int send_options; /* Send job options? */
|
||||
int num_options; /* Number of printer options */
|
||||
cups_option_t *options; /* Printer options */
|
||||
char method[255], /* Method in URI */
|
||||
@@ -416,6 +417,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
filename = tmpfilename;
|
||||
files = &filename;
|
||||
num_files = 1;
|
||||
|
||||
send_options = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -426,6 +429,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
num_files = argc - 6;
|
||||
files = argv + 6;
|
||||
|
||||
send_options = strncasecmp(content_type, "application/vnd.cups-", 21) != 0;
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (compression)
|
||||
compress_files(num_files, files);
|
||||
@@ -853,6 +858,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
content_type = "application/postscript";
|
||||
copies = 1;
|
||||
copies_remaining = 1;
|
||||
send_options = 0;
|
||||
}
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
@@ -868,7 +874,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
num_options, &options);
|
||||
}
|
||||
|
||||
if (copies_sup && version > 0)
|
||||
if (copies_sup && version > 0 && send_options)
|
||||
{
|
||||
/*
|
||||
* Only send options if the destination printer supports the copies
|
||||
@@ -1078,8 +1084,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Stop polling if the job is finished or pending-held...
|
||||
*/
|
||||
|
||||
if (job_state->values[0].integer > IPP_JOB_PROCESSING ||
|
||||
job_state->values[0].integer == IPP_JOB_HELD)
|
||||
if (job_state->values[0].integer > IPP_JOB_STOPPED)
|
||||
{
|
||||
if ((job_sheets = ippFindAttribute(response,
|
||||
"job-media-sheets-completed",
|
||||
|
||||
@@ -101,7 +101,8 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
|
||||
* Now loop until we are out of data from print_fd...
|
||||
*/
|
||||
|
||||
for (print_bytes = 0, print_ptr = print_buffer, offline = 0, paperout = 0, total_bytes = 0;;)
|
||||
for (print_bytes = 0, print_ptr = print_buffer, offline = -1,
|
||||
paperout = -1, total_bytes = 0;;)
|
||||
{
|
||||
/*
|
||||
* Use select() to determine whether we have data to copy around...
|
||||
@@ -125,7 +126,7 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
|
||||
* Pause printing to clear any pending errors...
|
||||
*/
|
||||
|
||||
if (errno == ENXIO && !offline)
|
||||
if (errno == ENXIO && offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs("INFO: Printer is currently off-line.\n", stderr);
|
||||
@@ -203,7 +204,7 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
|
||||
|
||||
if (errno == ENOSPC)
|
||||
{
|
||||
if (!paperout)
|
||||
if (paperout != 1)
|
||||
{
|
||||
fputs("ERROR: Out of paper!\n", stderr);
|
||||
fputs("STATE: +media-empty-error\n", stderr);
|
||||
@@ -212,7 +213,7 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
|
||||
}
|
||||
else if (errno == ENXIO)
|
||||
{
|
||||
if (!offline)
|
||||
if (offline != 1)
|
||||
{
|
||||
fputs("STATE: +offline-error\n", stderr);
|
||||
fputs("INFO: Printer is currently off-line.\n", stderr);
|
||||
|
||||
@@ -227,7 +227,7 @@ static void parse_pserror (char *sockBuffer, int len);
|
||||
* 'list_devices()' - List all USB devices.
|
||||
*/
|
||||
|
||||
void list_devices()
|
||||
static void list_devices()
|
||||
{
|
||||
iterate_printers(list_device_callback, NULL);
|
||||
}
|
||||
@@ -237,7 +237,7 @@ void list_devices()
|
||||
* 'print_device()' - Print a file to a USB device.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
static int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -44,7 +44,7 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
int open_device(const char *uri, int *use_bc);
|
||||
static int open_device(const char *uri, int *use_bc);
|
||||
|
||||
|
||||
/*
|
||||
@@ -78,6 +78,16 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
do
|
||||
{
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
/*
|
||||
* *BSD's ulpt driver currently does not support the
|
||||
* back-channel, incorrectly returns data ready on a select(),
|
||||
* and locks up on read()...
|
||||
*/
|
||||
|
||||
use_bc = 0;
|
||||
|
||||
#else
|
||||
/*
|
||||
* Disable backchannel data when printing to Brother, Canon, or
|
||||
* Minolta USB printers - apparently these printers will return
|
||||
@@ -89,6 +99,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
strcasecmp(hostname, "Canon") &&
|
||||
strcasecmp(hostname, "Konica Minolta") &&
|
||||
strcasecmp(hostname, "Minolta");
|
||||
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
|
||||
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
{
|
||||
@@ -185,7 +196,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
* 'list_devices()' - List all USB devices.
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
list_devices(void)
|
||||
{
|
||||
#ifdef __linux
|
||||
@@ -290,7 +301,7 @@ list_devices(void)
|
||||
* 'open_device()' - Open a USB device...
|
||||
*/
|
||||
|
||||
int /* O - File descriptor or -1 on error */
|
||||
static int /* O - File descriptor or -1 on error */
|
||||
open_device(const char *uri, /* I - Device URI */
|
||||
int *use_bc) /* O - Set to 0 for unidirectional */
|
||||
{
|
||||
@@ -510,7 +521,12 @@ open_device(const char *uri, /* I - Device URI */
|
||||
}
|
||||
#else
|
||||
{
|
||||
if ((fd = open(uri + 4, O_RDWR | O_EXCL)) < 0)
|
||||
if (use_bc)
|
||||
fd = open(uri + 4, O_RDWR | O_EXCL);
|
||||
else
|
||||
fd = -1;
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
fd = open(uri + 4, O_WRONLY | O_EXCL);
|
||||
*use_bc = 0;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* USB port backend for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -60,10 +60,10 @@
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
void list_devices(void);
|
||||
int print_device(const char *uri, const char *hostname,
|
||||
const char *resource, const char *options,
|
||||
int print_fd, int copies, int argc, char *argv[]);
|
||||
static void list_devices(void);
|
||||
static int print_device(const char *uri, const char *hostname,
|
||||
const char *resource, const char *options,
|
||||
int print_fd, int copies, int argc, char *argv[]);
|
||||
|
||||
|
||||
/*
|
||||
@@ -85,7 +85,7 @@ int print_device(const char *uri, const char *hostname,
|
||||
* 'list_devices()' - List all available USB devices to stdout.
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
list_devices(void)
|
||||
{
|
||||
/*
|
||||
@@ -103,7 +103,7 @@ list_devices(void)
|
||||
* 'print_device()' - Print a file to a USB device.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
static int /* O - Exit status */
|
||||
print_device(const char *uri, /* I - Device URI */
|
||||
const char *hostname, /* I - Hostname/manufacturer */
|
||||
const char *resource, /* I - Resource/modelname */
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#
|
||||
# "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $"
|
||||
# "$Id: mime.convs 6406 2007-03-27 16:11:27Z mike $"
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# MIME converts file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 1997-2005 by Easy Software Products.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
@@ -114,5 +118,5 @@ image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
|
||||
#application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id: mime.convs 5402 2006-04-14 19:21:03Z mike $".
|
||||
# End of "$Id: mime.convs 6406 2007-03-27 16:11:27Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#
|
||||
# "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $"
|
||||
# "$Id: mime.types 6548 2007-06-04 14:43:42Z mike $"
|
||||
#
|
||||
# MIME types file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
# Copyright 1997-2005 by Easy Software Products.
|
||||
# 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 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
@@ -167,5 +171,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 6003 2006-10-02 16:26:04Z mike $".
|
||||
# End of "$Id: mime.types 6548 2007-06-04 14:43:42Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6346 2007-03-17 18:07:17Z mike $"
|
||||
dnl "$Id: cups-common.m4 6548 2007-06-04 14:43:42Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -29,7 +29,7 @@ dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.2.10"
|
||||
CUPS_VERSION="1.2.11"
|
||||
CUPS_REVISION=""
|
||||
|
||||
AC_SUBST(CUPS_VERSION)
|
||||
@@ -264,5 +264,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 6346 2007-03-17 18:07:17Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 6548 2007-06-04 14:43:42Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 6145 2006-12-06 20:10:16Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 6448 2007-04-10 18:24:19Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -425,6 +425,10 @@ case $uname in
|
||||
# HP-UX 11.00 (at least) needs this definition to get the
|
||||
# u_short type used by the IP headers...
|
||||
OPTIM="$OPTIM -D_INCLUDE_HPUX_SOURCE"
|
||||
|
||||
# HP-UX 11.23 (at least) needs this definition to get the
|
||||
# IPv6 header to work...
|
||||
OPTIM="$OPTIM -D_HPUX_SOURCE"
|
||||
;;
|
||||
|
||||
OSF*)
|
||||
@@ -435,5 +439,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 6145 2006-12-06 20:10:16Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 6448 2007-04-10 18:24:19Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 6234 2007-02-05 20:25:50Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 6525 2007-05-08 18:56:05Z mike $"
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for the Common UNIX Printing System
|
||||
dnl (CUPS).
|
||||
@@ -24,11 +24,12 @@ dnl WWW: http://www.cups.org
|
||||
dnl
|
||||
|
||||
dnl Default langugages...
|
||||
AC_ARG_WITH(languages, [ --with-languages set installed languages, default="de es et fr it ja pl sv" ],
|
||||
AC_ARG_WITH(languages, [ --with-languages set installed languages,
|
||||
default="de es et fr it ja pl sv zh_TW" ],
|
||||
if test "x$withval" != xno; then
|
||||
LANGUAGES="$withval"
|
||||
fi,
|
||||
LANGUAGES="de es et fr it ja pl sv")
|
||||
LANGUAGES="de es et fr it ja pl sv zh_TW")
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl Default ConfigFilePerm
|
||||
@@ -252,5 +253,5 @@ fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-defaults.m4 6234 2007-02-05 20:25:50Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 6525 2007-05-08 18:56:05Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -68,10 +68,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0210
|
||||
# define CUPS_VERSION 1.0211
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 2
|
||||
# define CUPS_VERSION_PATCH 10
|
||||
# define CUPS_VERSION_PATCH 11
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
|
||||
@@ -603,7 +603,7 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
pthread_mutex_lock(&lang_mutex);
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
|
||||
if ((lang = cups_cache_lookup(langname, encoding)) != NULL)
|
||||
if ((lang = cups_cache_lookup(real, encoding)) != NULL)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_unlock(&lang_mutex);
|
||||
|
||||
@@ -69,6 +69,7 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */
|
||||
ppd_choice_t *choice; /* Current choice */
|
||||
ppd_coption_t *coption; /* Current custom option */
|
||||
ppd_cparam_t *cparam; /* Current custom parameter */
|
||||
ppd_attr_t *attr; /* Current attribute */
|
||||
cups_lang_t *lang; /* Current language */
|
||||
char ckeyword[PPD_MAX_NAME], /* Custom keyword */
|
||||
ll_CC[6], /* Language + country locale */
|
||||
@@ -95,6 +96,32 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */
|
||||
strlcpy(ll_CC, lang->language, sizeof(ll_CC));
|
||||
strlcpy(ll, lang->language, sizeof(ll));
|
||||
|
||||
if (strlen(ll_CC) == 2)
|
||||
{
|
||||
/*
|
||||
* Map "ll" to primary/origin country locales to have the best
|
||||
* chance of finding a match...
|
||||
*/
|
||||
|
||||
if (!strcmp(ll_CC, "cs"))
|
||||
strcpy(ll_CC, "cs_CZ");
|
||||
else if (!strcmp(ll_CC, "en"))
|
||||
strcpy(ll_CC, "en_US");
|
||||
else if (!strcmp(ll_CC, "ja"))
|
||||
strcpy(ll_CC, "ja_JP");
|
||||
else if (!strcmp(ll_CC, "sv"))
|
||||
strcpy(ll_CC, "sv_SE");
|
||||
else if (!strcmp(ll_CC, "zh"))
|
||||
strcpy(ll_CC, "zh_CN"); /* Simplified Chinese */
|
||||
else
|
||||
{
|
||||
ll_CC[2] = '_';
|
||||
ll_CC[3] = toupper(ll_CC[0] & 255);
|
||||
ll_CC[4] = toupper(ll_CC[1] & 255);
|
||||
ll_CC[5] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_printf((" lang->language=\"%s\", ll=\"%s\", ll_CC=\"%s\"...\n",
|
||||
lang->language, ll, ll_CC));
|
||||
|
||||
@@ -151,6 +178,29 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate ICC profile names...
|
||||
*/
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, "APCustomColorMatchingName", NULL)) != NULL)
|
||||
{
|
||||
if ((text = ppd_text(ppd, "APCustomColorMatchingName", attr->spec,
|
||||
ll_CC, ll)) != NULL)
|
||||
strlcpy(attr->text, text, sizeof(attr->text));
|
||||
}
|
||||
|
||||
for (attr = ppdFindAttr(ppd, "cupsICCProfile", NULL);
|
||||
attr;
|
||||
attr = ppdFindNextAttr(ppd, "cupsICCProfile", NULL))
|
||||
{
|
||||
cupsArraySave(ppd->sorted_attrs);
|
||||
|
||||
if ((text = ppd_text(ppd, "cupsICCProfile", attr->spec, ll_CC, ll)) != NULL)
|
||||
strlcpy(attr->text, text, sizeof(attr->text));
|
||||
|
||||
cupsArrayRestore(ppd->sorted_attrs);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1003,7 +1003,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
for (i = 0, sptr = string; i < 4; i ++)
|
||||
ppd->custom_margins[i] = (float)_cupsStrScand(sptr, &sptr, loc);
|
||||
}
|
||||
else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True"))
|
||||
else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True") && !option)
|
||||
{
|
||||
DEBUG_puts("Processing Custom option...");
|
||||
|
||||
@@ -1076,6 +1076,34 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
*/
|
||||
|
||||
ppd_add_size(ppd, "Custom");
|
||||
|
||||
if ((option = ppdFindOption(ppd, "PageRegion")) == NULL)
|
||||
{
|
||||
ppd_group_t *gtemp; /* Temporary group */
|
||||
|
||||
if ((gtemp = ppd_get_group(ppd, "General", _("General"), cg,
|
||||
encoding)) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to get general group!");
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
option = ppd_get_option(gtemp, "PageRegion");
|
||||
}
|
||||
|
||||
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
|
||||
{
|
||||
DEBUG_puts("Unable to add Custom choice!");
|
||||
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
strlcpy(choice->text, text[0] ? text : _("Custom"),
|
||||
sizeof(choice->text));
|
||||
option = NULL;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(keyword, "LandscapeOrientation"))
|
||||
@@ -1523,10 +1551,10 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
!strcmp(keyword, "NonUIConstraints"))
|
||||
{
|
||||
if (ppd->num_consts == 0)
|
||||
constraint = calloc(1, sizeof(ppd_const_t));
|
||||
constraint = calloc(2, sizeof(ppd_const_t));
|
||||
else
|
||||
constraint = realloc(ppd->consts,
|
||||
(ppd->num_consts + 1) * sizeof(ppd_const_t));
|
||||
(ppd->num_consts + 2) * sizeof(ppd_const_t));
|
||||
|
||||
if (constraint == NULL)
|
||||
{
|
||||
@@ -1687,6 +1715,34 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* For CustomPageSize and InputSlot/ManualFeed, create a duplicate
|
||||
* constraint for PageRegion...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(constraint->option1, "CustomPageSize") &&
|
||||
(!strcasecmp(constraint->option2, "InputSlot") ||
|
||||
!strcasecmp(constraint->option2, "ManualFeed")))
|
||||
{
|
||||
ppd->num_consts ++;
|
||||
|
||||
strcpy(constraint[1].option1, "PageRegion");
|
||||
strcpy(constraint[1].choice1, "Custom");
|
||||
strcpy(constraint[1].option2, constraint->option2);
|
||||
strcpy(constraint[1].choice2, constraint->choice2);
|
||||
}
|
||||
else if (!strcasecmp(constraint->option2, "CustomPageSize") &&
|
||||
(!strcasecmp(constraint->option1, "InputSlot") ||
|
||||
!strcasecmp(constraint->option1, "ManualFeed")))
|
||||
{
|
||||
ppd->num_consts ++;
|
||||
|
||||
strcpy(constraint[1].option1, constraint->option1);
|
||||
strcpy(constraint[1].choice1, constraint->choice1);
|
||||
strcpy(constraint[1].option2, "PageRegion");
|
||||
strcpy(constraint[1].choice2, "Custom");
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle CustomFoo option constraints...
|
||||
*/
|
||||
|
||||
@@ -345,19 +345,22 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
while ((state = ippRead(http, response)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
{
|
||||
/*
|
||||
* Delete the response...
|
||||
*/
|
||||
|
||||
DEBUG_puts("IPP read error!");
|
||||
ippDelete(response);
|
||||
response = NULL;
|
||||
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (state == IPP_ERROR)
|
||||
{
|
||||
/*
|
||||
* Delete the response...
|
||||
*/
|
||||
|
||||
DEBUG_puts("IPP read error!");
|
||||
ippDelete(response);
|
||||
response = NULL;
|
||||
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,3 +27,5 @@ Name[pl]=Zarządzanie drukowaniem
|
||||
Comment[pl]=Interfejs WWW CUPS
|
||||
Name[it]=Gestione stampa
|
||||
Comment[it]=Interfaccia web di CUPS
|
||||
Name[zh_TW]=印表管理
|
||||
Comment[zh_TW]=CUPS 網頁介面
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
"$Id: spec-ppd.html 6158 2006-12-17 01:44:21Z mike $"
|
||||
"$Id: spec-ppd.html 6458 2007-04-17 19:22:41Z mike $"
|
||||
|
||||
CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
|
||||
|
||||
@@ -204,13 +204,13 @@ http://www.vendor.com/help"
|
||||
|
||||
<p>This attribute describes which language localizations are
|
||||
included in the PPD. The "locale list" string is a space-delimited
|
||||
list of locale names ("en", "en_US", "fr_FR", etc.)</p>
|
||||
list of locale names ("en", "en_US", "fr_CA", etc.)</p>
|
||||
|
||||
<p>Example:</p>
|
||||
|
||||
<pre class='command'>
|
||||
<em>*% Specify Canadian, UK, and US English, and Candian and French French</em>
|
||||
*cupsLanguages: "en_CA en_UK en_US fr_CA fr_FR"
|
||||
*cupsLanguages: "en_CA en_UK en_US fr_CA fr_CA"
|
||||
</pre>
|
||||
|
||||
<h3>cupsManualCopies</h3>
|
||||
@@ -540,7 +540,10 @@ languages by following the following additional rules:</p>
|
||||
<li>Localizations are specified using a locale prefix of
|
||||
the form "ll" or "ll_CC." where "ll" is the 2-letter ISO
|
||||
language code and "CC" is the 2-letter ISO country
|
||||
code</li>
|
||||
code<ul>
|
||||
<li>A generic language translation ("ll") SHOULD be provided with country-specific differences ("ll_CC") provided only as needed</li>
|
||||
<li>For historical reasons, the "zh" and "zh_CN" locales map to Simplified Chinese while the "zh_TW" locale maps to Traditional Chinese</li>
|
||||
</ul></li>
|
||||
|
||||
<li>Locale-specific translation strings MUST be encoded
|
||||
using UTF-8.</li>
|
||||
@@ -577,17 +580,17 @@ in the PPD file for a given locale.</blockquote>
|
||||
<pre class='command'>
|
||||
*LanguageVersion: English
|
||||
*LanguageEncoding: ISOLatin1
|
||||
*cupsLanguages: "de_DE fr_FR"
|
||||
*cupsLanguages: "de fr_CA"
|
||||
*ModelName: "Foobar Laser 9999"
|
||||
|
||||
<em>*% Localize ModelName for French and German</em>
|
||||
*fr_FR.Translation ModelName/La Foobar Laser 9999: ""
|
||||
*de_DE.Translation ModelName/Foobar LaserDrucken 9999: ""
|
||||
*fr_CA.Translation ModelName/La Foobar Laser 9999: ""
|
||||
*de.Translation ModelName/Foobar LaserDrucken 9999: ""
|
||||
|
||||
*cupsIPPReason com.vendor-error/A serious error occurred: "/help/com.vendor/error.html"
|
||||
<em>*% Localize printer-state-reason for French and German</em>
|
||||
*fr_FR.cupsIPPReason com.vendor-error/Une erreur sèrieuse s'est produite: "/help/com.vendor/error.html"
|
||||
*de_DE.cupsIPPReason com.vendor-error/Eine ernste Störung trat: "/help/com.vendor/error.html"
|
||||
*fr_CA.cupsIPPReason com.vendor-error/Une erreur sèrieuse s'est produite: "/help/com.vendor/error.html"
|
||||
*de.cupsIPPReason com.vendor-error/Eine ernste Störung trat: "/help/com.vendor/error.html"
|
||||
|
||||
...
|
||||
|
||||
@@ -595,16 +598,16 @@ in the PPD file for a given locale.</blockquote>
|
||||
*OrderDependency: 10 AnySetup *InputSlot
|
||||
*DefaultInputSlot: Auto
|
||||
<em>*% Localize InputSlot for French and German</em>
|
||||
*fr_FR.Translation InputSlot/Papier source: ""
|
||||
*de_DE.Translation InputSlot/Papiereinzug: ""
|
||||
*fr_CA.Translation InputSlot/Papier source: ""
|
||||
*de.Translation InputSlot/Papiereinzug: ""
|
||||
*InputSlot Auto/Default: "<</ManualFeed false>>setpagedevice"
|
||||
<em>*% Localize InputSlot=Auto for French and German</em>
|
||||
*fr_FR.InputSlot Auto/Par Defaut: ""
|
||||
*de_DE.InputSlot Auto/Standard: ""
|
||||
*fr_CA.InputSlot Auto/Par Defaut: ""
|
||||
*de.InputSlot Auto/Standard: ""
|
||||
*InputSlot Manual/Manual Feed: "<</ManualFeed true>>setpagedevice"
|
||||
<em>*% Localize InputSlot=Manual for French and German</em>
|
||||
*fr_FR.InputSlot Manual/Manuel mecanisme de alimentation: ""
|
||||
*de_DE.InputSlot Manual/Manueller Einzug: ""
|
||||
*fr_CA.InputSlot Manual/Manuel mecanisme de alimentation: ""
|
||||
*de.InputSlot Manual/Manueller Einzug: ""
|
||||
*CloseUI: *InputSlot
|
||||
</pre>
|
||||
|
||||
|
||||
|
Depois Largura: | Altura: | Tamanho: 1.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 775 B |
|
Depois Largura: | Altura: | Tamanho: 1.2 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.8 KiB |
|
Depois Largura: | Altura: | Tamanho: 749 B |
|
Depois Largura: | Altura: | Tamanho: 1.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.7 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 764 B |
|
Depois Largura: | Altura: | Tamanho: 1.8 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.7 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.3 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.4 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.5 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.8 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.7 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.7 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.7 KiB |
|
Depois Largura: | Altura: | Tamanho: 1.6 KiB |
@@ -0,0 +1,137 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>首頁 - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/favicon.ico" TYPE="image/x-icon">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE WIDTH="100%" STYLE="height: 100%;" BORDER="0" CELLSPACING="0" CELLPADDING="0" SUMMARY="Common UNIX Printing System @CUPS_VERSION@">
|
||||
<TR CLASS="header">
|
||||
<TD VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG SRC="/images/top-left.gif" WIDTH="15" HEIGHT="80" ALT=""></TD>
|
||||
<TD VALIGN="TOP" WIDTH="55" ROWSPAN="2"><IMG SRC="/images/top-middle.gif" WIDTH="55" HEIGHT="80" ALT=""></TD>
|
||||
<TD WIDTH="100%" HEIGHT="60"><H1>Common UNIX Printing System @CUPS_VERSION@@CUPS_REVISION@</H1></TD>
|
||||
<TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG
|
||||
SRC="/images/top-right.gif" WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
</TR>
|
||||
<TR CLASS="header"><TD WIDTH="100%" VALIGN="BOTTOM" NOWRAP>
|
||||
|
||||
<A CLASS="sel" HREF="/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> 首頁 <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/admin/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> 管理 <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/classes/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> 分類 <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/help/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> 文件/求助 <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/jobs/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> 工作 <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/printers/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> 印表機 <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
</TD></TR>
|
||||
<TR CLASS="page">
|
||||
<TD WIDTH="15"> </TD>
|
||||
<TD COLSPAN="2" WIDTH="100%" VALIGN="TOP" CLASS="page">
|
||||
|
||||
<H2 CLASS="title">歡迎!</H2>
|
||||
|
||||
<P>此處的網頁讓您監看您的印表機和工作,以及
|
||||
進行系統管理任務。按下上方任何的分頁頁標或是
|
||||
下方的按鈕,以執行某個作業。</P>
|
||||
|
||||
<P>
|
||||
<A HREF="/help/"><IMG SRC="/images/button-help.gif" CLASS="button" ALT="求助"></A>
|
||||
<A HREF="/admin?OP=add-class"><IMG SRC="/images/button-add-class.gif" CLASS="button" ALT="增加分類"></A>
|
||||
<A HREF="/admin?OP=add-printer"><IMG SRC="/images/button-add-printer.gif" CLASS="button" ALT="增加印表機"></A>
|
||||
<A HREF="/classes"><IMG SRC="/images/button-manage-classes.gif" CLASS="button" ALT="管理分類"></A>
|
||||
<A HREF="/jobs"><IMG SRC="/images/button-manage-jobs.gif" CLASS="button" ALT="管理工作"></A>
|
||||
<A HREF="/printers"><IMG SRC="/images/button-manage-printers.gif" CLASS="button" ALT="管理印表機"></A>
|
||||
<A HREF="/admin"><IMG SRC="/images/button-manage-server.gif" CLASS="button" ALT="管理伺服器"></A>
|
||||
</P>
|
||||
|
||||
<P><I>如果向您要求使用者名稱與密碼,請輸入
|
||||
您的使用者名稱與密碼,或是 "root" 的使用者名稱與密碼。</I></P>
|
||||
|
||||
<H2 CLASS="title">關於 CUPS</H2>
|
||||
|
||||
<P>
|
||||
<IMG SRC="/images/happy.gif" ALIGN="LEFT" WIDTH="196" HEIGHT="144"
|
||||
STYLE="padding-right: 10px;" ALT="快樂的電腦與印表機">
|
||||
|
||||
<A HREF="http://www.easysw.com/"><IMG SRC="/images/esp-logo.gif"
|
||||
ALIGN="RIGHT" WIDTH="110" HEIGHT="68" BORDER="0"
|
||||
STYLE="padding-left: 10px; padding-bottom: 10px;"
|
||||
ALT="Easy Software Products"></A>
|
||||
|
||||
CUPS 提供以 UNIX<SUP>®</SUP> 為基礎的作業系統
|
||||
一層具有可攜性的列印介面。它是由 <A HREF="http://www.easysw.com">Easy Software
|
||||
Products</a> 為了推動一個標準的列印解決方案所開發與維護。CUPS 是目前用於
|
||||
MacOS<SUP>®</SUP> X 與大部份 Linux<SUP>®</SUP> 發行版本的標準列印系統。</P>
|
||||
|
||||
<P>CUPS 使用 <A HREF="http://www.pwg.org/ipp/"
|
||||
TARGET="_blank"> Internet Printing Protocol ("IPP")</A> 做為
|
||||
管理列印工作與佇列的基礎,並且加入瀏覽網路印表機和基於
|
||||
PostScript Printer Description ("PPD") 的列印選項,
|
||||
以支援真實世界中的列印。<BR CLEAR="ALL"></P>
|
||||
|
||||
<H2 CLASS="title">印表機驅動程式與協助</H2>
|
||||
|
||||
<P>造訪 CUPS 的官方網站以獲得印表機驅動程式與協助:</P>
|
||||
|
||||
<PRE>
|
||||
<A HREF="http://www.cups.org/" TARGET="_blank">www.cups.org</A>
|
||||
</PRE>
|
||||
|
||||
<P>CUPS 的商業支援與進階版本名為 <A
|
||||
HREF="http://www.easysw.com/printpro/">ESP Print Pro</A> 是提供自:</P>
|
||||
|
||||
<PRE>
|
||||
<A HREF="http://www.easysw.com/" TARGET="_blank">www.easysw.com</A>
|
||||
</PRE>
|
||||
|
||||
</TD>
|
||||
<TD WIDTH="15"> </TD>
|
||||
</TR>
|
||||
<TR CLASS="header">
|
||||
<TD VALIGN="BOTTOM" WIDTH="15"><IMG SRC="/images/bottom-left.gif"
|
||||
WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
<TD COLSPAN="2" WIDTH="100%" STYLE="padding: 5;">
|
||||
|
||||
<P><SMALL>The Common UNIX Printing System, CUPS, and the CUPS logo are the
|
||||
trademark property of <A HREF="http://www.easysw.com">Easy Software
|
||||
Products</A>. CUPS is copyright 1997-2007 by Easy Software Products,
|
||||
All Rights Reserved.</SMALL></P>
|
||||
|
||||
</TD>
|
||||
|
||||
<TD ALIGN="RIGHT" VALIGN="BOTTOM" WIDTH="15"><IMG SRC="/images/bottom-right.gif"
|
||||
WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -248,7 +248,7 @@ cupsRasterInterpretPPD(
|
||||
{
|
||||
float sc = atof(val);
|
||||
|
||||
if (sc >= 0.9 && sc <= 1.1)
|
||||
if (sc >= 0.5 && sc <= 2.0)
|
||||
h->cupsBorderlessScalingFactor = sc;
|
||||
}
|
||||
|
||||
|
||||
@@ -1245,7 +1245,9 @@ copy_page(cups_file_t *fp, /* I - File to read from */
|
||||
pageinfo->num_options = cupsAddOption("InputSlot", doc->ap_input_slot,
|
||||
pageinfo->num_options,
|
||||
&(pageinfo->options));
|
||||
pageinfo->num_options = cupsAddOption("ManualFeed", doc->ap_manual_feed,
|
||||
pageinfo->num_options = cupsAddOption("ManualFeed",
|
||||
doc->ap_input_slot ? "False" :
|
||||
doc->ap_manual_feed,
|
||||
pageinfo->num_options,
|
||||
&(pageinfo->options));
|
||||
}
|
||||
@@ -1258,7 +1260,9 @@ copy_page(cups_file_t *fp, /* I - File to read from */
|
||||
pageinfo->num_options = cupsAddOption("InputSlot", doc->input_slot,
|
||||
pageinfo->num_options,
|
||||
&(pageinfo->options));
|
||||
pageinfo->num_options = cupsAddOption("ManualFeed", doc->manual_feed,
|
||||
pageinfo->num_options = cupsAddOption("ManualFeed",
|
||||
doc->input_slot ? "False" :
|
||||
doc->manual_feed,
|
||||
pageinfo->num_options,
|
||||
&(pageinfo->options));
|
||||
}
|
||||
@@ -1537,7 +1541,7 @@ copy_page(cups_file_t *fp, /* I - File to read from */
|
||||
if (doc->number_up > 1 || doc->fitplot)
|
||||
continue;
|
||||
}
|
||||
else if (!strncmp(line, "%%EndFeature:", 13))
|
||||
else if (!strncmp(line, "%%EndFeature", 12))
|
||||
{
|
||||
feature = 0;
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
##
|
||||
# PrintingServices - a.k.a. CUPS
|
||||
##
|
||||
|
||||
. /etc/rc.common
|
||||
|
||||
StartService ()
|
||||
{
|
||||
ConsoleMessage "Starting printing services"
|
||||
launchctl start org.cups.cupsd
|
||||
}
|
||||
|
||||
StopService ()
|
||||
{
|
||||
ConsoleMessage "Stopping printing services"
|
||||
launchctl stop org.cups.cupsd
|
||||
}
|
||||
|
||||
RestartService ()
|
||||
{
|
||||
ConsoleMessage "Restarting printing services"
|
||||
launchctl stop org.cups.cupsd
|
||||
launchctl start org.cups.cupsd
|
||||
}
|
||||
|
||||
RunService "$1"
|
||||
@@ -6,13 +6,21 @@
|
||||
<string>org.cups.cupsd</string>
|
||||
<key>OnDemand</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<dict>
|
||||
<key>PathState</key>
|
||||
<dict>
|
||||
<key>/private/var/spool/cups/cache/org.cups.cupsd</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>RunAtLoad</key>
|
||||
<false/>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/sbin/cupsd</string>
|
||||
<string>-l</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>ServiceIPC</key>
|
||||
<true/>
|
||||
<key>Sockets</key>
|
||||
@@ -21,7 +29,13 @@
|
||||
<array>
|
||||
<dict>
|
||||
<key>SockNodeName</key>
|
||||
<string>localhost</string>
|
||||
<string>::1</string>
|
||||
<key>SockServiceName</key>
|
||||
<string>ipp</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>SockNodeName</key>
|
||||
<string>127.0.0.1</string>
|
||||
<key>SockServiceName</key>
|
||||
<string>ipp</string>
|
||||
</dict>
|
||||
|
||||
@@ -128,6 +128,9 @@
|
||||
%subpackage sv
|
||||
%description Swedish support
|
||||
|
||||
%subpackage zh
|
||||
%description Chinese support
|
||||
|
||||
%subpackage
|
||||
|
||||
|
||||
@@ -374,6 +377,8 @@ f 0644 root sys $LOCALEDIR/ja/cups_ja.po locale/cups_ja.po
|
||||
f 0644 root sys $LOCALEDIR/pl/cups_pl.po locale/cups_pl.po
|
||||
%subpackage sv
|
||||
f 0644 root sys $LOCALEDIR/sv/cups_sv.po locale/cups_sv.po
|
||||
%subpackage zh
|
||||
f 0644 root sys $LOCALEDIR/zh_TW/cups_zh_TW.po locale/cups_zh_TW.po
|
||||
%subpackage
|
||||
|
||||
d 0755 root sys $DATADIR -
|
||||
@@ -428,7 +433,7 @@ d 0755 root sys $DATADIR/model -
|
||||
f 0644 root sys $DATADIR/model ppd/*.ppd
|
||||
|
||||
d 0755 root sys $DATADIR/templates -
|
||||
c 0644 root sys $DATADIR/templates templates/*.tmpl
|
||||
f 0644 root sys $DATADIR/templates templates/*.tmpl
|
||||
|
||||
# Japanese template files
|
||||
%subpackage de
|
||||
@@ -455,6 +460,9 @@ f 0644 root sys $DATADIR/templates/pl templates/pl/*.tmpl
|
||||
%subpackage sv
|
||||
d 0755 root sys $DATADIR/templates/sv
|
||||
f 0644 root sys $DATADIR/templates/sv templates/sv/*.tmpl
|
||||
%subpackage zh
|
||||
d 0755 root sys $DATADIR/templates/zh_TW
|
||||
f 0644 root sys $DATADIR/templates/zh_TW templates/zh_TW/*.tmpl
|
||||
%subpackage
|
||||
|
||||
# Config files
|
||||
@@ -566,6 +574,11 @@ d 0755 root sys $DOCDIR/sv
|
||||
f 0644 root sys $DOCDIR/sv doc/sv/*.html
|
||||
d 0755 root sys $DOCDIR/sv/images -
|
||||
f 0644 root sys $DOCDIR/sv/images doc/sv/images/*.gif
|
||||
%subpackage zh
|
||||
d 0755 root sys $DOCDIR/zh_TW
|
||||
f 0644 root sys $DOCDIR/zh_TW doc/zh_TW/*.html
|
||||
d 0755 root sys $DOCDIR/zh_TW/images -
|
||||
f 0644 root sys $DOCDIR/zh_TW/images doc/zh_TW/images/*.gif
|
||||
%subpackage
|
||||
|
||||
# Man pages
|
||||
@@ -620,13 +633,26 @@ f 0644 root sys $AMANDIR/man$MAN8DIR/cups-lpd.$MAN8EXT man/cups-lpd.$MAN8EXT
|
||||
# Startup scripts
|
||||
%system darwin
|
||||
f 0644 root sys /System/Library/LaunchDaemons/org.cups.cupsd.plist init/org.cups.cupsd.plist
|
||||
d 0755 root sys /System/Library/StartupItems/PrintingServices -
|
||||
f 0644 root sys /System/Library/StartupItems/PrintingServices/PrintingServices init/PrintingServices.launchd
|
||||
f 0644 root sys /System/Library/StartupItems/PrintingServices/StartupParamters.plist init/StartupParameters.plist
|
||||
d 0755 root sys /System/Library/StartupItems/PrintingServices/Resources -
|
||||
d 0755 root sys /System/Library/StartupItems/PrintingServices/Resources/English.lproj -
|
||||
f 0644 root sys /System/Library/StartupItems/PrintingServices/Resources/English.lproj/Localizable.strings init/Localizable.strings
|
||||
%preremove <<EOF
|
||||
launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
|
||||
killall cupsd
|
||||
EOF
|
||||
%postinstall <<EOF
|
||||
rm -f /System/Library/StartupItems/PrintingServices/PrintingServices
|
||||
launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist || exit 0
|
||||
launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
|
||||
launchctl start org.cups.cupsd
|
||||
EOF
|
||||
%subpackage lpd
|
||||
f 0644 root sys /System/Library/LaunchDaemons/org.cups.cups-lpd.plist init/org.cups.cups-lpd.plist
|
||||
%preremove <<EOF
|
||||
launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || exit 0
|
||||
EOF
|
||||
%postinstall <<EOF
|
||||
rm -f /etc/xinetd.d/cups-lpd
|
||||
launchctl unload /System/Library/LaunchDaemons/org.cups.cups-lpd.plist || exit 0
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#
|
||||
# Original version by Jason McMullan <jmcc@ontv.com>.
|
||||
#
|
||||
# Copyright 1999-2006 by Easy Software Products, all rights reserved.
|
||||
# Copyright 1999-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Easy Software Products and are protected by Federal
|
||||
@@ -116,6 +116,11 @@ Summary: Common UNIX Printing System - Swedish support
|
||||
Group: System Environment/Daemons
|
||||
Requires: %{name} = %{epoch}:%{version}
|
||||
|
||||
%package zh
|
||||
Summary: Common UNIX Printing System - Chinese support
|
||||
Group: System Environment/Daemons
|
||||
Requires: %{name} = %{epoch}:%{version}
|
||||
|
||||
%if %{?_with_php:1}%{!?_with_php:0}
|
||||
%package php
|
||||
Summary: Common UNIX Printing System - PHP support
|
||||
@@ -174,6 +179,10 @@ UNIX
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This package provides Swedish support.
|
||||
|
||||
%description zh
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This package provides Chinese support.
|
||||
|
||||
%if %{?_with_php:1}%{!?_with_php:0}
|
||||
%description php
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
@@ -489,6 +498,16 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/cups/templates/sv/*
|
||||
/usr/share/locale/sv/cups_sv.po
|
||||
|
||||
%files zh
|
||||
%defattr(-,root,root)
|
||||
%dir /usr/share/doc/cups/zh_TW
|
||||
/usr/share/doc/cups/zh_TW/index.html
|
||||
%dir /usr/share/doc/cups/zh_TW/images
|
||||
/usr/share/doc/cups/zh_TW/images/*
|
||||
%dir /usr/share/cups/templates/zh_TW
|
||||
/usr/share/cups/templates/zh_TW/*
|
||||
/usr/share/locale/zh_TW/cups_zh_TW.po
|
||||
|
||||
%if %{?_with_php:1}%{!?_with_php:0}
|
||||
%files php
|
||||
# PHP
|
||||
|
||||
@@ -1159,7 +1159,14 @@ void PSOutputDev::writeHeader(int firstPage, int lastPage,
|
||||
}
|
||||
|
||||
// Tell CUPS pstops filter not to do its own rotation...
|
||||
writePSFmt("%%cupsRotation: %d\n", pageRotate);
|
||||
int cups_rotate = 0;
|
||||
int width = (int)ceil(mediaBox->x2 - mediaBox->x1);
|
||||
int height = (int)ceil(mediaBox->y2 - mediaBox->y1);
|
||||
int imgWidth = (int)ceil(cropBox->x2 - cropBox->x1);
|
||||
|
||||
if (width > height && width > imgWidth) cups_rotate = 90;
|
||||
|
||||
writePSFmt("%%cupsRotation: %d\n", cups_rotate);
|
||||
|
||||
writePSFmt("%%Producer: xpdf/pdftops %s\n", xpdfVersion);
|
||||
xref->getDocInfo(&info);
|
||||
@@ -2511,17 +2518,19 @@ GBool PSOutputDev::startPage(int pageNum, GfxState *state) {
|
||||
landscape = gFalse;
|
||||
} else {
|
||||
rotate = (360 - state->getRotate()) % 360;
|
||||
|
||||
fprintf(stderr, "DEBUG: Page rotate=%d, width=%d, height=%d, imgWidth=%d, imgHeight=%d\n",
|
||||
state->getRotate(), width, height, imgWidth, imgHeight);
|
||||
|
||||
if (rotate == 0 || rotate == 180) {
|
||||
if ((width > height && imgWidth < imgHeight) ||
|
||||
(height > width && imgHeight < imgWidth)) {
|
||||
if (width > height && width > imgWidth) {
|
||||
rotate += 90;
|
||||
landscape = gTrue;
|
||||
} else {
|
||||
landscape = gFalse;
|
||||
}
|
||||
} else { // rotate == 90 || rotate == 270
|
||||
if ((width > height && imgWidth < imgHeight) ||
|
||||
(height > width && imgHeight < imgWidth)) {
|
||||
if (height > width && height > imgWidth) {
|
||||
rotate = 270 - rotate;
|
||||
landscape = gTrue;
|
||||
} else {
|
||||
@@ -2529,6 +2538,7 @@ GBool PSOutputDev::startPage(int pageNum, GfxState *state) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
writePSFmt("%%%%PageOrientation: %s\n",
|
||||
landscape ? "Landscape" : "Portrait");
|
||||
writePS("pdfStartPage\n");
|
||||
|
||||
@@ -265,6 +265,14 @@ cupsdFindAvailablePrinter(
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure that the last printer is also a valid index into the printer
|
||||
* array. If not, reset the last printer to 0...
|
||||
*/
|
||||
|
||||
if (c->last_printer >= c->num_printers)
|
||||
c->last_printer = 0;
|
||||
|
||||
/*
|
||||
* Loop through the printers in the class and return the first idle
|
||||
* printer... We keep track of the last printer that we used so that
|
||||
@@ -667,7 +675,20 @@ cupsdLoadAllClasses(void)
|
||||
else if (!strcasecmp(line, "OpPolicy"))
|
||||
{
|
||||
if (value)
|
||||
cupsdSetString(&p->op_policy, value);
|
||||
{
|
||||
cupsd_policy_t *pol; /* Policy */
|
||||
|
||||
|
||||
if ((pol = cupsdFindPolicy(value)) != NULL)
|
||||
{
|
||||
cupsdSetString(&p->op_policy, value);
|
||||
p->op_policy_ptr = pol;
|
||||
}
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Bad policy \"%s\" on line %d of classes.conf",
|
||||
value, linenum);
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
|
||||
@@ -3344,9 +3344,9 @@ is_cgi(cupsd_client_t *con, /* I - Client connection */
|
||||
cupsdSetString(&con->command, CUPS_JAVA);
|
||||
|
||||
if (options)
|
||||
cupsdSetStringf(&con->options, "%s %s", filename, options);
|
||||
cupsdSetStringf(&con->options, " %s %s", filename, options);
|
||||
else
|
||||
cupsdSetString(&con->options, filename);
|
||||
cupsdSetStringf(&con->options, " %s", filename);
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
|
||||
@@ -3365,9 +3365,9 @@ is_cgi(cupsd_client_t *con, /* I - Client connection */
|
||||
cupsdSetString(&con->command, CUPS_PERL);
|
||||
|
||||
if (options)
|
||||
cupsdSetStringf(&con->options, "%s %s", filename, options);
|
||||
cupsdSetStringf(&con->options, " %s %s", filename, options);
|
||||
else
|
||||
cupsdSetString(&con->options, filename);
|
||||
cupsdSetStringf(&con->options, " %s", filename);
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
|
||||
@@ -3386,9 +3386,9 @@ is_cgi(cupsd_client_t *con, /* I - Client connection */
|
||||
cupsdSetString(&con->command, CUPS_PHP);
|
||||
|
||||
if (options)
|
||||
cupsdSetStringf(&con->options, "%s %s", filename, options);
|
||||
cupsdSetStringf(&con->options, " %s %s", filename, options);
|
||||
else
|
||||
cupsdSetString(&con->options, filename);
|
||||
cupsdSetStringf(&con->options, " %s", filename);
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
|
||||
@@ -3407,9 +3407,9 @@ is_cgi(cupsd_client_t *con, /* I - Client connection */
|
||||
cupsdSetString(&con->command, CUPS_PYTHON);
|
||||
|
||||
if (options)
|
||||
cupsdSetStringf(&con->options, "%s %s", filename, options);
|
||||
cupsdSetStringf(&con->options, " %s %s", filename, options);
|
||||
else
|
||||
cupsdSetString(&con->options, filename);
|
||||
cupsdSetStringf(&con->options, " %s", filename);
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
"is_cgi: Returning 1 with command=\"%s\" and options=\"%s\"",
|
||||
@@ -3928,8 +3928,9 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
|
||||
int envc; /* Number of environment variables */
|
||||
char argbuf[10240], /* Argument buffer */
|
||||
*argv[100], /* Argument strings */
|
||||
*envp[MAX_ENV + 17]; /* Environment variables */
|
||||
char content_length[1024], /* CONTENT_LENGTH environment variable */
|
||||
*envp[MAX_ENV + 20]; /* Environment variables */
|
||||
char auth_type[256], /* AUTH_TYPE environment variable */
|
||||
content_length[1024], /* CONTENT_LENGTH environment variable */
|
||||
content_type[1024], /* CONTENT_TYPE environment variable */
|
||||
http_cookie[32768], /* HTTP_COOKIE environment variable */
|
||||
http_user_agent[1024], /* HTTP_USER_AGENT environment variable */
|
||||
@@ -3938,6 +3939,7 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
|
||||
remote_addr[1024], /* REMOTE_ADDR environment variable */
|
||||
remote_host[1024], /* REMOTE_HOST environment variable */
|
||||
remote_user[1024], /* REMOTE_USER environment variable */
|
||||
script_filename[1024], /* SCRIPT_FILENAME environment variable */
|
||||
script_name[1024], /* SCRIPT_NAME environment variable */
|
||||
server_name[1024], /* SERVER_NAME environment variable */
|
||||
server_port[1024]; /* SERVER_PORT environment variable */
|
||||
@@ -3990,6 +3992,9 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
|
||||
{
|
||||
commptr = argbuf;
|
||||
path_info[0] = '\0';
|
||||
|
||||
if (*commptr == ' ')
|
||||
commptr ++;
|
||||
}
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_INFO, "commptr=\"%s\"", commptr);
|
||||
@@ -4064,6 +4069,17 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
|
||||
* Setup the environment variables as needed...
|
||||
*/
|
||||
|
||||
if (con->username[0])
|
||||
{
|
||||
snprintf(auth_type, sizeof(auth_type), "AUTH_TYPE=%s",
|
||||
httpGetField(HTTP(con), HTTP_FIELD_AUTHORIZATION));
|
||||
|
||||
if ((uriptr = strchr(auth_type + 10, ' ')) != NULL)
|
||||
*uriptr = '\0';
|
||||
}
|
||||
else
|
||||
auth_type[0] = '\0';
|
||||
|
||||
if (con->language)
|
||||
snprintf(lang, sizeof(lang), "LANG=%s.UTF-8", con->language->language);
|
||||
else
|
||||
@@ -4080,6 +4096,9 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
|
||||
if ((uriptr = strchr(script_name, '?')) != NULL)
|
||||
*uriptr = '\0';
|
||||
|
||||
snprintf(script_filename, sizeof(script_filename), "SCRIPT_FILENAME=%s%s",
|
||||
DocumentRoot, script_name + 12);
|
||||
|
||||
sprintf(server_port, "SERVER_PORT=%d", con->serverport);
|
||||
|
||||
snprintf(server_name, sizeof(server_name), "SERVER_NAME=%s",
|
||||
@@ -4087,13 +4106,18 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */
|
||||
|
||||
envc = cupsdLoadEnv(envp, (int)(sizeof(envp) / sizeof(envp[0])));
|
||||
|
||||
if (auth_type[0])
|
||||
envp[envc ++] = auth_type;
|
||||
|
||||
envp[envc ++] = lang;
|
||||
envp[envc ++] = "REDIRECT_STATUS=1";
|
||||
envp[envc ++] = "GATEWAY_INTERFACE=CGI/1.1";
|
||||
envp[envc ++] = server_name;
|
||||
envp[envc ++] = server_port;
|
||||
envp[envc ++] = remote_addr;
|
||||
envp[envc ++] = remote_host;
|
||||
envp[envc ++] = script_name;
|
||||
envp[envc ++] = script_filename;
|
||||
|
||||
if (path_info[0])
|
||||
envp[envc ++] = path_info;
|
||||
|
||||
@@ -1146,7 +1146,7 @@ check_permissions(const char *filename, /* I - File/directory name */
|
||||
{
|
||||
if (errno == ENOENT && create_dir)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Creating missing directory \"%s\"",
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "Creating missing directory \"%s\"",
|
||||
filename);
|
||||
|
||||
if (mkdir(filename, mode))
|
||||
@@ -1185,9 +1185,9 @@ check_permissions(const char *filename, /* I - File/directory name */
|
||||
|
||||
if (dir_created || fileinfo.st_uid != user || fileinfo.st_gid != group)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_WARN, "Repairing ownership of \"%s\"", filename);
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "Repairing ownership of \"%s\"", filename);
|
||||
|
||||
if (chown(filename, user, group))
|
||||
if (chown(filename, user, group) && !getuid())
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Unable to change ownership of \"%s\" - %s", filename,
|
||||
@@ -1198,7 +1198,8 @@ check_permissions(const char *filename, /* I - File/directory name */
|
||||
|
||||
if (dir_created || (fileinfo.st_mode & 07777) != mode)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_WARN, "Repairing access permissions of \"%s\"", filename);
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "Repairing access permissions of \"%s\"",
|
||||
filename);
|
||||
|
||||
if (chmod(filename, mode))
|
||||
{
|
||||
|
||||
@@ -675,7 +675,7 @@ load_ppds(const char *d, /* I - Actual directory */
|
||||
*language; /* Language code */
|
||||
} languages[] =
|
||||
{
|
||||
{ "chinese", "cn" },
|
||||
{ "chinese", "zh" },
|
||||
{ "danish", "da" },
|
||||
{ "dutch", "nl" },
|
||||
{ "english", "en" },
|
||||
|
||||
@@ -2627,7 +2627,7 @@ send_cups_browse(cupsd_printer_t *p) /* I - Printer to send */
|
||||
{
|
||||
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
|
||||
iface->hostname, iface->port,
|
||||
(p->type & CUPS_PRINTER_CLASS) ? "/classes/%s%s" :
|
||||
(p->type & CUPS_PRINTER_CLASS) ? "/classes/%s" :
|
||||
"/printers/%s",
|
||||
p->name);
|
||||
snprintf(packet, sizeof(packet), "%x %x %s \"%s\" \"%s\" \"%s\" %s\n",
|
||||
|
||||
@@ -1823,7 +1823,7 @@ add_job_subscriptions(
|
||||
|
||||
while (attr && attr->group_tag != IPP_TAG_ZERO)
|
||||
{
|
||||
if (!strcmp(attr->name, "notify-recipient") &&
|
||||
if (!strcmp(attr->name, "notify-recipient-uri") &&
|
||||
attr->value_tag == IPP_TAG_URI)
|
||||
recipient = attr->values[0].string.text;
|
||||
else if (!strcmp(attr->name, "notify-pull-method") &&
|
||||
@@ -7356,6 +7356,9 @@ renew_subscription(
|
||||
cupsdSaveAllSubscriptions();
|
||||
|
||||
con->response->request.status.status_code = IPP_OK;
|
||||
|
||||
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER,
|
||||
"notify-lease-duration", sub->lease);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -199,12 +199,11 @@ cupsdCancelJob(cupsd_job_t *job, /* I - Job to cancel */
|
||||
|
||||
case IPP_JOB_COMPLETED :
|
||||
/*
|
||||
* Clear the printer's state_message and state_reasons and move on...
|
||||
* Clear the printer's printer-state-message and move on...
|
||||
*/
|
||||
|
||||
printer->state_message[0] = '\0';
|
||||
|
||||
cupsdSetPrinterReasons(printer, "");
|
||||
cupsdSetPrinterState(printer, IPP_PRINTER_IDLE, 0);
|
||||
|
||||
cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, printer, job,
|
||||
@@ -373,11 +372,12 @@ cupsdCheckJobs(void)
|
||||
|
||||
pclass = printer;
|
||||
|
||||
if (!(pclass->type & CUPS_PRINTER_REMOTE) &&
|
||||
pclass->state != IPP_PRINTER_STOPPED)
|
||||
printer = cupsdFindAvailablePrinter(job->dest);
|
||||
else
|
||||
if (pclass->state == IPP_PRINTER_STOPPED)
|
||||
printer = NULL;
|
||||
else if (pclass->type & CUPS_PRINTER_REMOTE)
|
||||
break;
|
||||
else
|
||||
printer = cupsdFindAvailablePrinter(printer->name);
|
||||
}
|
||||
|
||||
if (!printer && !pclass)
|
||||
@@ -2839,6 +2839,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */
|
||||
if ((!strcmp(attr->name, "page-label") ||
|
||||
!strcmp(attr->name, "page-border") ||
|
||||
!strncmp(attr->name, "number-up", 9) ||
|
||||
!strcmp(attr->name, "page-ranges") ||
|
||||
!strcmp(attr->name, "page-set") ||
|
||||
!strcasecmp(attr->name, "AP_FIRSTPAGE_InputSlot") ||
|
||||
!strcasecmp(attr->name, "AP_FIRSTPAGE_ManualFeed")) &&
|
||||
@@ -3431,6 +3432,8 @@ start_job(cupsd_job_t *job, /* I - Job ID */
|
||||
cupsdClosePipe(job->status_pipes);
|
||||
cupsdStatBufDelete(job->status_buffer);
|
||||
|
||||
job->status_buffer = NULL;
|
||||
|
||||
cupsArrayDelete(filters);
|
||||
|
||||
if (printer->remote && job->num_files > 1)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Scheduler main loop for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -32,12 +32,7 @@
|
||||
* cupsdSetStringf() - Set a formatted string value.
|
||||
* launchd_checkin() - Check-in with launchd and collect the
|
||||
* listening fds.
|
||||
* launchd_create_dict() - Create a dictionary representing the launchd
|
||||
* config file org.cups.cupsd.plist.
|
||||
* launchd_reload() - Tell launchd to reload the configuration
|
||||
* file to pick up the new listening directives.
|
||||
* launchd_sync_conf() - Re-write the launchd config file
|
||||
* org.cups.cupsd.plist based on cupsd.conf.
|
||||
* launchd_checkout() - Check-out with launchd.
|
||||
* parent_handler() - Catch USR1/CHLD signals...
|
||||
* process_children() - Process all dead children...
|
||||
* sigchld_handler() - Handle 'child' signals from old processes.
|
||||
@@ -62,6 +57,17 @@
|
||||
#ifdef HAVE_LAUNCH_H
|
||||
# include <launch.h>
|
||||
# include <libgen.h>
|
||||
# define CUPS_KEEPALIVE CUPS_CACHEDIR "/org.cups.cupsd"
|
||||
/* Name of the launchd KeepAlive file */
|
||||
# ifndef LAUNCH_JOBKEY_KEEPALIVE
|
||||
# define LAUNCH_JOBKEY_KEEPALIVE "KeepAlive"
|
||||
# endif /* !LAUNCH_JOBKEY_KEEPALIVE */
|
||||
# ifndef LAUNCH_JOBKEY_PATHSTATE
|
||||
# define LAUNCH_JOBKEY_PATHSTATE "PathState"
|
||||
# endif /* !LAUNCH_JOBKEY_PATHSTATE */
|
||||
# ifndef LAUNCH_JOBKEY_SERVICEIPC
|
||||
# define LAUNCH_JOBKEY_SERVICEIPC "ServiceIPC"
|
||||
# endif /* !LAUNCH_JOBKEY_SERVICEIPC */
|
||||
#endif /* HAVE_LAUNCH_H */
|
||||
|
||||
#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
||||
@@ -78,9 +84,7 @@
|
||||
|
||||
#ifdef HAVE_LAUNCHD
|
||||
static void launchd_checkin(void);
|
||||
static CFDictionaryRef launchd_create_dict(void);
|
||||
static void launchd_reload(void);
|
||||
static int launchd_sync_conf(void);
|
||||
static void launchd_checkout(void);
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
static void parent_handler(int sig);
|
||||
static void process_children(void);
|
||||
@@ -106,13 +110,6 @@ static int dead_children = 0;
|
||||
static int stop_scheduler = 0;
|
||||
/* Should the scheduler stop? */
|
||||
|
||||
#ifdef HAVE_LAUNCHD
|
||||
static CFURLRef launchd_conf_url = NULL;
|
||||
/* org.cups.cupsd.plist url */
|
||||
static CFDictionaryRef launchd_conf_dict = NULL;
|
||||
/* org.cups.cupsd.plist dict */
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Main entry for the CUPS scheduler.
|
||||
@@ -351,7 +348,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
getrlimit(RLIMIT_NOFILE, &limit);
|
||||
|
||||
for (i = 0; i < limit.rlim_cur; i ++)
|
||||
for (i = 0; i < limit.rlim_cur && i < 1024; i ++)
|
||||
close(i);
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
@@ -415,23 +412,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (Launchd)
|
||||
{
|
||||
/*
|
||||
* If we were started by launchd make sure the cupsd plist file contains the
|
||||
* same listeners as cupsd.conf; If it didn't then reload it before getting
|
||||
* the list of listening file descriptors...
|
||||
* If we were started by launchd get the listen sockets file descriptors...
|
||||
*/
|
||||
|
||||
if (launchd_sync_conf())
|
||||
{
|
||||
launchd_reload();
|
||||
|
||||
/*
|
||||
* Until rdar://3854821 is fixed we have to exit after the reload...
|
||||
*/
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "Exiting on launchd_reload");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
launchd_checkin();
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
@@ -632,18 +615,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
#if HAVE_LAUNCHD
|
||||
if (Launchd)
|
||||
{
|
||||
if (launchd_sync_conf())
|
||||
{
|
||||
launchd_reload();
|
||||
|
||||
/*
|
||||
* Until rdar://3854821 is fixed we have to exit after the reload...
|
||||
*/
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "Exiting on launchd_reload");
|
||||
stop_scheduler = 1;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* If we were started by launchd get the listen sockets file descriptors...
|
||||
*/
|
||||
|
||||
launchd_checkin();
|
||||
}
|
||||
@@ -679,8 +653,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
if (timeout.tv_sec == 86400 && Launchd && LaunchdTimeout && !NumPolled &&
|
||||
(!Browsing || !(BrowseLocalProtocols & BROWSE_DNSSD) ||
|
||||
cupsArrayCount(Printers) == 0))
|
||||
(!Browsing ||
|
||||
(!BrowseRemoteProtocols &&
|
||||
(!NumBrowsers || !BrowseLocalProtocols ||
|
||||
cupsArrayCount(Printers) == 0))))
|
||||
{
|
||||
timeout.tv_sec = LaunchdTimeout;
|
||||
launchd_idle_exit = 1;
|
||||
@@ -1111,16 +1087,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
#ifdef HAVE_LAUNCHD
|
||||
/*
|
||||
* Update the launchd config file as needed...
|
||||
* Update the launchd KeepAlive file as needed...
|
||||
*/
|
||||
|
||||
launchd_sync_conf();
|
||||
|
||||
if (launchd_conf_url)
|
||||
CFRelease(launchd_conf_url);
|
||||
|
||||
if (launchd_conf_dict)
|
||||
CFRelease(launchd_conf_dict);
|
||||
if (Launchd)
|
||||
launchd_checkout();
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
#ifdef __sgi
|
||||
@@ -1364,6 +1335,8 @@ launchd_checkin(void)
|
||||
cupsd_listener_t *lis; /* Listeners array */
|
||||
http_addr_t addr; /* Address variable */
|
||||
socklen_t addrlen; /* Length of address */
|
||||
int fd; /* File descriptor */
|
||||
char s[256]; /* String addresss */
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: pid=%d", (int)getpid());
|
||||
@@ -1417,56 +1390,77 @@ launchd_checkin(void)
|
||||
|
||||
if (launch_data_get_type(ld_array) == LAUNCH_DATA_ARRAY)
|
||||
{
|
||||
/*
|
||||
* Free the listeners array built from cupsd.conf...
|
||||
*/
|
||||
|
||||
cupsdDeleteAllListeners();
|
||||
|
||||
/*
|
||||
* Create a new array of listeners from the launchd data...
|
||||
*/
|
||||
|
||||
Listeners = cupsArrayNew(NULL, NULL);
|
||||
count = launch_data_array_get_count(ld_array);
|
||||
count = launch_data_array_get_count(ld_array);
|
||||
|
||||
for (i = 0; i < count; i ++)
|
||||
{
|
||||
/*
|
||||
* Copy the current address and log it...
|
||||
* Get the launchd file descriptor and address...
|
||||
*/
|
||||
|
||||
if ((lis = calloc(1, sizeof(cupsd_listener_t))) == NULL)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"launchd_checkin: Unable to allocate listener - %s.",
|
||||
strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
cupsArrayAdd(Listeners, lis);
|
||||
|
||||
tmp = launch_data_array_get_index(ld_array, i);
|
||||
lis->fd = launch_data_get_fd(tmp);
|
||||
addrlen = sizeof(lis->address);
|
||||
fd = launch_data_get_fd(tmp);
|
||||
addrlen = sizeof(addr);
|
||||
|
||||
if (getsockname(lis->fd, (struct sockaddr *)&(lis->address), &addrlen))
|
||||
if (getsockname(fd, (struct sockaddr *)&addr, &addrlen))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"launchd_checkin: Unable to get local address - %s",
|
||||
strerror(errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to match the launchd socket address to one of the listeners...
|
||||
*/
|
||||
|
||||
for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
|
||||
lis;
|
||||
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
if (httpAddrEqual(&lis->address, &addr))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Add a new listener If there's no match...
|
||||
*/
|
||||
|
||||
if (lis)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_checkin: Matched existing listener %s with fd %d...",
|
||||
httpAddrString(&(lis->address), s, sizeof(s)), fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_checkin: Adding new listener %s with fd %d...",
|
||||
httpAddrString(&addr, s, sizeof(s)), fd);
|
||||
|
||||
if ((lis = calloc(1, sizeof(cupsd_listener_t))) == NULL)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"launchd_checkin: Unable to allocate listener - %s.",
|
||||
strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
cupsArrayAdd(Listeners, lis);
|
||||
|
||||
memcpy(&lis->address, &addr, sizeof(lis->address));
|
||||
}
|
||||
|
||||
lis->fd = fd;
|
||||
|
||||
# ifdef HAVE_SSL
|
||||
portnum = 0;
|
||||
|
||||
# ifdef AF_INET6
|
||||
if (addr.addr.sa_family == AF_INET6)
|
||||
portnum = ntohs(addr.ipv6.sin6_port);
|
||||
if (lis->address.addr.sa_family == AF_INET6)
|
||||
portnum = ntohs(lis->address.ipv6.sin6_port);
|
||||
else
|
||||
# endif /* AF_INET6 */
|
||||
if (addr.addr.sa_family == AF_INET)
|
||||
portnum = ntohs(addr.ipv4.sin_port);
|
||||
if (lis->address.addr.sa_family == AF_INET)
|
||||
portnum = ntohs(lis->address.ipv4.sin_port);
|
||||
|
||||
if (portnum == 443)
|
||||
lis->encryption = HTTP_ENCRYPT_ALWAYS;
|
||||
@@ -1474,458 +1468,45 @@ launchd_checkin(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Collect the browse socket (if there is one)...
|
||||
*/
|
||||
|
||||
if ((ld_array = launch_data_dict_lookup(ld_sockets, "BrowseSockets")))
|
||||
{
|
||||
if (launch_data_get_type(ld_array) == LAUNCH_DATA_ARRAY)
|
||||
{
|
||||
if ((tmp = launch_data_array_get_index(ld_array, 0)))
|
||||
{
|
||||
if (launch_data_get_type(tmp) == LAUNCH_DATA_FD)
|
||||
{
|
||||
if (BrowseSocket != -1)
|
||||
close(BrowseSocket);
|
||||
|
||||
BrowseSocket = launch_data_get_fd(tmp);
|
||||
}
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"launchd_checkin: BrowseSocket not a fd!");
|
||||
}
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"launchd_checkin: BrowseSockets is an empty array!");
|
||||
}
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"launchd_checkin: BrowseSockets is not an array!");
|
||||
}
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: No BrowseSockets");
|
||||
|
||||
launch_data_free(ld_msg);
|
||||
launch_data_free(ld_resp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'launchd_create_dict()' - Create a dictionary representing the launchd
|
||||
* config file org.cups.cupsd.plist.
|
||||
*/
|
||||
|
||||
static CFDictionaryRef /* O - CFDictionary */
|
||||
launchd_create_dict(void)
|
||||
{
|
||||
int portnum; /* Port number */
|
||||
bool runatload; /* Run at load? */
|
||||
CFMutableDictionaryRef cupsd_dict, /* org.cups.cupsd.plist dictionary */
|
||||
sockets, /* Sockets dictionary */
|
||||
listener; /* Listener dictionary */
|
||||
CFMutableArrayRef array; /* Array */
|
||||
CFNumberRef socket_mode; /* Domain socket mode bits */
|
||||
CFStringRef socket_path; /* Domain socket path */
|
||||
CFTypeRef value; /* CF values */
|
||||
cupsd_listener_t *lis; /* Current listening socket */
|
||||
struct servent *service; /* Services data base entry */
|
||||
char temp[1024]; /* Temporary buffer for value */
|
||||
|
||||
|
||||
if ((cupsd_dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) == NULL)
|
||||
return NULL;
|
||||
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_LABEL),
|
||||
CFSTR("org.cups.cupsd"));
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_ONDEMAND),
|
||||
kCFBooleanTrue);
|
||||
|
||||
/*
|
||||
* Run-at-load if there are active jobs, polling or shared printers
|
||||
* to advertise...
|
||||
*/
|
||||
|
||||
runatload = (cupsArrayCount(ActiveJobs) || NumPolled ||
|
||||
(Browsing && BrowseLocalProtocols &&
|
||||
NumBrowsers && cupsArrayCount(Printers))) ? true : false;
|
||||
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_RUNATLOAD),
|
||||
runatload ? kCFBooleanTrue : kCFBooleanFalse);
|
||||
# ifdef LAUNCH_JOBKEY_SERVICEIPC
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_SERVICEIPC),
|
||||
kCFBooleanTrue);
|
||||
# endif /* LAUNCH_JOBKEY_SERVICEIPC */
|
||||
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 2,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_PROGRAMARGUMENTS),
|
||||
array);
|
||||
CFArrayAppendValue(array, CFSTR("/usr/sbin/cupsd"));
|
||||
CFArrayAppendValue(array, CFSTR("-l"));
|
||||
CFRelease(array);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a sockets dictionary...
|
||||
*/
|
||||
|
||||
if ((sockets = (CFMutableDictionaryRef)CFDictionaryCreateMutable(
|
||||
kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_SOCKETS), sockets);
|
||||
|
||||
/*
|
||||
* Add a Listeners array to the sockets dictionary...
|
||||
*/
|
||||
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(sockets, CFSTR("Listeners"), array);
|
||||
|
||||
/*
|
||||
* For each listener add a dictionary to the listeners array...
|
||||
*/
|
||||
|
||||
for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
|
||||
lis;
|
||||
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
{
|
||||
if ((listener = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFArrayAppendValue(array, listener);
|
||||
|
||||
# ifdef AF_LOCAL
|
||||
if (lis->address.addr.sa_family == AF_LOCAL)
|
||||
{
|
||||
if ((socket_path = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
lis->address.un.sun_path,
|
||||
kCFStringEncodingUTF8)))
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_PATHNAME),
|
||||
socket_path);
|
||||
CFRelease(socket_path);
|
||||
}
|
||||
portnum = 0140777; /* (S_IFSOCK|S_IRWXU|S_IRWXG|S_IRWXO) or *
|
||||
* 49663d decimal */
|
||||
if ((socket_mode = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberIntType, &portnum)))
|
||||
{
|
||||
CFDictionaryAddValue(listener, CFSTR("SockPathMode"),
|
||||
socket_mode);
|
||||
CFRelease(socket_mode);
|
||||
}
|
||||
}
|
||||
else
|
||||
# endif /* AF_LOCAL */
|
||||
{
|
||||
# ifdef AF_INET6
|
||||
if (lis->address.addr.sa_family == AF_INET6)
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv6"));
|
||||
portnum = lis->address.ipv6.sin6_port;
|
||||
}
|
||||
else
|
||||
# endif /* AF_INET6 */
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv4"));
|
||||
portnum = lis->address.ipv4.sin_port;
|
||||
}
|
||||
|
||||
if ((service = getservbyport(portnum, NULL)))
|
||||
value = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
service->s_name,
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
value = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberIntType, &portnum);
|
||||
|
||||
if (value)
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_SERVICENAME),
|
||||
value);
|
||||
CFRelease(value);
|
||||
}
|
||||
|
||||
httpAddrString(&lis->address, temp, sizeof(temp));
|
||||
if ((value = CFStringCreateWithCString(kCFAllocatorDefault, temp,
|
||||
kCFStringEncodingUTF8)))
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_NODENAME),
|
||||
value);
|
||||
CFRelease(value);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(listener);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(array);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the BrowseSocket to the sockets dictionary...
|
||||
*/
|
||||
|
||||
if (Browsing && (BrowseRemoteProtocols & BROWSE_CUPS))
|
||||
{
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(sockets, CFSTR("BrowseSockets"), array);
|
||||
|
||||
if ((listener = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFArrayAppendValue(array, listener);
|
||||
|
||||
CFDictionaryAddValue(listener, CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv4"));
|
||||
CFDictionaryAddValue(listener, CFSTR(LAUNCH_JOBSOCKETKEY_TYPE),
|
||||
CFSTR("dgram"));
|
||||
|
||||
if ((service = getservbyport(BrowsePort, NULL)))
|
||||
value = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
service->s_name,
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
value = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType,
|
||||
&BrowsePort);
|
||||
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_SERVICENAME), value);
|
||||
CFRelease(value);
|
||||
|
||||
CFRelease(listener);
|
||||
}
|
||||
|
||||
CFRelease(array);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(sockets);
|
||||
}
|
||||
|
||||
return (cupsd_dict);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'launchd_reload()' - Tell launchd to reload the configuration file to pick
|
||||
* up the new listening directives.
|
||||
* 'launchd_checkout()' - Update the launchd KeepAlive file as needed.
|
||||
*/
|
||||
|
||||
static void
|
||||
launchd_reload(void)
|
||||
launchd_checkout(void)
|
||||
{
|
||||
int child_status; /* Exit status of child process */
|
||||
pid_t child_pid, /* Child PID */
|
||||
waitpid_status; /* Child process exit status */
|
||||
char *argv[4]; /* Argument strings */
|
||||
int fd; /* File descriptor */
|
||||
|
||||
|
||||
/*
|
||||
* The current launchd doesn't support a reload option (rdar://3854821).
|
||||
* Until this is fixed we need to reload the config file by execing launchctl
|
||||
* twice (to unload then load). NOTE: This will cause us to exit on SIGTERM
|
||||
* which will cancel all client & job activity.
|
||||
*
|
||||
* After this is fixed we'll be able to tell launchd to reload the file
|
||||
* and pick up the new listening descriptors without disrupting current
|
||||
* activity.
|
||||
* Create or remove the launchd KeepAlive file based on whether
|
||||
* there are active jobs, polling, browsing for remote printers or
|
||||
* shared printers to advertise...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Unloading the current configuration will cause launchd to send us a SIGTERM;
|
||||
* block it for now so we can get our work done...
|
||||
*/
|
||||
if ((cupsArrayCount(ActiveJobs) || NumPolled ||
|
||||
(Browsing &&
|
||||
(BrowseRemoteProtocols ||
|
||||
(BrowseLocalProtocols && NumBrowsers && cupsArrayCount(Printers))))))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"Creating launchd keepalive file \"" CUPS_KEEPALIVE "\"...");
|
||||
|
||||
cupsdHoldSignals();
|
||||
|
||||
/*
|
||||
* Set up the unload arguments to launchctl...
|
||||
*/
|
||||
|
||||
argv[0] = "/bin/launchctl";
|
||||
argv[1] = "unload";
|
||||
argv[2] = LaunchdConf;
|
||||
argv[3] = NULL;
|
||||
|
||||
if (cupsdStartProcess(argv[0], argv, NULL, -1, -1, -1, -1, 1, &child_pid) < 0)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"launchd_reload: Unable to execute %s - %s", argv[0],
|
||||
strerror(errno));
|
||||
if ((fd = open(CUPS_KEEPALIVE, O_RDONLY | O_CREAT | O_EXCL, S_IRUSR)) >= 0)
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
waitpid_status = waitpid(child_pid, &child_status, 0);
|
||||
}
|
||||
while (waitpid_status == (pid_t)-1 && errno == EINTR);
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"Removing launchd keepalive file \"" CUPS_KEEPALIVE "\"...");
|
||||
|
||||
if (WIFSIGNALED(child_status))
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_reload: %s pid %d crashed on signal %d!",
|
||||
basename(argv[0]), child_pid, WTERMSIG(child_status));
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_reload: %s pid %d stopped with status %d!",
|
||||
basename(argv[0]), child_pid, WEXITSTATUS(child_status));
|
||||
|
||||
/*
|
||||
* Do it again with the load command...
|
||||
*/
|
||||
|
||||
argv[1] = "load";
|
||||
|
||||
if (cupsdStartProcess(argv[0], argv, NULL, -1, -1, -1, -1, 1,
|
||||
&child_pid) < 0)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"launchd_reload: Unable to fork for %s - %s", argv[0],
|
||||
strerror(errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
waitpid_status = waitpid(child_pid, &child_status, 0);
|
||||
} while (waitpid_status == (pid_t)-1 && errno == EINTR);
|
||||
|
||||
if (WIFSIGNALED(child_status))
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_reload: %s pid %d crashed on signal %d!",
|
||||
basename(argv[0]), child_pid, WTERMSIG(child_status));
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_reload: %s pid %d stopped with status %d",
|
||||
basename(argv[0]), child_pid,
|
||||
WEXITSTATUS(child_status));
|
||||
}
|
||||
unlink(CUPS_KEEPALIVE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Leave signals blocked since exit() will be called momentarily anyways...
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'launchd_sync_conf()' - Rewrite the launchd config file
|
||||
* org.cups.cupsd.plist based on cupsd.conf.
|
||||
*/
|
||||
|
||||
static int /* O - 1 if the file was updated */
|
||||
launchd_sync_conf(void)
|
||||
{
|
||||
SInt32 errorCode; /* Error code */
|
||||
CFDataRef resourceData; /* XML property list */
|
||||
CFDictionaryRef cupsd_dict; /* New org.cups.cupsd.plist dict */
|
||||
|
||||
|
||||
/*
|
||||
* If needed reconstitute the existing org.cups.cupsd.plist...
|
||||
*/
|
||||
|
||||
if (!launchd_conf_url &&
|
||||
!(launchd_conf_url = CFURLCreateFromFileSystemRepresentation(
|
||||
kCFAllocatorDefault,
|
||||
(const unsigned char *)LaunchdConf,
|
||||
strlen(LaunchdConf), false)))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_sync_conf: "
|
||||
"Unable to create file URL for \"%s\"\n", LaunchdConf);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (!launchd_conf_dict)
|
||||
{
|
||||
if (CFURLCreateDataAndPropertiesFromResource(NULL, launchd_conf_url,
|
||||
&resourceData, NULL, NULL, &errorCode))
|
||||
{
|
||||
launchd_conf_dict = CFPropertyListCreateFromXMLData(NULL, resourceData,
|
||||
kCFPropertyListImmutable, NULL);
|
||||
CFRelease(resourceData);
|
||||
}
|
||||
|
||||
if (!launchd_conf_dict)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_sync_conf: "
|
||||
"Unable to create dictionary for \"%s\"\n", LaunchdConf);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a new org.cups.cupsd.plist dictionary...
|
||||
*/
|
||||
|
||||
if ((cupsd_dict = launchd_create_dict()) == NULL)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_sync_conf: "
|
||||
"Unable to create file URL for \"%s\"\n", LaunchdConf);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the dictionaries are different write a new org.cups.cupsd.plist...
|
||||
*/
|
||||
|
||||
if (!CFEqual(cupsd_dict, launchd_conf_dict))
|
||||
{
|
||||
if ((resourceData = CFPropertyListCreateXMLData(kCFAllocatorDefault,
|
||||
cupsd_dict)))
|
||||
{
|
||||
if (CFURLWriteDataAndPropertiesToResource(launchd_conf_url, resourceData,
|
||||
NULL, &errorCode))
|
||||
{
|
||||
/*
|
||||
* The new cupsd dictionary becomes the on-disk launchd dictionary...
|
||||
*/
|
||||
|
||||
if (launchd_conf_dict)
|
||||
CFRelease(launchd_conf_dict);
|
||||
|
||||
launchd_conf_dict = cupsd_dict;
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"launchd_sync_conf: "
|
||||
"CFURLWriteDataAndPropertiesToResource(\"%s\") "
|
||||
"failed: %d\n",
|
||||
LaunchdConf, (int)errorCode);
|
||||
|
||||
CFRelease(cupsd_dict);
|
||||
}
|
||||
|
||||
CFRelease(resourceData);
|
||||
}
|
||||
|
||||
/*
|
||||
* Let the caller know we updated the file...
|
||||
*/
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Printer routines for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -265,7 +265,7 @@ cupsdCreateCommonData(void)
|
||||
*notifier; /* Current notifier */
|
||||
static const int nups[] = /* number-up-supported values */
|
||||
{ 1, 2, 4, 6, 9, 16 };
|
||||
static const ipp_orient_t orients[4] =/* orientation-requested-supported values */
|
||||
static const int orients[4] =/* orientation-requested-supported values */
|
||||
{
|
||||
IPP_PORTRAIT,
|
||||
IPP_LANDSCAPE,
|
||||
@@ -288,7 +288,7 @@ cupsdCreateCommonData(void)
|
||||
"1.0",
|
||||
"1.1"
|
||||
};
|
||||
static const ipp_op_t ops[] = /* operations-supported values */
|
||||
static const int ops[] = /* operations-supported values */
|
||||
{
|
||||
IPP_PRINT_JOB,
|
||||
IPP_VALIDATE_JOB,
|
||||
@@ -556,11 +556,11 @@ cupsdCreateCommonData(void)
|
||||
/* operations-supported */
|
||||
ippAddIntegers(CommonData, IPP_TAG_PRINTER, IPP_TAG_ENUM,
|
||||
"operations-supported",
|
||||
sizeof(ops) / sizeof(ops[0]) + JobFiles - 1, (int *)ops);
|
||||
sizeof(ops) / sizeof(ops[0]) + JobFiles - 1, ops);
|
||||
|
||||
/* orientation-requested-supported */
|
||||
ippAddIntegers(CommonData, IPP_TAG_PRINTER, IPP_TAG_ENUM,
|
||||
"orientation-requested-supported", 4, (int *)orients);
|
||||
"orientation-requested-supported", 4, orients);
|
||||
|
||||
/* page-ranges-supported */
|
||||
ippAddBoolean(CommonData, IPP_TAG_PRINTER, "page-ranges-supported", 1);
|
||||
@@ -1187,7 +1187,20 @@ cupsdLoadAllPrinters(void)
|
||||
else if (!strcasecmp(line, "OpPolicy"))
|
||||
{
|
||||
if (value)
|
||||
cupsdSetString(&p->op_policy, value);
|
||||
{
|
||||
cupsd_policy_t *pol; /* Policy */
|
||||
|
||||
|
||||
if ((pol = cupsdFindPolicy(value)) != NULL)
|
||||
{
|
||||
cupsdSetString(&p->op_policy, value);
|
||||
p->op_policy_ptr = pol;
|
||||
}
|
||||
else
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"Bad policy \"%s\" on line %d of printers.conf",
|
||||
value, linenum);
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
@@ -1484,7 +1497,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
|
||||
ipp_attribute_t *attr; /* Attribute data */
|
||||
ipp_value_t *val; /* Attribute value */
|
||||
int num_finishings; /* Number of finishings */
|
||||
ipp_finish_t finishings[5]; /* finishings-supported values */
|
||||
int finishings[5]; /* finishings-supported values */
|
||||
cups_option_t *option; /* Current printer option */
|
||||
static const char * const sides[3] = /* sides-supported values */
|
||||
{
|
||||
@@ -2081,7 +2094,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
|
||||
}
|
||||
|
||||
ippAddIntegers(p->attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
|
||||
"finishings-supported", num_finishings, (int *)finishings);
|
||||
"finishings-supported", num_finishings, finishings);
|
||||
ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM,
|
||||
"finishings-default", IPP_FINISHINGS_NONE);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Subscription routines for the Common UNIX Printing System (CUPS) scheduler.
|
||||
*
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
@@ -52,8 +52,8 @@
|
||||
# include <dbus/dbus.h>
|
||||
# ifdef HAVE_DBUS_MESSAGE_ITER_INIT_APPEND
|
||||
# define dbus_message_append_iter_init dbus_message_iter_init_append
|
||||
# define dbus_message_iter_append_string(i,v) dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, v)
|
||||
# define dbus_message_iter_append_uint32(i,v) dbus_message_iter_append_basic(i, DBUS_TYPE_UINT32, v)
|
||||
# define dbus_message_iter_append_string(i,v) dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &(v))
|
||||
# define dbus_message_iter_append_uint32(i,v) dbus_message_iter_append_basic(i, DBUS_TYPE_UINT32, &(v))
|
||||
# endif /* HAVE_DBUS_MESSAGE_ITER_INIT_APPEND */
|
||||
#endif /* HAVE_DBUS */
|
||||
|
||||
@@ -1362,11 +1362,11 @@ cupsd_send_dbus(cupsd_eventmask_t event,/* I - Event to send */
|
||||
|
||||
dbus_message_append_iter_init(message, &iter);
|
||||
if (dest)
|
||||
dbus_message_iter_append_string(&iter, &(dest->name));
|
||||
dbus_message_iter_append_string(&iter, dest->name);
|
||||
if (job)
|
||||
{
|
||||
dbus_message_iter_append_uint32(&iter, &(job->id));
|
||||
dbus_message_iter_append_string(&iter, &(job->username));
|
||||
dbus_message_iter_append_uint32(&iter, job->id);
|
||||
dbus_message_iter_append_string(&iter, job->username);
|
||||
}
|
||||
|
||||
dbus_connection_send(con, message, NULL);
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <cups/i18n.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -84,31 +85,39 @@ int valid_utf8(const char *s);
|
||||
* 'main()' - Main entry for test program.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line args */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i, j, k, m, n; /* Looping vars */
|
||||
int len; /* Length of option name */
|
||||
char *opt; /* Option character */
|
||||
const char *ptr; /* Pointer into string */
|
||||
int files; /* Number of files */
|
||||
int verbose; /* Want verbose output? */
|
||||
int status; /* Exit status */
|
||||
int errors; /* Number of conformance errors */
|
||||
int ppdversion; /* PPD spec version in PPD file */
|
||||
ppd_status_t error; /* Status of ppdOpen*() */
|
||||
int line; /* Line number for error */
|
||||
int xdpi, /* X resolution */
|
||||
ydpi; /* Y resolution */
|
||||
ppd_file_t *ppd; /* PPD file record */
|
||||
ppd_attr_t *attr; /* PPD attribute */
|
||||
ppd_size_t *size; /* Size record */
|
||||
ppd_group_t *group; /* UI group */
|
||||
ppd_option_t *option; /* Standard UI option */
|
||||
ppd_group_t *group2; /* UI group */
|
||||
ppd_option_t *option2; /* Standard UI option */
|
||||
ppd_choice_t *choice; /* Standard UI option choice */
|
||||
int i, j, k, m, n; /* Looping vars */
|
||||
int len; /* Length of option name */
|
||||
char *opt; /* Option character */
|
||||
const char *ptr; /* Pointer into string */
|
||||
int files; /* Number of files */
|
||||
int verbose; /* Want verbose output? */
|
||||
int status; /* Exit status */
|
||||
int errors; /* Number of conformance errors */
|
||||
int ppdversion; /* PPD spec version in PPD file */
|
||||
ppd_status_t error; /* Status of ppdOpen*() */
|
||||
int line; /* Line number for error */
|
||||
struct stat statbuf; /* File information */
|
||||
char super[16], /* Super-type for filter */
|
||||
type[256], /* Type for filter */
|
||||
program[256], /* Program/filter name */
|
||||
pathprog[1024], /* Complete path to program/filter */
|
||||
*root; /* Root directory */
|
||||
int cost; /* Cost of filter */
|
||||
int xdpi, /* X resolution */
|
||||
ydpi; /* Y resolution */
|
||||
ppd_file_t *ppd; /* PPD file record */
|
||||
ppd_attr_t *attr; /* PPD attribute */
|
||||
ppd_size_t *size; /* Size record */
|
||||
ppd_group_t *group; /* UI group */
|
||||
ppd_option_t *option; /* Standard UI option */
|
||||
ppd_group_t *group2; /* UI group */
|
||||
ppd_option_t *option2; /* Standard UI option */
|
||||
ppd_choice_t *choice; /* Standard UI option choice */
|
||||
ppd_const_t *c; /* Current constraint */
|
||||
static char *uis[] = { "BOOLEAN", "PICKONE", "PICKMANY" };
|
||||
static char *sections[] = { "ANY", "DOCUMENT", "EXIT",
|
||||
"JCL", "PAGE", "PROLOG" };
|
||||
@@ -126,6 +135,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
ppd = NULL;
|
||||
files = 0;
|
||||
status = ERROR_NONE;
|
||||
root = "";
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
if (argv[i][0] == '-' && argv[i][1])
|
||||
@@ -133,6 +143,15 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
switch (*opt)
|
||||
{
|
||||
case 'R' : /* Alternate root directory */
|
||||
i ++;
|
||||
|
||||
if (i >= argc)
|
||||
usage();
|
||||
|
||||
root = argv[i];
|
||||
break;
|
||||
|
||||
case 'q' : /* Quiet mode */
|
||||
if (verbose > 0)
|
||||
{
|
||||
@@ -318,6 +337,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
!strcmp(attr->name, "DefaultImageableArea") ||
|
||||
!strcmp(attr->name, "DefaultOutputOrder") ||
|
||||
!strcmp(attr->name, "DefaultPaperDimension") ||
|
||||
!strcmp(attr->name, "DefaultResolution") ||
|
||||
!strcmp(attr->name, "DefaultTransfer"))
|
||||
continue;
|
||||
|
||||
@@ -1010,16 +1030,26 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* This file contains localizations, check them...
|
||||
*/
|
||||
|
||||
char *languages, /* Copy of attribute value */
|
||||
*langstart, /* Start of current language */
|
||||
*langptr, /* Pointer into languages */
|
||||
keyword[PPD_MAX_NAME], /* Localization keyword */
|
||||
ckeyword[PPD_MAX_NAME]; /* Custom option keyword */
|
||||
char *languages, /* Copy of attribute value */
|
||||
*langstart, /* Start of current language */
|
||||
*langptr, /* Pointer into languages */
|
||||
keyword[PPD_MAX_NAME],
|
||||
/* Localization keyword (full) */
|
||||
llkeyword[PPD_MAX_NAME],
|
||||
/* Localization keyword (base) */
|
||||
ckeyword[PPD_MAX_NAME],
|
||||
/* Custom option keyword (full) */
|
||||
cllkeyword[PPD_MAX_NAME];
|
||||
/* Custom option keyword (base) */
|
||||
ppd_coption_t *coption; /* Custom option */
|
||||
ppd_cparam_t *cparam; /* Custom parameter */
|
||||
cups_array_t *langlist; /* List of languages so far */
|
||||
char ll[3]; /* Base language */
|
||||
|
||||
|
||||
languages = strdup(attr->value);
|
||||
langlist = cupsArrayNew((cups_array_func_t)strcmp, NULL);
|
||||
|
||||
for (langptr = languages; *langptr;)
|
||||
{
|
||||
/*
|
||||
@@ -1060,6 +1090,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
continue;
|
||||
}
|
||||
|
||||
cupsArrayAdd(langlist, langstart);
|
||||
|
||||
strlcpy(ll, langstart, sizeof(ll));
|
||||
|
||||
/*
|
||||
* Loop through all options and choices...
|
||||
*/
|
||||
@@ -1069,7 +1103,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
option = ppdNextOption(ppd))
|
||||
{
|
||||
snprintf(keyword, sizeof(keyword), "%s.Translation", langstart);
|
||||
if ((attr = ppdFindAttr(ppd, keyword, option->keyword)) == NULL)
|
||||
snprintf(llkeyword, sizeof(llkeyword), "%s.Translation", ll);
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, keyword, option->keyword)) == NULL &&
|
||||
(attr = ppdFindAttr(ppd, llkeyword, option->keyword)) == NULL)
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
@@ -1123,6 +1160,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
snprintf(keyword, sizeof(keyword), "%s.%s", langstart,
|
||||
option->keyword);
|
||||
snprintf(llkeyword, sizeof(llkeyword), "%s.%s", ll,
|
||||
option->keyword);
|
||||
|
||||
for (j = 0; j < option->num_choices; j ++)
|
||||
{
|
||||
if (!strcasecmp(option->choices[j].choice, "Custom") &&
|
||||
@@ -1132,24 +1172,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
snprintf(ckeyword, sizeof(ckeyword), "%s.Custom%s",
|
||||
langstart, option->keyword);
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, ckeyword, "True")) == NULL)
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" **FAIL** Missing \"%s\" "
|
||||
"translation string for option %s, "
|
||||
"choice %s!\n"),
|
||||
langstart, ckeyword + 1 + strlen(langstart),
|
||||
"True");
|
||||
}
|
||||
|
||||
errors ++;
|
||||
}
|
||||
else if (!valid_utf8(attr->text))
|
||||
if ((attr = ppdFindAttr(ppd, ckeyword, "True")) != NULL &&
|
||||
!valid_utf8(attr->text))
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
@@ -1175,7 +1199,13 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
snprintf(ckeyword, sizeof(ckeyword), "%s.ParamCustom%s",
|
||||
langstart, option->keyword);
|
||||
if ((attr = ppdFindAttr(ppd, ckeyword, cparam->name)) == NULL)
|
||||
snprintf(cllkeyword, sizeof(cllkeyword), "%s.ParamCustom%s",
|
||||
ll, option->keyword);
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, ckeyword,
|
||||
cparam->name)) == NULL &&
|
||||
(attr = ppdFindAttr(ppd, cllkeyword,
|
||||
cparam->name)) == NULL)
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
@@ -1214,7 +1244,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((attr = ppdFindAttr(ppd, keyword, option->choices[j].choice)) == NULL)
|
||||
else if ((attr = ppdFindAttr(ppd, keyword,
|
||||
option->choices[j].choice)) == NULL &&
|
||||
(attr = ppdFindAttr(ppd, llkeyword,
|
||||
option->choices[j].choice)) == NULL)
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
@@ -1273,18 +1306,54 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify that we have the base language for each localized one...
|
||||
*/
|
||||
|
||||
for (langptr = (char *)cupsArrayFirst(langlist);
|
||||
langptr;
|
||||
langptr = (char *)cupsArrayNext(langlist))
|
||||
if (langptr[2])
|
||||
{
|
||||
/*
|
||||
* Lookup the base language...
|
||||
*/
|
||||
|
||||
cupsArraySave(langlist);
|
||||
|
||||
strlcpy(ll, langptr, sizeof(ll));
|
||||
|
||||
if (!cupsArrayFind(langlist, ll) && strcmp(ll, "zh"))
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" **FAIL** No base translation \"%s\" "
|
||||
"is included in file!\n"), ll);
|
||||
}
|
||||
|
||||
errors ++;
|
||||
}
|
||||
|
||||
cupsArrayRestore(langlist);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free memory used for the languages...
|
||||
*/
|
||||
|
||||
cupsArrayDelete(langlist);
|
||||
free(languages);
|
||||
}
|
||||
|
||||
for (attr = ppdFindAttr(ppd, "cupsFilter", NULL);
|
||||
attr;
|
||||
attr = ppdFindNextAttr(ppd, "cupsFilter", NULL))
|
||||
{
|
||||
char super[16], /* Filter super type */
|
||||
type[256], /* Filter type */
|
||||
program[256]; /* Filter program */
|
||||
int cost; /* Filter cost */
|
||||
|
||||
|
||||
if (!attr->value ||
|
||||
sscanf(attr->value, "%15[^/]/%255s%d%255s", super, type, &cost,
|
||||
program) != 4)
|
||||
@@ -1301,6 +1370,90 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
errors ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (program[0] == '/')
|
||||
snprintf(pathprog, sizeof(pathprog), "%s%s", root, program);
|
||||
else
|
||||
{
|
||||
if ((ptr = getenv("CUPS_SERVERBIN")) == NULL)
|
||||
ptr = CUPS_SERVERBIN;
|
||||
|
||||
if (*ptr == '/' || !*root)
|
||||
snprintf(pathprog, sizeof(pathprog), "%s%s/filter/%s", root, ptr,
|
||||
program);
|
||||
else
|
||||
snprintf(pathprog, sizeof(pathprog), "%s/%s/filter/%s", root, ptr,
|
||||
program);
|
||||
}
|
||||
|
||||
if (stat(pathprog, &statbuf))
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
_cupsLangPrintf(stdout, _(" **FAIL** Missing cupsFilter "
|
||||
"file \"%s\"\n"), program);
|
||||
}
|
||||
|
||||
errors ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (attr = ppdFindAttr(ppd, "cupsPreFilter", NULL);
|
||||
attr;
|
||||
attr = ppdFindNextAttr(ppd, "cupsPreFilter", NULL))
|
||||
{
|
||||
if (!attr->value ||
|
||||
sscanf(attr->value, "%15[^/]/%255s%d%255s", super, type, &cost,
|
||||
program) != 4)
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" **FAIL** Bad cupsPreFilter value \"%s\"!\n"),
|
||||
attr->value ? attr->value : "");
|
||||
}
|
||||
|
||||
errors ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (program[0] == '/')
|
||||
snprintf(pathprog, sizeof(pathprog), "%s%s", root, program);
|
||||
else
|
||||
{
|
||||
if ((ptr = getenv("CUPS_SERVERBIN")) == NULL)
|
||||
ptr = CUPS_SERVERBIN;
|
||||
|
||||
if (*ptr == '/' || !*root)
|
||||
snprintf(pathprog, sizeof(pathprog), "%s%s/filter/%s", root, ptr,
|
||||
program);
|
||||
else
|
||||
snprintf(pathprog, sizeof(pathprog), "%s/%s/filter/%s", root, ptr,
|
||||
program);
|
||||
}
|
||||
|
||||
if (stat(pathprog, &statbuf))
|
||||
{
|
||||
if (verbose >= 0)
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
_cupsLangPrintf(stdout, _(" **FAIL** Missing cupsPreFilter "
|
||||
"file \"%s\"\n"), program);
|
||||
}
|
||||
|
||||
errors ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, "1284DeviceID", NULL)) &&
|
||||
@@ -1320,6 +1473,66 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
errors ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for bad UIConstraints...
|
||||
*/
|
||||
|
||||
for (j = ppd->num_consts, c = ppd->consts; j > 0; j --, c ++)
|
||||
{
|
||||
option = ppdFindOption(ppd, c->option1);
|
||||
option2 = ppdFindOption(ppd, c->option2);
|
||||
|
||||
if (!option || !option2)
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
if (!option)
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" **FAIL** Missing option %s in "
|
||||
"UIConstraint \"*%s %s *%s %s\"!\n"),
|
||||
c->option1,
|
||||
c->option1, c->choice1, c->option2, c->choice2);
|
||||
|
||||
if (!option2)
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" **FAIL** Missing option %s in "
|
||||
"UIConstraint \"*%s %s *%s %s\"!\n"),
|
||||
c->option2,
|
||||
c->option1, c->choice1, c->option2, c->choice2);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c->choice1[0] && !ppdFindChoice(option, c->choice1))
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" **FAIL** Missing choice *%s %s in "
|
||||
"UIConstraint \"*%s %s *%s %s\"!\n"),
|
||||
c->option1, c->choice1,
|
||||
c->option1, c->choice1, c->option2, c->choice2);
|
||||
}
|
||||
|
||||
if (c->choice2[0] && !ppdFindChoice(option2, c->choice2))
|
||||
{
|
||||
if (!errors && !verbose)
|
||||
_cupsLangPuts(stdout, _(" FAIL\n"));
|
||||
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" **FAIL** Missing choice *%s %s in "
|
||||
"UIConstraint \"*%s %s *%s %s\"!\n"),
|
||||
c->option2, c->choice2,
|
||||
c->option1, c->choice1, c->option2, c->choice2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Final pass/fail notification...
|
||||
*/
|
||||
|
||||
if (errors)
|
||||
status = ERROR_CONFORMANCE;
|
||||
else if (!verbose)
|
||||
@@ -1483,6 +1696,73 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* cupsICCProfile
|
||||
*/
|
||||
|
||||
for (attr = ppdFindAttr(ppd, "cupsICCProfile", NULL);
|
||||
attr != NULL;
|
||||
attr = ppdFindNextAttr(ppd, "cupsICCProfile", NULL))
|
||||
{
|
||||
if (attr->value)
|
||||
{
|
||||
if (attr->value[0] == '/')
|
||||
snprintf(pathprog, sizeof(pathprog), "%s%s", root, attr->value);
|
||||
else
|
||||
{
|
||||
if ((ptr = getenv("CUPS_DATADIR")) == NULL)
|
||||
ptr = CUPS_DATADIR;
|
||||
|
||||
if (*ptr == '/' || !*root)
|
||||
snprintf(pathprog, sizeof(pathprog), "%s%s/profiles/%s", root,
|
||||
ptr, attr->value);
|
||||
else
|
||||
snprintf(pathprog, sizeof(pathprog), "%s/%s/profiles/%s", root,
|
||||
ptr, attr->value);
|
||||
}
|
||||
}
|
||||
|
||||
if (!attr->value || !attr->value[0] || stat(pathprog, &statbuf))
|
||||
{
|
||||
if (verbose >= 0)
|
||||
_cupsLangPrintf(stdout,
|
||||
_(" WARN Missing cupsICCProfile "
|
||||
"file \"%s\"\n"),
|
||||
!attr->value || !attr->value[0] ? "<NULL>" :
|
||||
attr->value);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* APDialogExtension
|
||||
*/
|
||||
|
||||
for (attr = ppdFindAttr(ppd, "APDialogExtension", NULL);
|
||||
attr != NULL;
|
||||
attr = ppdFindNextAttr(ppd, "APDialogExtension", NULL))
|
||||
{
|
||||
if ((!attr->value || stat(attr->value, &statbuf)) && verbose >= 0)
|
||||
_cupsLangPrintf(stdout, _(" WARN Missing "
|
||||
"APDialogExtension file \"%s\"\n"),
|
||||
attr->value ? attr->value : "<NULL>");
|
||||
}
|
||||
|
||||
/*
|
||||
* APPrinterIconPath
|
||||
*/
|
||||
|
||||
for (attr = ppdFindAttr(ppd, "APPrinterIconPath", NULL);
|
||||
attr != NULL;
|
||||
attr = ppdFindNextAttr(ppd, "APPrinterIconPath", NULL))
|
||||
{
|
||||
if ((!attr->value || stat(attr->value, &statbuf)) && verbose >= 0)
|
||||
_cupsLangPrintf(stdout, _(" WARN Missing "
|
||||
"APPrinterIconPath file \"%s\"\n"),
|
||||
attr->value ? attr->value : "<NULL>");
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
if (verbose > 0)
|
||||
{
|
||||
if (errors)
|
||||
@@ -1848,9 +2128,10 @@ void
|
||||
usage(void)
|
||||
{
|
||||
_cupsLangPuts(stdout,
|
||||
_("Usage: cupstestppd [-q] [-r] [-v[v]] filename1.ppd[.gz] "
|
||||
"[... filenameN.ppd[.gz]]\n"
|
||||
" program | cupstestppd [-q] [-r] [-v[v]] -\n"));
|
||||
_("Usage: cupstestppd [-R root-directory] [-q] [-r] [-v[v]] "
|
||||
"filename1.ppd[.gz] [... filenameN.ppd[.gz]]\n"
|
||||
" program | cupstestppd [-R root-directory] [-q] [-r] "
|
||||
"[-v[v]] -\n"));
|
||||
|
||||
exit(ERROR_USAGE);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TABLE WIDTH="100%" CLASS="button" CELLSPACING="0" CELLPADDING="0" SUMMARY="{printer_name}">
|
||||
<TR>
|
||||
<TD VALIGN="TOP"><A HREF="{printer_uri_supported}">
|
||||
<IMG SRC="/images/printer-{printer_state=3?bezczynna:{printer_state=4?przetwarzanie:zatrzymana}}.gif" CLASS="button" ALT=""></A>
|
||||
<IMG SRC="/images/printer-{printer_state=3?idle:{printer_state=4?processing:stopped}}.gif" CLASS="button" ALT=""></A>
|
||||
</TD>
|
||||
<TD VALIGN="TOP"><B>Opis:</B> {printer_info}<BR>
|
||||
<B>Położenie:</B> {printer_location}<BR>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
|
||||
<H2 CLASS="title">加入分類</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">名稱:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_NAME" SIZE="40" MAXLENGTH="127"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">位置:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_LOCATION" SIZE="40" MAXLENGTH="127"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">描述:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_INFO" SIZE="40" MAXLENGTH="127"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">成員:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="MEMBER_URIS" SIZE="10" MULTIPLE>
|
||||
{[member_uris]<OPTION VALUE="{member_uris}" {?member_selected}>{member_names}}
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-add-class.gif" ALT="加入分類"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -0,0 +1,28 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
|
||||
<H2 CLASS="title">加入新的印表機</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">名稱:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_NAME" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(可能包含任何除了 "/"、"#" 和 space 以外可列印的字元)</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">位置:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_LOCATION" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(容易理解的位置,像是 "實驗室一")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">描述:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_INFO" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(容易理解的描述,像是 "HP LaserJet with Duplexer")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="繼續"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -0,0 +1,77 @@
|
||||
<TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" SUMMARY="管理任務">
|
||||
<TR><TD VALIGN="TOP" NOWRAP>
|
||||
|
||||
<H2 CLASS="title">印表機</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/admin?op=add-printer"><IMG
|
||||
SRC="/images/button-add-printer.gif" ALT="加入印表機" CLASS="button"></A>
|
||||
<A HREF="/printers/"><IMG SRC="/images/button-manage-printers.gif"
|
||||
ALT="管理印表機" CLASS="button"></A>
|
||||
{have_samba?<A HREF="/admin/?op=export-samba"><IMG
|
||||
SRC="/images/button-export-samba.gif" ALT="匯出印表機到 Samba"
|
||||
CLASS="button"></A>:}
|
||||
</P>
|
||||
|
||||
{#device_uri=0?:<P><B>找到新的印表機:</B></P><UL>{[device_uri]
|
||||
<LI><A HREF="/admin?op=add-printer&{device_options}"><IMG
|
||||
SRC="/images/button-add-this-printer.gif" ALT="加入此印表機" CLASS="button"
|
||||
ALIGN="MIDDLE"></A>
|
||||
{device_make_and_model} ({device_info})</LI>
|
||||
}</UL>}
|
||||
|
||||
<H2 CLASS="title">分類</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/admin?op=add-class"><IMG SRC="/images/button-add-class.gif"
|
||||
ALT="加入分類" CLASS="button"></A>
|
||||
<A HREF="/classes/"><IMG SRC="/images/button-manage-classes.gif"
|
||||
ALT="管理分類" CLASS="button"></A>
|
||||
</P>
|
||||
|
||||
<H2 CLASS="title">工作</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/jobs/"><IMG SRC="/images/button-manage-jobs.gif" ALT="管理
|
||||
工作" CLASS="button"></A>
|
||||
</P>
|
||||
|
||||
</TD><TD> </TD><TD VALIGN="TOP">
|
||||
|
||||
<H2 CLASS="title">伺服器</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/admin?op=config-server"><IMG
|
||||
SRC="/images/button-edit-configuration-file.gif" ALT="編輯配置
|
||||
檔案" CLASS="button"></A>
|
||||
<A HREF="/admin/log/access_log" TARGET="_blank"><IMG
|
||||
SRC="/images/button-view-access-log.gif" ALT="檢視存取記錄"
|
||||
CLASS="button"></A>
|
||||
<A HREF="/admin/log/error_log" TARGET="_blank"><IMG
|
||||
SRC="/images/button-view-error-log.gif" ALT="檢視錯誤記錄"
|
||||
CLASS="button"></A>
|
||||
<A HREF="/admin/log/page_log" TARGET="_blank"><IMG
|
||||
SRC="/images/button-view-page-log.gif" ALT="檢視頁面記錄"
|
||||
CLASS="button"></A>
|
||||
</P>
|
||||
|
||||
{SETTINGS_ERROR?<P>{SETTINGS_MESSAGE}</P>
|
||||
<BLOCKQUOTE>{SETTINGS_ERROR}</BLOCKQUOTE>:
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
|
||||
<P><B>基本伺服器設定值:</B></P>
|
||||
|
||||
<P><INPUT TYPE="HIDDEN" NAME="OP" VALUE="config-server">
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_PRINTERS" {?remote_printers}> 顯示其他系統分享的印表機<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> 分享連接到此系統的公開印表機<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> 允許遠端管理<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> 允許使用者取消任何工作 (而非只有他們所擁有的)<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> 儲存除錯資訊以便解決問題</P>
|
||||
|
||||
<P><INPUT TYPE="IMAGE" SRC="/images/button-change-settings.gif" ALT="變更設定值"></P>
|
||||
|
||||
</FORM>}
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
@@ -0,0 +1,26 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{?printer_location}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{?printer_info}">
|
||||
<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{?current_make_and_model}">
|
||||
|
||||
<H2 CLASS="title">{printer_name} 的裝置</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">裝置:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="DEVICE_URI">
|
||||
{[device_uri]<OPTION VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}" {?current_device_uri={device_uri}?SELECTED:{current_device_scheme={device_uri}?SELECTED:}}>
|
||||
{device_info} {?device_make_and_model!Unknown?({device_make_and_model}):}</OPTION>
|
||||
}</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="繼續"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -0,0 +1,42 @@
|
||||
<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{?printer_location}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{?printer_info}">
|
||||
<INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
|
||||
<H2 CLASS="title">{printer_name} 的廠牌/製造商</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">廠牌:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="PPD_MAKE" SIZE="10">
|
||||
{[ppd_make]<OPTION VALUE="{ppd_make}" {?current_make={ppd_make}?SELECTED:}>{ppd_make}}
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="繼續"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">或是提供 PPD 檔案:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="262144"><INPUT
|
||||
TYPE="FILE" NAME="PPD_FILE"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-{op}.gif" ALT="{op=add-printer?加入印表機:修改印表機}"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||