[Pkg-cups-devel] r352 - in cupsys/branches/cups-1.2/debian: .

Kenshi Muto kmuto at costa.debian.org
Sun Aug 20 09:45:54 UTC 2006


Author: kmuto
Date: Sun Aug 20 09:45:52 2006
New Revision: 352

Added:
   cupsys/branches/cups-1.2/debian/patches/00_r5845.dpatch   (contents, props changed)
Removed:
   cupsys/branches/cups-1.2/debian/patches/00_r5818.dpatch
Modified:
   cupsys/branches/cups-1.2/debian/changelog
   cupsys/branches/cups-1.2/debian/patches/00list

Log:
apply r5845 and release 1.2.2-2.

Modified: cupsys/branches/cups-1.2/debian/changelog
==============================================================================
--- cupsys/branches/cups-1.2/debian/changelog	(original)
+++ cupsys/branches/cups-1.2/debian/changelog	Sun Aug 20 09:45:52 2006
@@ -1,7 +1,13 @@
-cupsys (1.2.2-2) UNRELEASED; urgency=high
+cupsys (1.2.2-3) UNRELEASED; urgency=low
+
+  * BSP march
+
+ -- Kenshi Muto <kmuto at debian.org>  Sun, 20 Aug 2006 18:44:24 +0900
+
+cupsys (1.2.2-2) unstable; urgency=high
 
   [ Kenshi Muto ]
-  * Apply upstream svn change r5818.
+  * Apply upstream svn change r5845.
     - BrowseRelay didn't work on Debian (closes: #372855)
     61_job_c_strangeloop.dpatch: I don't make sure but job.c of
     r5818 causes strange CPU busy when it gets printing jobs.

