]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Load cups into easysw/current.
authorjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 20 Mar 2007 18:25:41 +0000 (18:25 +0000)
committerjlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 20 Mar 2007 18:25:41 +0000 (18:25 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@289 a1ca3aef-8c08-0410-bb20-df032aa958be

51 files changed:
CHANGES-1.2.txt
CHANGES.txt
CREDITS.txt
backend/ipp.c
backend/usb-darwin.c
berkeley/lpr.c
cgi-bin/admin.c
cgi-bin/cgi-private.h
config-scripts/cups-common.m4
config-scripts/cups-directories.m4
config-scripts/cups-network.m4
config.h.in
cups/adminutil.c
cups/encode.c
cups/localize.c
cups/request.c
cups/string.c
cups/testlang.c
doc/help/translation.html
fonts/Vera.ttf [new file with mode: 0644]
init/cups.sh.in
init/org.cups.cupsd.plist
pdftops/Catalog.cxx
pdftops/Catalog.h
scheduler/auth.c
scheduler/auth.h
scheduler/client.c
scheduler/conf.c
scheduler/conf.h
scheduler/cups-driverd.c
scheduler/cupsd.h
scheduler/dirsvc.c
scheduler/ipp.c
scheduler/job.c
scheduler/main.c
scheduler/printers.c
scheduler/quotas.c
systemv/lp.c
systemv/lpoptions.c
templates/admin.tmpl
templates/de/admin.tmpl
templates/es/admin.tmpl
templates/et/admin.tmpl
templates/fr/admin.tmpl
templates/it/admin.tmpl
templates/ja/admin.tmpl
templates/pl/admin.tmpl
templates/sv/admin.tmpl
tools/buttons.gif [new file with mode: 0644]
tools/buttons.txt [new file with mode: 0644]
tools/makebuttons [new file with mode: 0755]

index 8c0c5f1459b75f444a02e5873b184ab2e38c6f0c..d1fe1e7637175026d331753debf69a6f1792d041 100644 (file)
@@ -1,6 +1,61 @@
 CHANGES-1.2.txt
 ---------------
 
+CHANGES IN CUPS V1.2.10
+
+       - ppdLocalize() now supports localizing for Japanese
+         using the "jp" locale name used by the ppdmerge
+         program from the CUPS DDK 1.1.0 (STR #2301)
+       - _cupsAdminSetServerSettings() did not support changing
+         of top-level directives as designed.
+       - The init script path check was broken.
+       - CUPS incorrectly used the attribute "notify-recipient"
+         instead of "notify-recicpient-uri" in several places
+         (STR #2297)
+       - Fixed a configure script bug on MirBSD (STR #2294)
+       - The pdftops filter did not limit the amount of recursion
+         of page sets (STR #2293)
+       - Custom page sizes with fractional point sizes did not
+         work (STR #2296)
+       - The lpoptions command would crash when adding or removing
+         options on a system with no printers (STR #2295)
+
+
+CHANGES IN CUPS V1.2.9
+
+       - The scheduler did not use the default job-sheets
+         (banners) for implicit classes (STR #2284)
+       - The scheduler could crash when listing complete jobs
+         that had been unloaded from memory (STR #2288)
+       - The French localization was doubled up (STR #2287)
+       - Build system fixes for several platforms (STR #2260,
+         STR #2275)
+       - The scheduler's openssl certificate generation code was
+         broken on some platforms (STR #2282)
+       - The scheduler's log rotation check for devices was
+         broken (STR #2278)
+       - The LPD mini-daemon did not handle the document-format
+         option correctly (STR #2266)
+       - The pdftops filter ignored the "match" size option in the
+         pdftops.conf file (STR #2285)
+       - cupstestppd now validates UTF-8 text strings in
+         globalized PPD files (STR #2283)
+       - The outputorder=reverse option did not work with all
+         printers (STR #2279)
+       - Classes containing other classes did not always work
+         (STR #2255)
+       - Printer location and description information was lost
+         if the corresponding string contained the "#" character
+         (STR #2254)
+       - cupsRemoveOption() did not work properly (STR #2264)
+       - The USB backend did not work with some USB to parallel
+         cables on Mac OS X.
+       - The test page did not print the rulers properly on
+         large media sizes (STR #2252)
+       - The text filter could crash when pretty printing certain
+         types of files (STR #2158)
+
+
 CHANGES IN CUPS V1.2.8
 
        - Documentation fixes (STR #2141, STR #2157)
index f5e4af6d3a621cc01c764e1bc9f90c75391bc70b..852ce9c4bb0ec759f1c9e7ca42982ea6dca392a5 100644 (file)
@@ -1,9 +1,13 @@
-CHANGES.txt - 2007-02-19
+CHANGES.txt - 2007-03-19
 ------------------------
 
 CHANGES IN CUPS V1.3
 
        - Documentation updates (STR #2130, STR #2131)
+       - Added new public cupsAdminGetServerSettings() and
+         cupsAdminSetServerSettings() APIs.
+       - Added new "makebuttons" script in the "tools" directory
+         for creating web interface buttons (STR #2231)
        - Added support for DNS-SD (aka "Bonjour") printer sharing
          (STR #1171)
        - Job operations (cancel, hold, release, etc.) from the
index c839ba1e4c6fa779418390e6d07d729449f87970..221ebb6acace1e37e9cefe75a52763528ed13c80 100644 (file)
@@ -6,7 +6,7 @@ like to thank the following individuals for their contributions:
 
     Nathaniel Barbour              - Lots of testing and feedback.
     N. Becker                      - setsid().
-    Philippe Combes                - French localization.
+    Philippe Combes                - French localization and buttons script.
     Jean-Eric Cuendet              - GhostScript filters for CUPS.
     Van Dang                       - HTTP and IPP policeman.
     L. Peter Deutsch               - MD5 code.
index c7d647d141450f46bdc96445821b58670143987d..3cc342f2cfdf68c1ca5e08f66957c922c995d483 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: ipp.c 6318 2007-03-06 04:36:55Z mike $"
+ * "$Id: ipp.c 6365 2007-03-19 20:56:57Z mike $"
  *
  *   IPP backend for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -521,6 +521,9 @@ main(int  argc,                             /* I - Number of command-line args */
 
     if ((http = httpConnectEncrypt(hostname, port, cupsEncryption())) == NULL)
     {
+      if (job_cancelled)
+       break;
+
       if (getenv("CLASS") != NULL)
       {
        /*
@@ -567,10 +570,21 @@ main(int  argc,                           /* I - Number of command-line args */
        perror("ERROR: Unable to connect to IPP host");
        sleep(30);
       }
+
+      if (job_cancelled)
+       break;
     }
   }
   while (http == NULL);
 
+  if (job_cancelled)
+  {
+    if (argc == 6 || strcmp(filename, argv[6]))
+      unlink(filename);
+
+    return (CUPS_BACKEND_FAILED);
+  }
+
   fputs("STATE: -connecting-to-device\n", stderr);
   fprintf(stderr, "INFO: Connected to %s...\n", hostname);
 
@@ -1667,5 +1681,5 @@ sigterm_handler(int sig)          /* I - Signal */
 
 
 /*
- * End of "$Id: ipp.c 6318 2007-03-06 04:36:55Z mike $".
+ * End of "$Id: ipp.c 6365 2007-03-19 20:56:57Z mike $".
  */
index 4e0697752118122609678696d010f5d725abb10d..aefbc95cdd00fd91e74af2bd108c0376cb5bac6c 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * "$Id: usb-darwin.c 6302 2007-02-22 19:36:36Z mike $"
+ * "$Id: usb-darwin.c 6365 2007-03-19 20:56:57Z mike $"
  *
- * © Copyright 2005-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright © 2005-2007 Apple Inc. All rights reserved.
  *
  * IMPORTANT:  This Apple software is supplied to you by Apple Computer,
  * Inc. ("Apple") in consideration of your agreement to the following
@@ -185,6 +185,8 @@ typedef struct printer_data_s {                     /**** Printer context data ****/
 
   UInt32               location;
   Boolean              waitEOF;
+  
+  CFRunLoopTimerRef statusTimer;
 
   pthread_cond_t       reqWaitCompCond;
   pthread_mutex_t      reqWaitMutex;
@@ -206,6 +208,7 @@ typedef struct printer_data_s {                     /**** Printer context data ****/
 
 static Boolean list_device_callback(void *refcon, io_service_t obj);
 static Boolean find_device_callback(void *refcon, io_service_t obj);
+static void statusTimerCallback(CFRunLoopTimerRef timer, void *info);
 static void iterate_printers(iterator_callback_t callBack, void *userdata);
 static void device_added(void *userdata, io_iterator_t iterator);
 static void copy_deviceinfo(CFStringRef deviceIDString, CFStringRef *make, CFStringRef *model, CFStringRef *serial);
@@ -637,11 +640,11 @@ static Boolean list_device_callback(void *refcon, io_service_t obj)
 static Boolean find_device_callback(void *refcon, io_service_t obj)
 {
   Boolean keepLooking = true;
+  printer_data_t *userData = (printer_data_t *)refcon;
 
-  if (obj != 0x0 && refcon != NULL) {
+  if (obj != 0x0) {
     CFStringRef idString = NULL;
     UInt32 location = -1;
-    printer_data_t *userData = (printer_data_t *)refcon;
 
     copy_devicestring(obj, &idString, &location);
     if (idString != NULL) {
@@ -676,12 +679,33 @@ static Boolean find_device_callback(void *refcon, io_service_t obj)
     }
   }
   else {               
-    keepLooking = (refcon != NULL && ((printer_data_t *)refcon)->printerObj == 0);
+    keepLooking = (userData->printerObj == 0);
+    if (obj == 0x0 && keepLooking) {
+      CFRunLoopTimerContext context = { 0, userData, NULL, NULL, NULL };
+      CFRunLoopTimerRef timer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + 1.0, 10, 0x0, 0x0, statusTimerCallback, &context);
+      if (timer != NULL) {
+       CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopDefaultMode);
+       userData->statusTimer = timer;
+      }
+    }
+  }
+  
+  if (!keepLooking && userData->statusTimer != NULL) {
+    fputs("STATE: -offline-error\n", stderr);
+    fputs("INFO: Printer is now on-line.\n", stderr);
+    CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), userData->statusTimer, kCFRunLoopDefaultMode);
+    CFRelease(userData->statusTimer);
+    userData->statusTimer = NULL;
   }
 
   return keepLooking;
 }
 
+static void statusTimerCallback (CFRunLoopTimerRef timer, void *info)
+{
+  fputs("STATE: +offline-error\n", stderr);
+  fputs("INFO: Printer is currently off-line.\n", stderr);
+}
 
 #pragma mark -
 /*
@@ -877,23 +901,20 @@ static kern_return_t unload_classdriver(classdriver_context_t ***classDriver)
 
 static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *driverBundlePath)
 {
-  IOCFPlugInInterface **iodev = NULL;
-  SInt32 score;
+  IOCFPlugInInterface  **iodev = NULL;
+  SInt32               score;
+  kern_return_t                kr;
+  printer_interface_t  intf;
+  HRESULT              res;
+
+  kr = IOCreatePlugInInterfaceForService(printer->printerObj, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &iodev, &score);
+  if (kr == kIOReturnSuccess)
+  {
+    if ((res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &intf)) == noErr)
+    {
+      *driverBundlePath = IORegistryEntryCreateCFProperty(printer->printerObj, kUSBClassDriverProperty, NULL, kNilOptions);
 
-  kern_return_t kr = IOCreatePlugInInterfaceForService(printer->printerObj, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &iodev, &score);
-  if (kr == kIOReturnSuccess) {
-    printer_interface_t intf;
-    HRESULT res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &intf);
-    if (res == noErr) {
-      CFMutableDictionaryRef properties = NULL;
-
-      kr = IORegistryEntryCreateCFProperties(printer->printerObj, &properties, NULL, kNilOptions);
-      if (kr == kIOReturnSuccess) {
-       if (properties != NULL) {
-         *driverBundlePath = (CFStringRef) CFDictionaryGetValue(properties, kUSBClassDriverProperty);
-       }
-       kr = load_classdriver(*driverBundlePath, intf, &printer->printerDriver);
-      }
+      kr = load_classdriver(*driverBundlePath, intf, &printer->printerDriver);
 
       if (kr != kIOReturnSuccess)
        (*intf)->Release(intf);
@@ -1034,40 +1055,37 @@ static OSStatus copy_deviceid(classdriver_context_t **printer, CFStringRef *devi
 
 static void copy_devicestring(io_service_t usbInterface, CFStringRef *deviceID, UInt32 *deviceLocation)
 {
-  IOCFPlugInInterface **iodev = NULL;
-  SInt32 score;
-
-  kern_return_t kr = IOCreatePlugInInterfaceForService(usbInterface, kIOUSBInterfaceUserClientTypeID, 
+  IOCFPlugInInterface  **iodev = NULL;
+  SInt32               score;
+  kern_return_t                kr;
+  printer_interface_t  intf;
+  HRESULT              res;
+  classdriver_context_t        **klassDriver = NULL;
+  CFStringRef          driverBundlePath;
+
+  kr = IOCreatePlugInInterfaceForService(usbInterface, kIOUSBInterfaceUserClientTypeID, 
                                                       kIOCFPlugInInterfaceID, &iodev, &score);
-  if (kr == kIOReturnSuccess) {
-    printer_interface_t intf;
-
-    HRESULT res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &intf);
-    if (res == noErr) {
+  if (kr == kIOReturnSuccess)
+  {
+    if ((res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &intf)) == noErr)
+    {
       /* ignore the result for location id... */
       (void)(*intf)->GetLocationID(intf, deviceLocation);
 
-      CFMutableDictionaryRef properties = NULL;
-      kr = IORegistryEntryCreateCFProperties(usbInterface, &properties, NULL, kNilOptions);
-      if (kIOReturnSuccess == kr) {
-       classdriver_context_t **klassDriver = NULL;
-       CFStringRef driverBundlePath = NULL;
+      driverBundlePath = IORegistryEntryCreateCFProperty( usbInterface, kUSBClassDriverProperty, NULL, kNilOptions );
 
-       if (properties != NULL) {
-         driverBundlePath = (CFStringRef) CFDictionaryGetValue(properties, kUSBClassDriverProperty);
-       }
+      kr = load_classdriver(driverBundlePath, intf, &klassDriver);
 
-       kr = load_classdriver(driverBundlePath, intf, &klassDriver);
-       if (kr != kIOReturnSuccess && driverBundlePath != NULL)
-         kr = load_classdriver(NULL, intf, &klassDriver);
-       if (kr == kIOReturnSuccess && klassDriver != NULL) {                            
+      if (kr != kIOReturnSuccess && driverBundlePath != NULL)
+       kr = load_classdriver(NULL, intf, &klassDriver);
+
+      if (kr == kIOReturnSuccess && klassDriver != NULL)                       
          kr = copy_deviceid(klassDriver, deviceID);                                            
-       }
-       unload_classdriver(&klassDriver);
 
-       if (properties != NULL)
-         CFRelease(properties);
-      }
+      unload_classdriver(&klassDriver);
+
+      if (driverBundlePath != NULL)
+       CFRelease(driverBundlePath);
 
       /* (*intf)->Release(intf); */
     }          
@@ -1710,5 +1728,5 @@ static void usbGetDevState(printer_data_t *userData, cups_sc_status_t *status, c
 }
 
 /*
- * End of "$Id: usb-darwin.c 6302 2007-02-22 19:36:36Z mike $".
+ * End of "$Id: usb-darwin.c 6365 2007-03-19 20:56:57Z mike $".
  */
index 893c62bf327d719737ba96ac9fde39514e0027cd..c4bf045b987cbc8130f8786dc473c8a330ce3473 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: lpr.c 5925 2006-09-05 19:43:11Z mike $"
+ * "$Id: lpr.c 6356 2007-03-19 13:54:48Z mike $"
  *
  *   "lpr" command for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products.
+ *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -232,7 +232,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
              snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(),
                       httpGetHostname(NULL, buffer, sizeof(buffer)));
-             num_options = cupsAddOption("notify-recipient", email,
+             num_options = cupsAddOption("notify-recipient-uri", email,
                                          num_options, &options);
            }
            break;
@@ -529,5 +529,5 @@ sighandler(int s)                   /* I - Signal number */
 
 
 /*
- * End of "$Id: lpr.c 5925 2006-09-05 19:43:11Z mike $".
+ * End of "$Id: lpr.c 6356 2007-03-19 13:54:48Z mike $".
  */
index de4bcd1123850a669e0cbabe68d035f65885f666..dd8e25f98b644e6472654f47170f8c1875ceaa69 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: admin.c 6304 2007-02-22 22:06:23Z mike $"
+ * "$Id: admin.c 6361 2007-03-19 16:01:28Z mike $"
  *
  *   Administration CGI for the Common UNIX Printing System (CUPS).
  *
@@ -360,8 +360,8 @@ do_add_rss_subscription(http_t *http)       /* I - HTTP connection */
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
                NULL, user);
 
-  ippAddString(request, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI, "notify-recipient",
-               NULL, rss_uri);
+  ippAddString(request, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI,
+               "notify-recipient-uri", NULL, rss_uri);
   ippAddStrings(request, IPP_TAG_SUBSCRIPTION, IPP_TAG_KEYWORD, "notify-events",
                 num_events, NULL, events);
   ippAddInteger(request, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER,
@@ -1834,6 +1834,10 @@ do_config_server(http_t *http)           /* I - HTTP connection */
                        *remote_printers,
                                        /* REMOTE_PRINTERS value */
                        *share_printers,/* SHARE_PRINTERS value */
+#ifdef HAVE_GSSAPI
+                       *default_auth_type,
+                                       /* DefaultAuthType value */
+#endif /* HAVE_GSSAPI */
                        *user_cancel_any;
                                        /* USER_CANCEL_ANY value */
 
@@ -1842,12 +1846,17 @@ do_config_server(http_t *http)          /* I - HTTP connection */
     * Get the checkbox values from the form...
     */
 
-    debug_logging   = cgiGetVariable("DEBUG_LOGGING") ? "1" : "0";
-    remote_admin    = cgiGetVariable("REMOTE_ADMIN") ? "1" : "0";
-    remote_any      = cgiGetVariable("REMOTE_ANY") ? "1" : "0";
-    remote_printers = cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0";
-    share_printers  = cgiGetVariable("SHARE_PRINTERS") ? "1" : "0";
-    user_cancel_any = cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0";
+    debug_logging     = cgiGetVariable("DEBUG_LOGGING") ? "1" : "0";
+    remote_admin      = cgiGetVariable("REMOTE_ADMIN") ? "1" : "0";
+    remote_any        = cgiGetVariable("REMOTE_ANY") ? "1" : "0";
+    remote_printers   = cgiGetVariable("REMOTE_PRINTERS") ? "1" : "0";
+    share_printers    = cgiGetVariable("SHARE_PRINTERS") ? "1" : "0";
+    user_cancel_any   = cgiGetVariable("USER_CANCEL_ANY") ? "1" : "0";
+#ifdef HAVE_GSSAPI
+    default_auth_type = cgiGetVariable("KERBEROS") ? "Negotiate" : "Basic";
+
+    fprintf(stderr, "DEBUG: DefaultAuthType %s\n", default_auth_type);
+#endif /* HAVE_GSSAPI */
 
    /*
     * Get the current server settings...
@@ -1878,6 +1887,11 @@ do_config_server(http_t *http)           /* I - HTTP connection */
                                               num_settings, settings)) ||
         strcmp(share_printers, cupsGetOption(CUPS_SERVER_SHARE_PRINTERS,
                                              num_settings, settings)) ||
+#ifdef HAVE_GSSAPI
+        !cupsGetOption("DefaultAuthType", num_settings, settings) ||
+       strcmp(default_auth_type, cupsGetOption("DefaultAuthType",
+                                               num_settings, settings)) ||
+#endif /* HAVE_GSSAPI */
         strcmp(user_cancel_any, cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY,
                                               num_settings, settings)))
     {
@@ -1900,6 +1914,10 @@ do_config_server(http_t *http)           /* I - HTTP connection */
                                    share_printers, num_settings, &settings);
       num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY,
                                    user_cancel_any, num_settings, &settings);
+#ifdef HAVE_GSSAPI
+      num_settings = cupsAddOption("DefaultAuthType", default_auth_type,
+                                   num_settings, &settings);
+#endif /* HAVE_GSSAPI */
 
       if (!_cupsAdminSetServerSettings(http, num_settings, settings))
       {
@@ -2473,6 +2491,14 @@ do_menu(http_t *http)                    /* I - HTTP connection */
                            settings)) != NULL && atoi(val))
     cgiSetVariable("USER_CANCEL_ANY", "CHECKED");
 
+#ifdef HAVE_GSSAPI
+  cgiSetVariable("HAVE_GSSAPI", "1");
+
+  if ((val = cupsGetOption("DefaultAuthType", num_settings,
+                           settings)) != NULL && !strcasecmp(val, "Negotiate"))
+    cgiSetVariable("KERBEROS", "CHECKED");
+#endif /* HAVE_GSSAPI */
+
   cupsFreeOptions(num_settings, settings);
 
  /*
@@ -3225,5 +3251,5 @@ match_string(const char *a,               /* I - First string */
 
     
 /*
- * End of "$Id: admin.c 6304 2007-02-22 22:06:23Z mike $".
+ * End of "$Id: admin.c 6361 2007-03-19 16:01:28Z mike $".
  */
index b2af6d715213797ac49083feb8c5786ca145fef5..f50a7aabef5278d03e9b735e34301413d03e7d65 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: cgi-private.h 4921 2006-01-12 21:26:26Z mike $"
+ * "$Id: cgi-private.h 6361 2007-03-19 16:01:28Z mike $"
  *
  *   Private CGI definitions for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products.
+ *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -40,5 +40,5 @@
 
 
 /*
- * End of "$Id: cgi-private.h 4921 2006-01-12 21:26:26Z mike $".
+ * End of "$Id: cgi-private.h 6361 2007-03-19 16:01:28Z mike $".
  */
index 03a348031ada76603bb3e3ba5df3de98ad95dedb..765c5109df94b9c24cc0147c350b8c4a1877244c 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-common.m4 6304 2007-02-22 22:06:23Z mike $"
+dnl "$Id: cups-common.m4 6370 2007-03-20 14:36:12Z mike $"
 dnl
 dnl   Common configuration stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -216,10 +216,14 @@ case $uname in
                AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
                AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
 
-               dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
+               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))
                AC_CHECK_FUNCS(mbr_uid_to_uuid)
 
+               dnl Need <dlfcn.h> header...
+               AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H))
+
                dnl Check for notify_post support
                AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
                AC_CHECK_FUNCS(notify_post)
@@ -277,5 +281,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
 
 dnl
-dnl End of "$Id: cups-common.m4 6304 2007-02-22 22:06:23Z mike $".
+dnl End of "$Id: cups-common.m4 6370 2007-03-20 14:36:12Z mike $".
 dnl
index 09f3d969703410b78b5c0c678678a3ca3b358dd1..7728746c9197f23fda05c1d15bc4b658b54c6557 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-directories.m4 6332 2007-03-12 16:08:51Z mike $"
+dnl "$Id: cups-directories.m4 6351 2007-03-19 04:53:49Z mike $"
 dnl
 dnl   Directory stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -148,7 +148,7 @@ if test x$rcdir = x; then
                        fi
                        ;;
 
-               FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
+               FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
                        # FreeBSD and OpenBSD
                        ;;
 
@@ -365,5 +365,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups")
 AC_SUBST(CUPS_STATEDIR)
 
 dnl
-dnl End of "$Id: cups-directories.m4 6332 2007-03-12 16:08:51Z mike $".
+dnl End of "$Id: cups-directories.m4 6351 2007-03-19 04:53:49Z mike $".
 dnl
index 10cf682812ba8ca18f8e1f81319eeb50ed3da2f3..8da5f62664cea510bf2a9100c07a297f93ccdfc9 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-network.m4 6046 2006-10-20 14:43:30Z mike $"
+dnl "$Id: cups-network.m4 6365 2007-03-19 20:56:57Z mike $"
 dnl
 dnl   Networking stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -89,6 +89,9 @@ fi
 AC_SUBST(CUPS_DEFAULT_DOMAINSOCKET)
 AC_SUBST(CUPS_LISTEN_DOMAINSOCKET)
 
+AC_CHECK_HEADERS(AppleTalk/at_proto.h,AC_DEFINE(HAVE_APPLETALK_AT_PROTO_H),,
+       [#include <netat/appletalk.h>])
+
 dnl
-dnl End of "$Id: cups-network.m4 6046 2006-10-20 14:43:30Z mike $".
+dnl End of "$Id: cups-network.m4 6365 2007-03-19 20:56:57Z mike $".
 dnl
index e2a76addd88337cbe7cb75687e51911dfb628446..20fe8ce70ed49ee1f011b5458fbda2b4a5a4a375 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: config.h.in 6304 2007-02-22 22:06:23Z mike $"
+ * "$Id: config.h.in 6370 2007-03-20 14:36:12Z mike $"
  *
  *   Configuration file for the Common UNIX Printing System (CUPS).
  *
  */
 
 #undef HAVE_MEMBERSHIP_H
+#undef HAVE_MEMBERSHIPPRIV_H
 #undef HAVE_MBR_UID_TO_UUID
 
 
 #undef HAVE_KQUEUE
 
 
+/*
+ * Do we have the <dlfcn.h> header?
+ */
+
+#undef HAVE_DLFCN_H
+
+
 #endif /* !_CUPS_CONFIG_H_ */
 
 /*
- * End of "$Id: config.h.in 6304 2007-02-22 22:06:23Z mike $".
+ * End of "$Id: config.h.in 6370 2007-03-20 14:36:12Z mike $".
  */
index 8b96fcb6c1de0bcf61911f5222684d7c3cfef868..5ef1a590f7dab5d8dee0290c121ff3183c497d5d 100644 (file)
@@ -1,12 +1,9 @@
 /*
- * "$Id: adminutil.c 6270 2007-02-12 14:27:47Z mike $"
+ * "$Id: adminutil.c 6361 2007-03-19 16:01:28Z mike $"
  *
  *   Administration utility API definitions for the Common UNIX Printing
  *   System (CUPS).
  *
- *   MANY OF THE FUNCTIONS IN THIS HEADER ARE PRIVATE AND SUBJECT TO
- *   CHANGE AT ANY TIME.  USE AT YOUR OWN RISK.
- *
  *   Copyright 2001-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *
  *   cupsAdminCreateWindowsPPD()   - Create the Windows PPD file for a printer.
  *   cupsAdminExportSamba()        - Export a printer to Samba.
- *   _cupsAdminGetServerSettings() - Get settings from the server.
- *   _cupsAdminSetServerSettings() - Set settings on the server.
+ *   cupsAdminGetServerSettings()  - Get settings from the server.
+ *   _cupsAdminGetServerSettings() - Get settings from the server (private).
+ *   cupsAdminSetServerSettings()  - Set settings on the server.
+ *   _cupsAdminSetServerSettings() - Set settings on the server (private).
  *   do_samba_command()            - Do a SAMBA command.
  *   get_cupsd_conf()              - Get the current cupsd.conf file.
  *   invalidate_cupsd_cache()      - Invalidate the cached cupsd.conf settings.
@@ -693,6 +692,25 @@ cupsAdminExportSamba(
 }
 
 
+/*
+ * 'cupsAdminGetServerSettings()' - Get settings from the server.
+ *
+ * The returned settings should be freed with cupsFreeOptions() when
+ * you are done with them.
+ *
+ * @since CUPS 1.3@
+ */
+
+int                                    /* O - 1 on success, 0 on failure */
+cupsAdminGetServerSettings(
+    http_t        *http,               /* I - Connection to server */
+    int           *num_settings,       /* O - Number of settings */
+    cups_option_t **settings)          /* O - Settings */
+{
+  return (_cupsAdminGetServerSettings(http, num_settings, settings));
+}
+
+
 /*
  * '_cupsAdminGetServerSettings()' - Get settings from the server.
  *
@@ -966,6 +984,22 @@ _cupsAdminGetServerSettings(
 }
 
 
+/*
+ * 'cupsAdminSetServerSettings()' - Set settings on the server.
+ *
+ * @since CUPS 1.3@
+ */
+
+int                                    /* O - 1 on success, 0 on failure */
+cupsAdminSetServerSettings(
+    http_t        *http,               /* I - Connection to server */
+    int           num_settings,                /* I - Number of settings */
+    cups_option_t *settings)           /* I - Settings */
+{
+  return (_cupsAdminSetServerSettings(http, num_settings, settings));
+}
+
+
 /*
  * '_cupsAdminSetServerSettings()' - Set settings on the server.
  *
@@ -1531,14 +1565,13 @@ _cupsAdminSetServerSettings(
       }
     }
     else if (!in_policy && !in_location &&
-             (val = cupsGetOption(line, num_settings, settings)) != NULL &&
-             !cupsGetOption(line, cupsd_num_settings, cupsd_settings))
+             (val = cupsGetOption(line, num_settings, settings)) != NULL)
     {
      /*
-      * Add this directive to the list of directives we have written...
+      * Replace this directive's value with the new one...
       */
 
-      cupsd_num_settings = cupsAddOption(line, value, cupsd_num_settings,
+      cupsd_num_settings = cupsAddOption(line, val, cupsd_num_settings,
                                          &cupsd_settings);
 
      /*
@@ -1546,7 +1579,7 @@ _cupsAdminSetServerSettings(
       * only support setting root directives, not in sections...
       */
 
-      cupsFilePrintf(temp, "%s %s\n", line, value);
+      cupsFilePrintf(temp, "%s %s\n", line, val);
     }
     else if (value)
     {
@@ -1752,8 +1785,8 @@ _cupsAdminSetServerSettings(
                                          cupsd_num_settings, &cupsd_settings);
 
      /*
-      * Write the new value in its place, without indentation since we
-      * only support setting root directives, not in sections...
+      * Write the new value, without indentation since we only support
+      * setting root directives, not in sections...
       */
 
       cupsFilePrintf(temp, "%s %s\n", setting->name, setting->value);
@@ -2155,5 +2188,5 @@ write_option(cups_file_t     *dstfp,      /* I - PPD file */
 
 
 /*
- * End of "$Id: adminutil.c 6270 2007-02-12 14:27:47Z mike $".
+ * End of "$Id: adminutil.c 6361 2007-03-19 16:01:28Z mike $".
  */
index 530800d5ef8537b3f59af536e3eeea4f61dc1ad2..ed91a4ffc83011e76e4885bd08f83f9d8546b2d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: encode.c 6267 2007-02-11 23:24:22Z mike $"
+ * "$Id: encode.c 6356 2007-03-19 13:54:48Z mike $"
  *
  *   Option encoding routines for the Common UNIX Printing System (CUPS).
  *
@@ -88,7 +88,7 @@ static const _ipp_option_t ipp_options[] =
   { "notify-lease-duration-default", IPP_TAG_INTEGER,  IPP_TAG_PRINTER },
   { "notify-natural-language", IPP_TAG_LANGUAGE,       IPP_TAG_SUBSCRIPTION },
   { "notify-pull-method",      IPP_TAG_KEYWORD,        IPP_TAG_SUBSCRIPTION },
-  { "notify-recipient",                IPP_TAG_URI,            IPP_TAG_SUBSCRIPTION },
+  { "notify-recipient-uri",    IPP_TAG_URI,            IPP_TAG_SUBSCRIPTION },
   { "notify-time-interval",    IPP_TAG_INTEGER,        IPP_TAG_SUBSCRIPTION },
   { "notify-user-data",                IPP_TAG_STRING,         IPP_TAG_SUBSCRIPTION },
   { "number-up",               IPP_TAG_INTEGER,        IPP_TAG_JOB },
@@ -570,5 +570,5 @@ compare_ipp_options(_ipp_option_t *a,       /* I - First option */
 
 
 /*
- * End of "$Id: encode.c 6267 2007-02-11 23:24:22Z mike $".
+ * End of "$Id: encode.c 6356 2007-03-19 13:54:48Z mike $".
  */
index bb9024f9ca50a1c30aee473d5773c35029e862bd..d38fdc3844031b8e29354722569dc1b323504ba1 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: localize.c 5824 2006-08-15 18:19:45Z mike $"
+ * "$Id: localize.c 6367 2007-03-20 01:34:29Z mike $"
  *
  *   PPD custom option routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -183,6 +183,19 @@ ppd_text(ppd_file_t *ppd,          /* I - PPD file */
   {
     snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll, keyword);
     attr = ppdFindAttr(ppd, lkeyword, spec);
+
+    if (!attr && !strcmp(ll, "ja"))
+    {
+     /*
+      * Due to a bug in the CUPS DDK 1.1.0 ppdmerge program, Japanese
+      * PPD files were incorrectly assigned "jp" as the locale name
+      * instead of "ja".  Support both the old (incorrect) and new
+      * locale names for Japanese...
+      */
+
+      snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword);
+      attr = ppdFindAttr(ppd, lkeyword, spec);
+    }
   }
 
 #ifdef DEBUG
@@ -202,5 +215,5 @@ ppd_text(ppd_file_t *ppd,           /* I - PPD file */
 
 
 /*
- * End of "$Id: localize.c 5824 2006-08-15 18:19:45Z mike $".
+ * End of "$Id: localize.c 6367 2007-03-20 01:34:29Z mike $".
  */
index 0e89634ba6d264cfb59cf9798fa2d1a5731df08d..53a0f915ce2bfd7e78851876c0d648efc3de5189 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: request.c 6253 2007-02-10 18:48:40Z mike $"
+ * "$Id: request.c 6355 2007-03-19 06:33:04Z mike $"
  *
  *   IPP utilities for the Common UNIX Printing System (CUPS).
  *
@@ -144,6 +144,19 @@ cupsDoFileRequest(http_t     *http,        /* I - HTTP connection to server */
   else
     file = NULL;
 
+#ifdef HAVE_SSL
+ /*
+  * See if we have an auth-info attribute and are communicating over
+  * a non-local link.  If so, encrypt the link so that we can pass
+  * the authentication information securely...
+  */
+
+  if (ippFindAttribute(request, "auth-info", IPP_TAG_TEXT) &&
+      !httpAddrLocalhost(http->hostaddr) && !http->tls &&
+      httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
+    return (NULL);
+#endif /* HAVE_SSL */
+
  /*
   * Loop until we can send the request without authorization problems.
   */
@@ -494,5 +507,5 @@ _cupsSetError(ipp_status_t status,  /* I - IPP status code */
 
 
 /*
- * End of "$Id: request.c 6253 2007-02-10 18:48:40Z mike $".
+ * End of "$Id: request.c 6355 2007-03-19 06:33:04Z mike $".
  */
index 5b2cea2a55e6f565cc04bc934399be7caf5bd688..c44b7a0613cd589f76566330d921b4f3536525e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: string.c 6187 2007-01-10 16:20:42Z mike $"
+ * "$Id: string.c 6345 2007-03-17 18:00:04Z mike $"
  *
  *   String functions for the Common UNIX Printing System (CUPS).
  *
@@ -266,9 +266,9 @@ _cupsStrFormatd(char         *buf,  /* I - String */
          tempptr < tempdec && bufptr < bufend;
         *bufptr++ = *tempptr++);
 
-    tempdec += declen;
+    tempptr += declen;
 
-    if (*tempdec && bufptr < bufend)
+    if (*tempptr && bufptr < bufend)
     {
       *bufptr++ = '.';
 
@@ -743,5 +743,5 @@ compare_sp_items(_cups_sp_item_t *a,        /* I - First item */
 
 
 /*
- * End of "$Id: string.c 6187 2007-01-10 16:20:42Z mike $".
+ * End of "$Id: string.c 6345 2007-03-17 18:00:04Z mike $".
  */
index f41408b03c3d2ae0cf986fb803d84eb5ff1b335c..2c3ebe805b0149c831746b7e4f4db16ca2142870 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testlang.c 4903 2006-01-10 20:02:46Z mike $"
+ * "$Id: testlang.c 6345 2007-03-17 18:00:04Z mike $"
  *
  *   Localization test program for the Common UNIX Printing System (CUPS).
  *
@@ -34,6 +34,7 @@
 
 #include <stdio.h>
 #include "i18n.h"
+#include "string.h"
 
 
 /*
@@ -44,9 +45,23 @@ int                                  /* O - Exit status */
 main(int  argc,                                /* I - Number of command-line arguments */
      char *argv[])                     /* I - Command-line arguments */
 {
+  int                  i;              /* Looping var */
+  int                  errors = 0;     /* Number of errors */
   cups_lang_t          *language;      /* Message catalog */
   cups_lang_t          *language2;     /* Message catalog */
+  struct lconv         *loc;           /* Locale data */
+  char                 buffer[1024];   /* String buffer */
+  double               number;         /* Number */
+  static const char * const tests[] =  /* Test strings */
+  {
+    "1",
+    "-1",
+    "3",
+    "5.125"
+  };
+
 
+  _cupsSetLocale(argv);
 
   if (argc == 1)
   {
@@ -61,6 +76,8 @@ main(int  argc,                               /* I - Number of command-line arguments */
 
   if (language != language2)
   {
+    errors ++;
+
     puts("**** ERROR: Language cache did not work! ****");
     puts("First result from cupsLangGet:");
   }
@@ -80,10 +97,29 @@ main(int  argc,                             /* I - Number of command-line arguments */
     printf("Yes      = \"%s\"\n", _cupsLangString(language2, "Yes"));
   }
 
-  return (0);
+  loc = localeconv();
+
+  for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i ++)
+  {
+    number = _cupsStrScand(tests[i], NULL, loc);
+
+    printf("_cupsStrScand(\"%s\") number=%f\n", tests[i], number);
+
+    _cupsStrFormatd(buffer, buffer + sizeof(buffer), number, loc);
+
+    printf("_cupsStrFormatd(%f) buffer=\"%s\"\n", number, buffer);
+
+    if (strcmp(buffer, tests[i]))
+    {
+      errors ++;
+      puts("**** ERROR: Bad formatted number! ****");
+    }
+  }
+
+  return (errors > 0);
 }
 
 
 /*
- * End of "$Id: testlang.c 4903 2006-01-10 20:02:46Z mike $".
+ * End of "$Id: testlang.c 6345 2007-03-17 18:00:04Z mike $".
  */
index 52efe31a22d23abcef0988130d764497bc3a8b5f..32057349539085adaab02677260fbf28a04f3ef2 100644 (file)
@@ -26,8 +26,11 @@ files and directories:</P>
        <LI><VAR>doc/images/button-*.gif</VAR> - the web
        interface button images</LI>
 
-       <LI><VAR>doc/images/button-*.scm</VAR> - the Gimp scripts
-       we use to generate the web interface button images</LI>
+       <LI><VAR>tools/buttons.txt</VAR> - the English text for the
+       web interface buttons</LI>
+
+       <LI><VAR>tools/makebuttons</VAR> - the shell script we use
+       to generate the web interface button images</LI>
 
        <LI><VAR>doc/index.html</VAR> - the web interface home
        page</LI>
@@ -44,7 +47,7 @@ localization files are  placed in subdirectories under the
 <VAR>doc</VAR> and <VAR>templates</VAR> using the locale name.
 Locale names are either <VAR>ll</VAR> or <VAR>ll_CC</VAR>, where
 "ll" is the 2-letter language code and "CC" is the 2-letter
-country code.</P>
+country code. <em>CUPS does not currently use or support the newer <VAR>ll-region</VAR> syntax for locale names.</em></P>
 
 <P>All non-image files must be encoded using the UTF-8 character
 set.</P>
@@ -86,22 +89,23 @@ Comment[<I>ll_CC</I>]=<I>Translation of "CUPS Web Interface"</I>
 
 <H2 CLASS="title"><A NAME="IMAGES">Button Images</A></H2>
 
-<P>The web interface button images are used to activate functions
-on the CUPS web pages. Table 1 lists the button images and the
-English text labels for those buttons. Use the supplied Gimp
-scripts to create button images that match the CUPS web interface
-and save them in the <VAR>doc/ll_CC/images</VAR> subdirectory.
-The Gimp button scripts can be installed using the following
-command:</P>
+<P>The web interface button images are used to activate functions on
+the CUPS web pages. Table 1 lists the button images and the English
+text labels for those buttons. Copy the file
+<VAR>tools/buttons.txt</VAR> to <VAR>buttons-ll_CC.txt</VAR>,
+translate the text in that file (use UTF-8 as the text encoding!),
+and then use the supplied <VAR>tools/makebuttons</VAR> script to
+create button images that match the CUPS web interface:</P>
 
 <PRE CLASS="command">
-cp doc/images/button*.scm ~/.gimp-2.2/scripts
+cp tools/buttons.txt buttons-ll_CC.txt
+vi buttons-ll_CC.txt
+tools/makebuttons ll_CC buttons-ll_CC.txt
 </PRE>
 
-<P>If you have already started the Gimp application, choose
-<VAR>Refresh Scripts</VAR> from the <VAR>Xtns->Script-Fu</VAR>
-sub-menu. The button scripts will be available under a new
-<VAR>Btns</VAR menu in the Gimp tool window.</P>
+<BLOCKQUOTE><B>Note:</B> The <VAR>tools/makebuttons</VAR> script
+requires at least version 6.2.4 of the ImageMagick software to
+work.</BLOCKQUOTE>
 
 <P>When you have created all of the button images, edit the
 <VAR>Makedefs</VAR> file and add the locale name to the
diff --git a/fonts/Vera.ttf b/fonts/Vera.ttf
new file mode 100644 (file)
index 0000000..58cd6b5
Binary files /dev/null and b/fonts/Vera.ttf differ
index cef5ad2d05cde77a66a3beb6b0fef23284c525e4..38b79e3dd3d5cc46c3bc75a95dd9970eadaf8018 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# "$Id: cups.sh.in 6332 2007-03-12 16:08:51Z mike $"
+# "$Id: cups.sh.in 6358 2007-03-19 14:16:44Z mike $"
 #
 #   Startup/shutdown script for the Common UNIX Printing System (CUPS).
 #
@@ -141,7 +141,7 @@ unset TMPDIR
 # provide a standard path on boot-up...
 #
 
-if "x$PATH" = x; then
+if test "x$PATH" = x; then
        PATH="/bin:/usr/bin:/sbin:/usr/sbin"
 else
        PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"
@@ -239,5 +239,5 @@ exit 0
 
 
 #
-# End of "$Id: cups.sh.in 6332 2007-03-12 16:08:51Z mike $".
+# End of "$Id: cups.sh.in 6358 2007-03-19 14:16:44Z mike $".
 #
index 856ee96e589d8e0537e66f4a860b71d9911a151b..89bcab309f0c2ed3d2baaca5f5192c5ba93c4f55 100644 (file)
@@ -10,7 +10,7 @@
        <dict>
                <key>PathState</key>
                <dict>
-                       <key>/private/var/run/cups/cupsd</key>
+                       <key>/private/var/spool/cups/cache/org.cups.cupsd</key>
                        <true/>
                </dict>
        </dict>
                <array>
                        <dict>
                                <key>SockNodeName</key>
-                               <string>localhost</string>
+                               <string>::1</string>
+                               <key>SockServiceName</key>
+                               <string>ipp</string>
+                       </dict>
+                       <dict>
+                               <key>SockNodeName</key>
+                               <string>127.0.0.1</string>
                                <key>SockServiceName</key>
                                <string>ipp</string>
                        </dict>
index d1ff4cb8e7d078108d917000e4e2fe03717899bd..4fa6e8e9120eeda45ad736c152dc9078ce688142 100644 (file)
 #include "Link.h"
 #include "Catalog.h"
 
+// This define is used to limit the depth of recursive readPageTree calls
+// This is needed because the page tree nodes can reference their parents
+// leaving us in an infinite loop
+// Most sane pdf documents don't have a call depth higher than 10
+#define MAX_CALL_DEPTH 1000
+
 //------------------------------------------------------------------------
 // Catalog
 //------------------------------------------------------------------------
@@ -71,7 +77,7 @@ Catalog::Catalog(XRef *xrefA) {
     pageRefs[i].num = -1;
     pageRefs[i].gen = -1;
   }
-  numPages = readPageTree(pagesDict.getDict(), NULL, 0);
+  numPages = readPageTree(pagesDict.getDict(), NULL, 0, 0);
   if (numPages != numPages0) {
     error(-1, "Page count in top-level pages object is incorrect");
   }
@@ -169,7 +175,7 @@ GString *Catalog::readMetadata() {
   return s;
 }
 
-int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start) {
+int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start, int callDepth) {
   Object kids;
   Object kid;
   Object kidRef;
@@ -214,9 +220,13 @@ int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start) {
     // This should really be isDict("Pages"), but I've seen at least one
     // PDF file where the /Type entry is missing.
     } else if (kid.isDict()) {
-      if ((start = readPageTree(kid.getDict(), attrs1, start))
-         < 0)
-       goto err2;
+      if (callDepth > MAX_CALL_DEPTH) {
+        error(-1, "Limit of %d recursive calls reached while reading the page tree. If your document is correct and not a test to try to force a crash, please report a bug.", MAX_CALL_DEPTH);
+      } else {
+        if ((start = readPageTree(kid.getDict(), attrs1, start, callDepth + 1))
+           < 0)
+         goto err2;
+      }
     } else {
       error(-1, "Kid object (page %d) is wrong type (%s)",
            start+1, kid.getTypeName());
index 08e50cae0cfe2b038571481854ac725b4e8e3388..8cef948180c37714a33841872af826edd71b5f1e 100644 (file)
@@ -85,7 +85,7 @@ private:
   Object acroForm;             // AcroForm dictionary
   GBool ok;                    // true if catalog is valid
 
-  int readPageTree(Dict *pages, PageAttrs *attrs, int start);
+  int readPageTree(Dict *pages, PageAttrs *attrs, int start, int callDepth);
   Object *findDestInTree(Object *tree, GString *name, Object *obj);
 };
 
index 8baf945113c32b05b5905ef2cd30b448607f7ffc..ddc31ce6dcccef9f77212fdd5015edcc858aa0db 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: auth.c 6314 2007-03-01 19:11:54Z mike $"
+ * "$Id: auth.c 6361 2007-03-19 16:01:28Z mike $"
  *
  *   Authorization routines for the Common UNIX Printing System (CUPS).
  *
@@ -835,7 +835,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
     }
   }
 #ifdef HAVE_GSSAPI
-  else if (!strncmp(authorization, "Negotiate", 9) && type == AUTH_KERBEROS
+  else if (!strncmp(authorization, "Negotiate", 9) && type == AUTH_NEGOTIATE
   {
     int                        len;            /* Length of authorization string */
     gss_cred_id_t      server_creds;   /* Server credentials */
@@ -1819,8 +1819,8 @@ cupsdIsAuthorized(cupsd_client_t *con,    /* I - Connection */
   if ((best->encryption >= HTTP_ENCRYPT_REQUIRED && !con->http.tls &&
       strcasecmp(con->http.hostname, "localhost") &&
       best->satisfy == AUTH_SATISFY_ALL) &&
-      !(best->type == AUTH_KERBEROS || 
-        (best->type == AUTH_NONE && DefaultAuthType == AUTH_KERBEROS)))
+      !(best->type == AUTH_NEGOTIATE || 
+        (best->type == AUTH_NONE && DefaultAuthType == AUTH_NEGOTIATE)))
   {
     cupsdLogMessage(CUPSD_LOG_DEBUG2,
                     "cupsdIsAuthorized: Need upgrade to TLS...");
@@ -2522,5 +2522,5 @@ to64(char          *s,                    /* O - Output string */
 
 
 /*
- * End of "$Id: auth.c 6314 2007-03-01 19:11:54Z mike $".
+ * End of "$Id: auth.c 6361 2007-03-19 16:01:28Z mike $".
  */
index 61c7ae993685d4293ca39ed6dc248111f05bd0d4..de62893ac0d0e349aceeafda2612e34db18ede12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: auth.h 5919 2006-08-31 04:20:45Z mike $"
+ * "$Id: auth.h 6361 2007-03-19 16:01:28Z mike $"
  *
  *   Authorization definitions for the Common UNIX Printing System (CUPS)
  *   scheduler.
@@ -38,7 +38,7 @@
 #define AUTH_BASIC             1       /* Basic authentication */
 #define AUTH_DIGEST            2       /* Digest authentication */
 #define AUTH_BASICDIGEST       3       /* Basic authentication w/passwd.md5 */
-#define AUTH_KERBEROS          4       /* Kerberos authentication */
+#define AUTH_NEGOTIATE         4       /* Kerberos authentication */
 
 #define AUTH_ANON              0       /* Anonymous access */
 #define AUTH_USER              1       /* Must have a valid username/password */
@@ -159,5 +159,5 @@ extern http_status_t        cupsdIsAuthorized(cupsd_client_t *con, const char *owner);
 
 
 /*
- * End of "$Id: auth.h 5919 2006-08-31 04:20:45Z mike $".
+ * End of "$Id: auth.h 6361 2007-03-19 16:01:28Z mike $".
  */
index 9c0a17dc68191759b1e521f654192352769283b9..1ba04e96911af98c026e6ef4f526793697e0deee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c 6329 2007-03-12 14:48:28Z mike $"
+ * "$Id: client.c 6361 2007-03-19 16:01:28Z mike $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -2221,7 +2221,7 @@ cupsdSendError(cupsd_client_t *con,       /* I - Connection */
   * never disable it in that case.
   */
 
-  if (code >= HTTP_BAD_REQUEST && con->http.auth_type != AUTH_KERBEROS)
+  if (code >= HTTP_BAD_REQUEST && con->http.auth_type != AUTH_NEGOTIATE)
     con->http.keep_alive = HTTP_KEEPALIVE_OFF;
 
  /*
@@ -2397,7 +2397,7 @@ cupsdSendHeader(cupsd_client_t *con,      /* I - Client to send to */
       snprintf(auth_str, sizeof(auth_str), "Digest realm=\"CUPS\", nonce=\"%s\"",
               con->http.hostname);
 #ifdef HAVE_GSSAPI
-    else if (auth_type == AUTH_KERBEROS && !con->no_negotiate &&
+    else if (auth_type == AUTH_NEGOTIATE && !con->no_negotiate &&
             con->gss_output_token.length == 0)
       strlcpy(auth_str, "Negotiate", sizeof(auth_str));
 #endif /* HAVE_GSSAPI */
@@ -4533,5 +4533,5 @@ write_file(cupsd_client_t *con,           /* I - Client connection */
 
 
 /*
- * End of "$Id: client.c 6329 2007-03-12 14:48:28Z mike $".
+ * End of "$Id: client.c 6361 2007-03-19 16:01:28Z mike $".
  */
index d033627ad73b0105e47f135b69ae6a3e526f91c0..04a58bd4d4c3b426885be9b6ab5533b834ecf105 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: conf.c 6253 2007-02-10 18:48:40Z mike $"
+ * "$Id: conf.c 6365 2007-03-19 20:56:57Z mike $"
  *
  *   Configuration routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -87,6 +87,9 @@ typedef struct
 static cupsd_var_t     variables[] =
 {
   { "AccessLog",               &AccessLog,             CUPSD_VARTYPE_STRING },
+#ifdef __APPLE__
+  { "AppleQuotas",             &AppleQuotas,           CUPSD_VARTYPE_BOOLEAN },
+#endif  /* __APPLE__ */
   { "AutoPurgeJobs",           &JobAutoPurge,          CUPSD_VARTYPE_BOOLEAN },
   { "BrowseInterval",          &BrowseInterval,        CUPSD_VARTYPE_INTEGER },
 #ifdef HAVE_LDAP
@@ -463,6 +466,10 @@ cupsdReadConfiguration(void)
   cupsdSetString(&LaunchdConf, CUPS_DEFAULT_LAUNCHD_CONF);
 #endif /* HAVE_LAUNCHD */
 
+#ifdef __APPLE__
+  AppleQuotas = TRUE;
+#endif  /* __APPLE__ */
+
  /*
   * Read the configuration file...
   */
@@ -1718,10 +1725,9 @@ parse_aaa(cupsd_location_t *loc, /* I - Location */
        loc->level = AUTH_USER;
     }
 #ifdef HAVE_GSSAPI
-    else if (!strcasecmp(value, "kerberos") ||
-            !strcasecmp(value, "gssapi"))
+    else if (!strcasecmp(value, "negotiate"))
     {
-      loc->type = AUTH_KERBEROS;
+      loc->type = AUTH_NEGOTIATE;
 
       if (loc->level == AUTH_ANON)
        loc->level = AUTH_USER;
@@ -2737,8 +2743,8 @@ read_configuration(cups_file_t *fp)       /* I - File to read from */
       else if (!strcasecmp(value, "basicdigest"))
        DefaultAuthType = AUTH_BASICDIGEST;
 #ifdef HAVE_GSSAPI
-      else if (!strcasecmp(value, "kerberos"))
-        DefaultAuthType = AUTH_KERBEROS;
+      else if (!strcasecmp(value, "negotiate"))
+        DefaultAuthType = AUTH_NEGOTIATE;
 #endif /* HAVE_GSSAPI */
       else
       {
@@ -3342,5 +3348,5 @@ read_policy(cups_file_t *fp,              /* I - Configuration file */
 
 
 /*
- * End of "$Id: conf.c 6253 2007-02-10 18:48:40Z mike $".
+ * End of "$Id: conf.c 6365 2007-03-19 20:56:57Z mike $".
  */
index cfb71fc4e371621026620f1b7717cffe1bd4cfa5..0a5e073d69ffbb7f114f979f86dbb9dd9691a237 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * "$Id: conf.h 6291 2007-02-19 21:54:27Z mike $"
+ * "$Id: conf.h 6365 2007-03-19 20:56:57Z mike $"
  *
  *   Configuration file definitions for the Common UNIX Printing System (CUPS)
  *   scheduler.
  *
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -201,6 +201,11 @@ VAR char           *LaunchdConf            VALUE(NULL);
                                        /* launchd(8) configuration file */
 #endif /* HAVE_LAUNCHD */
 
+#ifdef __APPLE__
+VAR int                        AppleQuotas             VALUE(TRUE);
+                                       /* Use Apple PrintService Quotas instead of CUPS quotas */
+#endif  /* __APPLE__ */
+
 #ifdef HAVE_AUTHORIZATION_H
 VAR char               *SystemGroupAuthKey     VALUE(NULL);
                                        /* System group auth key */
@@ -228,5 +233,5 @@ extern int  cupsdLogRequest(cupsd_client_t *con, http_status_t code);
 
 
 /*
- * End of "$Id: conf.h 6291 2007-02-19 21:54:27Z mike $".
+ * End of "$Id: conf.h 6365 2007-03-19 20:56:57Z mike $".
  */
index 39892bc71f0a42c0fb9664a791385e6519e290be..d5ed5a33a7af0f757887fcfa376ce9d31e84df4a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cups-driverd.c 6211 2007-01-23 15:44:34Z mike $"
+ * "$Id: cups-driverd.c 6363 2007-03-19 20:48:49Z mike $"
  *
  *   PPD/driver support for the Common UNIX Printing System (CUPS).
  *
@@ -684,7 +684,7 @@ load_ppds(const char *d,            /* I - Actual directory */
     { "german",                "de" },
     { "greek",         "el" },
     { "italian",       "it" },
-    { "japanese",      "jp" },
+    { "japanese",      "ja" },
     { "norwegian",     "no" },
     { "polish",                "pl" },
     { "portuguese",    "pt" },
@@ -1122,5 +1122,5 @@ load_drivers(void)
 
 
 /*
- * End of "$Id: cups-driverd.c 6211 2007-01-23 15:44:34Z mike $".
+ * End of "$Id: cups-driverd.c 6363 2007-03-19 20:48:49Z mike $".
  */
index 81b5b35888ea929ace3b702ba3b24b0f0b74754b..93b29b09b454f9b7813622a943e7f2cdffb86e6a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupsd.h 6170 2007-01-02 17:26:41Z mike $"
+ * "$Id: cupsd.h 6365 2007-03-19 20:56:57Z mike $"
  *
  *   Main header file for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -172,6 +172,16 @@ VAR int                    Launchd         VALUE(0);
                                        /* Running from launchd */
 #endif /* HAVE_LAUNCH_H */
 
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+typedef int (*PSQUpdateQuotaProcPtr)(const char *printer, const char *info, 
+                                     const char *user, int nPages, int options);
+VAR PSQUpdateQuotaProcPtr PSQUpdateQuotaProc
+                                       VALUE(0);
+                                       /* Apple PrintService quota function */
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
+
+
 
 /*
  * Prototypes...
@@ -217,5 +227,5 @@ extern void cupsdStopSelect(void);
 
 
 /*
- * End of "$Id: cupsd.h 6170 2007-01-02 17:26:41Z mike $".
+ * End of "$Id: cupsd.h 6365 2007-03-19 20:56:57Z mike $".
  */
index 73abd7bfce43792f2708c905ce30399e38c03639..7953ad5d78e01fc87f4049a4bde4da8552e015b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: dirsvc.c 6309 2007-02-24 03:11:56Z mike $"
+ * "$Id: dirsvc.c 6354 2007-03-19 06:16:32Z mike $"
  *
  *   Directory services routines for the Common UNIX Printing System (CUPS).
  *
@@ -2448,10 +2448,11 @@ dnssdBuildTxtRecord(
     int             *txt_len,          /* O - TXT record length */
     cupsd_printer_t *p)                        /* I - Printer information */
 {
-  int          i;                      /* Looping var */
+  int          i, j;                   /* Looping vars */
   char         type_str[32],           /* Type to string buffer */
                state_str[32],          /* State to string buffer */
                rp_str[1024],           /* Queue name string buffer */
+               air_str[1024],          /* auth-info-required string buffer */
                *keyvalue[32][2];       /* Table of key/value pairs */
 
 
@@ -2556,6 +2557,27 @@ dnssdBuildTxtRecord(
   keyvalue[i  ][0] = "pdl";
   keyvalue[i++][1] = p->pdl ? p->pdl : "application/postscript";
 
+  if (p->num_auth_info_required)
+  {
+    char       *air = air_str;         /* Pointer into string */
+
+
+    for (j = 0; j < p->num_auth_info_required; j ++)
+    {
+      if (air >= (air_str + sizeof(air_str) - 2))
+        break;
+
+      if (j)
+        *air++ = ',';
+
+      strlcpy(air, p->auth_info_required[j], sizeof(air_str) - (air - air_str));
+      air += strlen(air);
+    }
+
+    keyvalue[i  ][0] = "air";
+    keyvalue[i++][1] = air;
+  }
+
  /*
   * Then pack them into a proper txt record...
   */
@@ -2978,6 +3000,9 @@ process_implicit_classes(void)
         cupsdSetString(&pclass->location, p->location);
         cupsdSetString(&pclass->info, p->info);
 
+        cupsdSetString(&pclass->job_sheets[0], p->job_sheets[0]);
+        cupsdSetString(&pclass->job_sheets[1], p->job_sheets[1]);
+
         update = 1;
 
         cupsdLogMessage(CUPSD_LOG_DEBUG, "Added implicit class \"%s\"...",
@@ -3079,7 +3104,7 @@ process_implicit_classes(void)
 
 /*
  * 'send_cups_browse()' - Send new browsing information using the CUPS
- *                           protocol.
+ *                        protocol.
  */
 
 static void
@@ -3774,5 +3799,5 @@ slp_url_callback(
 
 
 /*
- * End of "$Id: dirsvc.c 6309 2007-02-24 03:11:56Z mike $".
+ * End of "$Id: dirsvc.c 6354 2007-03-19 06:16:32Z mike $".
  */
index 78edc3cc869573689a4f4c7a7b0118258c7d1cb1..95602848478ce3e4d7d8fb4320a00653d9b31da7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c 6318 2007-03-06 04:36:55Z mike $"
+ * "$Id: ipp.c 6370 2007-03-20 14:36:12Z mike $"
  *
  *   IPP routines for the Common UNIX Printing System (CUPS) scheduler.
  *
 #  include <paper.h>
 #endif /* HAVE_LIBPAPER */
 
+#ifdef HAVE_MEMBERSHIP_H
+#  include <membership.h>
+#endif /* HAVE_MEMBERSHIP_H */
+#ifdef HAVE_MEMBERSHIPPRIV_H
+#  include <membershipPriv.h>
+#else
+extern int mbr_user_name_to_uuid(const char* name, uuid_t uu);
+extern int mbr_group_name_to_uuid(const char* name, uuid_t uu);
+extern int mbr_check_membership_by_id(uuid_t user, gid_t group, int* ismember);
+#endif /* HAVE_MEMBERSHIPPRIV_H */
+
 
 /*
  * Local functions...
@@ -1175,16 +1186,31 @@ add_job(cupsd_client_t  *con,           /* I - Client connection */
   * Check policy...
   */
 
+  auth_info = ippFindAttribute(job->attrs, "auth-info", IPP_TAG_TEXT);
+
   if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK)
   {
     send_http_error(con, status);
     return (NULL);
   }
-  else if ((printer->type & CUPS_PRINTER_AUTHENTICATED) && !con->username[0])
+  else if ((printer->type & CUPS_PRINTER_AUTHENTICATED) &&
+           !con->username[0] && !auth_info)
   {
     send_http_error(con, HTTP_UNAUTHORIZED);
     return (NULL);
   }
+#ifdef HAVE_SSL
+  else if (auth_info && !con->http.tls &&
+           !httpAddrLocalhost(con->http.hostaddr))
+  {
+   /*
+    * Require encryption of auth-info over non-local connections...
+    */
+
+    send_http_error(con, HTTP_UPGRADE_REQUIRED);
+    return (NULL);
+  }
+#endif /* HAVE_SSL */
 
  /*
   * See if the printer is accepting jobs...
@@ -1364,8 +1390,6 @@ add_job(cupsd_client_t  *con,             /* I - Client connection */
     attr->name = _cupsStrAlloc("job-originating-user-name");
   }
 
-  auth_info = ippFindAttribute(job->attrs, "auth-info", IPP_TAG_TEXT);
-
   if (con->username[0] || auth_info)
   {
     save_auth_info(con, job, auth_info);
@@ -3151,7 +3175,24 @@ check_quotas(cupsd_client_t  *con,       /* I - Client connection */
   int          i;                      /* Looping var */
   char         username[33];           /* Username */
   cupsd_quota_t        *q;                     /* Quota data */
+#ifdef HAVE_MBR_UID_TO_UUID
+ /*
+  * Use Apple membership APIs which require that all names represent
+  * valid user account or group records accessible by the server.
+  */
+
+  uuid_t       usr_uuid;               /* UUID for job requesting user  */
+  uuid_t       usr2_uuid;              /* UUID for ACL user name entry  */
+  uuid_t       grp_uuid;               /* UUID for ACL group name entry */
+  int          mbr_err;                /* Error from membership function */
+  int          is_member;              /* Is this user a member? */
+#else
+ /*
+  * Use standard POSIX APIs for checking users and groups...
+  */
+
   struct passwd        *pw;                    /* User password data */
+#endif /* HAVE_MBR_UID_TO_UUID */
 
 
   cupsdLogMessage(CUPSD_LOG_DEBUG2, "check_quotas(%p[%d], %p[%s])",
@@ -3211,8 +3252,34 @@ check_quotas(cupsd_client_t  *con,       /* I - Client connection */
 
   if (p->num_users)
   {
+#ifdef HAVE_MBR_UID_TO_UUID
+   /*
+    * Get UUID for job requesting user...
+    */
+
+    if (mbr_user_name_to_uuid((char *)username, usr_uuid))
+    {
+     /*
+      * Unknown user...
+      */
+
+      cupsdLogMessage(CUPSD_LOG_DEBUG,
+                     "check_quotas: UUID lookup failed for user \"%s\"",
+                     username);
+      cupsdLogMessage(CUPSD_LOG_INFO,
+                     "Denying user \"%s\" access to printer \"%s\" "
+                     "(unknown user)...",
+                     username, p->name);
+      return (0);
+    }
+#else
+   /*
+    * Get UID and GID of requesting user...
+    */
+
     pw = getpwnam(username);
     endpwent();
+#endif /* HAVE_MBR_UID_TO_UUID */
 
     for (i = 0; i < p->num_users; i ++)
       if (p->users[i][0] == '@')
@@ -3221,11 +3288,86 @@ check_quotas(cupsd_client_t  *con,      /* I - Client connection */
         * Check group membership...
        */
 
+#ifdef HAVE_MBR_UID_TO_UUID
+       if ((mbr_err = mbr_group_name_to_uuid((char *)p->users[i] + 1,
+                                             grp_uuid)) != 0)
+       {
+        /*
+         * Invalid ACL entries are ignored for matching; just record a
+         * warning in the log...
+         */
+
+         cupsdLogMessage(CUPSD_LOG_DEBUG,
+                         "check_quotas: UUID lookup failed for ACL entry "
+                         "\"%s\" (err=%d)", p->users[i], mbr_err);
+         cupsdLogMessage(CUPSD_LOG_WARN,
+                         "Access control entry \"%s\" not a valid group name; "
+                         "entry ignored", p->users[i]);
+       }
+       else
+       {
+         if ((mbr_err = mbr_check_membership(usr_uuid, grp_uuid,
+                                             &is_member)) != 0)
+         {
+          /*
+           * At this point, there should be no errors, but check anyways...
+           */
+
+           cupsdLogMessage(CUPSD_LOG_DEBUG,
+                           "check_quotas: group \"%s\" membership check "
+                           "failed (err=%d)", p->users[i] + 1, mbr_err);
+            is_member = 0;
+         }
+
+         /*
+         * Stop if we found a match...
+         */
+
+         if (is_member)
+           break;
+       }
+#else
         if (cupsdCheckGroup(username, pw, p->users[i] + 1))
          break;
+#endif /* HAVE_MBR_UID_TO_UUID */
+      }
+#ifdef HAVE_MBR_UID_TO_UUID
+      else
+      {
+        if ((mbr_err = mbr_user_name_to_uuid((char *)p->users[i],
+                                            usr2_uuid)) != 0)
+       {
+        /*
+         * Invalid ACL entries are ignored for matching; just record a
+         * warning in the log...
+         */
+
+          cupsdLogMessage(CUPSD_LOG_DEBUG,
+                         "check_quotas: UUID lookup failed for ACL entry "
+                         "\"%s\" (err=%d)", p->users[i], mbr_err);
+          cupsdLogMessage(CUPSD_LOG_WARN,
+                         "Access control entry \"%s\" not a valid user name; "
+                         "entry ignored", p->users[i]);
+       }
+       else
+       {
+         if ((mbr_err = mbr_check_membership(usr_uuid, usr2_uuid,
+                                             &is_member)) != 0)
+          {
+           cupsdLogMessage(CUPSD_LOG_DEBUG,
+                           "check_quotas: User \"%s\" identity check failed "
+                           "(err=%d)", p->users[i], mbr_err);
+           is_member = 0;
+         }
+
+         if (is_member)
+           break;
+       }
       }
+#else
       else if (!strcasecmp(username, p->users[i]))
        break;
+#endif /* HAVE_MBR_UID_TO_UUID */
 
     if ((i < p->num_users) == p->deny_users)
     {
@@ -3240,6 +3382,66 @@ check_quotas(cupsd_client_t  *con,       /* I - Client connection */
   * Check quotas...
   */
 
+#ifdef __APPLE__
+  if (AppleQuotas)
+  {
+   /*
+    * TODO: Define these special page count values as constants!
+    */
+
+    if (q->page_count == -4) /* special case: unlimited user */
+    {
+      cupsdLogMessage(CUPSD_LOG_INFO,
+                      "User \"%s\" request approved for printer %s (%s): " 
+                     "unlimited quota.",
+                     username, p->name, p->info);
+      q->page_count = 0; /* allow user to print */
+      return (1);
+    }
+    else if (q->page_count == -3) /* quota exceeded */
+    {
+      cupsdLogMessage(CUPSD_LOG_INFO,
+                      "User \"%s\" request denied for printer %s (%s): "
+                     "quota limit exceeded.",
+                     username, p->name, p->info);
+      q->page_count = 2; /* force quota exceeded failure */
+      return (0);
+    }
+    else if (q->page_count == -2) /* quota disabled for user */
+    {
+      cupsdLogMessage(CUPSD_LOG_INFO,
+                      "User \"%s\" request denied for printer %s (%s): "
+                     "printing disabled for user.",
+                     username, p->name, p->info);
+      q->page_count = 2; /* force quota exceeded failure */
+      return (0);
+    }
+    else if (q->page_count == -1) /* quota access error */
+    {
+      cupsdLogMessage(CUPSD_LOG_INFO,
+                      "User \"%s\" request denied for printer %s (%s): "
+                     "unable to determine quota limit.",
+                     username, p->name, p->info);
+      q->page_count = 2; /* force quota exceeded failure */
+      return (0);
+    }
+    else if (q->page_count < 0) /* user not found or other error */
+    {
+      cupsdLogMessage(CUPSD_LOG_INFO,
+                      "User \"%s\" request denied for printer %s (%s): "
+                     "user disabled / missing quota.",
+                     username, p->name, p->info);
+      q->page_count = 2; /* force quota exceeded failure */
+      return (0);
+    }
+    else /* page within user limits */
+    {
+      q->page_count = 0; /* allow user to print */
+      return (1);
+    }
+  }
+  else
+#endif /* __APPLE__ */
   if (p->k_limit || p->page_limit)
   {
     if ((q = cupsdUpdateQuota(p, username, 0, 0)) == NULL)
@@ -4832,7 +5034,7 @@ create_subscription(
 
     while (attr && attr->group_tag != IPP_TAG_ZERO)
     {
-      if (!strcmp(attr->name, "notify-recipient") &&
+      if (!strcmp(attr->name, "notify-recipient-uri") &&
           attr->value_tag == IPP_TAG_URI)
       {
        /*
@@ -4851,7 +5053,7 @@ create_subscription(
                            resource, sizeof(resource)) < HTTP_URI_OK)
         {
           send_ipp_status(con, IPP_NOT_POSSIBLE,
-                         _("Bad notify-recipient URI \"%s\"!"), recipient);
+                         _("Bad notify-recipient-uri URI \"%s\"!"), recipient);
          ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
                        "notify-status-code", IPP_URI_SCHEME);
          return;
@@ -4862,7 +5064,7 @@ create_subscription(
         if (access(notifier, X_OK))
        {
           send_ipp_status(con, IPP_NOT_POSSIBLE,
-                         _("notify-recipient URI \"%s\" uses unknown scheme!"),
+                         _("notify-recipient-uri URI \"%s\" uses unknown scheme!"),
                          recipient);
          ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
                        "notify-status-code", IPP_URI_SCHEME);
@@ -5503,9 +5705,6 @@ get_jobs(cupsd_client_t  *con,            /* I - Client connection */
     if ((job->dtype & dmask) != dtype &&
         (!job->printer || (job->printer->type & dmask) != dtype))
       continue;
-    if (username[0] && strcasecmp(username, job->username))
-      continue;
-
     if (completed && job->state_value <= IPP_JOB_STOPPED)
       continue;
 
@@ -5517,6 +5716,9 @@ get_jobs(cupsd_client_t  *con,            /* I - Client connection */
     if (!job->attrs)
       continue;
 
+    if (username[0] && strcasecmp(username, job->username))
+      continue;
+
     if (count > 0)
       ippAddSeparator(con->response);
 
@@ -7658,7 +7860,6 @@ static void
 save_krb5_creds(cupsd_client_t *con,   /* I - Client connection */
                 cupsd_job_t    *job)   /* I - Job */
 {
-#  ifndef __APPLE__
   krb5_context krb_context;            /* Kerberos context */
   krb5_ccache  ccache;                 /* Credentials cache */
   OM_uint32    major_status,           /* Major status code */
@@ -7699,7 +7900,6 @@ save_krb5_creds(cupsd_client_t *con,      /* I - Client connection */
   cupsdSetStringf(&(job->ccname), "KRB5CCNAME=FILE:%s",
                   krb5_cc_get_name(krb_context, ccache));
   krb5_cc_close(krb_context, ccache);
-#  endif /* !__APPLE__ */
 }
 #endif /* HAVE_GSSAPI && HAVE_KRB5_H */
 
@@ -9248,5 +9448,5 @@ validate_user(cupsd_job_t    *job,        /* I - Job */
 
 
 /*
- * End of "$Id: ipp.c 6318 2007-03-06 04:36:55Z mike $".
+ * End of "$Id: ipp.c 6370 2007-03-20 14:36:12Z mike $".
  */
index 3c876a649f3774a0928b98aa3a675c6fa4291205..aded577575ae04fdbc8d4e87ac60b0b277b7bfd0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: job.c 6318 2007-03-06 04:36:55Z mike $"
+ * "$Id: job.c 6365 2007-03-19 20:56:57Z mike $"
  *
  *   Job management routines for the Common UNIX Printing System (CUPS).
  *
@@ -1700,7 +1700,28 @@ cupsdUpdateJob(cupsd_job_t *job) /* I - Job to check */
         job->sheets->values[0].integer += copies;
 
        if (job->printer->page_limit)
-         cupsdUpdateQuota(job->printer, job->username, copies, 0);
+       {
+         cupsd_quota_t *q = cupsdUpdateQuota(job->printer, job->username,
+                                             copies, 0);
+
+#ifdef __APPLE__
+         if (AppleQuotas && q->page_count == -3)
+         {
+          /*
+           * Quota limit exceeded, cancel job in progress immediately...
+           */
+
+           cupsdLogMessage(CUPSD_LOG_INFO,
+                           "Job %d canceled: pages exceed user %s quota "
+                           "limit on printer %s (%s).",
+                           job->id, job->username, job->printer->name,
+                           job->printer->info);
+
+           cupsdCancelJob(job, 1, IPP_JOB_CANCELED);
+           return;
+         }
+#endif /* __APPLE__ */
+       }
       }
 
       cupsdLogPage(job, message);
@@ -3521,5 +3542,5 @@ unload_job(cupsd_job_t *job)              /* I - Job */
 
 
 /*
- * End of "$Id: job.c 6318 2007-03-06 04:36:55Z mike $".
+ * End of "$Id: job.c 6365 2007-03-19 20:56:57Z mike $".
  */
index 8591cc0f37264b0e47c1903ffd67d2907480ca7d..f17969eea5880742d446ca2b7e201f1f203cf62a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: main.c 6326 2007-03-11 17:50:18Z mike $"
+ * "$Id: main.c 6365 2007-03-19 20:56:57Z mike $"
  *
  *   Scheduler main loop for the Common UNIX Printing System (CUPS).
  *
@@ -61,7 +61,7 @@
 #ifdef HAVE_LAUNCH_H
 #  include <launch.h>
 #  include <libgen.h>
-#  define CUPS_KEEPALIVE       CUPS_STATEDIR "/org.cups.cupsd"
+#  define CUPS_KEEPALIVE       CUPS_CACHEDIR "/org.cups.cupsd"
                                        /* Name of the launchd KeepAlive file */
 #  ifndef LAUNCH_JOBKEY_KEEPALIVE
 #    define LAUNCH_JOBKEY_KEEPALIVE "KeepAlive"
 #  include <notify.h>
 #endif /* HAVE_NOTIFY_H */
 
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+#  include <dlfcn.h>
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
 
 /*
  * Local functions...
@@ -123,6 +127,12 @@ static CFDictionaryRef     launchd_conf_dict = NULL;
                                        /* org.cups.cupsd.plist dict */
 #endif /* HAVE_LAUNCHD */
 
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+static const char *PSQLibPath = "/usr/lib/libPrintServiceQuota.dylib";
+static const char *PSQLibFuncName = "PSQUpdateQuota";
+static void *PSQLibRef;                        /* libPrintServiceQuota.dylib */
+#endif /* HAVE_DLFCN_H */
+
 
 /*
  * 'main()' - Main entry for the CUPS scheduler.
@@ -424,6 +434,17 @@ main(int  argc,                            /* I - Number of command-line args */
   }
 #endif /* HAVE_LAUNCHD */
 
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+ /*
+  * Load Print Service quota enforcement library (X Server only)
+  */
+
+  PSQLibRef = dlopen(PSQLibPath, RTLD_LAZY);
+
+  if (PSQLibRef)
+    PSQUpdateQuotaProc = dlsym(PSQLibRef, PSQLibFuncName);
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
  /*
   * Startup the server...
   */
@@ -2134,5 +2155,5 @@ usage(int status)                 /* O - Exit status */
 
 
 /*
- * End of "$Id: main.c 6326 2007-03-11 17:50:18Z mike $".
+ * End of "$Id: main.c 6365 2007-03-19 20:56:57Z mike $".
  */
index 9a33a22212940d56235a8c0ca380099536a64742..c76a9778037320094bd89b947d70e1daa189011f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c 6318 2007-03-06 04:36:55Z mike $"
+ * "$Id: printers.c 6354 2007-03-19 06:16:32Z mike $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -2288,6 +2288,14 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
     if (BrowseLocalOptions)
       length += 12 + strlen(BrowseLocalOptions);
 
+    if (p->num_auth_info_required > 0)
+    {
+      length += 18;                    /* auth-info-required */
+
+      for (i = 0; i < p->num_auth_info_required; i ++)
+        length += strlen(p->auth_info_required[i]) + 1;
+    }
+
    /*
     * Allocate the new string...
     */
@@ -2334,7 +2342,20 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
        }
       }
 
-      *attrptr = '\0';
+      if (p->num_auth_info_required > 0)
+      {
+        strcpy(attrptr, "auth-info-required");
+       attrptr += 18;
+
+       for (i = 0; i < p->num_auth_info_required; i ++)
+       {
+         *attrptr++ = i ? ',' : '=';
+         strcpy(attrptr, p->auth_info_required[i]);
+         attrptr += strlen(attrptr);
+       }
+      }
+      else
+       *attrptr = '\0';
     }
   }
 
@@ -3632,5 +3653,5 @@ write_irix_state(cupsd_printer_t *p)      /* I - Printer to update */
 
 
 /*
- * End of "$Id: printers.c 6318 2007-03-06 04:36:55Z mike $".
+ * End of "$Id: printers.c 6354 2007-03-19 06:16:32Z mike $".
  */
index a51f7f08dc0ee4a8df85cc55d0e0925e016c9b7f..e224ebe3a8d97cd93e4db6cec047975c18a06191 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: quotas.c 5969 2006-09-19 20:09:24Z mike $"
+ * "$Id: quotas.c 6365 2007-03-19 20:56:57Z mike $"
  *
  *   Quota routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products.
+ *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -101,6 +101,19 @@ cupsdUpdateQuota(
                   "cupsdUpdateQuota: p=%s username=%s pages=%d k=%d",
                   p->name, username, pages, k);
 
+#if defined(__APPLE__) && defined(HAVE_DLFCN_H)
+ /*
+  * Use Apple PrintService quota enforcement if installed (X Server only)
+  */
+
+  if (AppleQuotas && PSQUpdateQuotaProc)
+  { 
+    q->page_count = (*PSQUpdateQuotaProc)(p->name, p->info, username, pages, 0);
+
+    return (q);
+  }
+#endif /* __APPLE__ && HAVE_DLFCN_H */
+
   curtime = time(NULL);
 
   if (curtime < q->next_update)
@@ -230,5 +243,5 @@ find_quota(cupsd_printer_t *p,              /* I - Printer */
 
 
 /*
- * End of "$Id: quotas.c 5969 2006-09-19 20:09:24Z mike $".
+ * End of "$Id: quotas.c 6365 2007-03-19 20:56:57Z mike $".
  */
index 526930cd7dc2927aa299cde036277b53b8ef46ea..8500f802e55d84d07e1b0c28e391e652b9fac330 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: lp.c 5925 2006-09-05 19:43:11Z mike $"
+ * "$Id: lp.c 6356 2007-03-19 13:54:48Z mike $"
  *
  *   "lp" command for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2006 by Easy Software Products.
+ *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -290,7 +290,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
              snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(),
                       httpGetHostname(NULL, buffer, sizeof(buffer)));
-             num_options = cupsAddOption("notify-recipient", email,
+             num_options = cupsAddOption("notify-recipient-uri", email,
                                          num_options, &options);
            }
 
@@ -840,5 +840,5 @@ sighandler(int s)                   /* I - Signal number */
 
 
 /*
- * End of "$Id: lp.c 5925 2006-09-05 19:43:11Z mike $".
+ * End of "$Id: lp.c 6356 2007-03-19 13:54:48Z mike $".
  */
index e6778acc9d5378a3f9488e73f61758d81aea580a..582213204dfd5487647ed74e05997f67749c8952 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: lpoptions.c 6202 2007-01-22 21:37:45Z mike $"
+ * "$Id: lpoptions.c 6347 2007-03-18 03:21:36Z mike $"
  *
  *   Printer option program for the Common UNIX Printing System (CUPS).
  *
@@ -174,6 +174,12 @@ main(int  argc,                            /* I - Number of command-line arguments */
              if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
                dest = dests;
 
+             if (dest == NULL)
+              {
+               _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
+                return (1);
+              }
+
              for (j = 0; j < dest->num_options; j ++)
                if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
                  num_options = cupsAddOption(dest->options[j].name,
@@ -244,6 +250,12 @@ main(int  argc,                            /* I - Number of command-line arguments */
              if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) == NULL)
                dest = dests;
 
+             if (dest == NULL)
+              {
+               _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n"));
+                return (1);
+              }
+
              for (j = 0; j < dest->num_options; j ++)
                if (cupsGetOption(dest->options[j].name, num_options, options) == NULL)
                  num_options = cupsAddOption(dest->options[j].name,
@@ -484,5 +496,5 @@ usage(void)
 
 
 /*
- * End of "$Id: lpoptions.c 6202 2007-01-22 21:37:45Z mike $".
+ * End of "$Id: lpoptions.c 6347 2007-03-18 03:21:36Z mike $".
  */
index 056790dfd9cd33e55c813f22f8722d00b7f0169d..137e26475b80fa5af93f5ecd66654596e06fae7d 100644 (file)
@@ -67,6 +67,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Share published printers connected to this system<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Allow remote administration<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Allow users to cancel any job (not just their own)<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Save debugging information for troubleshooting</P>
 
index 170c42c36a2817d27c2067431f6db2a9aa6b9329..da45641b4918d36e57e246a896968cb927b8523a 100644 (file)
@@ -67,6 +67,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Verteile publizierte Drucker welche mit diesem System verbunden sind<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Erlaube entfernte Verwaltung<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Erlaube Benutzern jeden Auftrag abzubrechen (nicht nur die Eigenen)<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Speichere Fehlerinformationen f&uuml;r Fehlersuche</P>
 
index 3cd99e0dce7812d4fe4dca8da61903d06f2afe2d..2f03f48d4f198929d8636e0c35e36c41eb41fa48 100644 (file)
@@ -67,6 +67,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Compartir impresoras p&uacute;blicas conectadas a este sistema<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Permitir administraci&oacute;n remota<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Permitir a los usuarios cancelar cualquier trabajo (no s&oacute;lo los suyos propios)<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Guardar informaci&oacute;n de depuraci&oacute;n para b&uacute;squeda de problemas</P>
 
index e7d38428a8b6ef19f62dad448fbbc3fba37b160d..fd47b90c418f3d76799f45aebc6abc2bbaafa677 100644 (file)
@@ -67,6 +67,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Aktiivse süsteemiga ühendatud avaldatud printerite jagamine<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Võrguhalduse lubamine<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Kasutajatel lubatakse katkestada kõiki töid (mitte ainult enda omi)<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Silumisinfo salvestamine probleemide tuvastamiseks</P>
 
index e0486ef6773a0870c7eff3c06d0d2bb971a9d45b..78c7f170de46472aaa1a32aebed17a4bfc8bad6d 100644 (file)
@@ -70,6 +70,7 @@ imprimantes publiques connectées à ce système<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Autoriser
 l'administration à distance<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Autoriser les
 utilisateurs à annuler n'importe quelle tâche ( pas seulement les leurs )<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Enregistrer les
index b7526b3cfd7a70bc9f8a099aa903438b5884ce27..f74ffdedd7498d84b1249d12e60022f875a173d6 100644 (file)
@@ -67,6 +67,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Condividi le stampanti pubblicate connesse a questo sistema<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Consenti amministrazione remota<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Consenti agli utenti di annullare qualunque operazione (non solo le proprie)<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Salva le informazioni di debug per la risoluzione di problemi</P>
 
index ad8a5b7d1029c62129a7e6a2556ce781fbfd683b..03512ac8cf97a04590ef9e33d4845d295b205967 100644 (file)
@@ -65,6 +65,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> このシステムに接続されている公開済みプリンタを共有<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> リモート管理を許可<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> どのジョブであってもキャンセルすることを (たとえ所有者でなくても) ユーザに許可<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> トラブルシューティングのためにデバッグ情報を保存</P>
 
index 12e40cd1c43e15defe78f95a120e4895d667015a..1302a78d5131c22c933017f94da77b20d8f6c414 100644 (file)
@@ -65,6 +65,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Udostępnij opublikowane drukarki połączone do tego systemu<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Pozwól na zdalną administrację<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Pozwól użytkownikom na anulowanie każdego zadania (nie tylko ich)<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Zapisz informacje o debugowaniu do rozwiązywania problemów</P>
 
index ff80be8b8fb6b5189e5fe301cb400dbc0fed4ce5..690ec5811376581102a8d9f980d6f1df11eec3de 100644 (file)
@@ -67,6 +67,7 @@ CLASS="button"></A>
 <INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Dela ut publicerade skrivare anslutna till detta system<BR>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
 <INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Tillåt fjärradministration<BR>
+{have_gssapi?<INPUT TYPE="CHECKBOX" NAME="KERBEROS" {?kerberos}> Use Kerberos authentication<BR>:}
 <INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Tillåt användare att avbryta alla jobb (inte bara sina egna)<BR>
 <INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Spara felsökningsinformation för problemlösning</P>
 
diff --git a/tools/buttons.gif b/tools/buttons.gif
new file mode 100644 (file)
index 0000000..080dc86
Binary files /dev/null and b/tools/buttons.gif differ
diff --git a/tools/buttons.txt b/tools/buttons.txt
new file mode 100644 (file)
index 0000000..51cc4e4
--- /dev/null
@@ -0,0 +1,54 @@
+button-accept-jobs.gif              green     Accept Jobs
+button-add-class.gif               standard  Add Class
+button-add-printer.gif                     standard  Add Printer
+button-add-rss-subscription.gif     standard  Add RSS Subscription
+button-add-this-printer.gif         standard  Add This Printer
+button-cancel-all-jobs.gif         black     Cancel All Jobs
+button-cancel-job.gif              black     Cancel Job
+button-cancel-subscription.gif      standard  Cancel Subscription
+button-change-settings.gif         standard  Change Settings
+button-clean-print-heads.gif       standard  Clean Print Heads
+button-clear.gif                   standard  Clear
+button-continue.gif                standard  Continue
+button-delete-class.gif            black     Delete Class
+button-delete-printer.gif          black     Delete Printer
+button-edit-configuration-file.gif  standard  Edit Configuration File
+button-export-samba.gif            standard  Export Printers to Samba
+button-help.gif                    standard  Help
+button-hold-job.gif                red       Hold Job
+button-manage-classes.gif          standard  Manage Classes
+button-manage-jobs.gif                     standard  Manage Jobs
+button-manage-printers.gif         standard  Manage Printers
+button-manage-server.gif           standard  Manage Server
+button-modify-class.gif            standard  Modify Class
+button-modify-printer.gif          standard  Modify Printer
+button-move-job.gif                standard  Move Job
+button-move-jobs.gif               standard  Move All Jobs
+button-print-self-test-page.gif     standard  Print Self-Test Page
+button-print-test-page.gif         standard  Print Test Page
+button-publish-printer.gif         standard  Publish Printer
+button-reject-jobs.gif                     red       Reject Jobs
+button-release-job.gif                     green     Release Job
+button-restart-job.gif                     standard  Reprint Job
+button-save-changes.gif            standard  Save Changes
+button-search.gif                  standard  Search
+button-set-allowed-users.gif       standard  Set Allowed Users
+button-set-as-default.gif          standard  Set As Default
+button-set-printer-options.gif             standard  Set Printer Options
+button-show-active.gif                     standard  Show Active Jobs
+button-show-all.gif                standard  Show All Jobs
+button-show-completed.gif          standard  Show Completed Jobs
+button-show-next.gif               standard  Show Next
+button-show-previous.gif           standard  Show Previous
+button-sort-ascending.gif          standard  @UP Sort Ascending @UP
+button-sort-descending.gif         standard  @DOWN Sort Descending @DOWN
+button-start-class.gif                     green     Start Class
+button-start-printer.gif           green     Start Printer
+button-stop-class.gif              red       Stop Class
+button-stop-printer.gif            red       Stop Printer
+button-unpublish-printer.gif       standard  Unpublish Printer
+button-use-default-config.gif      standard  Use Default Configuration File
+button-view-access-log.gif         standard  View Access Log
+button-view-error-log.gif          standard  View Error Log
+button-view-page-log.gif           standard  View Page Log
+button-view-printable-version.gif   standard  View Printable Version
diff --git a/tools/makebuttons b/tools/makebuttons
new file mode 100755 (executable)
index 0000000..5723ab4
--- /dev/null
@@ -0,0 +1,268 @@
+#!/bin/sh
+#
+# "$Id$"
+#
+#   Button generation script for the Common UNIX Printing System (CUPS).
+#
+#   Originally created and donated by Philippe Combes (see STR #2231).
+#
+#   Copyright 2007 by Easy Software Products, all rights reserved.
+#
+#   These coded instructions, statements, and computer programs are the
+#   property of Easy Software Products and are protected by Federal
+#   copyright law.  Distribution and use rights are outlined in the file
+#   "LICENSE.txt" which should have been included with this file.  If this
+#   file is missing or damaged please contact Easy Software Products
+#   at:
+#
+#       Attn: CUPS Licensing Information
+#       Easy Software Products
+#       44141 Airport View Drive, Suite 204
+#       Hollywood, Maryland 20636-3142 USA
+#
+#       Voice: (301) 373-9600
+#       EMail: cups-info@cups.org
+#         WWW: http://www.cups.org
+#
+
+#
+# This little script uses convert from ImageMagick to generate CUPS buttons.
+# It requires ImageMagick version 6.2.4 or higher.
+#
+# It can generate 20-pixel high one-line buttons and 40-pixel high two-line
+# buttons.
+#
+# Usage:
+#
+#     tools/makebuttons locale buttons.txt
+#
+# "Locale" is the locale name, either "ll" or "ll_CC" where "ll" is the
+# 2-letter language abbreviation and "CC" is the 2-letter ISO country
+# code.  The new "ll-region" syntax is *not* supported at this time
+# and should not be used!
+#
+# "Buttons.txt" is a file containing the buttons to be created and must
+# be formatted as follows:
+#
+#     filename.gif color text for button
+# 
+# "filename.gif" is the name of the image file to create.
+#
+# "color" is the color of the button, one of "std" (the normal olive
+# background), "black", "green", or "red".
+#
+# The remainder of the line following the color is used as the text
+# for the button.  Use "@UP" and "@DOWN" to include up and down arrows,
+# and "\\n" to break the text into 2 lines (not generally recommended).
+#
+# Lines starting with '#' are treated as comments.  See the file
+# "tools/buttons.txt" for inspiration...
+#
+
+if test $# -lt 2; then
+       echo Usage: tools/makebuttons locale buttons.txt
+       exit 1
+elif test ! -d tools; then
+       echo ERROR: You MUST run the makebuttons script from the main CUPS source directory!
+       exit 1
+elif test "x`convert --help | grep extent`" = x; then
+       echo ERROR: This script requires ImageMagick 6.2.4 or higher.
+       exit 1
+else
+       locale=$1
+       list=$2
+fi
+
+if test ! -f $list; then
+       echo "ERROR: $list: file not found."
+       exit 1
+elif test ! -r $list; then
+       echo "ERROR: $list: cannot read file."
+       exit 1
+fi
+
+
+# Bitstream Vera font...
+font="fonts/Vera.ttf"
+
+# Base image
+base="tools/buttons.gif"
+
+# Colors
+background="#d4d4a4"
+black="#000000"
+green="#009900"
+red="#cc0000"
+standard="#666633"
+
+
+# 'generate_button()' - Create a button image.
+#
+# Arg 1: button filename (WITH .gif extension!)
+# Arg 2: button color: black, green, red or std (only the initial letter matters)
+# Arg 3+: the text !
+
+function generate_button()
+{
+       # Collect arguments...
+       filename=$1
+       shift
+
+       color=$1
+       shift
+
+       txt="$*"
+
+       # Show progress...
+       echo Creating $filename...
+
+       # Figure out the foreground and background colors...
+       bgclr=$background
+
+       case x$color in
+               xb*)
+                       fgclr=$black
+                       fuzz="10%"
+                       ;;
+
+               xg*)
+                       fgclr=$green
+                       fuzz="10%"
+                       ;;
+
+               xr*)
+                       fgclr=$red
+                       fuzz="1%"
+                       ;;
+
+               xs*)
+                       fgclr=$standard
+                       fuzz="10%"
+                       ;;
+
+               *)
+                       echo "ERROR: Unknown color $color for $filename!"
+                       exit 1
+                       ;;
+       esac
+
+       # See if we need to add the up or down arrows...
+       add_arrows=0 # 1: up arrows, 2: down arrows
+
+       if echo $txt | grep '@UP' > /dev/null 2>&1; then
+               add_arrows=1
+               txt="`echo $txt | sed 's|@UP||g'`"
+       elif echo $txt | grep '@DOWN' > /dev/null 2>&1; then
+               add_arrows=2
+               txt="`echo $txt | sed 's|@DOWN||g'`"
+       fi
+
+       tmp_btn=/tmp/cups-btn-$$.bmp
+
+       # First step: generate an image trimmed to the text.
+       #  -> annotate a 40x400 rectangle with the provided text
+       #  -> trim to the text
+       convert $base -extent 400x40 -fill "$fgclr" \
+               -draw "rectangle 0,0 399,39" \
+               -fill "#ffffff" -encoding Unicode -pointsize 13 -font "$font" \
+               -gravity Center -annotate 0x0+0+0 "$txt" -trim $tmp_btn
+
+       # From the 1st step, we get text width and height
+       txt_h=`identify -format "%h" $tmp_btn`
+       txt_w=`identify -format "%w" $tmp_btn`
+
+       if test $txt_h -gt 32; then
+               echo "ERROR: 2 lines maximum for the button text"
+               exit 1
+       fi
+
+       # With the default font, one line is less than 16 pixels high, and a
+       # two lines of text is at least 20 pixels high.  So, from the text
+       # height we guess if we need a one- or two-line button.
+       if test $txt_h -ge 18; then
+               btn_h=40
+       else
+               btn_h=20
+       fi
+
+       if test $add_arrows -gt 0; then
+               if test $btn_h -eq 20; then
+                       txt_w=`expr $txt_w + 36`
+               elif test $btn_h -eq 40; then
+                       txt_w=`expr $txt_w + 58`
+               fi
+       fi
+
+       # Second step: generate the button.
+       #
+       # Procedure:
+       #
+       #     - Draw a rectangle with the background color (for correct
+       #       button borders)
+       #     - Draw a roundRectangle (args are coordinates, not lengths!)
+       #     - Make the background transparent (with correct fuzz feature)
+       #     - Annotate centered text (in height, it is necessary to have
+       #       -1 in y parameter so that the text is not too low)
+       rad=`expr $btn_h / 2`
+       btn_w=`expr $txt_w + $rad + $rad`
+       btn_top=`expr $btn_h - 1`
+
+       convert $base \
+               -extent $btn_w'x'$btn_h -fill "$bgclr" \
+               -draw "rectangle 0,0 $btn_w,$btn_h" -fill "$fgclr" \
+               -draw "roundRectangle 0,0 `expr $btn_w - 1`,$btn_top `expr $rad - 1`,$rad" \
+               -fuzz $fuzz -transparent "$bgclr" -write $filename \
+               -fill "#ffffff" -encoding Unicode -pointsize 13 \
+               -font "$font" -gravity Center -annotate 0x0+0-1 "$txt" \
+               $filename
+
+       if test $add_arrows -gt 0; then
+               if test $add_arrows -eq 1; then
+                       # UP arrows
+                       if test $btn_h -eq 20; then
+                               # 1-line buttons
+                               pts1="9,15 21,15 15,4"
+                               pts2="`expr $btn_w - 10`,15 `expr $btn_w - 22`,15 `expr $btn_w - 16`,4"
+                       else
+                               # 2-line buttons
+                               pts1="16,30 34,30 25,10"
+                               pts2="`expr $btn_w - 17`,30 `expr $btn_w - 35`,30 `expr $btn_w - 26`,10"
+                       fi
+               else
+                       # DOWN arrows
+                       if [ $btn_h -eq 20 ]; then
+                               # 1-line buttons
+                               pts1="9,4 21,4 15,15"
+                               pts2="`expr $btn_w - 10`,4 `expr $btn_w - 22`,4 `expr $btn_w - 16`,15"
+                       else
+                               # 2-line buttons
+                               pts1="16,10 34,10 25,30"
+                               pts2="`expr $btn_w - 17`,10 `expr $btn_w - 35`,10 `expr $btn_w - 26`,30"
+                       fi
+               fi
+
+               convert $filename -fill "#ffffff" -draw "polygon $pts1" \
+                       -draw "polygon $pts2" $filename
+       fi
+
+       rm -f $tmp_btn
+}
+
+# Make sure the locale-specific destination directory exists...
+if test ! -d doc/$locale/images; then
+       echo Creating doc/$locale/images...
+       mkdir -p doc/$locale/images
+fi
+
+# Process each line in the file...
+cat $list | while read line; do
+       if test "x`echo $line | cut -c1`" = "x#"; then
+               continue
+       fi
+
+       generate_button doc/$locale/images/$line
+done
+
+#
+# End of "$Id$".
+#