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)
-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
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.
/*
- * "$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
if ((http = httpConnectEncrypt(hostname, port, cupsEncryption())) == NULL)
{
+ if (job_cancelled)
+ break;
+
if (getenv("CLASS") != NULL)
{
/*
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);
/*
- * 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 $".
*/
/*
- * "$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
UInt32 location;
Boolean waitEOF;
+
+ CFRunLoopTimerRef statusTimer;
pthread_cond_t reqWaitCompCond;
pthread_mutex_t reqWaitMutex;
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);
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) {
}
}
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 -
/*
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);
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); */
}
}
/*
- * 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 $".
*/
/*
- * "$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
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;
/*
- * 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 $".
*/
/*
- * "$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).
*
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,
*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 */
* 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...
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)))
{
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))
{
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);
/*
/*
- * 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 $".
*/
/*
- * "$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
/*
- * 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 $".
*/
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
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)
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
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
fi
;;
- FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
+ FreeBSD* | OpenBSD* | MirBSD* | ekkoBSD*)
# FreeBSD and OpenBSD
;;
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
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
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
/*
- * "$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 $".
*/
/*
- * "$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.
}
+/*
+ * '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.
*
}
+/*
+ * '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.
*
}
}
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);
/*
* 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)
{
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);
/*
- * 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 $".
*/
/*
- * "$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).
*
{ "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 },
/*
- * 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 $".
*/
/*
- * "$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
{
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
/*
- * 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 $".
*/
/*
- * "$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).
*
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.
*/
/*
- * 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 $".
*/
/*
- * "$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).
*
tempptr < tempdec && bufptr < bufend;
*bufptr++ = *tempptr++);
- tempdec += declen;
+ tempptr += declen;
- if (*tempdec && bufptr < bufend)
+ if (*tempptr && bufptr < bufend)
{
*bufptr++ = '.';
/*
- * 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 $".
*/
/*
- * "$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).
*
#include <stdio.h>
#include "i18n.h"
+#include "string.h"
/*
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)
{
if (language != language2)
{
+ errors ++;
+
puts("**** ERROR: Language cache did not work! ****");
puts("First result from cupsLangGet:");
}
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 $".
*/
<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>
<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>
<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
#!/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).
#
# 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"
#
-# 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 $".
#
<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>
#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
//------------------------------------------------------------------------
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");
}
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;
// 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());
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);
};
/*
- * "$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).
*
}
}
#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 */
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...");
/*
- * 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 $".
*/
/*
- * "$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.
#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 */
/*
- * 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 $".
*/
/*
- * "$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.
*
* 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;
/*
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 */
/*
- * 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 $".
*/
/*
- * "$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
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
cupsdSetString(&LaunchdConf, CUPS_DEFAULT_LAUNCHD_CONF);
#endif /* HAVE_LAUNCHD */
+#ifdef __APPLE__
+ AppleQuotas = TRUE;
+#endif /* __APPLE__ */
+
/*
* Read the configuration file...
*/
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;
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
{
/*
- * 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 $".
*/
/*
- * "$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
/* 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 */
/*
- * 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 $".
*/
/*
- * "$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).
*
{ "german", "de" },
{ "greek", "el" },
{ "italian", "it" },
- { "japanese", "jp" },
+ { "japanese", "ja" },
{ "norwegian", "no" },
{ "polish", "pl" },
{ "portuguese", "pt" },
/*
- * 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 $".
*/
/*
- * "$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.
*
/* 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...
/*
- * 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 $".
*/
/*
- * "$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).
*
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 */
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...
*/
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\"...",
/*
* 'send_cups_browse()' - Send new browsing information using the CUPS
- * protocol.
+ * protocol.
*/
static void
/*
- * 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 $".
*/
/*
- * "$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...
* 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...
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);
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])",
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] == '@')
* 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)
{
* 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)
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)
{
/*
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;
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);
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;
if (!job->attrs)
continue;
+ if (username[0] && strcasecmp(username, job->username))
+ continue;
+
if (count > 0)
ippAddSeparator(con->response);
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 */
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 */
/*
- * 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 $".
*/
/*
- * "$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).
*
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);
/*
- * 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 $".
*/
/*
- * "$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).
*
#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...
/* 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.
}
#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...
*/
/*
- * 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 $".
*/
/*
- * "$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).
*
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...
*/
}
}
- *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';
}
}
/*
- * 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 $".
*/
/*
- * "$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
"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)
/*
- * 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 $".
*/
/*
- * "$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
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);
}
/*
- * 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 $".
*/
/*
- * "$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).
*
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,
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,
/*
- * 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 $".
*/
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Share published printers connected to this system<BR>
<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>
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Verteile publizierte Drucker welche mit diesem System verbunden sind<BR>
<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ür Fehlersuche</P>
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Compartir impresoras públicas conectadas a este sistema<BR>
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ANY" {?remote_any}> Allow printing from the Internet<BR>
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Permitir administració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ólo los suyos propios)<BR>
<INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Guardar información de depuración para búsqueda de problemas</P>
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Aktiivse süsteemiga ühendatud avaldatud printerite jagamine<BR>
<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>
<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
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Condividi le stampanti pubblicate connesse a questo sistema<BR>
<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>
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> このシステムに接続されている公開済みプリンタを共有<BR>
<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>
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Udostępnij opublikowane drukarki połączone do tego systemu<BR>
<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>
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Dela ut publicerade skrivare anslutna till detta system<BR>
<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>
--- /dev/null
+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
--- /dev/null
+#!/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$".
+#