From 229681c188bf1940a4963a5796df4be65bb00825 Mon Sep 17 00:00:00 2001
From: msweet
Date: Fri, 3 Dec 2010 06:58:01 +0000
Subject: [PATCH] Merge changes from CUPS 1.5svn-r9400
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2890 a1ca3aef-8c08-0410-bb20-df032aa958be
---
CHANGES-1.4.txt | 10 +
CHANGES.txt | 4 +-
Makefile | 2 +
backend/snmp-supplies.c | 36 ++-
conf/cupsd.conf.in | 3 +
config-scripts/cups-common.m4 | 6 +
config-scripts/cups-defaults.m4 | 25 ++
config.h.in | 16 +-
cups/http-support.c | 3 +
cups/http.h | 3 +-
doc/help/ref-cupsd-conf.html.in | 13 ++
filter/bannertops.c | 2 +-
filter/pstext.c | 4 +-
filter/pstops.c | 10 +-
filter/texttops.c | 4 +-
locale/Makefile | 17 +-
man/cupsd.conf.man.in | 5 +
scheduler/client.c | 107 ++++++++-
scheduler/conf.c | 4 +-
scheduler/conf.h | 4 +-
scheduler/ipp.c | 400 ++++++++++++++++++++++++++++----
scheduler/job.c | 2 +-
systemv/lpstat.c | 43 ++--
23 files changed, 621 insertions(+), 102 deletions(-)
diff --git a/CHANGES-1.4.txt b/CHANGES-1.4.txt
index 2dfb2c414..97ccb0631 100644
--- a/CHANGES-1.4.txt
+++ b/CHANGES-1.4.txt
@@ -1,6 +1,16 @@
CHANGES-1.4.txt
---------------
+CHANGES IN CUPS V1.4.7
+
+ - The scheduler did not always show the most recent status message from
+ the print filters (STR #3731)
+ - The PostScript filter did not apply the mirror and number-up options
+ properly, leading to offset and clipped output (STR #3732)
+ - The network backends always reported "low toner" or "out of toner"
+ states, even for inkjet printers (STR #3733)
+
+
CHANGES IN CUPS V1.4.6
- Regression: The pstops filter did not support landscape printing of
diff --git a/CHANGES.txt b/CHANGES.txt
index 008b91b37..66066105b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,8 +1,10 @@
-CHANGES.txt - 2010-11-05
+CHANGES.txt - 2010-12-01
------------------------
CHANGES IN CUPS V1.5b1
+ - The web interface can now be disabled using the WebInterface directive
+ in cupsd.conf (STR #2625)
- The scheduler now provides privacy controls for jobs and subscriptions
(STR #2969)
- Added new cupsArrayNew3 API which offers memory management of array
diff --git a/Makefile b/Makefile
index d2dafad75..3babe2cc3 100644
--- a/Makefile
+++ b/Makefile
@@ -160,6 +160,8 @@ install: install-data install-headers install-libs install-exec
#
install-data:
+ echo Making all in cups...
+ (cd cups; $(MAKE) $(MFLAGS) all)
for dir in $(DIRS); do\
echo Installing data files in $$dir... ;\
(cd $$dir; $(MAKE) $(MFLAGS) install-data) || exit 1;\
diff --git a/backend/snmp-supplies.c b/backend/snmp-supplies.c
index 8ee031d69..af2ba7d95 100644
--- a/backend/snmp-supplies.c
+++ b/backend/snmp-supplies.c
@@ -66,7 +66,9 @@ static http_addr_t current_addr; /* Current address */
static int current_state = -1;
/* Current device state bits */
static int charset = -1; /* Character set for supply names */
-static int num_supplies = 0;
+static int laser_printer = -1,
+ /* Laser printer with toner? */
+ num_supplies = 0;
/* Number of supplies found */
static backend_supplies_t supplies[CUPS_MAX_SUPPLIES];
/* Supply information */
@@ -197,7 +199,6 @@ backendSNMPSupplies(
/* marker-levels value string */
*ptr; /* Pointer into value string */
cups_snmp_t packet; /* SNMP response packet */
-
/*
* Generate the marker-levels value string...
@@ -242,13 +243,33 @@ backendSNMPSupplies(
else
change_state = current_state ^ new_state;
+ fprintf(stderr, "DEBUG: new_state=%x, change_state=%x, laser_printer=%d\n",
+ new_state, change_state, laser_printer);
+
for (i = 0;
i < (int)(sizeof(printer_states) / sizeof(printer_states[0]));
i ++)
if (change_state & printer_states[i].bit)
- fprintf(stderr, "STATE: %c%s\n",
- (new_state & printer_states[i].bit) ? '+' : '-',
- printer_states[i].keyword);
+ {
+ if (!laser_printer && !strncmp(printer_states[i].keyword, "toner-", 6))
+ {
+ /*
+ * Map toner-xxx to marker-supply-xxx to avoid confusing "out of toner"
+ * messages on inkjet print queues...
+ */
+
+ if (printer_states[i].bit == CUPS_TC_lowToner)
+ fprintf(stderr, "STATE: %cmarker-supply-low-report\n",
+ (new_state & CUPS_TC_lowToner) ? '+' : '-');
+ else
+ fprintf(stderr, "STATE: %cmarker-supply-empty-warning\n",
+ (new_state & CUPS_TC_noToner) ? '+' : '-');
+ }
+ else
+ fprintf(stderr, "STATE: %c%s\n",
+ (new_state & printer_states[i].bit) ? '+' : '-',
+ printer_states[i].keyword);
+ }
current_state = new_state;
@@ -590,6 +611,8 @@ backend_init_supplies(
* Output the marker-types attribute...
*/
+ laser_printer = 0;
+
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
{
if (i)
@@ -597,6 +620,9 @@ backend_init_supplies(
type = supplies[i].type;
+ if (type == CUPS_TC_toner)
+ laser_printer = 1;
+
if (type < CUPS_TC_other || type > CUPS_TC_covers)
strcpy(ptr, "unknown");
else
diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in
index 1a2037cfa..1950e05e3 100644
--- a/conf/cupsd.conf.in
+++ b/conf/cupsd.conf.in
@@ -26,6 +26,9 @@ BrowseLocalProtocols @CUPS_BROWSE_LOCAL_PROTOCOLS@
# Default authentication type, when authentication is required...
DefaultAuthType Basic
+# Web interface setting...
+WebInterface @CUPS_WEBIF@
+
# Restrict access to the server...
Order allow,deny
diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4
index d99b86301..1c2f4d25b 100644
--- a/config-scripts/cups-common.m4
+++ b/config-scripts/cups-common.m4
@@ -323,6 +323,12 @@ case $uname in
dnl Check for dynamic store function...
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName)
+ dnl Check for new ColorSync APIs...
+ SAVELIBS="$LIBS"
+ LIBS="$LIBS -framework ApplicationServices"
+ AC_CHECK_FUNCS(ColorSyncRegisterDevice)
+ LIBS="$SAVELIBS"
+
dnl Check for the new membership functions in MacOSX 10.4...
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index 5e98f124d..314426632 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -470,6 +470,31 @@ fi
AC_SUBST(FONTS)
+dnl Web interface...
+AC_ARG_ENABLE(webif, [ --enable-webif enable the web interface by default, default=no for Mac OS X])
+case "x$enable_webif" in
+ xno)
+ CUPS_WEBIF=No
+ CUPS_DEFAULT_WEBIF=0
+ ;;
+ xyes)
+ CUPS_WEBIF=Yes
+ CUPS_DEFAULT_WEBIF=1
+ ;;
+ *)
+ if test $uname = Darwin; then
+ CUPS_WEBIF=No
+ CUPS_DEFAULT_WEBIF=0
+ else
+ CUPS_WEBIF=Yes
+ CUPS_DEFAULT_WEBIF=1
+ fi
+ ;;
+esac
+
+AC_SUBST(CUPS_WEBIF)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF)
+
dnl
dnl End of "$Id: cups-defaults.m4 7959 2008-09-17 19:30:58Z mike $".
dnl
diff --git a/config.h.in b/config.h.in
index f1c5fd300..1e0c22d2f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -100,12 +100,19 @@
/*
- * Do we have domain socket support?
+ * Do we have domain socket support, and if so what is the default one?
*/
#undef CUPS_DEFAULT_DOMAINSOCKET
+/*
+ * Default WebInterface value...
+ */
+
+#undef CUPS_DEFAULT_WEBIF
+
+
/*
* Where are files stored?
*
@@ -694,6 +701,13 @@
#undef CUPS_BUNDLEDIR
+/*
+ * Do we have the ColorSyncRegisterDevice function?
+ */
+
+#undef HAVE_COLORSYNCREGISTERDEVICE
+
+
#endif /* !_CUPS_CONFIG_H_ */
/*
diff --git a/cups/http-support.c b/cups/http-support.c
index 1c5697cc6..255f760e5 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -1253,6 +1253,9 @@ httpStatus(http_status_t status) /* I - HTTP status code */
case HTTP_PKI_ERROR :
s = _("SSL/TLS Negotiation Error");
break;
+ case HTTP_WEBIF_DISABLED :
+ s = _("Web Interface is Disabled");
+ break;
default :
s = _("Unknown");
diff --git a/cups/http.h b/cups/http.h
index 8dc79096c..bd6e4571d 100644
--- a/cups/http.h
+++ b/cups/http.h
@@ -251,7 +251,8 @@ typedef enum http_status_e /**** HTTP status codes ****/
HTTP_NOT_SUPPORTED, /* HTTP version not supported */
HTTP_AUTHORIZATION_CANCELED = 1000, /* User canceled authorization @since CUPS 1.4@ */
- HTTP_PKI_ERROR /* Error negotiating a secure connection @since CUPS 1.5@ */
+ HTTP_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5@ */
+ HTTP_WEBIF_DISABLED /* Web interface is disabled @private@ */
} http_status_t;
typedef enum http_uri_status_e /**** URI separation status @since CUPS 1.2@ ****/
diff --git a/doc/help/ref-cupsd-conf.html.in b/doc/help/ref-cupsd-conf.html.in
index d3610cb84..9114c489c 100644
--- a/doc/help/ref-cupsd-conf.html.in
+++ b/doc/help/ref-cupsd-conf.html.in
@@ -3180,5 +3180,18 @@ user whose ID is 0.
+
+
+Examples
+
+
+WebInterface yes
+WebInterface no
+
+
+Description
+
+The WebInterface
directive specifies whether the web interface is enabled. The default value is @CUPS_WEBIF@
.
+