From d09495fadd23469999a64b1812ffb880bf4372de Mon Sep 17 00:00:00 2001
From: jlovell
Date: Wed, 30 Aug 2006 16:09:13 +0000
Subject: [PATCH] Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@211 a1ca3aef-8c08-0410-bb20-df032aa958be
---
CHANGES.txt | 76 +++-
Makedefs.in | 8 +-
Makefile | 35 +-
README.txt | 2 +-
backend/backend-private.h | 12 +-
backend/ieee1284.c | 8 +-
backend/ipp.c | 47 ++-
backend/lpd.c | 5 +-
backend/runloop.c | 10 +-
backend/snmp.c | 305 ++++++++++++++--
berkeley/lpc.c | 6 +-
berkeley/lpq.c | 9 +-
berkeley/lpr.c | 8 +-
berkeley/lprm.c | 10 +-
cgi-bin/admin.c | 102 ++++--
cgi-bin/ipp-var.c | 5 +-
config-scripts/cups-common.m4 | 6 +-
config-scripts/cups-defaults.m4 | 8 +-
config-scripts/cups-directories.m4 | 32 +-
config-scripts/cups-manpages.m4 | 12 +-
configure.in | 18 +-
cups-config.in | 5 +-
cups/Makefile | 5 +-
cups/adminutil.c | 45 ++-
cups/attr.c | 50 ++-
cups/cups.h | 8 +-
cups/dir.h | 10 +-
cups/file.c | 5 +-
cups/file.h | 14 +-
cups/http.c | 35 +-
cups/http.h | 14 +-
cups/i18n.h | 5 +-
cups/ipp-support.c | 35 +-
cups/ipp.h | 10 +-
cups/langprintf.c | 50 ++-
cups/language.c | 6 +-
cups/libcups_s.exp | 1 +
cups/localize.c | 25 +-
cups/notify.c | 6 +-
cups/ppd.c | 8 +-
cups/testi18n.c | 9 +-
cups/testppd.c | 22 +-
cups/transcode.c | 8 +-
cups/usersys.c | 20 +-
desktop/cups.desktop | 10 +-
doc/help/ref-snmp-conf.html | 17 +
doc/help/translation.html | 53 ++-
filter/pstops.c | 14 +-
init/org.cups.cups-lpd.plist | 33 ++
man/cups-snmp.conf.man | 7 +-
packaging/cups.list.in | 58 ++-
packaging/installer.gif | Bin 0 -> 2686 bytes
scheduler/Dependencies | 157 ++++----
scheduler/Makefile | 21 +-
scheduler/auth.c | 13 +-
scheduler/client.c | 189 +++++++++-
scheduler/client.h | 5 +-
scheduler/conf.c | 65 ++--
scheduler/cups-lpd.c | 12 +-
scheduler/cups-polld.c | 97 +++--
scheduler/dirsvc.c | 37 +-
scheduler/dirsvc.h | 5 +-
scheduler/ipp.c | 125 ++++---
scheduler/job.c | 43 +--
scheduler/job.h | 6 +-
scheduler/main.c | 10 +-
scheduler/mime.h | 12 +-
scheduler/policy.c | 8 +-
scheduler/printers.c | 16 +-
scheduler/printers.h | 5 +-
scheduler/statbuf.c | 6 +-
scheduler/subscriptions.c | 16 +-
scheduler/sysman.c | 7 +-
scheduler/testlpd.c | 550 +++++++++++++++++++++++++++++
systemv/accept.c | 6 +-
systemv/cancel.c | 6 +-
systemv/cupsaddsmb.c | 6 +-
systemv/cupstestdsc.c | 8 +-
systemv/cupstestppd.c | 88 ++++-
systemv/lp.c | 6 +-
systemv/lpadmin.c | 6 +-
systemv/lpinfo.c | 6 +-
systemv/lpmove.c | 6 +-
systemv/lpoptions.c | 6 +-
systemv/lppasswd.c | 6 +-
systemv/lpstat.c | 39 +-
templates/Makefile | 5 +-
templates/es/norestart.tmpl | 2 +
templates/job-cancel.tmpl | 2 +-
templates/jobs.tmpl | 2 +-
templates/norestart.tmpl | 2 +
test/4.2-cups-printer-ops.test | 6 +-
test/4.4-subscription-ops.test | 10 +-
test/ipptest.c | 8 +-
tools/testosx | 5 +-
95 files changed, 2306 insertions(+), 642 deletions(-)
create mode 100644 init/org.cups.cups-lpd.plist
create mode 100644 packaging/installer.gif
create mode 100644 scheduler/testlpd.c
create mode 100644 templates/es/norestart.tmpl
create mode 100644 templates/norestart.tmpl
diff --git a/CHANGES.txt b/CHANGES.txt
index f55439e5f..5ac921349 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,80 @@
-CHANGES.txt - 2006-07-18
+CHANGES.txt - 2006-08-29
------------------------
+CHANGES IN CUPS V1.2.3
+
+ - The scheduler did not send job-state or
+ job-config-changed events when a job was held,
+ released, or changed (STR #1947)
+ - The scheduler now aborts if the configuration file and
+ directory checks fail (STR #1941)
+ - Fixed a problem with ippPort() not using the port
+ number that was set via the client.conf file or
+ CUPS_SERVER environment variable (STR #1945)
+ - HTTP headers were not buffered (STR #1899)
+ - Some IPP printers (HP) did not like UTF-8 job names
+ (STR #1837)
+ - The CUPS desktop icon is now localized for Polish (STR
+ #1920)
+ - Printer options were not always honored when printing
+ from Windows clients (STR #1839)
+ - The openssl command would lock up the scheduler when
+ generating an encryption certificate on some platforms
+ due to a lack of entropy for the random number
+ generator (STR #1876)
+ - The web admin page did not recognize that "Listen 631"
+ enabled remote access (STR #1908)
+ - The web admin page did not check whether changes were
+ made to the Basic Server Settings check boxes (STR
+ #1908)
+ - The IPP backend could generate N*N copies in certain
+ edge cases.
+ - The scheduler did not restore remote printers properly
+ when BrowseShortNames was enabled (STR #1893)
+ - Polling did not handle changes to the network
+ environment on Mac OS X (STR #1896)
+ - The "make test" subscription tests used invalid
+ notify-recipient-uri values (STR #1910)
+ - Printers could be left in an undefined state on system
+ sleep (STR #1905)
+ - The Berkeley and System V commands did not always use
+ the expected character set (STR #1915)
+ - Remote printing fixes (STR #1881)
+ - The cupstestppd utility did not validate translation
+ strings for custom options properly.
+ - Multi-language PPD files were not properly localized in
+ the web interface (STR #1913)
+ - The admin page's simple settings options did not check
+ for local domain socket or IPv6 addresses and did not
+ use "localhost" as the listen address.
+ - An empty BrowseProtocols, BrowseLocalProtocols, or
+ BrowseRemoteProtocols line would crash the scheduler
+ instead of disabling the corresponding browsing options.
+ - The scheduler now logs IPP operation status as debug
+ messages instead of info or error.
+ - cupsFileRewind() didn't clear the end-of-file state.
+ - cupstestppd didn't report the actual misspelling of the
+ 1284DeviceID attribute (STR #1849)
+ - BrowseRelay didn't work on Debian (STR #1887)
+ - configure --without-languages didn't work (STR #1879)
+ - Manually added remote printers did not work (STR #1881)
+ - The header was not installed.
+ - Updated the build files for Autoconf 2.60 (STR #1853)
+ - The scheduler incorrectly terminated the polling
+ processes after receiving a partial log line.
+ - The cups-lpd mini-daemon reported "No printer-state
+ attribute found" errors when reporting the queue status
+ (PR #6250, STR #1821)
+ - SNMP backend improvements (STR #1737, STR #1742, STR
+ #1790, STR #1835, STR #1880)
+ - The scheduler erroneously reported an error with the
+ CGI pipe (STR #1860)
+ - Fixed HP-UX compile problems (STR #1858, STR #1859)
+ - cupstestppd crashed with some PPD files (STR #1864)
+ - The and header files did not
+ work with C++.
+
+
CHANGES IN CUPS V1.2.2
- Documentation updates (STR #1765, STR #1780)
diff --git a/Makedefs.in b/Makedefs.in
index 10198cc49..97c55e09c 100644
--- a/Makedefs.in
+++ b/Makedefs.in
@@ -1,5 +1,5 @@
#
-# "$Id: Makedefs.in 5609 2006-05-30 20:31:10Z mike $"
+# "$Id: Makedefs.in 5799 2006-08-03 00:54:38Z mike $"
#
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
@@ -174,12 +174,16 @@ UNINSTALL64 = @UNINSTALL64@
# We have to define these first because autoconf uses ${prefix}
# and ${exec_prefix} for most of the other directories...
#
+# The "datarootdir" variable may not get defined if you are using
+# a version of autoconf prior to 2.60.
+#
# This is immediately followed by definition in ALL CAPS for the
# needed directories...
#
bindir = @bindir@
datadir = @datadir@
+datarootdir = @datarootdir@
exec_prefix = @exec_prefix@
includedir = @includedir@
infodir = @infodir@
@@ -265,5 +269,5 @@ DBUSDIR = @DBUSDIR@
#
-# End of "$Id: Makedefs.in 5609 2006-05-30 20:31:10Z mike $"
+# End of "$Id: Makedefs.in 5799 2006-08-03 00:54:38Z mike $"
#
diff --git a/Makefile b/Makefile
index d1fe2d02d..45dd92c05 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile 5547 2006-05-19 12:44:29Z mike $"
+# "$Id: Makefile 5902 2006-08-29 15:51:19Z mike $"
#
# Top-level Makefile for the Common UNIX Printing System (CUPS).
#
@@ -121,8 +121,9 @@ install: installhdrs
$(INSTALL_DIR) -m 755 $(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 file...; \
+ 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; \
else \
echo Installing RC script...; \
$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \
@@ -220,24 +221,44 @@ uninstall:
# Run the test suite...
#
-check test: all
+test: all
echo Running CUPS test suite...
cd test; ./run-stp-tests.sh
+check: all
+ echo Running CUPS test suite with defaults...
+ cd test; ./run-stp-tests.sh 1 0 n
+
+
#
# Make software distributions using EPM (http://www.easysw.com/epm/)...
#
-EPMFLAGS = -v
+EPMFLAGS = -v --output-dir dist $(EPMARCH)
-aix bsd deb depot inst osx pkg rpm setld slackware swinstall tardist:
+aix bsd deb depot inst pkg rpm setld slackware swinstall tardist:
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
epm:
- epm $(EPMFLAGS) cups packaging/cups.list
+ epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
+
+osx:
+ epm $(EPMFLAGS) -f osx -s packaging/installer.tif cups packaging/cups.list
+
+.PHONEY: dist
+dist: all
+ $(RM) -r dist
+ $(MAKE) $(MFLAGS) epm
+ case `uname` in \
+ *BSD*) $(MAKE) $(MFLAGS) bsd;; \
+ Darwin*) $(MAKE) $(MFLAGS) osx;; \
+ IRIX*) $(MAKE) $(MFLAGS) tardist;; \
+ Linux*) $(MAKE) $(MFLAGS) rpm;; \
+ SunOS*) $(MAKE) $(MFLAGS) pkg;; \
+ esac
#
-# End of "$Id: Makefile 5547 2006-05-19 12:44:29Z mike $".
+# End of "$Id: Makefile 5902 2006-08-29 15:51:19Z mike $".
#
diff --git a/README.txt b/README.txt
index 4595be8c4..34983cd94 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-README - CUPS v1.2.0 - 2006-05-08
+README - CUPS v1.2.3 - 2006-08-28
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
diff --git a/backend/backend-private.h b/backend/backend-private.h
index f9384931c..14b93cc87 100644
--- a/backend/backend-private.h
+++ b/backend/backend-private.h
@@ -1,5 +1,5 @@
/*
- * "$Id: backend-private.h 5592 2006-05-27 03:11:52Z mike $"
+ * "$Id: backend-private.h 5771 2006-07-20 18:06:20Z mike $"
*
* Backend support definitions for the Common UNIX Printing System (CUPS).
*
@@ -45,9 +45,9 @@
* C++ magic...
*/
-# ifdef _cplusplus
+# ifdef __cplusplus
extern "C" {
-# endif /* _cplusplus */
+# endif /* __cplusplus */
/*
@@ -62,12 +62,12 @@ extern int backendGetMakeModel(const char *device_id, char *make_model,
extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc);
-# ifdef _cplusplus
+# ifdef __cplusplus
}
-# endif /* _cplusplus */
+# endif /* __cplusplus */
#endif /* !_CUPS_BACKEND_PRIVATE_H_ */
/*
- * End of "$Id: backend-private.h 5592 2006-05-27 03:11:52Z mike $".
+ * End of "$Id: backend-private.h 5771 2006-07-20 18:06:20Z mike $".
*/
diff --git a/backend/ieee1284.c b/backend/ieee1284.c
index f564215e0..f54149367 100644
--- a/backend/ieee1284.c
+++ b/backend/ieee1284.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ieee1284.c 5591 2006-05-26 19:51:59Z mike $"
+ * "$Id: ieee1284.c 5866 2006-08-23 03:03:49Z mike $"
*
* IEEE-1284 support functions for the Common UNIX Printing System (CUPS).
*
@@ -233,6 +233,8 @@ backendGetDeviceID(
if (!strcasecmp(manufacturer, "Hewlett-Packard"))
strcpy(manufacturer, "HP");
+ else if (!strcasecmp(manufacturer, "Lexmark International"))
+ strcpy(manufacturer, "Lexmark");
}
else
{
@@ -399,6 +401,8 @@ backendGetMakeModel(
{
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
+ else if (!strncasecmp(mfg, "Lexmark International", 21))
+ strlcpy(make_model, "Lexmark", make_model_size);
else
strlcpy(make_model, mfg, make_model_size);
@@ -495,5 +499,5 @@ backendGetMakeModel(
/*
- * End of "$Id: ieee1284.c 5591 2006-05-26 19:51:59Z mike $".
+ * End of "$Id: ieee1284.c 5866 2006-08-23 03:03:49Z mike $".
*/
diff --git a/backend/ipp.c b/backend/ipp.c
index e64d6c44c..73ad5f6f4 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp.c 5724 2006-07-12 19:42:35Z mike $"
+ * "$Id: ipp.c 5889 2006-08-24 21:44:35Z mike $"
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
@@ -132,13 +132,13 @@ main(int argc, /* I - Number of command-line args */
ipp_attribute_t *format_sup; /* document-format-supported */
ipp_attribute_t *printer_state; /* printer-state attribute */
ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
- int copies; /* Number of copies remaining */
+ int copies, /* Number of copies for job */
+ copies_remaining; /* Number of copies remaining */
const char *content_type; /* CONTENT_TYPE environment variable */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
int version; /* IPP version */
- int reasons; /* Number of printer-state-reasons */
static const char * const pattrs[] =
{ /* Printer attributes we want */
"copies-supported",
@@ -214,6 +214,9 @@ main(int argc, /* I - Number of command-line args */
if ((content_type = getenv("CONTENT_TYPE")) == NULL)
content_type = "application/octet-stream";
+ if (!strncmp(content_type, "printer/", 8))
+ content_type = "application/vnd.cups-raw";
+
/*
* Extract the hostname and printer name from the URI...
*/
@@ -736,19 +739,25 @@ main(int argc, /* I - Number of command-line args */
* See if the printer supports multiple copies...
*/
+ copies = atoi(argv[4]);
+
if (copies_sup || argc < 7)
- copies = 1;
+ {
+ copies_remaining = 1;
+
+ if (argc < 7)
+ copies = 1;
+ }
else
- copies = atoi(argv[4]);
+ copies_remaining = copies;
/*
* Then issue the print-job request...
*/
- reasons = 0;
job_id = 0;
- while (copies > 0)
+ while (copies_remaining > 0)
{
/*
* Build the IPP request...
@@ -775,7 +784,13 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "DEBUG: requesting-user-name = \"%s\"\n", argv[2]);
- if (argv[3][0])
+ /*
+ * Only add a "job-name" attribute if the remote server supports
+ * copy generation - some IPP implementations like HP's don't seem
+ * to like UTF-8 job names (STR #1837)...
+ */
+
+ if (argv[3][0] && copies_sup)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
argv[3]);
@@ -822,8 +837,9 @@ main(int argc, /* I - Number of command-line args */
* number of copies to 1...
*/
- content_type = "application/postscript";
- copies = 1;
+ content_type = "application/postscript";
+ copies = 1;
+ copies_remaining = 1;
}
}
#endif /* __APPLE__ */
@@ -851,8 +867,9 @@ main(int argc, /* I - Number of command-line args */
*/
cupsEncodeOptions(request, num_options, options);
+
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies",
- atoi(argv[4]));
+ copies);
}
cupsFreeOptions(num_options, options);
@@ -952,13 +969,13 @@ main(int argc, /* I - Number of command-line args */
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
{
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
- copies --;
+ copies_remaining --;
}
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
break;
else
- copies --;
+ copies_remaining --;
/*
* Wait for the job to complete...
@@ -1300,6 +1317,8 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
#endif /* __APPLE__ */
exit(CUPS_BACKEND_AUTH_REQUIRED);
+
+ return (NULL); /* Eliminate compiler warning */
}
}
@@ -1622,5 +1641,5 @@ sigterm_handler(int sig) /* I - Signal */
/*
- * End of "$Id: ipp.c 5724 2006-07-12 19:42:35Z mike $".
+ * End of "$Id: ipp.c 5889 2006-08-24 21:44:35Z mike $".
*/
diff --git a/backend/lpd.c b/backend/lpd.c
index ef7ef05d3..218dba737 100644
--- a/backend/lpd.c
+++ b/backend/lpd.c
@@ -1,5 +1,5 @@
/*
- * "$Id: lpd.c 5495 2006-05-05 17:58:07Z mike $"
+ * "$Id: lpd.c 5886 2006-08-24 19:53:17Z mike $"
*
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
*
@@ -261,6 +261,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
/* We want to pass utf-8 characters, not re-map them (3071945) */
sanitize_title = 0;
+ /* Get the default timeout from a system preference... */
{
CFPropertyListRef pvalue; /* Preference value */
SInt32 toval; /* Timeout value */
@@ -1230,5 +1231,5 @@ sigterm_handler(int sig) /* I - Signal */
/*
- * End of "$Id: lpd.c 5495 2006-05-05 17:58:07Z mike $".
+ * End of "$Id: lpd.c 5886 2006-08-24 19:53:17Z mike $".
*/
diff --git a/backend/runloop.c b/backend/runloop.c
index 03bb09282..82673a447 100644
--- a/backend/runloop.c
+++ b/backend/runloop.c
@@ -1,5 +1,5 @@
/*
- * "$Id: runloop.c 5726 2006-07-12 20:00:11Z mike $"
+ * "$Id: runloop.c 5776 2006-07-26 20:55:13Z mike $"
*
* Common run loop API for the Common UNIX Printing System (CUPS).
*
@@ -33,7 +33,11 @@
*/
#include "backend-private.h"
-#include
+#ifdef __hpux
+# include
+#else
+# include
+#endif /* __hpux */
/*
@@ -254,5 +258,5 @@ backendRunLoop(int print_fd, /* I - Print file descriptor */
/*
- * End of "$Id: runloop.c 5726 2006-07-12 20:00:11Z mike $".
+ * End of "$Id: runloop.c 5776 2006-07-26 20:55:13Z mike $".
*/
diff --git a/backend/snmp.c b/backend/snmp.c
index 56e7ad9e7..4a90f2ebc 100644
--- a/backend/snmp.c
+++ b/backend/snmp.c
@@ -1,5 +1,5 @@
/*
- * "$Id: snmp.c 5736 2006-07-13 19:59:36Z mike $"
+ * "$Id: snmp.c 5898 2006-08-28 18:54:10Z mike $"
*
* SNMP discovery backend for the Common UNIX Printing System (CUPS).
*
@@ -52,6 +52,7 @@
* packed integer value.
* compare_cache() - Compare two cache entries.
* debug_printf() - Display some debugging information.
+ * do_request() - Do a non-blocking IPP request.
* fix_make_model() - Fix common problems in the make-and-model
* string.
* free_array() - Free an array of strings.
@@ -59,7 +60,7 @@
* get_interface_addresses() - Get the broadcast address(es) associated
* with an interface.
* hex_debug() - Output hex debugging data...
- * list_devices() - List all of the devices we found...
+ * list_device() - List a device we found...
* open_snmp_socket() - Open the SNMP broadcast socket.
* password_cb() - Handle authentication requests.
* probe_device() - Probe a device to discover whether it is a
@@ -193,6 +194,13 @@ typedef struct snmp_packet_s /**** SNMP packet ****/
} snmp_packet_t;
+/*
+ * Private CUPS API to set the last error...
+ */
+
+extern void _cupsSetError(ipp_status_t status, const char *message);
+
+
/*
* Local functions...
*/
@@ -238,6 +246,8 @@ static int asn1_size_oid(const int *oid);
static int asn1_size_packed(int integer);
static int compare_cache(snmp_cache_t *a, snmp_cache_t *b);
static void debug_printf(const char *format, ...);
+static ipp_t *do_request(http_t *http, ipp_t *request,
+ const char *resource);
static void fix_make_model(char *make_model,
const char *old_make_model,
int make_model_size);
@@ -245,7 +255,7 @@ static void free_array(cups_array_t *a);
static void free_cache(void);
static http_addrlist_t *get_interface_addresses(const char *ifname);
static void hex_debug(unsigned char *buffer, size_t len);
-static void list_devices(void);
+static void list_device(snmp_cache_t *cache);
static int open_snmp_socket(void);
static const char *password_cb(const char *prompt);
static void probe_device(snmp_cache_t *device);
@@ -278,6 +288,7 @@ static int DeviceDescOID[] = { 1, 3, 6, 1, 2, 1, 25, 3,
static unsigned DeviceTypeRequest;
static unsigned DeviceDescRequest;
static int HostNameLookups = 0;
+static int MaxRunTime = 10;
static struct timeval StartTime;
@@ -290,6 +301,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
int fd; /* SNMP socket */
+#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
+ struct sigaction action; /* Actions for POSIX signals */
+#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
@@ -308,6 +322,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
cupsSetPasswordCB(password_cb);
+ /*
+ * Catch SIGALRM signals...
+ */
+
+#ifdef HAVE_SIGSET
+ sigset(SIGALRM, alarm_handler);
+#elif defined(HAVE_SIGACTION)
+ memset(&action, 0, sizeof(action));
+
+ sigemptyset(&action.sa_mask);
+ sigaddset(&action.sa_mask, SIGALRM);
+ action.sa_handler = alarm_handler;
+ sigaction(SIGALRM, &action, NULL);
+#else
+ signal(SIGALRM, alarm_handler);
+#endif /* HAVE_SIGSET */
+
/*
* Open the SNMP socket...
*/
@@ -329,12 +360,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
scan_devices(fd);
- /*
- * Display the results...
- */
-
- list_devices();
-
/*
* Close, free, and return with no errors...
*/
@@ -384,7 +409,7 @@ add_cache(http_addr_t *addr, /* I - Device IP address */
debug_printf("DEBUG: add_cache(addr=%p, addrname=\"%s\", uri=\"%s\", "
"id=\"%s\", make_and_model=\"%s\")\n",
- addr, addrname, uri ? uri : "(null)", id ? id : "(null)",
+ addr, addrname, uri ? uri : "(null)", id ? id : "(null)",
make_and_model ? make_and_model : "(null)");
temp = calloc(1, sizeof(snmp_cache_t));
@@ -402,6 +427,9 @@ add_cache(http_addr_t *addr, /* I - Device IP address */
temp->make_and_model = strdup(make_and_model);
cupsArrayAdd(Devices, temp);
+
+ if (uri)
+ list_device(temp);
}
@@ -418,6 +446,10 @@ alarm_handler(int sig) /* I - Signal number */
(void)sig;
+#if !defined(HAVE_SIGSET) && !defined(HAVE_SIGACTION)
+ signal(SIGALRM, alarm_handler);
+#endif /* !HAVE_SIGSET && !HAVE_SIGACTION */
+
if (DebugLevel)
write(2, "DEBUG: ALARM!\n", 14);
}
@@ -1227,6 +1259,173 @@ debug_printf(const char *format, /* I - Printf-style format string */
}
+/*
+ * 'do_request()' - Do a non-blocking IPP request.
+ */
+
+static ipp_t * /* O - Response data or NULL */
+do_request(http_t *http, /* I - HTTP connection to server */
+ ipp_t *request, /* I - IPP request */
+ const char *resource) /* I - HTTP resource for POST */
+{
+ ipp_t *response; /* IPP response data */
+ http_status_t status; /* Status of HTTP request */
+ ipp_state_t state; /* State of IPP processing */
+
+
+ /*
+ * Setup the HTTP variables needed...
+ */
+
+ httpClearFields(http);
+ httpSetLength(http, ippLength(request));
+ httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
+
+ /*
+ * Do the POST request...
+ */
+
+ debug_printf("DEBUG: %.3f POST %s...\n", run_time(), resource);
+
+ if (httpPost(http, resource))
+ {
+ if (httpReconnect(http))
+ {
+ _cupsSetError(IPP_DEVICE_ERROR, "Unable to reconnect");
+ return (NULL);
+ }
+ else if (httpPost(http, resource))
+ {
+ _cupsSetError(IPP_GONE, "Unable to POST");
+ return (NULL);
+ }
+ }
+
+ /*
+ * Send the IPP data...
+ */
+
+ request->state = IPP_IDLE;
+ status = HTTP_CONTINUE;
+
+ while ((state = ippWrite(http, request)) != IPP_DATA)
+ if (state == IPP_ERROR)
+ {
+ status = HTTP_ERROR;
+ break;
+ }
+ else if (httpCheck(http))
+ {
+ if ((status = httpUpdate(http)) != HTTP_CONTINUE)
+ break;
+ }
+
+ /*
+ * Get the server's return status...
+ */
+
+ debug_printf("DEBUG: %.3f Getting response...\n", run_time());
+
+ while (status == HTTP_CONTINUE)
+ if (httpWait(http, 1000))
+ status = httpUpdate(http);
+ else
+ {
+ status = HTTP_ERROR;
+ http->error = ETIMEDOUT;
+ }
+
+ if (status != HTTP_OK)
+ {
+ /*
+ * Flush any error message...
+ */
+
+ httpFlush(http);
+ response = NULL;
+ }
+ else
+ {
+ /*
+ * Read the response...
+ */
+
+ response = ippNew();
+
+ while ((state = ippRead(http, response)) != IPP_DATA)
+ if (state == IPP_ERROR)
+ {
+ /*
+ * Delete the response...
+ */
+
+ ippDelete(response);
+ response = NULL;
+
+ _cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno));
+ break;
+ }
+ }
+
+ /*
+ * Delete the original request and return the response...
+ */
+
+ ippDelete(request);
+
+ if (response)
+ {
+ ipp_attribute_t *attr; /* status-message attribute */
+
+
+ attr = ippFindAttribute(response, "status-message", IPP_TAG_TEXT);
+
+ _cupsSetError(response->request.status.status_code,
+ attr ? attr->values[0].string.text :
+ ippErrorString(response->request.status.status_code));
+ }
+ else if (status != HTTP_OK)
+ {
+ switch (status)
+ {
+ case HTTP_NOT_FOUND :
+ _cupsSetError(IPP_NOT_FOUND, httpStatus(status));
+ break;
+
+ case HTTP_UNAUTHORIZED :
+ _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status));
+ break;
+
+ case HTTP_FORBIDDEN :
+ _cupsSetError(IPP_FORBIDDEN, httpStatus(status));
+ break;
+
+ case HTTP_BAD_REQUEST :
+ _cupsSetError(IPP_BAD_REQUEST, httpStatus(status));
+ break;
+
+ case HTTP_REQUEST_TOO_LARGE :
+ _cupsSetError(IPP_REQUEST_VALUE, httpStatus(status));
+ break;
+
+ case HTTP_NOT_IMPLEMENTED :
+ _cupsSetError(IPP_OPERATION_NOT_SUPPORTED, httpStatus(status));
+ break;
+
+ case HTTP_NOT_SUPPORTED :
+ _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status));
+ break;
+
+ default :
+ _cupsSetError(IPP_SERVICE_UNAVAILABLE, httpStatus(status));
+ break;
+ }
+ }
+
+ return (response);
+}
+
+
/*
* 'fix_make_model()' - Fix common problems in the make-and-model string.
*/
@@ -1288,6 +1487,16 @@ fix_make_model(
_cups_strcpy(mmptr, mmptr + 7);
}
+ if ((mmptr = strstr(make_model, " Network")) != NULL)
+ {
+ /*
+ * Drop unnecessary informational text, e.g. "Xerox DocuPrint N2025
+ * Network LaserJet - 2.12" becomes "Xerox DocuPrint N2025"...
+ */
+
+ *mmptr = '\0';
+ }
+
if ((mmptr = strchr(make_model, ',')) != NULL)
{
/*
@@ -1422,24 +1631,18 @@ hex_debug(unsigned char *buffer, /* I - Buffer */
/*
- * 'list_devices()' - List all of the devices we found...
+ * 'list_device()' - List a device we found...
*/
static void
-list_devices(void)
+list_device(snmp_cache_t *cache) /* I - Cached device */
{
- snmp_cache_t *cache; /* Cached device */
-
-
- for (cache = (snmp_cache_t *)cupsArrayFirst(Devices);
- cache;
- cache = (snmp_cache_t *)cupsArrayNext(Devices))
- if (cache->uri)
- printf("network %s \"%s\" \"%s %s\" \"%s\"\n",
- cache->uri,
- cache->make_and_model ? cache->make_and_model : "Unknown",
- cache->make_and_model ? cache->make_and_model : "Unknown",
- cache->addrname, cache->id ? cache->id : "");
+ if (cache->uri)
+ printf("network %s \"%s\" \"%s %s\" \"%s\"\n",
+ cache->uri,
+ cache->make_and_model ? cache->make_and_model : "Unknown",
+ cache->make_and_model ? cache->make_and_model : "Unknown",
+ cache->addrname, cache->id ? cache->id : "");
}
@@ -1524,7 +1727,29 @@ probe_device(snmp_cache_t *device) /* I - Device */
debug_printf("DEBUG: %.3f Probing %s...\n", run_time(), device->addrname);
- if ((http = httpConnect(device->addrname, 631)) != NULL)
+ if (device->make_and_model &&
+ (!strncasecmp(device->make_and_model, "Xerox", 5) ||
+ !strncasecmp(device->make_and_model, "Kyocera", 7)))
+ {
+ /*
+ * Xerox and Kyocera printers often lock up on IPP probes, so exclude
+ * them from the IPP connection test...
+ */
+
+ http = NULL;
+ }
+ else
+ {
+ /*
+ * Otherwise, try connecting for up to 1 second...
+ */
+
+ alarm(1);
+ http = httpConnect(device->addrname, 631);
+ alarm(0);
+ }
+
+ if (http);
{
/*
* IPP is supported...
@@ -1551,8 +1776,6 @@ probe_device(snmp_cache_t *device) /* I - Device */
};
- debug_printf("DEBUG: %s supports IPP!\n", device->addrname);
-
/*
* Use non-blocking IO...
*/
@@ -1568,6 +1791,13 @@ probe_device(snmp_cache_t *device) /* I - Device */
i < (int)(sizeof(resources) / sizeof(resources[0]));
i ++)
{
+ /*
+ * Stop early if we are out of time...
+ */
+
+ if (MaxRunTime > 0 && run_time() >= MaxRunTime)
+ break;
+
/*
* Don't look past /ipp if we have found a working URI...
*/
@@ -1578,16 +1808,14 @@ probe_device(snmp_cache_t *device) /* I - Device */
httpAssembleURI(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
device->addrname, 631, resources[i]);
- debug_printf("DEBUG: Trying %s (num_uris=%d)\n", uri, num_uris);
-
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
- response = cupsDoRequest(http, request, resources[i]);
+ response = do_request(http, request, resources[i]);
- debug_printf("DEBUG: %s %s (%s)\n", uri,
+ debug_printf("DEBUG: %.3f %s %s (%s)\n", run_time(), uri,
ippErrorString(cupsLastError()), cupsLastErrorString());
if (response && response->request.status.status_code == IPP_OK)
@@ -1726,6 +1954,7 @@ read_snmp_conf(const char *address) /* I - Single address to probe */
int linenum; /* Line number */
const char *cups_serverroot; /* CUPS_SERVERROOT env var */
const char *debug; /* CUPS_DEBUG_LEVEL env var */
+ const char *runtime; /* CUPS_MAX_RUN_TIME env var */
/*
@@ -1741,6 +1970,9 @@ read_snmp_conf(const char *address) /* I - Single address to probe */
if ((debug = getenv("CUPS_DEBUG_LEVEL")) != NULL)
DebugLevel = atoi(debug);
+ if ((runtime = getenv("CUPS_MAX_RUN_TIME")) != NULL)
+ MaxRunTime = atoi(runtime);
+
/*
* Find the snmp.conf file...
*/
@@ -1777,6 +2009,8 @@ read_snmp_conf(const char *address) /* I - Single address to probe */
!strcasecmp(value, "yes") ||
!strcasecmp(value, "true") ||
!strcasecmp(value, "double");
+ else if (!strcasecmp(line, "MaxRunTime"))
+ MaxRunTime = atoi(value);
else
fprintf(stderr, "ERROR: Unknown directive %s on line %d of %s!\n",
line, linenum, filename);
@@ -2075,7 +2309,9 @@ scan_devices(int fd) /* I - SNMP socket */
for (device = (snmp_cache_t *)cupsArrayFirst(Devices);
device;
device = (snmp_cache_t *)cupsArrayNext(Devices))
- if (!device->uri)
+ if (MaxRunTime > 0 && run_time() >= MaxRunTime)
+ break;
+ else if (!device->uri)
probe_device(device);
debug_printf("DEBUG: %.3f Scan complete!\n", run_time());
@@ -2169,7 +2405,6 @@ try_connect(http_addr_t *addr, /* I - Socket address */
addr->ipv4.sin_port = htons(port);
- signal(SIGALRM, alarm_handler);
alarm(1);
status = connect(fd, (void *)addr, httpAddrLength(addr));
@@ -2211,9 +2446,11 @@ update_cache(snmp_cache_t *device, /* I - Device */
device->make_and_model = strdup(make_model);
}
+
+ list_device(device);
}
/*
- * End of "$Id: snmp.c 5736 2006-07-13 19:59:36Z mike $".
+ * End of "$Id: snmp.c 5898 2006-08-28 18:54:10Z mike $".
*/
diff --git a/berkeley/lpc.c b/berkeley/lpc.c
index 271d60477..c00a23a7a 100644
--- a/berkeley/lpc.c
+++ b/berkeley/lpc.c
@@ -1,5 +1,5 @@
/*
- * "$Id: lpc.c 5023 2006-01-29 14:39:44Z mike $"
+ * "$Id: lpc.c 5833 2006-08-16 20:05:58Z mike $"
*
* "lpc" command for the Common UNIX Printing System (CUPS).
*
@@ -65,6 +65,8 @@ main(int argc, /* I - Number of command-line arguments */
*params; /* Pointer to parameters */
+ _cupsSetLocale();
+
/*
* Connect to the scheduler...
*/
@@ -518,5 +520,5 @@ show_status(http_t *http, /* I - HTTP connection to server */
/*
- * End of "$Id: lpc.c 5023 2006-01-29 14:39:44Z mike $".
+ * End of "$Id: lpc.c 5833 2006-08-16 20:05:58Z mike $".
*/
diff --git a/berkeley/lpq.c b/berkeley/lpq.c
index 43f01c620..78387fd5d 100644
--- a/berkeley/lpq.c
+++ b/berkeley/lpq.c
@@ -1,5 +1,5 @@
/*
- * "$Id: lpq.c 5638 2006-06-06 20:08:13Z mike $"
+ * "$Id: lpq.c 5838 2006-08-17 14:41:42Z mike $"
*
* "lpq" command for the Common UNIX Printing System (CUPS).
*
@@ -76,9 +76,10 @@ main(int argc, /* I - Number of command-line arguments */
longstatus; /* Show file details */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
- cups_lang_t *language; /* Language */
+ _cupsSetLocale();
+
/*
* Check for command-line options...
*/
@@ -90,8 +91,8 @@ main(int argc, /* I - Number of command-line arguments */
interval = 0;
longstatus = 0;
all = 0;
- language = cupsLangDefault();
num_dests = 0;
+ dests = NULL;
for (i = 1; i < argc; i ++)
if (argv[i][0] == '+')
@@ -675,5 +676,5 @@ usage(void)
/*
- * End of "$Id: lpq.c 5638 2006-06-06 20:08:13Z mike $".
+ * End of "$Id: lpq.c 5838 2006-08-17 14:41:42Z mike $".
*/
diff --git a/berkeley/lpr.c b/berkeley/lpr.c
index f6b5fb3b7..90b73bf4d 100644
--- a/berkeley/lpr.c
+++ b/berkeley/lpr.c
@@ -1,5 +1,5 @@
/*
- * "$Id: lpr.c 5235 2006-03-06 13:02:23Z mike $"
+ * "$Id: lpr.c 5838 2006-08-17 14:41:42Z mike $"
*
* "lpr" command for the Common UNIX Printing System (CUPS).
*
@@ -87,13 +87,14 @@ main(int argc, /* I - Number of command-line arguments */
ssize_t bytes; /* Bytes copied */
off_t filesize; /* Size of temp file */
int temp; /* Temporary file descriptor */
- cups_lang_t *language; /* Language information */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Signal action */
struct sigaction oldaction; /* Old signal action */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+ _cupsSetLocale();
+
deletefile = 0;
printer = NULL;
num_dests = 0;
@@ -102,7 +103,6 @@ main(int argc, /* I - Number of command-line arguments */
options = NULL;
num_files = 0;
title = NULL;
- language = cupsLangDefault();
for (i = 1; i < argc; i ++)
if (argv[i][0] == '-')
@@ -529,5 +529,5 @@ sighandler(int s) /* I - Signal number */
/*
- * End of "$Id: lpr.c 5235 2006-03-06 13:02:23Z mike $".
+ * End of "$Id: lpr.c 5838 2006-08-17 14:41:42Z mike $".
*/
diff --git a/berkeley/lprm.c b/berkeley/lprm.c
index 41f35ca12..574f26507 100644
--- a/berkeley/lprm.c
+++ b/berkeley/lprm.c
@@ -1,5 +1,5 @@
/*
- * "$Id: lprm.c 5719 2006-07-11 21:04:48Z mike $"
+ * "$Id: lprm.c 5878 2006-08-24 15:55:42Z mike $"
*
* "lprm" command for the Common UNIX Printing System (CUPS).
*
@@ -55,13 +55,14 @@ main(int argc, /* I - Number of command-line arguments */
ipp_t *request; /* IPP request */
ipp_t *response; /* IPP response */
ipp_op_t op; /* Operation */
- cups_lang_t *language; /* Language */
int num_dests; /* Number of destinations */
cups_dest_t *dests, /* Destinations */
*defdest; /* Default destination */
http_encryption_t encryption; /* Encryption? */
+ _cupsSetLocale();
+
/*
* Setup to cancel individual print jobs...
*/
@@ -72,7 +73,6 @@ main(int argc, /* I - Number of command-line arguments */
response = NULL;
http = NULL;
encryption = cupsEncryption();
- language = cupsLangDefault();
/*
* Open a connection to the server...
@@ -273,7 +273,7 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
- * If nothing has been cancelled yet, cancel the current job on the specified
+ * If nothing has been canceled yet, cancel the current job on the specified
* (or default) printer...
*/
@@ -294,5 +294,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
- * End of "$Id: lprm.c 5719 2006-07-11 21:04:48Z mike $".
+ * End of "$Id: lprm.c 5878 2006-08-24 15:55:42Z mike $".
*/
diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c
index 85142e3a0..6536c86f7 100644
--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
@@ -1,5 +1,5 @@
/*
- * "$Id: admin.c 5572 2006-05-22 18:47:09Z mike $"
+ * "$Id: admin.c 5878 2006-08-24 15:55:42Z mike $"
*
* Administration CGI for the Common UNIX Printing System (CUPS).
*
@@ -1597,39 +1597,97 @@ do_config_server(http_t *http) /* I - HTTP connection */
int num_settings; /* Number of server settings */
cups_option_t *settings; /* Server settings */
+ const char *debug_logging, /* DEBUG_LOGGING value */
+ *remote_admin, /* REMOTE_ADMIN value */
+ *remote_printers,
+ /* REMOTE_PRINTERS value */
+ *share_printers,/* SHARE_PRINTERS value */
+ *user_cancel_any;
+ /* USER_CANCEL_ANY value */
- num_settings = 0;
- num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
- cgiGetVariable("DEBUG_LOGGING") ? "1" : "0",
- num_settings, &settings);
- num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
- cgiGetVariable("REMOTE_ADMIN") ? "1" : "0",
- num_settings, &settings);
- num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
- cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0",
- num_settings, &settings);
- num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
- cgiGetVariable("SHARE_PRINTERS") ? "1" : "0",
- num_settings, &settings);
- num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
- cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0",
- num_settings, &settings);
-
-
- if (!_cupsAdminSetServerSettings(http, num_settings, settings))
+ /*
+ * Get the checkbox values from the form...
+ */
+
+ debug_logging = cgiGetVariable("DEBUG_LOGGING") ? "1" : "0";
+ remote_admin = cgiGetVariable("REMOTE_ADMIN") ? "1" : "0";
+ remote_printers = cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0";
+ share_printers = cgiGetVariable("SHARE_PRINTERS") ? "1" : "0";
+ user_cancel_any = cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0";
+
+ /*
+ * Get the current server settings...
+ */
+
+ if (!_cupsAdminGetServerSettings(http, &num_settings, &settings))
{
cgiStartHTML(cgiText(_("Change Settings")));
cgiSetVariable("MESSAGE",
cgiText(_("Unable to change server settings:")));
cgiSetVariable("ERROR", cupsLastErrorString());
cgiCopyTemplateLang("error.tmpl");
+ cgiEndHTML();
+ return;
+ }
+
+ /*
+ * See if the settings have changed...
+ */
+
+ if (strcmp(debug_logging, cupsGetOption(CUPS_SERVER_DEBUG_LOGGING,
+ num_settings, settings)) ||
+ strcmp(remote_admin, cupsGetOption(CUPS_SERVER_REMOTE_ADMIN,
+ num_settings, settings)) ||
+ strcmp(remote_printers, cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS,
+ num_settings, settings)) ||
+ strcmp(share_printers, cupsGetOption(CUPS_SERVER_SHARE_PRINTERS,
+ num_settings, settings)) ||
+ strcmp(user_cancel_any, cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY,
+ num_settings, settings)))
+ {
+ /*
+ * Settings *have* changed, so save the changes...
+ */
+
+ cupsFreeOptions(num_settings, settings);
+
+ num_settings = 0;
+ num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING,
+ debug_logging, num_settings, &settings);
+ num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN,
+ remote_admin, num_settings, &settings);
+ num_settings = cupsAddOption(CUPS_SERVER_REMOTE_PRINTERS,
+ remote_printers, num_settings, &settings);
+ num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
+ share_printers, num_settings, &settings);
+ num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
+ user_cancel_any, num_settings, &settings);
+
+ if (!_cupsAdminSetServerSettings(http, num_settings, settings))
+ {
+ cgiStartHTML(cgiText(_("Change Settings")));
+ cgiSetVariable("MESSAGE",
+ cgiText(_("Unable to change server settings:")));
+ cgiSetVariable("ERROR", cupsLastErrorString());
+ cgiCopyTemplateLang("error.tmpl");
+ }
+ else
+ {
+ cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
+ cgiStartHTML(cgiText(_("Change Settings")));
+ cgiCopyTemplateLang("restart.tmpl");
+ }
}
else
{
+ /*
+ * No changes...
+ */
+
cgiSetVariable("refresh_page", "5;URL=/admin/?OP=redirect");
cgiStartHTML(cgiText(_("Change Settings")));
- cgiCopyTemplateLang("restart.tmpl");
+ cgiCopyTemplateLang("norestart.tmpl");
}
cupsFreeOptions(num_settings, settings);
@@ -2893,5 +2951,5 @@ match_string(const char *a, /* I - First string */
/*
- * End of "$Id: admin.c 5572 2006-05-22 18:47:09Z mike $".
+ * End of "$Id: admin.c 5878 2006-08-24 15:55:42Z mike $".
*/
diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c
index 0b515f123..c312d8bff 100644
--- a/cgi-bin/ipp-var.c
+++ b/cgi-bin/ipp-var.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp-var.c 5572 2006-05-22 18:47:09Z mike $"
+ * "$Id: ipp-var.c 5838 2006-08-17 14:41:42Z mike $"
*
* CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS).
*
@@ -110,6 +110,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
*/
num_attrs = 0;
+ attrs[0] = NULL; /* Eliminate compiler warning */
while ((ch = getc(in)) != EOF)
if (ch == '\\')
@@ -1279,5 +1280,5 @@ cgiText(const char *message) /* I - Message */
/*
- * End of "$Id: ipp-var.c 5572 2006-05-22 18:47:09Z mike $".
+ * End of "$Id: ipp-var.c 5838 2006-08-17 14:41:42Z mike $".
*/
diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4
index 5495beaa0..d8c4d01f2 100644
--- a/config-scripts/cups-common.m4
+++ b/config-scripts/cups-common.m4
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: cups-common.m4 5466 2006-04-26 19:52:27Z mike $"
+dnl "$Id: cups-common.m4 5843 2006-08-17 18:49:31Z 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 Versio number information...
-CUPS_VERSION="1.2svn"
+CUPS_VERSION="1.2.3"
CUPS_REVISION=""
if test -z "$CUPS_REVISION" -a -d .svn; then
CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
@@ -265,5 +265,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
-dnl End of "$Id: cups-common.m4 5466 2006-04-26 19:52:27Z mike $".
+dnl End of "$Id: cups-common.m4 5843 2006-08-17 18:49:31Z mike $".
dnl
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index 6b99cb575..a46cf3835 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: cups-defaults.m4 5745 2006-07-18 13:45:56Z mike $"
+dnl "$Id: cups-defaults.m4 5804 2006-08-04 16:51:58Z mike $"
dnl
dnl Default cupsd configuration settings for the Common UNIX Printing System
dnl (CUPS).
@@ -25,7 +25,9 @@ dnl
dnl Default langugages...
AC_ARG_WITH(languages, [ --with-languages set installed languages, default="de es ja pl sv" ],
- LANGUAGES="$withval",
+ if test "x$withval" != xno; then
+ LANGUAGES="$withval"
+ fi,
LANGUAGES="de es ja pl sv")
AC_SUBST(LANGUAGES)
@@ -248,5 +250,5 @@ fi
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP")
dnl
-dnl End of "$Id: cups-defaults.m4 5745 2006-07-18 13:45:56Z mike $".
+dnl End of "$Id: cups-defaults.m4 5804 2006-08-04 16:51:58Z mike $".
dnl
diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4
index ece2b5820..595512b43 100644
--- a/config-scripts/cups-directories.m4
+++ b/config-scripts/cups-directories.m4
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: cups-directories.m4 5696 2006-06-26 18:34:20Z mike $"
+dnl "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $"
dnl
dnl Directory stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -57,6 +57,15 @@ if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
sharedstatedir="/usr/com"
fi
+dnl Fix "datarootdir" variable if it hasn't been specified...
+if test "$datarootdir" = "\${prefix}/share"; then
+ if test "$prefix" = "/"; then
+ datarootdir="/usr/share"
+ else
+ datarootdir="$prefix/share"
+ fi
+fi
+
dnl Fix "datadir" variable if it hasn't been specified...
if test "$datadir" = "\${prefix}/share"; then
if test "$prefix" = "/"; then
@@ -64,6 +73,8 @@ if test "$datadir" = "\${prefix}/share"; then
else
datadir="$prefix/share"
fi
+elif test "$datadir" = "\${datarootdir}"; then
+ datadir="$datarootdir"
fi
dnl Fix "includedir" variable if it hasn't been specified...
@@ -182,12 +193,15 @@ AC_SUBST(INITDDIR)
dnl Xinetd support...
XINETD=""
-for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
- if test -d $dir; then
- XINETD="$dir"
- break
- fi
-done
+
+if test ! -x /sbin/launchd; then
+ for dir in /private/etc/xinetd.d /etc/xinetd.d /usr/local/etc/xinetd.d; do
+ if test -d $dir; then
+ XINETD="$dir"
+ break
+ fi
+ done
+fi
AC_SUBST(XINETD)
@@ -197,7 +211,7 @@ AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cache
if test x$cachedir = x; then
if test "x$uname" = xDarwin; then
- CUPS_CACHEDIR="$localstatedir/tmp/cups"
+ CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
else
CUPS_CACHEDIR="$localstatedir/cache/cups"
fi
@@ -302,5 +316,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
AC_SUBST(CUPS_STATEDIR)
dnl
-dnl End of "$Id: cups-directories.m4 5696 2006-06-26 18:34:20Z mike $".
+dnl End of "$Id: cups-directories.m4 5905 2006-08-29 20:48:59Z mike $".
dnl
diff --git a/config-scripts/cups-manpages.m4 b/config-scripts/cups-manpages.m4
index 1e6ae44de..41e8190cb 100644
--- a/config-scripts/cups-manpages.m4
+++ b/config-scripts/cups-manpages.m4
@@ -1,9 +1,9 @@
dnl
-dnl "$Id: cups-manpages.m4 5466 2006-04-26 19:52:27Z mike $"
+dnl "$Id: cups-manpages.m4 5799 2006-08-03 00:54:38Z mike $"
dnl
dnl Manpage stuff for the Common UNIX Printing System (CUPS).
dnl
-dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
+dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
@@ -23,6 +23,12 @@ dnl WWW: http://www.cups.org
dnl
dnl Fix "mandir" variable...
+if test "$mandir" = "\${datarootdir}/man" -a "$prefix" = "/"; then
+ # New GNU "standards" break previous ones, so make sure we use
+ # the right default location for the operating system...
+ mandir="\${prefix}/man"
+fi
+
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
case "$uname" in
Darwin* | Linux | GNU | *BSD* | AIX*)
@@ -103,5 +109,5 @@ AC_SUBST(MAN8EXT)
AC_SUBST(MAN8DIR)
dnl
-dnl End of "$Id: cups-manpages.m4 5466 2006-04-26 19:52:27Z mike $".
+dnl End of "$Id: cups-manpages.m4 5799 2006-08-03 00:54:38Z mike $".
dnl
diff --git a/configure.in b/configure.in
index d9e4f6255..07909d7e1 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl
-dnl "$Id: configure.in 5609 2006-05-30 20:31:10Z mike $"
+dnl "$Id: configure.in 5804 2006-08-04 16:51:58Z mike $"
dnl
dnl Configuration script for the Common UNIX Printing System (CUPS).
dnl
@@ -54,9 +54,17 @@ if test "x$LANGUAGES" != x; then
INSTALL_LANGUAGES="install-languages"
UNINSTALL_LANGUAGES="uninstall-languages"
for lang in $LANGUAGES; do
- LANGFILES="$LANGFILES doc/$lang/index.html"
- LANGFILES="$LANGFILES templates/$lang/edit-config.tmpl"
- LANGFILES="$LANGFILES templates/$lang/header.tmpl"
+ if test -f doc/$lang/index.html.in; then
+ LANGFILES="$LANGFILES doc/$lang/index.html"
+ fi
+
+ if test -f templates/$lang/edit-config.tmpl.in; then
+ LANGFILES="$LANGFILES templates/$lang/edit-config.tmpl"
+ fi
+
+ if test -f templates/$lang/header.tmpl.in; then
+ LANGFILES="$LANGFILES templates/$lang/header.tmpl"
+ fi
done
fi
@@ -75,5 +83,5 @@ AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh init/cups-lpd cups-config
chmod +x cups-config
dnl
-dnl End of "$Id: configure.in 5609 2006-05-30 20:31:10Z mike $".
+dnl End of "$Id: configure.in 5804 2006-08-04 16:51:58Z mike $".
dnl
diff --git a/cups-config.in b/cups-config.in
index ef5084a64..81a982b47 100755
--- a/cups-config.in
+++ b/cups-config.in
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# "$Id: cups-config.in 5688 2006-06-23 20:33:08Z mike $"
+# "$Id: cups-config.in 5799 2006-08-03 00:54:38Z mike $"
#
# CUPS configuration utility.
#
@@ -32,6 +32,7 @@ bindir=@bindir@
includedir=@includedir@
libdir=@libdir@
imagelibdir=@libdir@
+datarootdir=@datadir@
datadir=@datadir@
sysconfdir=@sysconfdir@
cups_datadir=@CUPS_DATADIR@
@@ -150,5 +151,5 @@ while test $# -gt 0; do
done
#
-# End of "$Id: cups-config.in 5688 2006-06-23 20:33:08Z mike $".
+# End of "$Id: cups-config.in 5799 2006-08-03 00:54:38Z mike $".
#
diff --git a/cups/Makefile b/cups/Makefile
index 1af69254f..e0064b42e 100644
--- a/cups/Makefile
+++ b/cups/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile 5628 2006-06-05 15:25:23Z mike $"
+# "$Id: Makefile 5801 2006-08-03 02:20:57Z mike $"
#
# API library Makefile for the Common UNIX Printing System (CUPS).
#
@@ -93,6 +93,7 @@ OBJS = \
HEADERS = \
adminutil.h \
array.h \
+ backend.h \
cups.h \
dir.h \
file.h \
@@ -449,5 +450,5 @@ include Dependencies
#
-# End of "$Id: Makefile 5628 2006-06-05 15:25:23Z mike $".
+# End of "$Id: Makefile 5801 2006-08-03 02:20:57Z mike $".
#
diff --git a/cups/adminutil.c b/cups/adminutil.c
index 3825b40bf..710780029 100644
--- a/cups/adminutil.c
+++ b/cups/adminutil.c
@@ -1,5 +1,5 @@
/*
- * "$Id: adminutil.c 5753 2006-07-18 19:53:24Z mike $"
+ * "$Id: adminutil.c 5878 2006-08-24 15:55:42Z mike $"
*
* Administration utility API definitions for the Common UNIX Printing
* System (CUPS).
@@ -103,7 +103,7 @@ cupsAdminCreateWindowsPPD(
linenum; /* Current line number */
time_t curtime; /* Current time */
struct tm *curdate; /* Current date */
- static const char *pattrs[] = /* Printer attributes we want */
+ static const char * const pattrs[] = /* Printer attributes we want */
{
"job-hold-until-supported",
"job-hold-until-default",
@@ -772,19 +772,31 @@ _cupsAdminGetServerSettings(
if (!value)
continue;
- if (!strcasecmp(line, "Port"))
- {
- remote_access = 1;
- }
- else if (!strcasecmp(line, "Listen"))
+ if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen"))
{
char *port; /* Pointer to port number, if any */
if ((port = strrchr(value, ':')) != NULL)
*port = '\0';
+ else if (isdigit(*value & 255))
+ {
+ /*
+ * Listen on a port number implies remote access...
+ */
+
+ remote_access = 1;
+ continue;
+ }
- if (strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1"))
+ if (strcasecmp(value, "localhost") && strcmp(value, "127.0.0.1")
+#ifdef AF_LOCAL
+ && *value != '/'
+#endif /* AF_LOCAL */
+#ifdef AF_INET6
+ && strcmp(value, "::1")
+#endif /* AF_INET6 */
+ )
remote_access = 1;
}
else if (!strcasecmp(line, "Browsing"))
@@ -860,7 +872,14 @@ _cupsAdminGetServerSettings(
in_location = 0;
}
else if (!strcasecmp(line, "Allow") && in_admin_location &&
- strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1"))
+ strcasecmp(value, "localhost") && strcasecmp(value, "127.0.0.1")
+#ifdef AF_LOCAL
+ && *value != '/'
+#endif /* AF_LOCAL */
+#ifdef AF_INET6
+ && strcmp(value, "::1")
+#endif /* AF_INET6 */
+ )
{
remote_admin = 1;
}
@@ -1084,7 +1103,7 @@ _cupsAdminSetServerSettings(
{
cupsFilePuts(temp, "# Only listen for connections from the local "
"machine.\n");
- cupsFilePrintf(temp, "Listen 127.0.0.1:%d\n", ippPort());
+ cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort());
}
#ifdef CUPS_DEFAULT_DOMAINSOCKET
@@ -1440,7 +1459,7 @@ _cupsAdminSetServerSettings(
{
cupsFilePuts(temp,
"# Only listen for connections from the local machine.\n");
- cupsFilePrintf(temp, "Listen 127.0.0.1:%d\n", ippPort());
+ cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort());
}
#ifdef CUPS_DEFAULT_DOMAINSOCKET
@@ -1768,7 +1787,7 @@ get_cupsd_conf(
* Read cupsd.conf via a HTTP GET request...
*/
- if ((fd = cupsTempFd(name, sizeof(name))) < 0)
+ if ((fd = cupsTempFd(name, namesize)) < 0)
{
*name = '\0';
@@ -1929,5 +1948,5 @@ write_option(cups_file_t *dstfp, /* I - PPD file */
/*
- * End of "$Id: adminutil.c 5753 2006-07-18 19:53:24Z mike $".
+ * End of "$Id: adminutil.c 5878 2006-08-24 15:55:42Z mike $".
*/
diff --git a/cups/attr.c b/cups/attr.c
index 96b89ea05..56deac727 100644
--- a/cups/attr.c
+++ b/cups/attr.c
@@ -1,5 +1,5 @@
/*
- * "$Id: attr.c 5119 2006-02-16 15:52:06Z mike $"
+ * "$Id: attr.c 5826 2006-08-15 19:04:11Z mike $"
*
* PPD model-specific attribute routines for the Common UNIX Printing System
* (CUPS).
@@ -44,13 +44,18 @@
* @since CUPS 1.1.19@
*/
-ppd_attr_t * /* O - Attribute or NULL if not found */
-ppdFindAttr(ppd_file_t *ppd, /* I - PPD file data */
- const char *name, /* I - Attribute name */
- const char *spec) /* I - Specifier string or NULL */
+ppd_attr_t * /* O - Attribute or NULL if not found */
+ppdFindAttr(ppd_file_t *ppd, /* I - PPD file data */
+ const char *name, /* I - Attribute name */
+ const char *spec) /* I - Specifier string or NULL */
{
- ppd_attr_t key; /* Search key */
+ ppd_attr_t key, /* Search key */
+ *attr; /* Current attribute */
+ int diff; /* Current difference */
+
+ DEBUG_printf(("ppdFindAttr(ppd=%p, name=\"%s\", spec=\"%s\")\n", ppd,
+ name ? name : "(null)", spec ? spec : "(null)"));
/*
* Range check input...
@@ -72,7 +77,36 @@ ppdFindAttr(ppd_file_t *ppd, /* I - PPD file data */
* Return the first matching attribute, if any...
*/
- return ((ppd_attr_t *)cupsArrayFind(ppd->sorted_attrs, &key));
+ if ((attr = (ppd_attr_t *)cupsArrayFind(ppd->sorted_attrs, &key)) != NULL)
+ return (attr);
+ else if (spec)
+ return (NULL);
+
+ /*
+ * No match found, loop through the sorted attributes to see if we can
+ * find a "wildcard" match for the attribute...
+ */
+
+ for (attr = (ppd_attr_t *)cupsArrayFirst(ppd->sorted_attrs);
+ attr;
+ attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs))
+ {
+ if ((diff = strcasecmp(attr->name, name)) == 0)
+ break;
+
+ if (diff > 0)
+ {
+ /*
+ * All remaining attributes are > than the one we are trying to find...
+ */
+
+ cupsArrayIndex(ppd->sorted_attrs, cupsArrayCount(ppd->sorted_attrs));
+
+ return (NULL);
+ }
+ }
+
+ return (attr);
}
@@ -129,5 +163,5 @@ ppdFindNextAttr(ppd_file_t *ppd, /* I - PPD file data */
/*
- * End of "$Id: attr.c 5119 2006-02-16 15:52:06Z mike $".
+ * End of "$Id: attr.c 5826 2006-08-15 19:04:11Z mike $".
*/
diff --git a/cups/cups.h b/cups/cups.h
index 64b389a08..c74e52209 100644
--- a/cups/cups.h
+++ b/cups/cups.h
@@ -1,5 +1,5 @@
/*
- * "$Id: cups.h 5233 2006-03-06 03:39:28Z mike $"
+ * "$Id: cups.h 5805 2006-08-04 16:52:31Z mike $"
*
* API definitions for the Common UNIX Printing System (CUPS).
*
@@ -61,10 +61,10 @@ extern "C" {
* Constants...
*/
-# define CUPS_VERSION 1.0200
+# define CUPS_VERSION 1.0203
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 2
-# define CUPS_VERSION_PATCH 0
+# define CUPS_VERSION_PATCH 3
# define CUPS_DATE_ANY -1
@@ -244,5 +244,5 @@ extern cups_file_t *cupsTempFile2(char *filename, int len);
#endif /* !_CUPS_CUPS_H_ */
/*
- * End of "$Id: cups.h 5233 2006-03-06 03:39:28Z mike $".
+ * End of "$Id: cups.h 5805 2006-08-04 16:52:31Z mike $".
*/
diff --git a/cups/dir.h b/cups/dir.h
index 0fd52e8f1..ac5c5fc08 100644
--- a/cups/dir.h
+++ b/cups/dir.h
@@ -5,7 +5,7 @@
*
* This set of APIs abstracts enumeration of directory entries.
*
- * Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2006 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
@@ -39,9 +39,9 @@
* C++ magic...
*/
-# ifdef _cplusplus
+# ifdef __cplusplus
extern "C" {
-# endif /* _cplusplus */
+# endif /* __cplusplus */
/*
@@ -67,9 +67,9 @@ extern cups_dentry_t *cupsDirRead(cups_dir_t *dp);
extern void cupsDirRewind(cups_dir_t *dp);
-# ifdef _cplusplus
+# ifdef __cplusplus
}
-# endif /* _cplusplus */
+# endif /* __cplusplus */
#endif /* !_CUPS_DIR_H_ */
/*
diff --git a/cups/file.c b/cups/file.c
index a5c1372f5..246972d76 100644
--- a/cups/file.c
+++ b/cups/file.c
@@ -1,5 +1,5 @@
/*
- * "$Id: file.c 5324 2006-03-23 16:47:46Z mike $"
+ * "$Id: file.c 5812 2006-08-09 22:42:51Z mike $"
*
* File functions for the Common UNIX Printing System (CUPS).
*
@@ -1260,6 +1260,7 @@ cupsFileRewind(cups_file_t *fp) /* I - CUPS file */
fp->pos = 0;
fp->ptr = NULL;
fp->end = NULL;
+ fp->eof = 0;
return (0);
}
@@ -2080,5 +2081,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
/*
- * End of "$Id: file.c 5324 2006-03-23 16:47:46Z mike $".
+ * End of "$Id: file.c 5812 2006-08-09 22:42:51Z mike $".
*/
diff --git a/cups/file.h b/cups/file.h
index 24649147b..b36aa0577 100644
--- a/cups/file.h
+++ b/cups/file.h
@@ -1,5 +1,5 @@
/*
- * "$Id: file.h 5319 2006-03-21 15:28:29Z mike $"
+ * "$Id: file.h 5769 2006-07-20 17:17:14Z mike $"
*
* Public file definitions for the Common UNIX Printing System (CUPS).
*
@@ -8,7 +8,7 @@
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
- * Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2006 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
@@ -47,9 +47,9 @@ typedef off_t ssize_t; /* @private@ */
* C++ magic...
*/
-# ifdef _cplusplus
+# ifdef __cplusplus
extern "C" {
-# endif /* _cplusplus */
+# endif /* __cplusplus */
/*
@@ -103,11 +103,11 @@ extern int cupsFileUnlock(cups_file_t *fp);
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes);
-# ifdef _cplusplus
+# ifdef __cplusplus
}
-# endif /* _cplusplus */
+# endif /* __cplusplus */
#endif /* !_CUPS_FILE_H_ */
/*
- * End of "$Id: file.h 5319 2006-03-21 15:28:29Z mike $".
+ * End of "$Id: file.h 5769 2006-07-20 17:17:14Z mike $".
*/
diff --git a/cups/http.c b/cups/http.c
index 84e204620..504be39cf 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -1,5 +1,5 @@
/*
- * "$Id: http.c 5753 2006-07-18 19:53:24Z mike $"
+ * "$Id: http.c 5889 2006-08-24 21:44:35Z mike $"
*
* HTTP routines for the Common UNIX Printing System (CUPS).
*
@@ -1100,15 +1100,20 @@ httpPrintf(http_t *http, /* I - HTTP connection */
DEBUG_printf(("httpPrintf: %s", buf));
- if (http->wused)
+ if (http->data_encoding == HTTP_ENCODE_FIELDS)
+ return (httpWrite2(http, buf, bytes));
+ else
{
- DEBUG_puts(" flushing existing data...");
+ if (http->wused)
+ {
+ DEBUG_puts(" flushing existing data...");
- if (httpFlushWrite(http) < 0)
- return (-1);
- }
+ if (httpFlushWrite(http) < 0)
+ return (-1);
+ }
- return (http_write(http, buf, bytes));
+ return (http_write(http, buf, bytes));
+ }
}
@@ -1888,7 +1893,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */
httpFlushWrite(http);
}
- if ((length + http->wused) <= sizeof(http->wbuffer))
+ if ((length + http->wused) < sizeof(http->wbuffer))
{
/*
* Write to buffer...
@@ -2154,11 +2159,20 @@ http_send(http_t *http, /* I - HTTP connection */
if (httpReconnect(http))
return (-1);
+ /*
+ * Flush any written data that is pending...
+ */
+
+ if (http->wused)
+ httpFlushWrite(http);
+
/*
* Send the request header...
*/
- http->state = request;
+ http->state = request;
+ http->data_encoding = HTTP_ENCODE_FIELDS;
+
if (request == HTTP_POST || request == HTTP_PUT)
http->state ++;
@@ -2211,6 +2225,7 @@ http_send(http_t *http, /* I - HTTP connection */
return (-1);
}
+ httpFlushWrite(http);
httpGetLength2(http);
httpClearFields(http);
@@ -2811,5 +2826,5 @@ http_write_ssl(http_t *http, /* I - HTTP connection */
/*
- * End of "$Id: http.c 5753 2006-07-18 19:53:24Z mike $".
+ * End of "$Id: http.c 5889 2006-08-24 21:44:35Z mike $".
*/
diff --git a/cups/http.h b/cups/http.h
index 6303af452..2f8a28d73 100644
--- a/cups/http.h
+++ b/cups/http.h
@@ -1,5 +1,5 @@
/*
- * "$Id: http.h 5716 2006-07-11 17:56:57Z mike $"
+ * "$Id: http.h 5889 2006-08-24 21:44:35Z mike $"
*
* Hyper-Text Transport Protocol definitions for the Common UNIX Printing
* System (CUPS).
@@ -39,8 +39,8 @@
# include
# include
# else
-# ifdef __sgi /* IRIX needs this for IPv6 support!?! */
-# define INET6
+# ifdef __sgi
+# define INET6 /* IRIX IPv6 support... */
# endif /* __sgi */
# include
# include
@@ -53,6 +53,9 @@
# if !defined(__APPLE__) || !defined(TCP_NODELAY)
# include
# endif /* !__APPLE__ || !TCP_NODELAY */
+# if defined(AF_UNIX) && !defined(AF_LOCAL)
+# define AF_LOCAL AF_UNIX /* Older UNIX's have old names... */
+# endif /* AF_UNIX && !AF_LOCAL */
# ifdef AF_LOCAL
# include
# endif /* AF_LOCAL */
@@ -139,7 +142,8 @@ typedef enum http_auth_e /**** HTTP authentication types ****/
typedef enum http_encoding_e /**** HTTP transfer encoding values ****/
{
HTTP_ENCODE_LENGTH, /* Data is sent with Content-Length */
- HTTP_ENCODE_CHUNKED /* Data is chunked */
+ HTTP_ENCODE_CHUNKED, /* Data is chunked */
+ HTTP_ENCODE_FIELDS /* Sending HTTP fields */
} http_encoding_t;
typedef enum http_encryption_e /**** HTTP encryption values ****/
@@ -504,5 +508,5 @@ extern ssize_t httpWrite2(http_t *http, const char *buffer,
#endif /* !_CUPS_HTTP_H_ */
/*
- * End of "$Id: http.h 5716 2006-07-11 17:56:57Z mike $".
+ * End of "$Id: http.h 5889 2006-08-24 21:44:35Z mike $".
*/
diff --git a/cups/i18n.h b/cups/i18n.h
index 58de0eae5..14a5c1dd5 100644
--- a/cups/i18n.h
+++ b/cups/i18n.h
@@ -1,5 +1,5 @@
/*
- * "$Id: i18n.h 5366 2006-04-02 16:11:04Z mike $"
+ * "$Id: i18n.h 5833 2006-08-16 20:05:58Z mike $"
*
* (Private) localization support for the Common UNIX Printing System (CUPS).
*
@@ -105,6 +105,7 @@ extern const char *_cupsLangString(cups_lang_t *lang, const char *message);
extern void _cupsMessageFree(cups_array_t *a);
extern cups_array_t *_cupsMessageLoad(const char *filename);
extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
+extern void _cupsSetLocale(void);
# ifdef __cplusplus
}
@@ -113,5 +114,5 @@ extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
#endif /* !_CUPS_I18N_H_ */
/*
- * End of "$Id: i18n.h 5366 2006-04-02 16:11:04Z mike $".
+ * End of "$Id: i18n.h 5833 2006-08-16 20:05:58Z mike $".
*/
diff --git a/cups/ipp-support.c b/cups/ipp-support.c
index fef06af1c..d4911d60c 100644
--- a/cups/ipp-support.c
+++ b/cups/ipp-support.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp-support.c 5246 2006-03-08 13:22:09Z mike $"
+ * "$Id: ipp-support.c 5905 2006-08-29 20:48:59Z mike $"
*
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
@@ -304,19 +304,48 @@ ippPort(void)
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
+ DEBUG_puts("ippPort()");
+
+ if (!cg->ipp_port)
+ {
+ /*
+ * See if the server definition includes the port number...
+ */
+
+ DEBUG_puts("ippPort: Not initialized...");
+
+ cupsServer();
+
+#ifdef DEBUG
+ if (cg->ipp_port)
+ puts("ippPort: Set via cupsServer()...");
+#endif /* DEBUG */
+ }
+
if (!cg->ipp_port)
{
if ((ipp_port = getenv("IPP_PORT")) != NULL)
+ {
+ DEBUG_puts("ippPort: Set via IPP_PORT...");
portnum = atoi(ipp_port);
+ }
else if ((port = getservbyname("ipp", NULL)) == NULL)
+ {
+ DEBUG_puts("ippPort: Set via CUPS_DEFAULT_IPP_PORT...");
portnum = CUPS_DEFAULT_IPP_PORT;
+ }
else
+ {
+ DEBUG_puts("ippPort: Set via ipp service entry...");
portnum = ntohs(port->s_port);
+ }
if (portnum > 0)
cg->ipp_port = portnum;
}
+ DEBUG_printf(("ippPort: Returning %d...\n", cg->ipp_port));
+
return (cg->ipp_port);
}
@@ -328,10 +357,12 @@ ippPort(void)
void
ippSetPort(int p) /* I - Port number to use */
{
+ DEBUG_printf(("ippSetPort(p=%d)\n", p));
+
_cupsGlobals()->ipp_port = p;
}
/*
- * End of "$Id: ipp-support.c 5246 2006-03-08 13:22:09Z mike $".
+ * End of "$Id: ipp-support.c 5905 2006-08-29 20:48:59Z mike $".
*/
diff --git a/cups/ipp.h b/cups/ipp.h
index 6435a0eca..32b578fc7 100644
--- a/cups/ipp.h
+++ b/cups/ipp.h
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp.h 5138 2006-02-21 10:49:06Z mike $"
+ * "$Id: ipp.h 5878 2006-08-24 15:55:42Z mike $"
*
* Internet Printing Protocol definitions for the Common UNIX Printing
* System (CUPS).
@@ -172,10 +172,11 @@ typedef enum ipp_jstate_e /**** Job States.... */
IPP_JOB_HELD, /* Job is held for printing */
IPP_JOB_PROCESSING, /* Job is currently printing */
IPP_JOB_STOPPED, /* Job has been stopped */
- IPP_JOB_CANCELLED, /* Job has been cancelled */
+ IPP_JOB_CANCELED, /* Job has been canceled */
IPP_JOB_ABORTED, /* Job has aborted due to error */
IPP_JOB_COMPLETED /* Job has completed successfully */
} ipp_jstate_t;
+#define IPP_JOB_CANCELLED IPP_JOB_CANCELED
typedef enum ipp_pstate_e /**** Printer States.... */
{
@@ -304,10 +305,11 @@ typedef enum ipp_status_e /**** IPP status codes... ****/
IPP_TEMPORARY_ERROR, /* server-error-temporary-error */
IPP_NOT_ACCEPTING, /* server-error-not-accepting-jobs */
IPP_PRINTER_BUSY, /* server-error-busy */
- IPP_ERROR_JOB_CANCELLED, /* server-error-job-canceled */
+ IPP_ERROR_JOB_CANCELED, /* server-error-job-canceled */
IPP_MULTIPLE_JOBS_NOT_SUPPORTED, /* server-error-multiple-document-jobs-not-supported */
IPP_PRINTER_IS_DEACTIVATED /* server-error-printer-is-deactivated */
} ipp_status_t;
+#define IPP_ERROR_JOB_CANCELLED IPP_ERROR_JOB_CANCELED
typedef unsigned char ipp_uchar_t; /**** Unsigned 8-bit integer/character ****/
@@ -497,5 +499,5 @@ extern ipp_state_t ippWriteIO(void *dst, ipp_iocb_t cb, int blocking,
#endif /* !_CUPS_IPP_H_ */
/*
- * End of "$Id: ipp.h 5138 2006-02-21 10:49:06Z mike $".
+ * End of "$Id: ipp.h 5878 2006-08-24 15:55:42Z mike $".
*/
diff --git a/cups/langprintf.c b/cups/langprintf.c
index 4430c6792..909692347 100644
--- a/cups/langprintf.c
+++ b/cups/langprintf.c
@@ -1,5 +1,5 @@
/*
- * "$Id: langprintf.c 4924 2006-01-13 01:55:20Z mike $"
+ * "$Id: langprintf.c 5833 2006-08-16 20:05:58Z mike $"
*
* Localized printf/puts functions for the Common UNIX Printing
* System (CUPS).
@@ -28,6 +28,7 @@
*
* _cupsLangPrintf() - Print a formatted message string to a file.
* _cupsLangPuts() - Print a static message string to a file.
+ * _cupsSetLocale() - Set the current locale.
*/
/*
@@ -139,5 +140,50 @@ _cupsLangPuts(FILE *fp, /* I - File to write to */
/*
- * End of "$Id: langprintf.c 4924 2006-01-13 01:55:20Z mike $".
+ * '_cupsSetLocale()' - Set the current locale.
+ */
+
+void
+_cupsSetLocale(void)
+{
+#ifdef LC_TIME
+ const char *lc_time; /* Current LC_TIME value */
+ char new_lc_time[255], /* New LC_TIME value */
+ *charset; /* Pointer to character set */
+#endif /* LC_TIME */
+
+
+ /*
+ * Set the locale so that times, etc. are displayed properly.
+ *
+ * Unfortunately, while we need the localized time value, we *don't*
+ * want to use the localized charset for the time value, so we need
+ * to set LC_TIME to the locale name with .UTF-8 on the end (if
+ * the locale includes a character set specifier...)
+ */
+
+ setlocale(LC_ALL, "");
+
+#ifdef LC_TIME
+ if ((lc_time = setlocale(LC_TIME, NULL)) == NULL)
+ lc_time = setlocale(LC_ALL, NULL);
+
+ if (lc_time)
+ {
+ strlcpy(new_lc_time, lc_time, sizeof(new_lc_time));
+ if ((charset = strchr(new_lc_time, '.')) == NULL)
+ charset = new_lc_time + strlen(new_lc_time);
+
+ strlcpy(charset, ".UTF-8", sizeof(new_lc_time) - (charset - new_lc_time));
+ }
+ else
+ strcpy(new_lc_time, "C");
+
+ setlocale(LC_TIME, new_lc_time);
+#endif /* LC_TIME */
+}
+
+
+/*
+ * End of "$Id: langprintf.c 5833 2006-08-16 20:05:58Z mike $".
*/
diff --git a/cups/language.c b/cups/language.c
index b74738dbf..d46c9fea9 100644
--- a/cups/language.c
+++ b/cups/language.c
@@ -1,5 +1,5 @@
/*
- * "$Id: language.c 5753 2006-07-18 19:53:24Z mike $"
+ * "$Id: language.c 5769 2006-07-20 17:17:14Z mike $"
*
* I18N/language support for the Common UNIX Printing System (CUPS).
*
@@ -1288,6 +1288,8 @@ cups_unquote(char *d, /* O - Unquoted string */
*d = *d * 8 + *s - '0';
s ++;
}
+
+ d ++;
}
else
{
@@ -1312,5 +1314,5 @@ cups_unquote(char *d, /* O - Unquoted string */
/*
- * End of "$Id: language.c 5753 2006-07-18 19:53:24Z mike $".
+ * End of "$Id: language.c 5769 2006-07-20 17:17:14Z mike $".
*/
diff --git a/cups/libcups_s.exp b/cups/libcups_s.exp
index a7afc43d1..cad2f10af 100644
--- a/cups/libcups_s.exp
+++ b/cups/libcups_s.exp
@@ -16,6 +16,7 @@ _cupsMessageFree
_cupsMessageLoad
_cupsMessageLookup
_cupsSetError
+_cupsSetLocale
_cupsStrAlloc
_cupsStrFlush
_cupsStrFormatd
diff --git a/cups/localize.c b/cups/localize.c
index b07609bbb..c2be099b4 100644
--- a/cups/localize.c
+++ b/cups/localize.c
@@ -1,5 +1,5 @@
/*
- * "$Id: localize.c 5391 2006-04-14 12:26:50Z mike $"
+ * "$Id: localize.c 5826 2006-08-15 19:04:11Z mike $"
*
* PPD custom option routines for the Common UNIX Printing System (CUPS).
*
@@ -80,6 +80,8 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */
* Range check input...
*/
+ DEBUG_printf(("ppdLocalize(ppd=%p)\n", ppd));
+
if (!ppd)
return (-1);
@@ -93,6 +95,9 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */
strlcpy(ll_CC, lang->language, sizeof(ll_CC));
strlcpy(ll, lang->language, sizeof(ll));
+ DEBUG_printf((" lang->language=\"%s\", ll=\"%s\", ll_CC=\"%s\"...\n",
+ lang->language, ll, ll_CC));
+
/*
* Now lookup all of the groups, options, choices, etc.
*/
@@ -165,17 +170,29 @@ ppd_text(ppd_file_t *ppd, /* I - PPD file */
ppd_attr_t *attr; /* Current attribute */
+ DEBUG_printf(("ppd_text(ppd=%p, keyword=\"%s\", spec=\"%s\", "
+ "ll_CC=\"%s\", ll=\"%s\")\n",
+ ppd, keyword, spec, ll_CC, ll));
+
/*
* Look for Keyword.ll_CC, then Keyword.ll...
*/
- snprintf(lkeyword, sizeof(lkeyword), "%s.%s", keyword, ll_CC);
+ snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll_CC, keyword);
if ((attr = ppdFindAttr(ppd, lkeyword, spec)) == NULL)
{
- snprintf(lkeyword, sizeof(lkeyword), "%s.%s", keyword, ll);
+ snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll, keyword);
attr = ppdFindAttr(ppd, lkeyword, spec);
}
+#ifdef DEBUG
+ if (attr)
+ printf(" *%s %s/%s: \"%s\"\n", attr->name, attr->spec, attr->text,
+ attr->value ? attr->value : "");
+ else
+ puts(" NOT FOUND");
+#endif /* DEBUG */
+
/*
* Return text if we find it...
*/
@@ -185,5 +202,5 @@ ppd_text(ppd_file_t *ppd, /* I - PPD file */
/*
- * End of "$Id: localize.c 5391 2006-04-14 12:26:50Z mike $".
+ * End of "$Id: localize.c 5826 2006-08-15 19:04:11Z mike $".
*/
diff --git a/cups/notify.c b/cups/notify.c
index 2a89aca3c..752056636 100644
--- a/cups/notify.c
+++ b/cups/notify.c
@@ -1,5 +1,5 @@
/*
- * "$Id: notify.c 4961 2006-01-20 22:19:13Z mike $"
+ * "$Id: notify.c 5878 2006-08-24 15:55:42Z mike $"
*
* Notification routines for the Common UNIX Printing System (CUPS).
*
@@ -104,7 +104,7 @@ cupsNotifySubject(cups_lang_t *lang, /* I - Language data */
case IPP_JOB_STOPPED :
state = _cupsLangString(lang, _("stopped"));
break;
- case IPP_JOB_CANCELLED :
+ case IPP_JOB_CANCELED :
state = _cupsLangString(lang, _("canceled"));
break;
case IPP_JOB_ABORTED :
@@ -207,5 +207,5 @@ cupsNotifyText(cups_lang_t *lang, /* I - Language data */
/*
- * End of "$Id: notify.c 4961 2006-01-20 22:19:13Z mike $".
+ * End of "$Id: notify.c 5878 2006-08-24 15:55:42Z mike $".
*/
diff --git a/cups/ppd.c b/cups/ppd.c
index 540b14a8d..15abaa807 100644
--- a/cups/ppd.c
+++ b/cups/ppd.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ppd.c 5333 2006-03-24 00:52:21Z mike $"
+ * "$Id: ppd.c 5826 2006-08-15 19:04:11Z mike $"
*
* PPD file routines for the Common UNIX Printing System (CUPS).
*
@@ -2037,10 +2037,8 @@ ppd_compare_attrs(ppd_attr_t *a, /* I - First attribute */
if ((ret = strcasecmp(a->name, b->name)) != 0)
return (ret);
- else if (a->spec[0] && b->spec[0])
- return (strcasecmp(a->spec, b->spec));
else
- return (0);
+ return (strcasecmp(a->spec, b->spec));
}
@@ -2938,5 +2936,5 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
/*
- * End of "$Id: ppd.c 5333 2006-03-24 00:52:21Z mike $".
+ * End of "$Id: ppd.c 5826 2006-08-15 19:04:11Z mike $".
*/
diff --git a/cups/testi18n.c b/cups/testi18n.c
index 0fc439793..32e2e50b9 100644
--- a/cups/testi18n.c
+++ b/cups/testi18n.c
@@ -1,5 +1,5 @@
/*
- * "$Id: testi18n.c 5444 2006-04-20 18:16:54Z mike $"
+ * "$Id: testi18n.c 5838 2006-08-17 14:41:42Z mike $"
*
* Internationalization test for Common UNIX Printing System (CUPS).
*
@@ -82,7 +82,6 @@ main(int argc, /* I - Argument Count */
/* "A != ." - use Windows 950 (Big5) or EUC-TW */
cups_utf8_t utf8dest[1024]; /* UTF-8 destination string */
cups_utf32_t utf32dest[1024]; /* UTF-32 destination string */
- _cups_vmap_t *vmap; /* VBCS charmap pointer */
/*
@@ -190,7 +189,7 @@ main(int argc, /* I - Argument Count */
fputs("_cupsCharmapGet(CUPS_EUC_JP): ", stdout);
- if ((vmap = (_cups_vmap_t *)_cupsCharmapGet(CUPS_EUC_JP)) == NULL)
+ if (!_cupsCharmapGet(CUPS_EUC_JP))
{
errors ++;
puts("FAIL");
@@ -204,7 +203,7 @@ main(int argc, /* I - Argument Count */
fputs("_cupsCharmapGet(CUPS_EUC_TW): ", stdout);
- if ((vmap = (_cups_vmap_t *)_cupsCharmapGet(CUPS_EUC_TW)) == NULL)
+ if (!_cupsCharmapGet(CUPS_EUC_TW))
{
errors ++;
puts("FAIL");
@@ -556,5 +555,5 @@ print_utf8(const char *msg, /* I - Message String */
/*
- * End of "$Id: testi18n.c 5444 2006-04-20 18:16:54Z mike $"
+ * End of "$Id: testi18n.c 5838 2006-08-17 14:41:42Z mike $"
*/
diff --git a/cups/testppd.c b/cups/testppd.c
index bdaf944a4..37032ff62 100644
--- a/cups/testppd.c
+++ b/cups/testppd.c
@@ -1,5 +1,5 @@
/*
- * "$Id: testppd.c 5700 2006-06-26 19:20:39Z mike $"
+ * "$Id: testppd.c 5826 2006-08-15 19:04:11Z mike $"
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
@@ -192,10 +192,18 @@ main(int argc, /* I - Number of command-line arguments */
else
{
int i, j, k; /* Looping vars */
+ ppd_attr_t *attr; /* Current attribute */
ppd_group_t *group; /* Option group */
ppd_option_t *option; /* Option */
+ char lang[255]; /* LANG environment variable */
+ if (argc > 2)
+ {
+ snprintf(lang, sizeof(lang), "LANG=%s", argv[2]);
+ putenv(lang);
+ }
+
ppdLocalize(ppd);
for (i = ppd->num_groups, group = ppd->groups;
@@ -203,7 +211,7 @@ main(int argc, /* I - Number of command-line arguments */
i --, group ++)
{
printf("%s (%s):\n", group->name, group->text);
-
+
for (j = group->num_options, option = group->options;
j > 0;
j --, option ++)
@@ -215,6 +223,14 @@ main(int argc, /* I - Number of command-line arguments */
option->choices[k].text);
}
}
+
+ puts("Attributes:");
+
+ for (attr = (ppd_attr_t *)cupsArrayFirst(ppd->sorted_attrs);
+ attr;
+ attr = (ppd_attr_t *)cupsArrayNext(ppd->sorted_attrs))
+ printf(" *%s %s/%s: \"%s\"\n", attr->name, attr->spec,
+ attr->text, attr->value ? attr->value : "");
}
}
@@ -223,5 +239,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
- * End of "$Id: testppd.c 5700 2006-06-26 19:20:39Z mike $".
+ * End of "$Id: testppd.c 5826 2006-08-15 19:04:11Z mike $".
*/
diff --git a/cups/transcode.c b/cups/transcode.c
index c7384d9cb..40bf2f054 100644
--- a/cups/transcode.c
+++ b/cups/transcode.c
@@ -1,5 +1,5 @@
/*
- * "$Id: transcode.c 5373 2006-04-06 20:03:32Z mike $"
+ * "$Id: transcode.c 5838 2006-08-17 14:41:42Z mike $"
*
* Transcoding support for the Common UNIX Printing System (CUPS).
*
@@ -408,7 +408,6 @@ cupsUTF8ToUTF32(
const cups_utf8_t *src, /* I - Source string */
const int maxout) /* I - Max output */
{
- size_t srclen; /* Source string length */
int i; /* Looping variable */
cups_utf8_t ch; /* Character value */
cups_utf8_t next; /* Next character value */
@@ -430,7 +429,6 @@ cupsUTF8ToUTF32(
*/
*dest++ = 0xfeff;
- srclen = strlen((char *)src);
for (i = maxout - 1; *src && i > 0; i --)
{
@@ -1142,7 +1140,7 @@ free_vbcs_charmap(_cups_vmap_t *vmap) /* I - Character set */
*/
-void * /* O - Charset map pointer */
+static void * /* O - Charset map pointer */
get_charmap(
const cups_encoding_t encoding) /* I - Encoding */
{
@@ -1585,5 +1583,5 @@ get_vbcs_charmap(
/*
- * End of "$Id: transcode.c 5373 2006-04-06 20:03:32Z mike $"
+ * End of "$Id: transcode.c 5838 2006-08-17 14:41:42Z mike $"
*/
diff --git a/cups/usersys.c b/cups/usersys.c
index b75dc3790..7c9a8a848 100644
--- a/cups/usersys.c
+++ b/cups/usersys.c
@@ -1,5 +1,5 @@
/*
- * "$Id: usersys.c 5182 2006-02-26 04:10:27Z mike $"
+ * "$Id: usersys.c 5902 2006-08-29 15:51:19Z mike $"
*
* User, system, and password routines for the Common UNIX Printing
* System (CUPS).
@@ -49,6 +49,7 @@
#ifdef WIN32
# include
#endif /* WIN32 */
+#include "debug.h"
/*
@@ -224,15 +225,21 @@ cupsServer(void)
linenum = 0;
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum) != NULL)
+ {
+ DEBUG_printf(("cupsServer: %d: %s %s\n", linenum, line,
+ value ? value : "(null)"));
+
if (!strcasecmp(line, "ServerName") && value)
{
/*
* Got it!
*/
+ DEBUG_puts("cupsServer: Got a ServerName line!");
server = value;
break;
}
+ }
cupsFileClose(fp);
}
@@ -242,6 +249,8 @@ cupsServer(void)
* Copy the server name over and set the port number, if any...
*/
+ DEBUG_printf(("cupsServer: Using server \"%s\"...\n", server));
+
strlcpy(cg->server, server, sizeof(cg->server));
if (cg->server[0] != '/' && (port = strrchr(cg->server, ':')) != NULL &&
@@ -249,6 +258,7 @@ cupsServer(void)
{
*port++ = '\0';
+ DEBUG_printf(("cupsServer: Using port %d...\n", atoi(port)));
ippSetPort(atoi(port));
}
@@ -471,11 +481,17 @@ cups_open_client_conf(void)
snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home);
if ((fp = cupsFileOpen(filename, "r")) != NULL)
+ {
+ DEBUG_printf(("cups_open_client_conf: Using \"%s\"...\n", filename));
return (fp);
+ }
snprintf(filename, sizeof(filename), "%s/.cupsrc", home);
if ((fp = cupsFileOpen(filename, "r")) != NULL)
+ {
+ DEBUG_printf(("cups_open_client_conf: Using \"%s\"...\n", filename));
return (fp);
+ }
}
snprintf(filename, sizeof(filename), "%s/client.conf", cg->cups_serverroot);
@@ -484,5 +500,5 @@ cups_open_client_conf(void)
/*
- * End of "$Id: usersys.c 5182 2006-02-26 04:10:27Z mike $".
+ * End of "$Id: usersys.c 5902 2006-08-29 15:51:19Z mike $".
*/
diff --git a/desktop/cups.desktop b/desktop/cups.desktop
index a273a579f..a632eb793 100644
--- a/desktop/cups.desktop
+++ b/desktop/cups.desktop
@@ -1,14 +1,10 @@
[Desktop Entry]
Categories=Application;System;X-Red-Hat-Base;
-Comment=CUPS Web Interface
-Comment[en_US]=CUPS Web Interface
Encoding=UTF-8
Exec=htmlview http://localhost:631/
GenericName=
-GenericName[en_US]=
Icon=cups
MimeType=
-Name=Manage Printing
Path=
StartupNotify=false
Terminal=false
@@ -17,5 +13,11 @@ Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=
+Name=Manage Printing
+Name[en_US]=Manage Printing
+Comment=CUPS Web Interface
+Comment[en_US]=CUPS Web Interface
Name[es]=Administrar impresión
Comment[es]=Interfaz Web de CUPS
+Name[pl]=Zarządzanie drukowaniem
+Comment[pl]=Interfejs WWW CUPS
diff --git a/doc/help/ref-snmp-conf.html b/doc/help/ref-snmp-conf.html
index 92d8f375a..e3047f24b 100644
--- a/doc/help/ref-snmp-conf.html
+++ b/doc/help/ref-snmp-conf.html
@@ -96,5 +96,22 @@ addresses are converted to hostnames or left as numeric IP addresses.
The default setting is off.
+
+
+Examples
+
+
+MaxRunTime 10
+MaxRunTime 300
+
+
+Description
+
+The MaxRunTime
directive specifies the maxium
+number of seconds that the SNMP backend will spend looking for
+printer devices on the network.
+
+The default setting is 10.
+