Added: cupsys/branches/cups-1.2/debian/patches/00_r5845.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2/debian/patches/00_r5845.dpatch	Sun Aug 20 09:45:52 2006
@@ -0,0 +1,2733 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 00_r5845.dpatch by Kenshi Muto <kmuto at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cupsys-1.2.2~/CHANGES.txt cupsys-1.2.2/CHANGES.txt
+--- cupsys-1.2.2~/CHANGES.txt	2006-07-18 19:53:24.000000000 +0000
++++ cupsys-1.2.2/CHANGES.txt	2006-08-20 09:36:31.000000000 +0000
+@@ -1,6 +1,54 @@
+-CHANGES.txt - 2006-07-18
++CHANGES.txt - 2006-08-16
+ ------------------------
+ 
++CHANGES IN CUPS V1.2.3
++
++	- 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 <cups/backend.h> 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 <cups/dir.h> and <cups/file.h> header files did not
++	  work with C++.
++
++
+ CHANGES IN CUPS V1.2.2
+ 
+ 	- Documentation updates (STR #1765, STR #1780)
+diff -urNad cupsys-1.2.2~/Makedefs.in cupsys-1.2.2/Makedefs.in
+--- cupsys-1.2.2~/Makedefs.in	2006-05-30 20:31:10.000000000 +0000
++++ cupsys-1.2.2/Makedefs.in	2006-08-20 09:36:31.000000000 +0000
+@@ -174,12 +174,16 @@
+ # 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@
+diff -urNad cupsys-1.2.2~/Makefile cupsys-1.2.2/Makefile
+--- cupsys-1.2.2~/Makefile	2006-05-19 12:44:29.000000000 +0000
++++ cupsys-1.2.2/Makefile	2006-08-20 09:36:31.000000000 +0000
+@@ -229,13 +229,29 @@
+ # Make software distributions using EPM (http://www.easysw.com/epm/)...
+ #
+ 
+-EPMFLAGS	=	-v
++EPMFLAGS	=	-v --output-dir dist
+ 
+-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; ;; \
++		HP-UX*) $(MAKE) $(MFLAGS) swinstall; ;; \
++		IRIX*) $(MAKE) $(MFLAGS) tardist; ;; \
++		Linux*) $(MAKE) $(MFLAGS) rpm; ;; \
++		SunOS*) $(MAKE) $(MFLAGS) pkg; ;; \
++	esac
+ 
+ 
+ #
+diff -urNad cupsys-1.2.2~/README.txt cupsys-1.2.2/README.txt
+--- cupsys-1.2.2~/README.txt	2006-05-08 20:32:27.000000000 +0000
++++ cupsys-1.2.2/README.txt	2006-08-20 09:36:31.000000000 +0000
+@@ -1,4 +1,4 @@
+-README - CUPS v1.2.0 - 2006-05-08
++README - CUPS v1.2.3 - 2006-07-20
+ ---------------------------------
+ 
+ Looking for compile instructions?  Read the file "INSTALL.txt"
+diff -urNad cupsys-1.2.2~/backend/backend-private.h cupsys-1.2.2/backend/backend-private.h
+--- cupsys-1.2.2~/backend/backend-private.h	2006-05-27 03:11:52.000000000 +0000
++++ cupsys-1.2.2/backend/backend-private.h	2006-08-20 09:36:31.000000000 +0000
+@@ -45,9 +45,9 @@
+  * C++ magic...
+  */
+ 
+-#  ifdef _cplusplus
++#  ifdef __cplusplus
+ extern "C" {
+-#  endif /* _cplusplus */
++#  endif /* __cplusplus */
+ 
+ 
+ /*
+@@ -62,9 +62,9 @@
+ 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_ */
+ 
+ 
+diff -urNad cupsys-1.2.2~/backend/ipp.c cupsys-1.2.2/backend/ipp.c
+--- cupsys-1.2.2~/backend/ipp.c	2006-07-12 19:42:35.000000000 +0000
++++ cupsys-1.2.2/backend/ipp.c	2006-08-20 09:36:31.000000000 +0000
+@@ -138,7 +138,6 @@
+   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 +213,9 @@
+     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...
+   */
+@@ -745,7 +747,6 @@
+   * Then issue the print-job request...
+   */
+ 
+-  reasons = 0;
+   job_id  = 0;
+ 
+   while (copies > 0)
+@@ -1300,6 +1301,8 @@
+ #endif /* __APPLE__ */
+ 
+     exit(CUPS_BACKEND_AUTH_REQUIRED);
++
++    return (NULL);			/* Eliminate compiler warning */
+   }
+ }
+ 
+diff -urNad cupsys-1.2.2~/backend/runloop.c cupsys-1.2.2/backend/runloop.c
+--- cupsys-1.2.2~/backend/runloop.c	2006-07-12 20:00:11.000000000 +0000
++++ cupsys-1.2.2/backend/runloop.c	2006-08-20 09:36:31.000000000 +0000
+@@ -33,7 +33,11 @@
+  */
+ 
+ #include "backend-private.h"
+-#include <sys/select.h>
++#ifdef __hpux
++#  include <sys/time.h>
++#else
++#  include <sys/select.h>
++#endif /* __hpux */
+ 
+ 
+ /*
+diff -urNad cupsys-1.2.2~/backend/snmp.c cupsys-1.2.2/backend/snmp.c
+--- cupsys-1.2.2~/backend/snmp.c	2006-07-13 19:59:36.000000000 +0000
++++ cupsys-1.2.2/backend/snmp.c	2006-08-20 09:36:31.000000000 +0000
+@@ -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
+@@ -194,6 +195,13 @@
+ 
+ 
+ /*
++ * 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_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_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 unsigned		DeviceTypeRequest;
+ static unsigned		DeviceDescRequest;
+ static int		HostNameLookups = 0;
++static int		MaxRunTime = 10;
+ static struct timeval	StartTime;
+ 
+ 
+@@ -290,6 +301,9 @@
+      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 */
+ 
+ 
+  /*
+@@ -309,6 +323,23 @@
+   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...
+   */
+ 
+@@ -330,12 +361,6 @@
+   scan_devices(fd);
+ 
+  /*
+-  * Display the results...
+-  */
+-
+-  list_devices();
+-
+- /*
+   * Close, free, and return with no errors...
+   */
+ 
+@@ -384,7 +409,7 @@
+ 
+   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 @@
+     temp->make_and_model = strdup(make_and_model);
+ 
+   cupsArrayAdd(Devices, temp);
++
++  if (uri)
++    list_device(temp);
+ }
+ 
+ 
+@@ -418,6 +446,10 @@
+ 
+   (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);
+ }
+@@ -1228,6 +1260,173 @@
+ 
+ 
+ /*
++ * '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.
+  */
+ 
+@@ -1422,24 +1621,18 @@
+ 
+ 
+ /*
+- * '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 +1717,11 @@
+ 
+   debug_printf("DEBUG: %.3f Probing %s...\n", run_time(), device->addrname);
+ 
+-  if ((http = httpConnect(device->addrname, 631)) != NULL)
++  alarm(1);
++  http = httpConnect(device->addrname, 631);
++  alarm(0);
++
++  if (http);
+   {
+    /*
+     * IPP is supported...
+@@ -1551,8 +1748,6 @@
+ 			};
+ 
+ 
+-    debug_printf("DEBUG: %s supports IPP!\n", device->addrname);
+-
+    /*
+     * Use non-blocking IO...
+     */
+@@ -1569,6 +1764,13 @@
+          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 +1780,14 @@
+       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 +1926,7 @@
+   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 +1942,9 @@
+   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 +1981,8 @@
+ 	                  !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 +2281,9 @@
+   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 +2377,6 @@
+ 
+   addr->ipv4.sin_port = htons(port);
+ 
+-  signal(SIGALRM, alarm_handler);
+   alarm(1);
+ 
+   status = connect(fd, (void *)addr, httpAddrLength(addr));
+@@ -2211,6 +2418,8 @@
+ 
+     device->make_and_model = strdup(make_model);
+   }
++
++  list_device(device);
+ }
+ 
+ 
+diff -urNad cupsys-1.2.2~/berkeley/lpc.c cupsys-1.2.2/berkeley/lpc.c
+--- cupsys-1.2.2~/berkeley/lpc.c	2006-01-29 14:39:44.000000000 +0000
++++ cupsys-1.2.2/berkeley/lpc.c	2006-08-20 09:36:31.000000000 +0000
+@@ -65,6 +65,8 @@
+ 		*params;		/* Pointer to parameters */
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * Connect to the scheduler...
+   */
+diff -urNad cupsys-1.2.2~/berkeley/lpq.c cupsys-1.2.2/berkeley/lpq.c
+--- cupsys-1.2.2~/berkeley/lpq.c	2006-06-06 20:08:13.000000000 +0000
++++ cupsys-1.2.2/berkeley/lpq.c	2006-08-20 09:36:31.000000000 +0000
+@@ -76,9 +76,10 @@
+ 		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 @@
+   interval   = 0;
+   longstatus = 0;
+   all        = 0;
+-  language   = cupsLangDefault();
+   num_dests  = 0;
++  dests      = NULL;
+ 
+   for (i = 1; i < argc; i ++)
+     if (argv[i][0] == '+')
+diff -urNad cupsys-1.2.2~/berkeley/lpr.c cupsys-1.2.2/berkeley/lpr.c
+--- cupsys-1.2.2~/berkeley/lpr.c	2006-03-06 13:02:23.000000000 +0000
++++ cupsys-1.2.2/berkeley/lpr.c	2006-08-20 09:36:31.000000000 +0000
+@@ -87,13 +87,14 @@
+   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 @@
+   options     = NULL;
+   num_files   = 0;
+   title       = NULL;
+-  language    = cupsLangDefault();
+ 
+   for (i = 1; i < argc; i ++)
+     if (argv[i][0] == '-')
+diff -urNad cupsys-1.2.2~/berkeley/lprm.c cupsys-1.2.2/berkeley/lprm.c
+--- cupsys-1.2.2~/berkeley/lprm.c	2006-07-11 21:04:48.000000000 +0000
++++ cupsys-1.2.2/berkeley/lprm.c	2006-08-20 09:36:31.000000000 +0000
+@@ -55,13 +55,14 @@
+   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 @@
+   response   = NULL;
+   http       = NULL;
+   encryption = cupsEncryption();
+-  language   = cupsLangDefault();
+ 
+  /*
+   * Open a connection to the server...
+diff -urNad cupsys-1.2.2~/cgi-bin/ipp-var.c cupsys-1.2.2/cgi-bin/ipp-var.c
+--- cupsys-1.2.2~/cgi-bin/ipp-var.c	2006-05-22 18:47:09.000000000 +0000
++++ cupsys-1.2.2/cgi-bin/ipp-var.c	2006-08-20 09:36:31.000000000 +0000
+@@ -110,6 +110,7 @@
+   */
+ 
+   num_attrs = 0;
++  attrs[0]  = NULL;			/* Eliminate compiler warning */
+ 
+   while ((ch = getc(in)) != EOF)
+     if (ch == '\\')
+diff -urNad cupsys-1.2.2~/config-scripts/cups-common.m4 cupsys-1.2.2/config-scripts/cups-common.m4
+--- cupsys-1.2.2~/config-scripts/cups-common.m4	2006-07-19 14:18:15.000000000 +0000
++++ cupsys-1.2.2/config-scripts/cups-common.m4	2006-08-20 09:36:31.000000000 +0000
+@@ -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,8 +29,8 @@
+ AC_CONFIG_HEADER(config.h)
+ 
+ dnl Versio number information...
+-CUPS_VERSION=1.2.2
+-CUPS_REVISION=
++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'`"
+ fi
+@@ -265,5 +265,5 @@
+ 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 -urNad cupsys-1.2.2~/config-scripts/cups-defaults.m4 cupsys-1.2.2/config-scripts/cups-defaults.m4
+--- cupsys-1.2.2~/config-scripts/cups-defaults.m4	2006-07-18 13:45:56.000000000 +0000
++++ cupsys-1.2.2/config-scripts/cups-defaults.m4	2006-08-20 09:36:31.000000000 +0000
+@@ -25,7 +25,9 @@
+ 
+ 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)
+ 
+diff -urNad cupsys-1.2.2~/config-scripts/cups-directories.m4 cupsys-1.2.2/config-scripts/cups-directories.m4
+--- cupsys-1.2.2~/config-scripts/cups-directories.m4	2006-06-26 18:34:20.000000000 +0000
++++ cupsys-1.2.2/config-scripts/cups-directories.m4	2006-08-20 09:36:31.000000000 +0000
+@@ -57,6 +57,15 @@
+ 	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 @@
+ 	else
+ 		datadir="$prefix/share"
+ 	fi
++elif test "$datadir" = "\${datarootdir}"; then
++	datadir="$datarootdir"
+ fi
+ 
+ dnl Fix "includedir" variable if it hasn't been specified...
+diff -urNad cupsys-1.2.2~/config-scripts/cups-manpages.m4 cupsys-1.2.2/config-scripts/cups-manpages.m4
+--- cupsys-1.2.2~/config-scripts/cups-manpages.m4	2006-04-26 19:52:27.000000000 +0000
++++ cupsys-1.2.2/config-scripts/cups-manpages.m4	2006-08-20 09:36:31.000000000 +0000
+@@ -3,7 +3,7 @@
+ 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
+ 
+ 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*)
+diff -urNad cupsys-1.2.2~/configure.in cupsys-1.2.2/configure.in
+--- cupsys-1.2.2~/configure.in	2006-05-30 20:31:10.000000000 +0000
++++ cupsys-1.2.2/configure.in	2006-08-20 09:36:31.000000000 +0000
+@@ -54,9 +54,17 @@
+ 	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
+ 
+diff -urNad cupsys-1.2.2~/cups/Makefile cupsys-1.2.2/cups/Makefile
+--- cupsys-1.2.2~/cups/Makefile	2006-06-05 15:25:23.000000000 +0000
++++ cupsys-1.2.2/cups/Makefile	2006-08-20 09:36:31.000000000 +0000
+@@ -93,6 +93,7 @@
+ HEADERS	=	\
+ 		adminutil.h \
+ 		array.h \
++		backend.h \
+ 		cups.h \
+ 		dir.h \
+ 		file.h \
+diff -urNad cupsys-1.2.2~/cups/adminutil.c cupsys-1.2.2/cups/adminutil.c
+--- cupsys-1.2.2~/cups/adminutil.c	2006-07-18 19:53:24.000000000 +0000
++++ cupsys-1.2.2/cups/adminutil.c	2006-08-20 09:36:31.000000000 +0000
+@@ -784,7 +784,14 @@
+ 	if ((port = strrchr(value, ':')) != NULL)
+ 	  *port = '\0';
+ 
+-	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 +867,14 @@
+ 	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 +1098,7 @@
+ 	{
+ 	  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 +1454,7 @@
+     {
+       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
+diff -urNad cupsys-1.2.2~/cups/attr.c cupsys-1.2.2/cups/attr.c
+--- cupsys-1.2.2~/cups/attr.c	2006-02-16 15:52:06.000000000 +0000
++++ cupsys-1.2.2/cups/attr.c	2006-08-20 09:36:31.000000000 +0000
+@@ -44,14 +44,19 @@
+  * @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 @@
+   * 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);
+ }
+ 
+ 
+diff -urNad cupsys-1.2.2~/cups/cups.h cupsys-1.2.2/cups/cups.h
+--- cupsys-1.2.2~/cups/cups.h	2006-03-06 03:39:28.000000000 +0000
++++ cupsys-1.2.2/cups/cups.h	2006-08-20 09:36:31.000000000 +0000
+@@ -61,10 +61,10 @@
+  * 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
+ 
+ 
+diff -urNad cupsys-1.2.2~/cups/dir.h cupsys-1.2.2/cups/dir.h
+--- cupsys-1.2.2~/cups/dir.h	2005-09-21 22:17:44.000000000 +0000
++++ cupsys-1.2.2/cups/dir.h	2006-08-20 09:36:31.000000000 +0000
+@@ -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 void		cupsDirRewind(cups_dir_t *dp);
+ 
+ 
+-#  ifdef _cplusplus
++#  ifdef __cplusplus
+ }
+-#  endif /* _cplusplus */
++#  endif /* __cplusplus */
+ #endif /* !_CUPS_DIR_H_ */
+ 
+ /*
+diff -urNad cupsys-1.2.2~/cups/file.c cupsys-1.2.2/cups/file.c
+--- cupsys-1.2.2~/cups/file.c	2006-03-23 16:47:46.000000000 +0000
++++ cupsys-1.2.2/cups/file.c	2006-08-20 09:36:31.000000000 +0000
+@@ -1260,6 +1260,7 @@
+   fp->pos = 0;
+   fp->ptr = NULL;
+   fp->end = NULL;
++  fp->eof = 0;
+ 
+   return (0);
+ }
+diff -urNad cupsys-1.2.2~/cups/file.h cupsys-1.2.2/cups/file.h
+--- cupsys-1.2.2~/cups/file.h	2006-03-21 15:28:29.000000000 +0000
++++ cupsys-1.2.2/cups/file.h	2006-08-20 09:36:31.000000000 +0000
+@@ -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 @@
+  * C++ magic...
+  */
+ 
+-#  ifdef _cplusplus
++#  ifdef __cplusplus
+ extern "C" {
+-#  endif /* _cplusplus */
++#  endif /* __cplusplus */
+ 
+ 
+ /*
+@@ -103,9 +103,9 @@
+ 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_ */
+ 
+ /*
+diff -urNad cupsys-1.2.2~/cups/http.h cupsys-1.2.2/cups/http.h
+--- cupsys-1.2.2~/cups/http.h	2006-07-11 17:56:57.000000000 +0000
++++ cupsys-1.2.2/cups/http.h	2006-08-20 09:36:31.000000000 +0000
+@@ -39,8 +39,8 @@
+ #    include <winsock2.h>
+ #    include <ws2tcpip.h>
+ #  else
+-#    ifdef __sgi /* IRIX needs this for IPv6 support!?! */
+-#      define INET6
++#    ifdef __sgi
++#      define INET6			/* IRIX IPv6 support... */
+ #    endif /* __sgi */
+ #    include <unistd.h>
+ #    include <sys/time.h>
+@@ -53,6 +53,9 @@
+ #    if !defined(__APPLE__) || !defined(TCP_NODELAY)
+ #      include <netinet/tcp.h>
+ #    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 <sys/un.h>
+ #    endif /* AF_LOCAL */
+diff -urNad cupsys-1.2.2~/cups/i18n.h cupsys-1.2.2/cups/i18n.h
+--- cupsys-1.2.2~/cups/i18n.h	2006-04-02 16:11:04.000000000 +0000
++++ cupsys-1.2.2/cups/i18n.h	2006-08-20 09:36:31.000000000 +0000
+@@ -105,6 +105,7 @@
+ 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
+ }
+diff -urNad cupsys-1.2.2~/cups/langprintf.c cupsys-1.2.2/cups/langprintf.c
+--- cupsys-1.2.2~/cups/langprintf.c	2006-01-13 01:55:20.000000000 +0000
++++ cupsys-1.2.2/cups/langprintf.c	2006-08-20 09:36:31.000000000 +0000
+@@ -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 @@
+ 
+ 
+ /*
+- * 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 -urNad cupsys-1.2.2~/cups/language.c cupsys-1.2.2/cups/language.c
+--- cupsys-1.2.2~/cups/language.c	2006-07-18 19:53:24.000000000 +0000
++++ cupsys-1.2.2/cups/language.c	2006-08-20 09:36:31.000000000 +0000
+@@ -1288,6 +1288,8 @@
+ 	  *d = *d * 8 + *s - '0';
+ 	  s ++;
+ 	}
++
++	d ++;
+       }
+       else
+       {
+diff -urNad cupsys-1.2.2~/cups/libcups_s.exp cupsys-1.2.2/cups/libcups_s.exp
+--- cupsys-1.2.2~/cups/libcups_s.exp	2006-05-04 20:53:35.000000000 +0000
++++ cupsys-1.2.2/cups/libcups_s.exp	2006-08-20 09:36:31.000000000 +0000
+@@ -16,6 +16,7 @@
+ _cupsMessageLoad
+ _cupsMessageLookup
+ _cupsSetError
++_cupsSetLocale
+ _cupsStrAlloc
+ _cupsStrFlush
+ _cupsStrFormatd
+diff -urNad cupsys-1.2.2~/cups/localize.c cupsys-1.2.2/cups/localize.c
+--- cupsys-1.2.2~/cups/localize.c	2006-04-14 12:26:50.000000000 +0000
++++ cupsys-1.2.2/cups/localize.c	2006-08-20 09:36:31.000000000 +0000
+@@ -80,6 +80,8 @@
+   * Range check input...
+   */
+ 
++  DEBUG_printf(("ppdLocalize(ppd=%p)\n", ppd));
++
+   if (!ppd)
+     return (-1);
+ 
+@@ -93,6 +95,9 @@
+   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_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...
+   */
+diff -urNad cupsys-1.2.2~/cups/ppd.c cupsys-1.2.2/cups/ppd.c
+--- cupsys-1.2.2~/cups/ppd.c	2006-03-24 00:52:21.000000000 +0000
++++ cupsys-1.2.2/cups/ppd.c	2006-08-20 09:36:31.000000000 +0000
+@@ -2037,10 +2037,8 @@
+ 
+   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));
+ }
+ 
+ 
+diff -urNad cupsys-1.2.2~/cups/testi18n.c cupsys-1.2.2/cups/testi18n.c
+--- cupsys-1.2.2~/cups/testi18n.c	2006-04-20 18:16:54.000000000 +0000
++++ cupsys-1.2.2/cups/testi18n.c	2006-08-20 09:36:31.000000000 +0000
+@@ -82,7 +82,6 @@
+     /* "A != <CJK U+4E42>." - 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 @@
+ 
+   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 @@
+ 
+   fputs("_cupsCharmapGet(CUPS_EUC_TW): ", stdout);
+ 
+-  if ((vmap = (_cups_vmap_t *)_cupsCharmapGet(CUPS_EUC_TW)) == NULL)
++  if (!_cupsCharmapGet(CUPS_EUC_TW))
+   {
+     errors ++;
+     puts("FAIL");
+diff -urNad cupsys-1.2.2~/cups/testppd.c cupsys-1.2.2/cups/testppd.c
+--- cupsys-1.2.2~/cups/testppd.c	2006-06-26 19:20:39.000000000 +0000
++++ cupsys-1.2.2/cups/testppd.c	2006-08-20 09:36:31.000000000 +0000
+@@ -192,10 +192,18 @@
+     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 @@
+ 	   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 @@
+ 		   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 : "");
+     }
+   }
+ 
+diff -urNad cupsys-1.2.2~/cups/transcode.c cupsys-1.2.2/cups/transcode.c
+--- cupsys-1.2.2~/cups/transcode.c	2006-04-06 20:03:32.000000000 +0000
++++ cupsys-1.2.2/cups/transcode.c	2006-08-20 09:36:31.000000000 +0000
+@@ -408,7 +408,6 @@
+     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 @@
+   */
+ 
+   *dest++ = 0xfeff;
+-  srclen  = strlen((char *)src);
+ 
+   for (i = maxout - 1; *src && i > 0; i --)
+   {
+@@ -1142,7 +1140,7 @@
+  */
+ 
+ 
+-void *					/* O - Charset map pointer */
++static void *				/* O - Charset map pointer */
+ get_charmap(
+     const cups_encoding_t encoding)	/* I - Encoding */
+ {
+diff -urNad cupsys-1.2.2~/cups-config.in cupsys-1.2.2/cups-config.in
+--- cupsys-1.2.2~/cups-config.in	2006-06-23 20:33:08.000000000 +0000
++++ cupsys-1.2.2/cups-config.in	2006-08-20 09:36:31.000000000 +0000
+@@ -32,6 +32,7 @@
+ includedir=@includedir@
+ libdir=@libdir@
+ imagelibdir=@libdir@
++datarootdir=@datadir@
+ datadir=@datadir@
+ sysconfdir=@sysconfdir@
+ cups_datadir=@CUPS_DATADIR@
+diff -urNad cupsys-1.2.2~/doc/help/ref-snmp-conf.html cupsys-1.2.2/doc/help/ref-snmp-conf.html
+--- cupsys-1.2.2~/doc/help/ref-snmp-conf.html	2006-04-19 00:46:52.000000000 +0000
++++ cupsys-1.2.2/doc/help/ref-snmp-conf.html	2006-08-20 09:36:31.000000000 +0000
+@@ -96,5 +96,22 @@
+ 
+ <P>The default setting is <VAR>off</VAR>.</P>
+ 
++<H2 CLASS="title"><A NAME="MaxRunTime">MaxRunTime</A></H2>
++
++<H3>Examples</H3>
++
++<PRE CLASS="command">
++MaxRunTime 10
++MaxRunTime 300
++</PRE>
++
++<H3>Description</H3>
++
++<P>The <CODE>MaxRunTime</CODE> directive specifies the maxium
++number of seconds that the SNMP backend will spend looking for
++printer devices on the network.</P>
++
++<P>The default setting is <VAR>10</VAR>.</P>
++
+ </BODY>
+ </HTML>
+diff -urNad cupsys-1.2.2~/man/cups-snmp.conf.man cupsys-1.2.2/man/cups-snmp.conf.man
+--- cupsys-1.2.2~/man/cups-snmp.conf.man	2006-04-19 00:46:52.000000000 +0000
++++ cupsys-1.2.2/man/cups-snmp.conf.man	2006-08-20 09:36:31.000000000 +0000
+@@ -21,7 +21,7 @@
+ .\"       EMail: cups-info at cups.org
+ .\"         WWW: http://www.cups.org
+ .\"
+-.TH snmp.conf 5 "Common UNIX Printing System" "18 April 2006" "Easy Software Products"
++.TH snmp.conf 5 "Common UNIX Printing System" "31 July 2006" "Easy Software Products"
+ .SH NAME
+ snmp.conf \- snmp configuration file for cups
+ .SH DESCRIPTION
+@@ -68,6 +68,11 @@
+ Specifies whether the addresses of printers should be converted
+ to hostnames or left as numeric IP addresses. The default is
+ "off".
++.TP 5
++MaxRunTime \fIseconds\fR
++.br
++Specifies the maximum number of seconds that the SNMP backend
++will scan the network for printers.
+ .SH SEE ALSO
+ http://localhost:631/help
+ .SH COPYRIGHT
+diff -urNad cupsys-1.2.2~/packaging/cups.list.in cupsys-1.2.2/packaging/cups.list.in
+--- cupsys-1.2.2~/packaging/cups.list.in	2006-07-18 13:45:56.000000000 +0000
++++ cupsys-1.2.2/packaging/cups.list.in	2006-08-20 09:36:31.000000000 +0000
+@@ -122,6 +122,7 @@
+ $prefix=@prefix@
+ $exec_prefix=@exec_prefix@
+ $bindir=@bindir@
++$datarootdir=@datarootdir@
+ $datadir=@datadir@
+ $includedir=@includedir@
+ $infodir=@infodir@
+@@ -342,7 +343,7 @@
+ 
+ # Data files
+ %subpackage de
+-f 0644 root sys $LOCALEDIR/es/cups_de.po locale/cups_de.po
++f 0644 root sys $LOCALEDIR/de/cups_de.po locale/cups_de.po
+ %subpackage es
+ f 0644 root sys $LOCALEDIR/es/cups_es.po locale/cups_es.po
+ %subpackage ja
+diff -urNad cupsys-1.2.2~/scheduler/auth.c cupsys-1.2.2/scheduler/auth.c
+--- cupsys-1.2.2~/scheduler/auth.c	2006-06-07 20:58:29.000000000 +0000
++++ cupsys-1.2.2/scheduler/auth.c	2006-08-20 09:36:31.000000000 +0000
+@@ -89,9 +89,9 @@
+ static cupsd_authmask_t	*add_deny(cupsd_location_t *loc);
+ static int		compare_locations(cupsd_location_t *a,
+ 			                  cupsd_location_t *b);
+-#if !HAVE_LIBPAM
++#if !HAVE_LIBPAM && !defined(HAVE_USERSEC_H)
+ static char		*cups_crypt(const char *pw, const char *salt);
+-#endif /* !HAVE_LIBPAM */
++#endif /* !HAVE_LIBPAM && !HAVE_USERSEC_H */
+ static char		*get_md5_password(const char *username,
+ 			                  const char *group, char passwd[33]);
+ #if HAVE_LIBPAM
+@@ -540,7 +540,6 @@
+ 	    */
+ 
+ 	    char	*authmsg;	/* Authentication message */
+-	    char	*loginmsg;	/* Login message */
+ 	    int		reenter;	/* ??? */
+ 
+ 
+@@ -1871,7 +1870,7 @@
+ }
+ 
+ 
+-#if !HAVE_LIBPAM
++#if !HAVE_LIBPAM && !defined(HAVE_USERSEC_H)
+ /*
+  * 'cups_crypt()' - Encrypt the password using the DES or MD5 algorithms,
+  *                  as needed.
+@@ -1991,7 +1990,7 @@
+     return (crypt(pw, salt));
+   }
+ }
+-#endif /* !HAVE_LIBPAM */
++#endif /* !HAVE_LIBPAM && !HAVE_USERSEC_H */
+ 
+ 
+ /*
+diff -urNad cupsys-1.2.2~/scheduler/client.c cupsys-1.2.2/scheduler/client.c
+--- cupsys-1.2.2~/scheduler/client.c	2006-07-16 15:21:18.000000000 +0000
++++ cupsys-1.2.2/scheduler/client.c	2006-08-20 09:36:31.000000000 +0000
+@@ -2274,7 +2274,7 @@
+ 		return (0);
+ 	    }
+ 	    else if (!strncasecmp(buf, "Status:", 7))
+-  	      cupsdSendError(con, atoi(buf + 7));
++  	      cupsdSendError(con, (http_status_t)atoi(buf + 7));
+ 	    else
+ 	    {
+   	      cupsdSendHeader(con, HTTP_OK, NULL);
+diff -urNad cupsys-1.2.2~/scheduler/conf.c cupsys-1.2.2/scheduler/conf.c
+--- cupsys-1.2.2~/scheduler/conf.c	2006-07-13 19:59:36.000000000 +0000
++++ cupsys-1.2.2/scheduler/conf.c	2006-08-20 09:36:31.000000000 +0000
+@@ -1947,6 +1947,13 @@
+ 
+ 
+  /*
++  * Empty protocol line yields NULL pointer...
++  */
++
++  if (!s)
++    return (0);
++
++ /*
+   * Loop through the value string,...
+   */
+ 
+diff -urNad cupsys-1.2.2~/scheduler/cups-lpd.c cupsys-1.2.2/scheduler/cups-lpd.c
+--- cupsys-1.2.2~/scheduler/cups-lpd.c	2006-04-24 13:49:59.000000000 +0000
++++ cupsys-1.2.2/scheduler/cups-lpd.c	2006-08-20 09:36:31.000000000 +0000
+@@ -471,7 +471,7 @@
+ 
+     request = ippNewRequest(CUPS_GET_PRINTERS);
+ 
+-    ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
++    ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+                   "requested-attributes",
+ 		  (int)(sizeof(requested) / sizeof(requested[0])),
+                   NULL, requested);
+@@ -597,7 +597,7 @@
+     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+         	 NULL, uri);
+ 
+-    ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
++    ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
+                   "requested-attributes",
+ 		  (int)(sizeof(requested) / sizeof(requested[0])),
+                   NULL, requested);
+diff -urNad cupsys-1.2.2~/scheduler/cups-polld.c cupsys-1.2.2/scheduler/cups-polld.c
+--- cupsys-1.2.2~/scheduler/cups-polld.c	2006-07-18 19:53:24.000000000 +0000
++++ cupsys-1.2.2/scheduler/cups-polld.c	2006-08-20 09:36:31.000000000 +0000
+@@ -1,5 +1,5 @@
+ /*
+- * "$Id: cups-polld.c 5753 2006-07-18 19:53:24Z mike $"
++ * "$Id: cups-polld.c 5833 2006-08-16 20:05:58Z mike $"
+  *
+  *   Polling daemon for the Common UNIX Printing System (CUPS).
+  *
+@@ -23,9 +23,11 @@
+  *
+  * Contents:
+  *
+- *   main()        - Open sockets and poll until we are killed...
+- *   dequote()     - Remote quotes from a string.
+- *   poll_server() - Poll the server for the given set of printers or classes.
++ *   main()           - Open sockets and poll until we are killed...
++ *   dequote()        - Remote quotes from a string.
++ *   poll_server()    - Poll the server for the given set of printers or
++ *                      classes.
++ *   sighup_handler() - Handle 'hangup' signals to restart polling.
+  */
+ 
+ /*
+@@ -38,6 +40,14 @@
+ #include <errno.h>
+ #include <cups/language.h>
+ #include <cups/string.h>
++#include <signal.h>
++
++
++/*
++ * Local globals...
++ */
++
++static int	restart_polling = 1;
+ 
+ 
+ /*
+@@ -47,6 +57,7 @@
+ static char	*dequote(char *d, const char *s, int dlen);
+ static int	poll_server(http_t *http, int sock, int port, int interval,
+ 			    const char *prefix);
++static void	sighup_handler(int sig);
+ 
+ 
+ /*
+@@ -65,7 +76,27 @@
+   int		seconds,		/* Seconds left from poll */
+ 		remain;			/* Total remaining time to sleep */
+   char		prefix[1024];		/* Prefix for log messages */
++#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
++  struct sigaction action;		/* Actions for POSIX signals */
++#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
++
+ 
++ /*
++  * Catch hangup signals for when the network changes...
++  */
++
++#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
++  sigset(SIGHUP, sighup_handler);
++#elif defined(HAVE_SIGACTION)
++  memset(&action, 0, sizeof(action));
++
++  sigemptyset(&action.sa_mask);
++  sigaddset(&action.sa_mask, SIGHUP);
++  action.sa_handler = sighup_handler;
++  sigaction(SIGHUP, &action, NULL);
++#else
++  signal(SIGHUP, sighup_handler);
++#endif /* HAVE_SIGSET */
+ 
+  /*
+   * Don't buffer log messages...
+@@ -119,31 +150,35 @@
+   }
+ 
+  /*
+-  * Open a connection to the server...
++  * Loop forever, asking for available printers and classes...
+   */
+ 
+-  while ((http = httpConnectEncrypt(argv[1], atoi(argv[2]),
+-                                    cupsEncryption())) == NULL)
++  for (http = NULL;;)
+   {
+-    fprintf(stderr, "ERROR: %s Unable to connect to %s on port %s: %s\n",
+-            prefix, argv[1], argv[2],
+-	    h_errno ? hstrerror(h_errno) : strerror(errno));
+-    sleep(interval);
+-  }
++   /*
++    * Open a connection to the server...
++    */
+ 
+- /*
+-  * Loop forever, asking for available printers and classes...
+-  */
++    if (restart_polling || !http)
++    {
++      httpClose(http);
++
++      if ((http = httpConnectEncrypt(argv[1], atoi(argv[2]),
++                                     cupsEncryption())) == NULL)
++      {
++	fprintf(stderr, "ERROR: %s Unable to connect to %s on port %s: %s\n",
++        	prefix, argv[1], argv[2],
++		h_errno ? hstrerror(h_errno) : strerror(errno));
++      }
++    }
+ 
+-  for (;;)
+-  {
+    /*
+     * Get the printers and classes...
+     */
+ 
+     remain = interval;
+ 
+-    if ((seconds = poll_server(http, sock, port, interval, prefix)) > 0)
++    if (http && (seconds = poll_server(http, sock, port, interval, prefix)) > 0)
+       remain -= seconds;
+ 
+    /*
+@@ -260,6 +295,7 @@
+   * Do the request and get back a response...
+   */
+ 
++  seconds  = time(NULL);
+   response = cupsDoRequest(http, request, "/");
+ 
+   if (cupsLastError() > IPP_OK_CONFLICT)
+@@ -285,7 +321,6 @@
+     fprintf(stderr, "DEBUG: %s Found %d printers.\n", prefix, max_count);
+ 
+     count     = 0;
+-    seconds   = time(NULL);
+     max_count = max_count / interval + 1;
+ 
+    /*
+@@ -425,5 +460,22 @@
+ 
+ 
+ /*
+- * End of "$Id: cups-polld.c 5753 2006-07-18 19:53:24Z mike $".
++ * 'sighup_handler()' - Handle 'hangup' signals to restart polling.
++ */
++
++static void
++sighup_handler(int sig)			/* I - Signal number */
++{
++  (void)sig;
++
++  restart_polling = 1;
++
++#if !defined(HAVE_SIGSET) && !defined(HAVE_SIGACTION)
++  signal(SIGHUP, sighup_handler);
++#endif /* !HAVE_SIGSET && !HAVE_SIGACTION */
++}
++
++
++/*
++ * End of "$Id: cups-polld.c 5833 2006-08-16 20:05:58Z mike $".
+  */
+diff -urNad cupsys-1.2.2~/scheduler/dirsvc.c cupsys-1.2.2/scheduler/dirsvc.c
+--- cupsys-1.2.2~/scheduler/dirsvc.c	2006-08-20 09:36:15.000000000 +0000
++++ cupsys-1.2.2/scheduler/dirsvc.c	2006-08-20 09:36:31.000000000 +0000
+@@ -514,6 +514,23 @@
+ 
+ 
+ /*
++ * 'cupsdRestartPolling()' - Restart polling servers as needed.
++ */
++
++void
++cupsdRestartPolling(void)
++{
++  int			i;		/* Looping var */
++  cupsd_dirsvc_poll_t	*pollp;		/* Current polling server */
++
++
++  for (i = 0, pollp = Polled; i < NumPolled; i ++, pollp ++)
++    if (pollp->pid)
++      kill(pollp->pid, SIGHUP);
++}
++
++
++/*
+  * 'cupsdSaveRemoteCache()' - Save the remote printer cache.
+  */
+ 
+@@ -1468,7 +1485,7 @@
+     if (cupsdCheckAuth(address, srcname, len, 1, &(Relays[i].from)))
+       if (sendto(BrowseSocket, packet, bytes, 0,
+                  (struct sockaddr *)&(Relays[i].to),
+-		 sizeof(http_addr_t)) <= 0)
++		 httpAddrLength(&(Relays[i].to))) <= 0)
+       {
+ 	cupsdLogMessage(CUPSD_LOG_ERROR,
+ 	                "cupsdUpdateCUPSBrowse: sendto failed for relay %d - %s.",
+@@ -1609,7 +1626,7 @@
+     if (!strchr(PollStatusBuffer->buffer, '\n'))
+       break;
+ 
+-  if (ptr == NULL)
++  if (ptr == NULL && errno)
+   {
+    /*
+     * All polling processes have died; stop polling...
+@@ -1923,6 +1940,9 @@
+     else
+       return;
+ 
++    if (hptr && !*hptr)
++      *hptr = '.';			/* Resource FQDN */
++
+     if ((p = cupsdFindClass(name)) == NULL && BrowseShortNames)
+     {
+       if ((p = cupsdFindClass(resource + 9)) != NULL)
+@@ -2026,6 +2046,9 @@
+     else
+       return;
+ 
++    if (hptr && !*hptr)
++      *hptr = '.';			/* Resource FQDN */
++
+     if ((p = cupsdFindPrinter(name)) == NULL && BrowseShortNames)
+     {
+       if ((p = cupsdFindPrinter(resource + 10)) != NULL)
+@@ -2566,7 +2589,7 @@
+ 
+ 	  sendto(BrowseSocket, packet, bytes, 0,
+ 		 (struct sockaddr *)&(iface->broadcast),
+-		 sizeof(struct sockaddr_in));
++		 httpAddrLength(&(iface->broadcast)));
+         }
+       }
+       else if ((iface = cupsdNetIFFind(b->iface)) != NULL)
+@@ -2607,7 +2630,7 @@
+ 
+ 	  sendto(BrowseSocket, packet, bytes, 0,
+ 		 (struct sockaddr *)&(iface->broadcast),
+-		 sizeof(struct sockaddr_in));
++		 httpAddrLength(&(iface->broadcast)));
+         }
+       }
+     }
+@@ -2628,7 +2651,7 @@
+ 
+       if (sendto(BrowseSocket, packet, bytes, 0,
+ 		 (struct sockaddr *)&(b->to),
+-		 sizeof(struct sockaddr_in)) <= 0)
++		 httpAddrLength(&(b->to))) <= 0)
+       {
+        /*
+         * Unable to send browse packet, so remove this address from the
+diff -urNad cupsys-1.2.2~/scheduler/dirsvc.h cupsys-1.2.2/scheduler/dirsvc.h
+--- cupsys-1.2.2~/scheduler/dirsvc.h	2006-03-18 03:05:12.000000000 +0000
++++ cupsys-1.2.2/scheduler/dirsvc.h	2006-08-20 09:36:31.000000000 +0000
+@@ -164,6 +164,7 @@
+  */
+ 
+ extern void	cupsdLoadRemoteCache(void);
++extern void	cupsdRestartPolling(void);
+ extern void	cupsdSaveRemoteCache(void);
+ extern void	cupsdSendBrowseDelete(cupsd_printer_t *p);
+ extern void	cupsdSendBrowseList(void);
+diff -urNad cupsys-1.2.2~/scheduler/ipp.c cupsys-1.2.2/scheduler/ipp.c
+--- cupsys-1.2.2~/scheduler/ipp.c	2006-07-13 19:59:36.000000000 +0000
++++ cupsys-1.2.2/scheduler/ipp.c	2006-08-20 09:36:31.000000000 +0000
+@@ -784,7 +784,6 @@
+   cupsd_printer_t *pclass,		/* Class */
+ 		*member;		/* Member printer/class */
+   cups_ptype_t	dtype;			/* Destination type */
+-  const char	*dest;			/* Printer or class name */
+   ipp_attribute_t *attr;		/* Printer attribute */
+   int		modify;			/* Non-zero if we just modified */
+   char		newname[IPP_MAX_NAME];	/* New class name */
+@@ -1007,7 +1006,7 @@
+                       sizeof(method), username, sizeof(username), host,
+ 		      sizeof(host), &port, resource, sizeof(resource));
+ 
+-      if ((dest = cupsdValidateDest(host, resource, &dtype, &member)) == NULL)
++      if (!cupsdValidateDest(host, resource, &dtype, &member))
+       {
+        /*
+ 	* Bad URI...
+@@ -1467,7 +1466,7 @@
+   ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job->id);
+   job->state = ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_ENUM,
+                              "job-state", IPP_JOB_STOPPED);
+-  job->state_value = job->state->values[0].integer;
++  job->state_value = (ipp_jstate_t)job->state->values[0].integer;
+   job->sheets = ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER,
+                               "job-media-sheets-completed", 0);
+   ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI, "job-printer-uri", NULL,
+@@ -1961,7 +1960,6 @@
+              cupsd_job_t    *job)	/* I - Job */
+ {
+   char			uuid[1024];	/* job-uuid string */
+-  ipp_attribute_t	*attr;		/* job-uuid attribute */
+   _cups_md5_state_t	md5state;	/* MD5 state */
+   unsigned char		md5sum[16];	/* MD5 digest/sum */
+ 
+@@ -1970,7 +1968,7 @@
+   * First see if the job already has a job-uuid attribute; if so, return...
+   */
+ 
+-  if ((attr = ippFindAttribute(job->attrs, "job-uuid", IPP_TAG_URI)) != NULL)
++  if (ippFindAttribute(job->attrs, "job-uuid", IPP_TAG_URI))
+     return;
+ 
+  /*
+@@ -4382,7 +4380,7 @@
+       */
+ 
+       ippAddString(con->response, IPP_TAG_SUBSCRIPTION,
+-                   IPP_TAG_KEYWORD | IPP_TAG_COPY,
++                   (ipp_tag_t)(IPP_TAG_KEYWORD | IPP_TAG_COPY),
+                    "notify-events", NULL, name);
+     }
+     else
+@@ -4396,7 +4394,7 @@
+           count ++;
+ 
+       attr = ippAddStrings(con->response, IPP_TAG_SUBSCRIPTION,
+-                           IPP_TAG_KEYWORD | IPP_TAG_COPY,
++                           (ipp_tag_t)(IPP_TAG_KEYWORD | IPP_TAG_COPY),
+                            "notify-events", count, NULL, NULL);
+ 
+       for (mask = 1, count = 0; mask < CUPSD_EVENT_ALL; mask <<= 1)
+@@ -4676,7 +4674,6 @@
+   http_status_t	status;			/* Policy status */
+   int			i;		/* Looping var */
+   ipp_attribute_t	*attr;		/* Current attribute */
+-  const char		*dest;		/* Destination */
+   cups_ptype_t		dtype;		/* Destination type (printer or class) */
+   char			scheme[HTTP_MAX_URI],
+ 					/* Scheme portion of URI */
+@@ -4725,23 +4722,20 @@
+ 
+   if (!strcmp(resource, "/"))
+   {
+-    dest    = NULL;
+     dtype   = (cups_ptype_t)0;
+     printer = NULL;
+   }
+   else if (!strncmp(resource, "/printers", 9) && strlen(resource) <= 10)
+   {
+-    dest    = NULL;
+     dtype   = (cups_ptype_t)0;
+     printer = NULL;
+   }
+   else if (!strncmp(resource, "/classes", 8) && strlen(resource) <= 9)
+   {
+-    dest    = NULL;
+     dtype   = CUPS_PRINTER_CLASS;
+     printer = NULL;
+   }
+-  else if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
++  else if (!cupsdValidateDest(host, resource, &dtype, &printer))
+   {
+    /*
+     * Bad URI...
+@@ -5734,7 +5728,6 @@
+ 		  ipp_attribute_t *uri)	/* I - Printer URI */
+ {
+   http_status_t		status;		/* Policy status */
+-  const char		*dest;		/* Destination */
+   cups_ptype_t		dtype;		/* Destination type (printer or class) */
+   char			method[HTTP_MAX_URI],
+ 					/* Method portion of URI */
+@@ -5760,7 +5753,7 @@
+                   sizeof(method), username, sizeof(username), host,
+ 		  sizeof(host), &port, resource, sizeof(resource));
+ 
+-  if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL)
++  if (!cupsdValidateDest(host, resource, &dtype, &printer))
+   {
+    /*
+     * Bad URI...
+@@ -6323,8 +6316,7 @@
+   ipp_attribute_t *attr;		/* Current attribute */
+   int		jobid;			/* Job ID */
+   cupsd_job_t	*job;			/* Current job */
+-  const char	*src,			/* Source printer/class */
+-		*dest;			/* Destination */
++  const char	*src;			/* Source printer/class */
+   cups_ptype_t	stype,			/* Source type (printer or class) */
+ 		dtype;			/* Destination type (printer or class) */
+   char		method[HTTP_MAX_URI],	/* Method portion of URI */
+@@ -6359,7 +6351,7 @@
+                   sizeof(method), username, sizeof(username), host,
+ 		  sizeof(host), &port, resource, sizeof(resource));
+ 
+-  if ((dest = cupsdValidateDest(host, resource, &dtype, &dprinter)) == NULL)
++  if (!cupsdValidateDest(host, resource, &dtype, &dprinter))
+   {
+    /*
+     * Bad URI...
+@@ -8053,14 +8045,12 @@
+               _cupsLangString(con->language, message), ap);
+     va_end(ap);
+ 
+-    cupsdLogMessage(status >= IPP_BAD_REQUEST ? CUPSD_LOG_ERROR : CUPSD_LOG_INFO,
+-                    "%s %s: %s",
++    cupsdLogMessage(CUPSD_LOG_DEBUG, "%s %s: %s",
+ 		    ippOpString(con->request->request.op.operation_id),
+ 		    ippErrorString(status), formatted);
+   }
+   else
+-    cupsdLogMessage(status >= IPP_BAD_REQUEST ? CUPSD_LOG_ERROR : CUPSD_LOG_INFO,
+-                    "%s %s",
++    cupsdLogMessage(CUPSD_LOG_DEBUG, "%s %s",
+ 		    ippOpString(con->request->request.op.operation_id),
+ 		    ippErrorString(status));
+ 
+@@ -8375,7 +8365,7 @@
+               else if (con->response->request.status.status_code == IPP_OK)
+ 	      {
+ 		job->state->values[0].integer = attr->values[0].integer;
+-		job->state_value              = attr->values[0].integer;
++		job->state_value              = (ipp_jstate_t)attr->values[0].integer;
+ 	      }
+ 	      break;
+ 
+@@ -8405,7 +8395,7 @@
+ 		if (JobHistory)
+ 		{
+                   job->state->values[0].integer = attr->values[0].integer;
+-                  job->state_value              = attr->values[0].integer;
++                  job->state_value              = (ipp_jstate_t)attr->values[0].integer;
+ 		  cupsdSaveJob(job);
+ 		}
+ 	      }
+diff -urNad cupsys-1.2.2~/scheduler/job.c cupsys-1.2.2/scheduler/job.c
+--- cupsys-1.2.2~/scheduler/job.c	2006-07-11 21:04:48.000000000 +0000
++++ cupsys-1.2.2/scheduler/job.c	2006-08-20 09:36:31.000000000 +0000
+@@ -690,7 +690,7 @@
+ 
+   cupsdHoldSignals();
+ 
+-  cupsdStopAllJobs();
++  cupsdStopAllJobs(1);
+   cupsdSaveAllJobs();
+ 
+   for (job = (cupsd_job_t *)cupsArrayFirst(Jobs);
+@@ -1494,7 +1494,7 @@
+  */
+ 
+ void
+-cupsdStopAllJobs(void)
++cupsdStopAllJobs(int force)		/* I - 1 = Force all filters to stop */
+ {
+   cupsd_job_t	*job;			/* Current job */
+ 
+@@ -1506,7 +1506,7 @@
+        job = (cupsd_job_t *)cupsArrayNext(ActiveJobs))
+     if (job->state_value == IPP_JOB_PROCESSING)
+     {
+-      cupsdStopJob(job, 1);
++      cupsdStopJob(job, force);
+       job->state->values[0].integer = IPP_JOB_PENDING;
+       job->state_value              = IPP_JOB_PENDING;
+     }
+@@ -1728,7 +1728,7 @@
+       break;
+   }
+ 
+-  if (ptr == NULL)
++  if (ptr == NULL && errno)
+   {
+    /*
+     * See if all of the filters and the backend have returned their
+@@ -2053,7 +2053,7 @@
+     }
+     else if (!strcasecmp(line, "State"))
+     {
+-      job->state_value = atoi(value);
++      job->state_value = (ipp_jstate_t)atoi(value);
+ 
+       if (job->state_value < IPP_JOB_PENDING)
+         job->state_value = IPP_JOB_PENDING;
+@@ -2425,7 +2425,6 @@
+ 					/* PRINTER env variable */
+ 			rip_max_cache[255];
+ 					/* RIP_MAX_CACHE env variable */
+-  int			remote_job;	/* Remote print job? */
+   static char		*options = NULL;/* Full list of options */
+   static int		optlength = 0;	/* Length of option buffer */
+ 
+@@ -2567,17 +2566,10 @@
+   FilterLevel += job->cost;
+ 
+  /*
+-  * Determine if we are printing to a remote printer...
+-  */
+-
+-  remote_job = printer->raw && job->num_files > 1 &&
+-               !strncmp(printer->device_uri, "ipp://", 6);
+-
+- /*
+   * Add decompression filters, if any...
+   */
+ 
+-  if (!remote_job && job->compressions[job->current_file])
++  if (!printer->raw && job->compressions[job->current_file])
+   {
+    /*
+     * Add gziptoany filter to the front of the list...
+@@ -2911,7 +2903,7 @@
+   * For remote jobs, we send all of the files in the argument list.
+   */
+ 
+-  if (remote_job)
++  if (printer->remote && job->num_files > 1)
+     argv = calloc(7 + job->num_files, sizeof(char *));
+   else
+     argv = calloc(8, sizeof(char *));
+@@ -2925,7 +2917,7 @@
+   argv[4] = copies;
+   argv[5] = options;
+ 
+-  if (remote_job)
++  if (printer->remote && job->num_files > 1)
+   {
+     for (i = 0; i < job->num_files; i ++)
+     {
+@@ -3018,7 +3010,8 @@
+   envp[envc ++] = device_uri;
+   envp[envc ++] = printer_name;
+ 
+-  if ((filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL)
++  if (!printer->remote &&
++      (filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL)
+   {
+     snprintf(final_content_type, sizeof(final_content_type),
+              "FINAL_CONTENT_TYPE=%s/%s",
+@@ -3059,7 +3052,7 @@
+       cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]=\"DEVICE_URI=%s\"",
+                       job->id, i, sani_uri);
+ 
+-  if (remote_job)
++  if (printer->remote)
+     job->current_file = job->num_files;
+   else
+     job->current_file ++;
+@@ -3355,7 +3348,7 @@
+ 		  slot, filterfds[slot][0], filterfds[slot][1]);
+   cupsdClosePipe(filterfds[slot]);
+ 
+-  if (remote_job)
++  if (printer->remote && job->num_files > 1)
+   {
+     for (i = 0; i < job->num_files; i ++)
+       free(argv[i + 6]);
+@@ -3399,7 +3392,7 @@
+ 
+   cupsArrayDelete(filters);
+ 
+-  if (remote_job)
++  if (printer->remote && job->num_files > 1)
+   {
+     for (i = 0; i < job->num_files; i ++)
+       free(argv[i + 6]);
+diff -urNad cupsys-1.2.2~/scheduler/job.h cupsys-1.2.2/scheduler/job.h
+--- cupsys-1.2.2~/scheduler/job.h	2006-04-14 18:17:18.000000000 +0000
++++ cupsys-1.2.2/scheduler/job.h	2006-08-20 09:36:31.000000000 +0000
+@@ -115,7 +115,7 @@
+ extern void		cupsdSaveJob(cupsd_job_t *job);
+ extern void		cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when);
+ extern void		cupsdSetJobPriority(cupsd_job_t *job, int priority);
+-extern void		cupsdStopAllJobs(void);
++extern void		cupsdStopAllJobs(int force);
+ extern void		cupsdStopJob(cupsd_job_t *job, int force);
+ extern void		cupsdUpdateJob(cupsd_job_t *job);
+ 
+diff -urNad cupsys-1.2.2~/scheduler/main.c cupsys-1.2.2/scheduler/main.c
+--- cupsys-1.2.2~/scheduler/main.c	2006-06-06 17:48:27.000000000 +0000
++++ cupsys-1.2.2/scheduler/main.c	2006-08-20 09:36:31.000000000 +0000
+@@ -660,7 +660,7 @@
+     * inactivity...
+     */
+ 
+-    if (timeout.tv_sec == 86400 && Launchd && LaunchdTimeout &&
++    if (timeout.tv_sec == 86400 && Launchd && LaunchdTimeout && !NumPolled &&
+ 	(!Browsing || !(BrowseLocalProtocols & BROWSE_DNSSD) ||
+ 	 cupsArrayCount(Printers) == 0))
+     {
+@@ -1628,7 +1628,7 @@
+                          kCFBooleanTrue);
+ 
+     if ((Browsing && BrowseLocalProtocols && cupsArrayCount(Printers)) ||
+-        cupsArrayCount(ActiveJobs))
++        cupsArrayCount(ActiveJobs) || NumPolled)
+       CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_RUNATLOAD),
+                            kCFBooleanTrue);
+     else
+diff -urNad cupsys-1.2.2~/scheduler/mime.h cupsys-1.2.2/scheduler/mime.h
+--- cupsys-1.2.2~/scheduler/mime.h	2006-05-03 19:28:29.000000000 +0000
++++ cupsys-1.2.2/scheduler/mime.h	2006-08-20 09:36:31.000000000 +0000
+@@ -34,9 +34,9 @@
+  * C++ magic...
+  */
+ 
+-#  ifdef _cplusplus
++#  ifdef __cplusplus
+ extern "C" {
+-#  endif /* _cplusplus */
++#  endif /* __cplusplus */
+ 
+ 
+ /*
+@@ -147,9 +147,9 @@
+ extern mime_filter_t	*mimeNextFilter(mime_t *mime);
+ extern int		mimeNumFilters(mime_t *mime);
+ 
+-#  ifdef _cplusplus
++#  ifdef __cplusplus
+ }
+-#  endif /* _cplusplus */
++#  endif /* __cplusplus */
+ #endif /* !_CUPS_MIME_H_ */
+ 
+ /*
+diff -urNad cupsys-1.2.2~/scheduler/policy.c cupsys-1.2.2/scheduler/policy.c
+--- cupsys-1.2.2~/scheduler/policy.c	2006-03-08 13:43:38.000000000 +0000
++++ cupsys-1.2.2/scheduler/policy.c	2006-08-20 09:36:31.000000000 +0000
+@@ -195,7 +195,7 @@
+   {
+     cupsdLogMessage(CUPSD_LOG_CRIT, "cupsdCheckPolicy: p=%p, con=%p!", p, con);
+ 
+-    return (0);
++    return ((http_status_t)0);
+   }
+ 
+  /*
+@@ -205,7 +205,7 @@
+   if ((po = cupsdFindPolicyOp(p, con->request->request.op.operation_id)) == NULL)
+   {
+     cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCheckPolicy: No matching operation, returning 0!");
+-    return (0);
++    return ((http_status_t)0);
+   }
+ 
+   con->best = po;
+diff -urNad cupsys-1.2.2~/scheduler/printers.c cupsys-1.2.2/scheduler/printers.c
+--- cupsys-1.2.2~/scheduler/printers.c	2006-07-12 19:42:35.000000000 +0000
++++ cupsys-1.2.2/scheduler/printers.c	2006-08-20 09:36:31.000000000 +0000
+@@ -1492,7 +1492,8 @@
+     else
+       snprintf(resource, sizeof(resource), "/printers/%s", p->name);
+ 
+-    if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL)
++    if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL ||
++        auth->type == AUTH_NONE)
+       auth = cupsdFindPolicyOp(p->op_policy_ptr, IPP_PRINT_JOB);
+ 
+     if (auth)
+@@ -1572,7 +1573,8 @@
+ 
+   printer_type = p->type;
+ 
+-  p->raw = 0;
++  p->raw    = 0;
++  p->remote = 0;
+ 
+   if (p->type & CUPS_PRINTER_REMOTE)
+   {
+@@ -1590,7 +1592,8 @@
+     ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL,
+         	 p->uri);
+ 
+-    p->raw = 1;
++    p->raw    = 1;
++    p->remote = 1;
+   }
+   else
+   {
+@@ -2030,7 +2033,8 @@
+ 	  * Print all files directly...
+ 	  */
+ 
+-	  p->raw = 1;
++	  p->raw    = 1;
++	  p->remote = 1;
+ 	}
+ 	else
+ 	{
+diff -urNad cupsys-1.2.2~/scheduler/printers.h cupsys-1.2.2/scheduler/printers.h
+--- cupsys-1.2.2~/scheduler/printers.h	2006-03-23 21:07:20.000000000 +0000
++++ cupsys-1.2.2/scheduler/printers.h	2006-08-20 09:36:31.000000000 +0000
+@@ -66,6 +66,7 @@
+   char		*device_uri;		/* Device URI */
+   char		*port_monitor;		/* Port monitor */
+   int		raw;			/* Raw queue? */
++  int		remote;			/* Remote queue? */
+   mime_type_t	*filetype;		/* Pseudo-filetype for printer */
+   cups_array_t	*filetypes;		/* Supported file types */
+   void		*job;			/* Current job in queue */
+diff -urNad cupsys-1.2.2~/scheduler/statbuf.c cupsys-1.2.2/scheduler/statbuf.c
+--- cupsys-1.2.2~/scheduler/statbuf.c	2006-04-21 20:07:51.000000000 +0000
++++ cupsys-1.2.2/scheduler/statbuf.c	2006-08-20 09:36:31.000000000 +0000
+@@ -141,6 +141,13 @@
+ 
+ 
+  /*
++  * Clear the errno variable since not all systems clear it after a
++  * successful read...
++  */
++
++  errno = 0;
++
++ /*
+   * Check if the buffer already contains a full line...
+   */
+ 
+@@ -172,6 +179,7 @@
+ 
+       *loglevel = CUPSD_LOG_NONE;
+       line[0]   = '\0';
++      errno     = 0;
+ 
+       return (line);
+     }
+diff -urNad cupsys-1.2.2~/scheduler/subscriptions.c cupsys-1.2.2/scheduler/subscriptions.c
+--- cupsys-1.2.2~/scheduler/subscriptions.c	2006-07-11 17:56:57.000000000 +0000
++++ cupsys-1.2.2/scheduler/subscriptions.c	2006-08-20 09:36:31.000000000 +0000
+@@ -1245,13 +1245,12 @@
+ void
+ cupsdUpdateNotifierStatus(void)
+ {
+-  char		*ptr,			/* Pointer to end of line in buffer */
+-		message[1024];		/* Pointer to message text */
++  char		message[1024];		/* Pointer to message text */
+   int		loglevel;		/* Log level for message */
+ 
+ 
+-  while ((ptr = cupsdStatBufUpdate(NotifierStatusBuffer, &loglevel,
+-                                   message, sizeof(message))) != NULL)
++  while (cupsdStatBufUpdate(NotifierStatusBuffer, &loglevel,
++                            message, sizeof(message)))
+     if (!strchr(NotifierStatusBuffer->buffer, '\n'))
+       break;
+ }
+@@ -1506,7 +1505,6 @@
+ {
+   int	pid;				/* Notifier process ID */
+   int	fds[2];				/* Pipe file descriptors */
+-  int	envc;				/* Number of environment variables */
+   char	*argv[4],			/* Command-line arguments */
+ 	*envp[MAX_ENV],			/* Environment variables */
+ 	user_data[128],			/* Base-64 encoded user data */
+@@ -1546,7 +1544,7 @@
+   * Setup the environment...
+   */
+ 
+-  envc = cupsdLoadEnv(envp, (int)(sizeof(envp) / sizeof(envp[0])));
++  cupsdLoadEnv(envp, (int)(sizeof(envp) / sizeof(envp[0])));
+ 
+  /*
+   * Create pipes as needed...
+diff -urNad cupsys-1.2.2~/scheduler/sysman.c cupsys-1.2.2/scheduler/sysman.c
+--- cupsys-1.2.2~/scheduler/sysman.c	2006-03-18 03:05:12.000000000 +0000
++++ cupsys-1.2.2/scheduler/sysman.c	2006-08-20 09:36:31.000000000 +0000
+@@ -289,7 +289,7 @@
+ 
+       Sleeping = 1;
+ 
+-      cupsdStopAllJobs();
++      cupsdStopAllJobs(0);
+       cupsdSaveAllJobs();
+ 
+       for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
+@@ -350,6 +350,7 @@
+ 	  p->browse_time = 0;
+ 
+         cupsdSendBrowseList();
++	cupsdRestartPolling();
+       }
+       else
+         cupsdLogMessage(CUPSD_LOG_DEBUG,
+diff -urNad cupsys-1.2.2~/systemv/accept.c cupsys-1.2.2/systemv/accept.c
+--- cupsys-1.2.2~/systemv/accept.c	2006-02-15 03:21:04.000000000 +0000
++++ cupsys-1.2.2/systemv/accept.c	2006-08-20 09:36:31.000000000 +0000
+@@ -58,6 +58,8 @@
+   int		cancel;			/* Cancel jobs? */
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * See what operation we're supposed to do...
+   */
+diff -urNad cupsys-1.2.2~/systemv/cancel.c cupsys-1.2.2/systemv/cancel.c
+--- cupsys-1.2.2~/systemv/cancel.c	2006-06-26 18:34:20.000000000 +0000
++++ cupsys-1.2.2/systemv/cancel.c	2006-08-20 09:36:31.000000000 +0000
+@@ -60,6 +60,8 @@
+   ipp_op_t	op;			/* Operation */
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * Setup to cancel individual print jobs...
+   */
+diff -urNad cupsys-1.2.2~/systemv/cupsaddsmb.c cupsys-1.2.2/systemv/cupsaddsmb.c
+--- cupsys-1.2.2~/systemv/cupsaddsmb.c	2006-07-18 19:53:24.000000000 +0000
++++ cupsys-1.2.2/systemv/cupsaddsmb.c	2006-08-20 09:36:31.000000000 +0000
+@@ -78,6 +78,8 @@
+   cups_dest_t	*dests;			/* Printers */
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * Parse command-line arguments...
+   */
+diff -urNad cupsys-1.2.2~/systemv/cupstestdsc.c cupsys-1.2.2/systemv/cupstestdsc.c
+--- cupsys-1.2.2~/systemv/cupstestdsc.c	2006-04-14 17:50:39.000000000 +0000
++++ cupsys-1.2.2/systemv/cupstestdsc.c	2006-08-20 09:36:31.000000000 +0000
+@@ -65,6 +65,8 @@
+   int		num_files;		/* Number of files tested */
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * Collect command-line arguments...
+   */
+@@ -129,7 +131,6 @@
+ 		saw_end_setup,		/* %%EndSetup seen? */
+ 		saw_page,		/* %%Page seen? */
+ 		saw_trailer,		/* %%Trailer seen? */
+-		saw_eof,		/* %%EOF seen? */
+ 		saw_long_line;		/* Saw long lines? */
+ 
+ 
+@@ -162,7 +163,6 @@
+   saw_end_comments = 0;
+   saw_end_prolog   = 0;
+   saw_end_setup    = 0;
+-  saw_eof          = 0;
+   saw_long_line    = 0;
+   saw_page         = 0;
+   saw_pages        = 0;
+diff -urNad cupsys-1.2.2~/systemv/cupstestppd.c cupsys-1.2.2/systemv/cupstestppd.c
+--- cupsys-1.2.2~/systemv/cupstestppd.c	2006-05-19 19:39:28.000000000 +0000
++++ cupsys-1.2.2/systemv/cupstestppd.c	2006-08-20 09:36:31.000000000 +0000
+@@ -113,6 +113,8 @@
+                                 "JCL", "PAGE", "PROLOG" };
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * Display PPD files for each file listed on the command-line...
+   */
+@@ -306,9 +308,9 @@
+       * Look for default keywords with no matching option...
+       */
+ 
+-      for (i = 0; i < ppd->num_attrs; i ++)
++      for (j = 0; j < ppd->num_attrs; j ++)
+       {
+-	attr = ppd->attrs[i];
++	attr = ppd->attrs[j];
+ 
+         if (!strcmp(attr->name, "DefaultColorSpace") ||
+ 	    !strcmp(attr->name, "DefaultFont") ||
+@@ -327,11 +329,11 @@
+ 	    * Check that the default option value matches a choice...
+ 	    */
+ 
+-	    for (j = 0; j < option->num_choices; j ++)
+-	      if (!strcmp(option->choices[j].choice, attr->value))
++	    for (k = 0; k < option->num_choices; k ++)
++	      if (!strcmp(option->choices[k].choice, attr->value))
+ 	        break;
+ 
+-            if (j >= option->num_choices)
++            if (k >= option->num_choices)
+ 	    {
+ 	      if (verbose >= 0)
+ 	      {
+@@ -1010,7 +1012,10 @@
+         char	*languages,		/* Copy of attribute value */
+ 		*langstart,		/* Start of current language */
+ 		*langptr,		/* Pointer into languages */
+-		keyword[PPD_MAX_NAME];	/* Localization keyword */
++		keyword[PPD_MAX_NAME],	/* Localization keyword */
++		ckeyword[PPD_MAX_NAME];	/* Custom option keyword */
++	ppd_coption_t	*coption;	/* Custom option */
++	ppd_cparam_t	*cparam;	/* Custom parameter */
+ 
+ 
+         languages = strdup(attr->value);
+@@ -1104,7 +1109,61 @@
+ 	             option->keyword);
+             for (j = 0; j < option->num_choices; j ++)
+ 	    {
+-	      if (!ppdFindAttr(ppd, keyword, option->choices[j].choice))
++	      if (!strcasecmp(option->choices[j].choice, "Custom") &&
++	          (coption = ppdFindCustomOption(ppd,
++		                                 option->keyword)) != NULL)
++	      {
++		snprintf(ckeyword, sizeof(ckeyword), "%s.Custom%s",
++		         langstart, option->keyword);
++
++		if (!ppdFindAttr(ppd, ckeyword, "True"))
++		{
++		  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 ++;
++		}
++
++                if (strcasecmp(option->keyword, "PageSize"))
++		{
++		  for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
++		       cparam;
++		       cparam = (ppd_cparam_t *)cupsArrayNext(coption->params))
++		  {
++		    snprintf(ckeyword, sizeof(ckeyword), "%s.ParamCustom%s",
++		             langstart, option->keyword);
++		    if (!ppdFindAttr(ppd, ckeyword, cparam->name))
++		    {
++		      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),
++				        cparam->name);
++        	      }
++
++		      errors ++;
++		    }
++                  }
++                }
++	      }
++	      else if (!ppdFindAttr(ppd, keyword, option->choices[j].choice))
+ 	      {
+ 		if (verbose >= 0)
+ 		{
+@@ -1184,9 +1243,10 @@
+ 	  if (!errors && !verbose)
+ 	    _cupsLangPuts(stdout, _(" FAIL\n"));
+ 
+-	  _cupsLangPuts(stdout,
+-	                _("      **FAIL**  1284DeviceId must be 1284DeviceID!\n"
+-			  "                REF: Page 72, section 5.5\n"));
++	  _cupsLangPrintf(stdout,
++	                  _("      **FAIL**  %s must be 1284DeviceID!\n"
++			    "                REF: Page 72, section 5.5\n"),
++			  attr->name);
+         }
+ 
+ 	errors ++;
+@@ -1205,9 +1265,9 @@
+ 	* Look for default keywords with no corresponding option...
+ 	*/
+ 
+-	for (i = 0; i < ppd->num_attrs; i ++)
++	for (j = 0; j < ppd->num_attrs; j ++)
+ 	{
+-	  attr = ppd->attrs[i];
++	  attr = ppd->attrs[j];
+ 
+           if (!strcmp(attr->name, "DefaultColorSpace") ||
+ 	      !strcmp(attr->name, "DefaultColorSep") ||
+diff -urNad cupsys-1.2.2~/systemv/lp.c cupsys-1.2.2/systemv/lp.c
+--- cupsys-1.2.2~/systemv/lp.c	2006-03-06 13:02:23.000000000 +0000
++++ cupsys-1.2.2/systemv/lp.c	2006-08-20 09:36:31.000000000 +0000
+@@ -117,6 +117,8 @@
+     return (0);
+ #endif /* __sun */
+ 
++  _cupsSetLocale();
++
+   silent      = 0;
+   printer     = NULL;
+   num_dests   = 0;
+diff -urNad cupsys-1.2.2~/systemv/lpadmin.c cupsys-1.2.2/systemv/lpadmin.c
+--- cupsys-1.2.2~/systemv/lpadmin.c	2006-05-18 21:00:56.000000000 +0000
++++ cupsys-1.2.2/systemv/lpadmin.c	2006-08-20 09:36:31.000000000 +0000
+@@ -92,6 +92,8 @@
+   cups_option_t	*options;	/* Options */
+ 
+ 
++  _cupsSetLocale();
++
+   http        = NULL;
+   printer     = NULL;
+   num_options = 0;
+diff -urNad cupsys-1.2.2~/systemv/lpinfo.c cupsys-1.2.2/systemv/lpinfo.c
+--- cupsys-1.2.2~/systemv/lpinfo.c	2006-01-13 02:52:47.000000000 +0000
++++ cupsys-1.2.2/systemv/lpinfo.c	2006-08-20 09:36:31.000000000 +0000
+@@ -62,6 +62,8 @@
+   int		long_status;		/* Long listing? */
+ 
+ 
++  _cupsSetLocale();
++
+   http        = NULL;
+   long_status = 0;
+ 
+diff -urNad cupsys-1.2.2~/systemv/lpmove.c cupsys-1.2.2/systemv/lpmove.c
+--- cupsys-1.2.2~/systemv/lpmove.c	2006-01-29 14:39:44.000000000 +0000
++++ cupsys-1.2.2/systemv/lpmove.c	2006-08-20 09:36:31.000000000 +0000
+@@ -66,6 +66,8 @@
+ 		*dest;			/* New destination */
+ 
+ 
++  _cupsSetLocale();
++
+   dest      = NULL;
+   dests     = NULL;
+   http      = NULL;
+diff -urNad cupsys-1.2.2~/systemv/lpoptions.c cupsys-1.2.2/systemv/lpoptions.c
+--- cupsys-1.2.2~/systemv/lpoptions.c	2006-07-18 19:53:24.000000000 +0000
++++ cupsys-1.2.2/systemv/lpoptions.c	2006-08-20 09:36:31.000000000 +0000
+@@ -69,6 +69,8 @@
+  		*option;		/* Current option */
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * Loop through the command-line arguments...
+   */
+diff -urNad cupsys-1.2.2~/systemv/lppasswd.c cupsys-1.2.2/systemv/lppasswd.c
+--- cupsys-1.2.2~/systemv/lppasswd.c	2006-01-13 01:55:20.000000000 +0000
++++ cupsys-1.2.2/systemv/lppasswd.c	2006-08-20 09:36:31.000000000 +0000
+@@ -102,6 +102,8 @@
+ #endif /* HAVE_SIGACTION && !HAVE_SIGSET*/
+ 
+ 
++  _cupsSetLocale();
++
+  /*
+   * Check to see if stdin, stdout, and stderr are still open...
+   */
+diff -urNad cupsys-1.2.2~/systemv/lpstat.c cupsys-1.2.2/systemv/lpstat.c
+--- cupsys-1.2.2~/systemv/lpstat.c	2006-06-06 20:08:13.000000000 +0000
++++ cupsys-1.2.2/systemv/lpstat.c	2006-08-20 09:36:31.000000000 +0000
+@@ -84,41 +84,8 @@
+   char		op;			/* Last operation on command-line */
+ 
+ 
+- /*
+-  * 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
+-  {
+-    const char	*lc_time;		/* Current LC_TIME value */
+-    char	new_lc_time[255],	/* New LC_TIME value */
+-		*charset;		/* Pointer to character set */
+-
+-    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");
++  _cupsSetLocale();
+ 
+-    setlocale(LC_TIME, new_lc_time);
+-  }
+-#endif /* LC_TIME */
+-  
+  /*
+   * Parse command-line options...
+   */
+diff -urNad cupsys-1.2.2~/test/4.2-cups-printer-ops.test cupsys-1.2.2/test/4.2-cups-printer-ops.test
+--- cupsys-1.2.2~/test/4.2-cups-printer-ops.test	2006-05-05 16:33:57.000000000 +0000
++++ cupsys-1.2.2/test/4.2-cups-printer-ops.test	2006-08-20 09:36:31.000000000 +0000
+@@ -105,7 +105,7 @@
+ 	ATTR name requesting-user-name $user
+ 
+         GROUP subscription
+-	ATTR uri notify-recipient testnotify
++	ATTR uri notify-recipient testnotify://
+ 	ATTR keyword notify-events printer-added,printer-modified,printer-deleted
+ 
+ 	# What statuses are OK?
+diff -urNad cupsys-1.2.2~/test/4.4-subscription-ops.test cupsys-1.2.2/test/4.4-subscription-ops.test
+--- cupsys-1.2.2~/test/4.4-subscription-ops.test	2005-11-14 21:53:30.000000000 +0000
++++ cupsys-1.2.2/test/4.4-subscription-ops.test	2006-08-20 09:36:31.000000000 +0000
+@@ -18,7 +18,7 @@
+ 	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
+ 
+         GROUP subscription
+-	ATTR uri notify-recipient testnotify
++	ATTR uri notify-recipient testnotify://
+ 	ATTR keyword notify-events printer-state-changed
+ 	ATTR integer notify-lease-duration 5
+ 
+@@ -71,12 +71,12 @@
+ 	ATTR uri printer-uri $method://$hostname:$port/printers/Test1
+ 
+         GROUP subscription
+-	ATTR uri notify-recipient testnotify
++	ATTR uri notify-recipient testnotify://
+ 	ATTR keyword notify-events printer-state-changed
+ 	ATTR integer notify-lease-duration 5
+ 
+         GROUP subscription
+-	ATTR uri notify-recipient testnotify
++	ATTR uri notify-recipient testnotify://
+ 	ATTR keyword notify-events printer-config-changed
+ 	ATTR integer notify-lease-duration 5
+ 

Modified: cupsys/branches/cups-1.2/debian/patches/00list
==============================================================================
--- cupsys/branches/cups-1.2/debian/patches/00list	(original)
+++ cupsys/branches/cups-1.2/debian/patches/00list	Sun Aug 20 09:45:52 2006
@@ -1,4 +1,4 @@
-00_r5818.dpatch
+00_r5845.dpatch
 02_configure.dpatch
 #03_manext.dpatch
 03_clean.dpatch



More information about the Pkg-cups-devel mailing list