From: msweet
Date: Tue, 15 Jul 2008 01:21:40 +0000 (+0000)
Subject: Merge changes from CUPS 1.4svn-r7715.
X-Git-Tag: release-1.6.3~158
X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=1f0275e3cc0bc5fbe11e3bffd54581aa05c9c764
Merge changes from CUPS 1.4svn-r7715.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@859 a1ca3aef-8c08-0410-bb20-df032aa958be
---
diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt
index ba2785712..7324c268d 100644
--- a/CHANGES-1.3.txt
+++ b/CHANGES-1.3.txt
@@ -4,6 +4,22 @@ CHANGES-1.3.txt
CHANGES IN CUPS V1.3.8
- Documentation updates (STR #2785, STR #2861, STR #2862)
+ - The IPP backend did not relay marker-* attributes.
+ - The CUPS GNOME/KDE menu item was not localized for
+ Japanese (STR #2876)
+ - The cupstestppd utility reported mixed line endings for
+ Mac OS and Windows PPD files (STR #2874)
+ - The pdftops filter did not print landscape orientation PDF
+ pages correctly on all printers (STR #2850)
+ - The scheduler did not handle expiring of implicit classes
+ or their members properly, leading to a configuration where
+ one of the members would have a short name (STR #2766)
+ - The scheduler and cupstestppd utilities did not support
+ cupsFilter and cupsPreFilter programs with spaces in their
+ names (STR #2866)
+ - Removed unused variables and assignments found by the
+ LLVM "clang" tool.
+ - Added NULL checks recommended by the LLVM "clang" tool.
- The scheduler would crash if you started a printer that
pointed to a backend that did not exist (STR #2865)
- The ppdLocalize functions incorrectly mapped all generic
diff --git a/CHANGES.txt b/CHANGES.txt
index 7bc730132..e2478d39d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,8 +1,12 @@
-CHANGES.txt - 2008-07-02
+CHANGES.txt - 2008-07-14
------------------------
CHANGES IN CUPS V1.4b1
+ - Added an AccessLogLevel directive to cupsd.conf to control
+ what is logged to the access_log file.
+ - The default LogLevel is now "warn" instead of "info" to reduce
+ the amount of logging that is done to disk by default.
- The PPD compiler did not include OID query keywords in PPD
files (STR #2871)
- The cups-driverd helper program now directly supports driver
diff --git a/Makefile b/Makefile
index 67fd9d84f..fefe1336d 100644
--- a/Makefile
+++ b/Makefile
@@ -103,6 +103,20 @@ depend:
done
+#
+# Run the clang.llvm.org static code analysis tool on the C sources.
+#
+
+.PHONY: clang
+clang:
+ if test ! -d clang; then \
+ mkdir clang; \
+ else \
+ rm -rf clang/*; \
+ fi
+ $(MAKE) $(MFLAGS) CC="scan-build -o ../clang $(CC)" clean all
+
+
#
# Generate a ctags file...
#
diff --git a/backend/ipp.c b/backend/ipp.c
index 9944220a2..5113ac727 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -22,6 +22,7 @@
* compress_files() - Compress print files...
* password_cb() - Disable the password prompt for
* cupsDoFileRequest().
+ * report_attr() - Report an IPP attribute value.
* report_printer_state() - Report the printer state.
* run_pictwps_filter() - Convert PICT files to PostScript when printing
* remotely.
@@ -64,6 +65,7 @@ static void check_printer_state(http_t *http, const char *uri,
static void compress_files(int num_files, char **files);
#endif /* HAVE_LIBZ */
static const char *password_cb(const char *);
+static void report_attr(ipp_attribute_t *attr);
static int report_printer_state(ipp_t *ipp, int job_id);
#ifdef __APPLE__
@@ -88,6 +90,7 @@ main(int argc, /* I - Number of command-line args */
int send_options; /* Send job options? */
int num_options; /* Number of printer options */
cups_option_t *options; /* Printer options */
+ const char *device_uri; /* Device URI */
char method[255], /* Method in URI */
hostname[1024], /* Hostname */
username[255], /* Username info */
@@ -137,6 +140,11 @@ main(int argc, /* I - Number of command-line args */
{ /* Printer attributes we want */
"copies-supported",
"document-format-supported",
+ "marker-colors",
+ "marker-levels",
+ "marker-message",
+ "marker-names",
+ "marker-types",
"printer-is-accepting-jobs",
"printer-state",
"printer-state-message",
@@ -220,7 +228,10 @@ main(int argc, /* I - Number of command-line args */
* Extract the hostname and printer name from the URI...
*/
- if (httpSeparateURI(HTTP_URI_CODING_ALL, cupsBackendDeviceURI(argv),
+ if ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
+ return (CUPS_BACKEND_FAILED);
+
+ if (httpSeparateURI(HTTP_URI_CODING_ALL, device_uri,
method, sizeof(method), username, sizeof(username),
hostname, sizeof(hostname), &port,
resource, sizeof(resource)) < HTTP_URI_OK)
@@ -398,6 +409,7 @@ main(int argc, /* I - Number of command-line args */
cups_file_t *fp; /* Temporary file */
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
+ off_t tbytes; /* Total bytes copied */
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
@@ -414,6 +426,8 @@ main(int argc, /* I - Number of command-line args */
return (CUPS_BACKEND_FAILED);
}
+ tbytes = 0;
+
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
if (cupsFileWrite(fp, buffer, bytes) < bytes)
{
@@ -422,9 +436,22 @@ main(int argc, /* I - Number of command-line args */
unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}
+ else
+ tbytes += bytes;
cupsFileClose(fp);
+ /*
+ * Don't try printing files less than 2 bytes...
+ */
+
+ if (tbytes <= 1)
+ {
+ _cupsLangPuts(stderr, _("ERROR: Empty print file!\n"));
+ unlink(tmpfilename);
+ return (CUPS_BACKEND_FAILED);
+ }
+
/*
* Point to the single file from stdin...
*/
@@ -600,6 +627,7 @@ main(int argc, /* I - Number of command-line args */
*/
if ((snmp_fd = _cupsSNMPOpen(http->hostaddr->addr.sa_family)) >= 0)
+ {
if (backendSNMPSupplies(snmp_fd, http->hostaddr, &start_count, NULL))
{
/*
@@ -609,6 +637,9 @@ main(int argc, /* I - Number of command-line args */
_cupsSNMPClose(snmp_fd);
snmp_fd = -1;
}
+ }
+ else
+ start_count = 0;
/*
* Build a URI for the printer and fill the standard IPP attributes for
@@ -1335,6 +1366,11 @@ check_printer_state(
*response; /* IPP response */
static const char * const attrs[] = /* Attributes we want */
{
+ "marker-colors",
+ "marker-levels",
+ "marker-message",
+ "marker-names",
+ "marker-types",
"printer-state-message",
"printer-state-reasons"
};
@@ -1487,6 +1523,74 @@ password_cb(const char *prompt) /* I - Prompt (not used) */
}
+/*
+ * 'report_attr()' - Report an IPP attribute value.
+ */
+
+static void
+report_attr(ipp_attribute_t *attr) /* I - Attribute */
+{
+ int i; /* Looping var */
+ char value[1024], /* Value string */
+ *valptr, /* Pointer into value string */
+ *attrptr; /* Pointer into attribute value */
+
+
+ /*
+ * Convert the attribute values into quoted strings...
+ */
+
+ for (i = 0, valptr = value;
+ i < attr->num_values && valptr < (value + sizeof(value) - 10);
+ i ++)
+ {
+ if (i > 0)
+ *valptr++ = ',';
+
+ switch (attr->value_tag)
+ {
+ case IPP_TAG_INTEGER :
+ case IPP_TAG_ENUM :
+ snprintf(valptr, sizeof(value) - (valptr - value), "%d",
+ attr->values[i].integer);
+ valptr += strlen(valptr);
+ break;
+
+ case IPP_TAG_TEXT :
+ case IPP_TAG_NAME :
+ case IPP_TAG_KEYWORD :
+ *valptr++ = '\"';
+ for (attrptr = attr->values[i].string.text;
+ *attrptr && valptr < (value + sizeof(value) - 10);
+ attrptr ++)
+ {
+ if (*attrptr == '\\' || *attrptr == '\"')
+ *valptr++ = '\\';
+
+ *valptr++ = *attrptr;
+ }
+ *valptr++ = '\"';
+ break;
+
+ default :
+ /*
+ * Unsupported value type...
+ */
+
+ return;
+ }
+ }
+
+ *valptr = '\0';
+
+ /*
+ * Tell the scheduler about the new values...
+ */
+
+ fprintf(stderr, "ATTR: %s=%s\n", attr->name, value);
+}
+
+
/*
* 'report_printer_state()' - Report the printer state.
*/
@@ -1497,8 +1601,9 @@ report_printer_state(ipp_t *ipp, /* I - IPP response */
{
int i; /* Looping var */
int count; /* Count of reasons shown... */
- ipp_attribute_t *psm, /* pritner-state-message */
- *reasons; /* printer-state-reasons */
+ ipp_attribute_t *psm, /* printer-state-message */
+ *reasons, /* printer-state-reasons */
+ *marker; /* marker-* attributes */
const char *reason; /* Current reason */
const char *message; /* Message to show */
char unknown[1024]; /* Unknown message string */
@@ -1605,6 +1710,22 @@ report_printer_state(ipp_t *ipp, /* I - IPP response */
fprintf(stderr, "%s\n", state);
+ /*
+ * Relay the current marker-* attribute values...
+ */
+
+ if ((marker = ippFindAttribute(ipp, "marker-colors", IPP_TAG_NAME)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-levels",
+ IPP_TAG_INTEGER)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-message", IPP_TAG_TEXT)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-names", IPP_TAG_NAME)) != NULL)
+ report_attr(marker);
+ if ((marker = ippFindAttribute(ipp, "marker-types", IPP_TAG_KEYWORD)) != NULL)
+ report_attr(marker);
+
return (count);
}
diff --git a/backend/lpd.c b/backend/lpd.c
index 76123b32d..5bd008348 100644
--- a/backend/lpd.c
+++ b/backend/lpd.c
@@ -112,6 +112,7 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
+ const char *device_uri; /* Device URI */
char method[255], /* Method in URI */
hostname[1024], /* Hostname */
username[255], /* Username info */
@@ -188,7 +189,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Extract the hostname and printer name from the URI...
*/
- httpSeparateURI(HTTP_URI_CODING_ALL, cupsBackendDeviceURI(argv),
+ if ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
+ return (CUPS_BACKEND_FAILED);
+
+ httpSeparateURI(HTTP_URI_CODING_ALL, device_uri,
method, sizeof(method), username, sizeof(username),
hostname, sizeof(hostname), &port,
resource, sizeof(resource));
@@ -437,8 +441,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}
-
- filename = tmpfilename;
}
else if (argc == 6)
{
@@ -883,6 +885,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
*/
if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
+ {
if (backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count, NULL))
{
/*
@@ -892,6 +895,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
_cupsSNMPClose(snmp_fd);
snmp_fd = -1;
}
+ }
+ else
+ start_count = 0;
/*
* Check for side-channel requests...
diff --git a/backend/mdns.c b/backend/mdns.c
index dba97231c..4ae2c8121 100644
--- a/backend/mdns.c
+++ b/backend/mdns.c
@@ -55,7 +55,8 @@ typedef struct
*fullName, /* Full name */
*make_and_model; /* Make and model from TXT record */
cups_devtype_t type; /* Device registration type */
- int cups_shared, /* CUPS shared printer? */
+ int priority, /* Priority associated with type */
+ cups_shared, /* CUPS shared printer? */
sent; /* Did we list the device? */
} cups_device_t;
@@ -227,6 +228,7 @@ main(int argc, /* I - Number of command-line args */
* Announce any devices we've found...
*/
+ cups_device_t *best; /* Best matching device */
char device_uri[1024]; /* Device URI */
int count; /* Number of queries */
static const char * const schemes[] =
@@ -234,7 +236,8 @@ main(int argc, /* I - Number of command-line args */
/* URI schemes for devices */
- for (device = (cups_device_t *)cupsArrayFirst(devices), count = 0;
+ for (device = (cups_device_t *)cupsArrayFirst(devices),
+ best = NULL, count = 0;
device;
device = (cups_device_t *)cupsArrayNext(devices))
if (!device->ref && !device->sent)
@@ -268,17 +271,47 @@ main(int argc, /* I - Number of command-line args */
DNSServiceRefDeallocate(device->ref);
device->ref = 0;
- httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
- schemes[device->type], NULL, device->fullName, 0,
- device->cups_shared ? "/cups" : "/");
+ if (!best)
+ best = device;
+ else if (strcasecmp(best->name, device->name) ||
+ strcasecmp(best->domain, device->domain))
+ {
+ httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
+ schemes[best->type], NULL, best->fullName, 0,
+ best->cups_shared ? "/cups" : "/");
+
+ printf("network %s \"%s\" \"%s\"\n", device_uri,
+ best->make_and_model ? best->make_and_model : "Unknown",
+ best->name);
+ fflush(stdout);
+
+ best->sent = 1;
+ best = device;
+ }
+ else if (best->priority > device->priority ||
+ (best->priority == device->priority &&
+ best->type < device->type))
+ {
+ best->sent = 1;
+ best = device;
+ }
+ else
+ device->sent = 1;
+ }
- printf("network %s \"%s\" \"%s\"\n", device_uri,
- device->make_and_model ? device->make_and_model : "Unknown",
- device->name);
- fflush(stdout);
+ if (best)
+ {
+ httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri),
+ schemes[best->type], NULL, best->fullName, 0,
+ best->cups_shared ? "/cups" : "/");
- device->sent = 1;
- }
+ printf("network %s \"%s\" \"%s\"\n", device_uri,
+ best->make_and_model ? best->make_and_model : "Unknown",
+ best->name);
+ fflush(stdout);
+
+ best->sent = 1;
+ }
}
}
}
@@ -410,7 +443,8 @@ exec_backend(char **argv) /* I - Command-line arguments */
* Resolve the device URI...
*/
- resolved_uri = cupsBackendDeviceURI(argv);
+ if ((resolved_uri = cupsBackendDeviceURI(argv)) == NULL)
+ exit(CUPS_BACKEND_FAILED);
/*
* Extract the scheme from the URI...
@@ -481,47 +515,36 @@ get_device(cups_array_t *devices, /* I - Device array */
else
key.type = CUPS_DEVICE_RIOUSBPRINT;
- if ((device = cupsArrayFind(devices, &key)) != NULL)
- {
- /*
- * No, see if this registration is a higher priority protocol...
- */
+ for (device = cupsArrayFind(devices, &key);
+ device;
+ device = cupsArrayNext(devices))
+ if (strcasecmp(device->name, key.name) ||
+ strcasecmp(device->domain, key.domain))
+ break;
+ else if (device->type == key.type)
+ return (device);
- if (key.type > device->type)
- {
- fprintf(stderr, "DEBUG: Updating \"%s\" to \"%s.%s%s\"...\n",
- device->fullName, serviceName, regtype, replyDomain);
-
- device->type = key.type;
- }
- }
- else
- {
- /*
- * Yes, add the device...
- */
+ /*
+ * Yes, add the device...
+ */
- fprintf(stderr, "DEBUG: Found \"%s.%s%s\"...\n", serviceName, regtype,
- replyDomain);
+ fprintf(stderr, "DEBUG: Found \"%s.%s%s\"...\n", serviceName, regtype,
+ replyDomain);
- device = calloc(sizeof(cups_device_t), 1);
- device->name = strdup(serviceName);
- device->domain = strdup(replyDomain);
- device->type = key.type;
+ device = calloc(sizeof(cups_device_t), 1);
+ device->name = strdup(serviceName);
+ device->domain = strdup(replyDomain);
+ device->type = key.type;
+ device->priority = 50;
- cupsArrayAdd(devices, device);
- }
+ cupsArrayAdd(devices, device);
/*
- * Update the "full name" of this service, which is used for queries...
+ * Set the "full name" of this service, which is used for queries...
*/
snprintf(fullName, sizeof(fullName), "%s.%s%s", serviceName, regtype,
replyDomain);
-
- if (device->fullName)
- free(device->fullName);
-
device->fullName = strdup(fullName);
return (device);
@@ -585,105 +608,142 @@ query_callback(
if ((ptr = strstr(name, "._")) != NULL)
*ptr = '\0';
- if ((device = cupsArrayFind(devices, &key)) != NULL)
+ if (strstr(fullName, "_ipp._tcp.") ||
+ strstr(fullName, "_ipp-tls._tcp."))
+ key.type = CUPS_DEVICE_IPP;
+ else if (strstr(fullName, "_fax-ipp._tcp."))
+ key.type = CUPS_DEVICE_FAX_IPP;
+ else if (strstr(fullName, "_printer._tcp."))
+ key.type = CUPS_DEVICE_PRINTER;
+ else if (strstr(fullName, "_pdl-datastream._tcp."))
+ key.type = CUPS_DEVICE_PDL_DATASTREAM;
+ else
+ key.type = CUPS_DEVICE_RIOUSBPRINT;
+
+ for (device = cupsArrayFind(devices, &key);
+ device;
+ device = cupsArrayNext(devices))
{
- /*
- * Found it, pull out the make and model from the TXT record and save it...
- */
+ if (strcasecmp(device->name, key.name) ||
+ strcasecmp(device->domain, key.domain))
+ {
+ device = NULL;
+ break;
+ }
+ else if (device->type == key.type)
+ {
+ /*
+ * Found it, pull out the priority and make and model from the TXT
+ * record and save it...
+ */
- const void *value; /* Pointer to value */
- uint8_t valueLen; /* Length of value (max 255) */
- char make_and_model[512], /* Manufacturer and model */
- model[256]; /* Model */
+ const void *value; /* Pointer to value */
+ uint8_t valueLen; /* Length of value (max 255) */
+ char make_and_model[512], /* Manufacturer and model */
+ model[256], /* Model */
+ priority[256]; /* Priority */
- if ((value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MFG",
- &valueLen)) == NULL)
- value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MANUFACTURER", &valueLen);
+ value = TXTRecordGetValuePtr(rdlen, rdata, "priority", &valueLen);
- if (value && valueLen)
- {
- memcpy(make_and_model, value, valueLen);
- make_and_model[valueLen] = '\0';
- }
- else
- make_and_model[0] = '\0';
+ if (value && valueLen)
+ {
+ memcpy(priority, value, valueLen);
+ priority[valueLen] = '\0';
+ device->priority = atoi(priority);
+ }
- if ((value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MDL",
- &valueLen)) == NULL)
- value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MODEL", &valueLen);
+ if ((value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MFG",
+ &valueLen)) == NULL)
+ value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MANUFACTURER",
+ &valueLen);
- if (value && valueLen)
- {
- memcpy(model, value, valueLen);
- model[valueLen] = '\0';
- }
- else if ((value = TXTRecordGetValuePtr(rdlen, rdata, "product",
- &valueLen)) != NULL && valueLen > 2)
- {
- if (((char *)value)[0] == '(')
+ if (value && valueLen)
{
- /*
- * Strip parenthesis...
- */
-
- memcpy(model, value + 1, valueLen - 2);
- model[valueLen - 2] = '\0';
+ memcpy(make_and_model, value, valueLen);
+ make_and_model[valueLen] = '\0';
}
else
+ make_and_model[0] = '\0';
+
+ if ((value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MDL",
+ &valueLen)) == NULL)
+ value = TXTRecordGetValuePtr(rdlen, rdata, "usb_MODEL", &valueLen);
+
+ if (value && valueLen)
{
memcpy(model, value, valueLen);
model[valueLen] = '\0';
}
-
- if (!strcasecmp(model, "GPL Ghostscript") ||
- !strcasecmp(model, "GNU Ghostscript") ||
- !strcasecmp(model, "ESP Ghostscript"))
+ else if ((value = TXTRecordGetValuePtr(rdlen, rdata, "product",
+ &valueLen)) != NULL && valueLen > 2)
{
- if ((value = TXTRecordGetValuePtr(rdlen, rdata, "ty",
- &valueLen)) != NULL)
- {
+ if (((char *)value)[0] == '(')
+ {
+ /*
+ * Strip parenthesis...
+ */
+
+ memcpy(model, value + 1, valueLen - 2);
+ model[valueLen - 2] = '\0';
+ }
+ else
+ {
memcpy(model, value, valueLen);
model[valueLen] = '\0';
+ }
- if ((ptr = strchr(model, ',')) != NULL)
- *ptr = '\0';
+ if (!strcasecmp(model, "GPL Ghostscript") ||
+ !strcasecmp(model, "GNU Ghostscript") ||
+ !strcasecmp(model, "ESP Ghostscript"))
+ {
+ if ((value = TXTRecordGetValuePtr(rdlen, rdata, "ty",
+ &valueLen)) != NULL)
+ {
+ memcpy(model, value, valueLen);
+ model[valueLen] = '\0';
+
+ if ((ptr = strchr(model, ',')) != NULL)
+ *ptr = '\0';
+ }
+ else
+ strcpy(model, "Unknown");
}
- else
- strcpy(model, "Unknown");
}
- }
- else
- strcpy(model, "Unknown");
+ else
+ strcpy(model, "Unknown");
- if (device->make_and_model)
- free(device->make_and_model);
+ if (device->make_and_model)
+ free(device->make_and_model);
- if (make_and_model[0])
- {
- strlcat(make_and_model, " ", sizeof(make_and_model));
- strlcat(make_and_model, model, sizeof(make_and_model));
- device->make_and_model = strdup(make_and_model);
- }
- else
- device->make_and_model = strdup(model);
+ if (make_and_model[0])
+ {
+ strlcat(make_and_model, " ", sizeof(make_and_model));
+ strlcat(make_and_model, model, sizeof(make_and_model));
+ device->make_and_model = strdup(make_and_model);
+ }
+ else
+ device->make_and_model = strdup(model);
- if ((device->type == CUPS_DEVICE_IPP ||
- device->type == CUPS_DEVICE_PRINTER) &&
- (value = TXTRecordGetValuePtr(rdlen, rdata, "printer-type",
- &valueLen)) != NULL)
- {
- /*
- * This is a CUPS printer!
- */
+ if ((device->type == CUPS_DEVICE_IPP ||
+ device->type == CUPS_DEVICE_PRINTER) &&
+ TXTRecordGetValuePtr(rdlen, rdata, "printer-type", &valueLen))
+ {
+ /*
+ * This is a CUPS printer!
+ */
- device->cups_shared = 1;
+ device->cups_shared = 1;
- if (device->type == CUPS_DEVICE_PRINTER)
- device->sent = 1;
+ if (device->type == CUPS_DEVICE_PRINTER)
+ device->sent = 1;
+ }
+
+ break;
}
}
- else
+
+ if (!device)
fprintf(stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", fullName);
}
diff --git a/backend/pap.c b/backend/pap.c
index f0f194e73..03c825259 100644
--- a/backend/pap.c
+++ b/backend/pap.c
@@ -278,7 +278,6 @@ int main (int argc, const char * argv[])
*/
static int listDevices(void)
{
- int err = noErr;
int i;
int numberFound;
@@ -298,7 +297,7 @@ static int listDevices(void)
return -1; /* Network is down */
}
- if ((err = zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone)) != 0)
+ if (zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone))
{
_cupsLangPrintError(_("ERROR: Unable to get default AppleTalk zone"));
return -2;
@@ -410,14 +409,13 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
at_inet_t sendDataAddr;
at_inet_t src;
at_resp_t resp;
- int userdata, xo, reqlen;
+ int userdata, xo = 0, reqlen;
u_short tid;
u_char bitmap;
int maxfdp1,
nbp_failures = 0;
struct timeval timeout, *timeoutPtr;
u_char flowQuantum = 1;
- u_short recvSequence = 0;
time_t now,
start_time,
elasped_time,
@@ -731,7 +729,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
case AT_PAP_TYPE_SEND_DATA: /* Send-Data packet */
sendDataAddr.socket = src.socket;
gSendDataID = tid;
- recvSequence = OSReadBigInt16(&SEQUENCE_NUM(userdata), 0);
+ OSReadBigInt16(&SEQUENCE_NUM(userdata), 0);
if ((fileBufferNbytes > 0 || fileEOFRead) && fileEOFSent == false)
{
@@ -913,8 +911,7 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
{
int result,
open_result,
- userdata,
- atp_err;
+ userdata;
time_t tm,
waitTime;
char data[10],
@@ -963,8 +960,8 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN));
- if ((atp_err = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
- 0, &resp, &retry, 0)) < 0)
+ if (atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
+ 0, &resp, &retry, 0) < 0)
{
statusUpdate("Destination unreachable", 23);
result = EHOSTUNREACH;
@@ -1031,7 +1028,6 @@ static int papClose()
{
int fd;
u_short tmpID;
- int result;
unsigned char rdata[ATP_DATA_SIZE];
int userdata;
u_char *puserdata = (u_char *)&userdata;
@@ -1084,9 +1080,9 @@ static int papClose()
resp.resp[0].iov_base = rdata;
resp.resp[0].iov_len = sizeof(rdata);
- result = atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0);
+ atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0);
- result = close(fd);
+ close(fd);
}
return noErr;
}
diff --git a/backend/socket.c b/backend/socket.c
index 5992fc5f7..4e2dac146 100644
--- a/backend/socket.c
+++ b/backend/socket.c
@@ -61,6 +61,7 @@ int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments (6 or 7) */
char *argv[]) /* I - Command-line arguments */
{
+ const char *device_uri; /* Device URI */
char method[255], /* Method in URI */
hostname[1024], /* Hostname */
username[255], /* Username info (not used) */
@@ -160,7 +161,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Extract the hostname and port number from the URI...
*/
- httpSeparateURI(HTTP_URI_CODING_ALL, cupsBackendDeviceURI(argv),
+ if ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
+ return (CUPS_BACKEND_FAILED);
+
+ httpSeparateURI(HTTP_URI_CODING_ALL, device_uri,
method, sizeof(method), username, sizeof(username),
hostname, sizeof(hostname), &port,
resource, sizeof(resource));
@@ -364,6 +368,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
*/
if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
+ {
if (backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count, NULL))
{
/*
@@ -373,6 +378,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
_cupsSNMPClose(snmp_fd);
snmp_fd = -1;
}
+ }
+ else
+ start_count = 0;
/*
* Print everything...
diff --git a/berkeley/lpr.c b/berkeley/lpr.c
index a1388be7e..b529365d7 100644
--- a/berkeley/lpr.c
+++ b/berkeley/lpr.c
@@ -3,7 +3,7 @@
*
* "lpr" command for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies
index 1d4cb9791..3c913998b 100644
--- a/cgi-bin/Dependencies
+++ b/cgi-bin/Dependencies
@@ -56,6 +56,9 @@ testtemplate.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
testtemplate.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h
testtemplate.o: ../cups/file.h ../cups/language.h ../cups/array.h
testtemplate.o: help-index.h
+websearch.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
+websearch.o: ../cups/versioning.h ../cups/ppd.h ../cups/array.h
+websearch.o: ../cups/file.h ../cups/language.h ../cups/array.h help-index.h
# DO NOT DELETE
help-index.32.o: help-index.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
@@ -114,6 +117,9 @@ testtemplate.32.o: testtemplate.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/ht
testtemplate.32.o: testtemplate.c ../cups/versioning.h ../cups/ppd.h ../cups/array.h
testtemplate.32.o: testtemplate.c ../cups/file.h ../cups/language.h ../cups/array.h
testtemplate.32.o: testtemplate.c help-index.h
+websearch.32.o: websearch.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
+websearch.32.o: websearch.c ../cups/versioning.h ../cups/ppd.h ../cups/array.h
+websearch.32.o: websearch.c ../cups/file.h ../cups/language.h ../cups/array.h help-index.h
# DO NOT DELETE
help-index.64.o: help-index.c cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
@@ -172,3 +178,6 @@ testtemplate.64.o: testtemplate.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/ht
testtemplate.64.o: testtemplate.c ../cups/versioning.h ../cups/ppd.h ../cups/array.h
testtemplate.64.o: testtemplate.c ../cups/file.h ../cups/language.h ../cups/array.h
testtemplate.64.o: testtemplate.c help-index.h
+websearch.64.o: websearch.c cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
+websearch.64.o: websearch.c ../cups/versioning.h ../cups/ppd.h ../cups/array.h
+websearch.64.o: websearch.c ../cups/file.h ../cups/language.h ../cups/array.h help-index.h
diff --git a/cgi-bin/Makefile b/cgi-bin/Makefile
index 53911d845..3ddc6cd65 100644
--- a/cgi-bin/Makefile
+++ b/cgi-bin/Makefile
@@ -35,7 +35,8 @@ OBJS = \
printers.o \
testcgi.o \
testhi.o \
- testtemplate.o
+ testtemplate.o \
+ websearch.o
CGIS = \
admin.cgi \
classes.cgi \
@@ -48,7 +49,8 @@ LIBTARGETS = \
$(LIB32CUPSCGI) \
$(LIB32CUPSCGI) \
testcgi \
- testhi
+ testhi \
+ websearch
TARGETS = \
$(LIBTARGETS) \
@@ -390,6 +392,16 @@ testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/libcups.a
$(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
+#
+# websearch
+#
+
+websearch: websearch.o ../Makedefs libcupscgi.a ../cups/libcups.a
+ echo Linking $@...
+ $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ websearch.o libcupscgi.a \
+ ../cups/libcups.a $(COMMONLIBS) $(SSLLIBS) $(LIBZ) $(LIBGSSAPI)
+
+
#
# Dependencies...
#
diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c
index 3f94b8826..e67582d02 100644
--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
@@ -969,7 +969,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
return;
}
- else if (!file && (var = cgiGetVariable("PPD_NAME")) == NULL)
+ else if (!file && !cgiGetVariable("PPD_NAME"))
{
if (modify)
{
@@ -3016,15 +3016,15 @@ do_set_options(http_t *http, /* I - HTTP connection */
cgiSetVariable("KEYWORD", "job_sheets_start");
cgiSetVariable("KEYTEXT", cgiText(_("Starting Banner")));
- cgiSetVariable("DEFCHOICE", attr == NULL ?
- "" : attr->values[0].string.text);
+ cgiSetVariable("DEFCHOICE", attr != NULL ?
+ attr->values[0].string.text : "");
cgiCopyTemplateLang("option-pickone.tmpl");
cgiSetVariable("KEYWORD", "job_sheets_end");
cgiSetVariable("KEYTEXT", cgiText(_("Ending Banner")));
- cgiSetVariable("DEFCHOICE", attr == NULL && attr->num_values > 1 ?
- "" : attr->values[1].string.text);
+ cgiSetVariable("DEFCHOICE", attr != NULL && attr->num_values > 1 ?
+ attr->values[1].string.text : "");
cgiCopyTemplateLang("option-pickone.tmpl");
@@ -3211,7 +3211,7 @@ do_set_options(http_t *http, /* I - HTTP connection */
}
if ((var = cgiGetVariable("protocol")) != NULL)
- cupsFilePrintf(out, "*cupsProtocol: %s\n", cgiGetVariable("protocol"));
+ cupsFilePrintf(out, "*cupsProtocol: %s\n", var);
cupsFileClose(in);
cupsFileClose(out);
@@ -3250,12 +3250,12 @@ do_set_options(http_t *http, /* I - HTTP connection */
attr->values[1].string.text = _cupsStrAlloc(cgiGetVariable("job_sheets_end"));
if ((var = cgiGetVariable("printer_error_policy")) != NULL)
- attr = ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
- "printer-error-policy", NULL, var);
+ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
+ "printer-error-policy", NULL, var);
if ((var = cgiGetVariable("printer_op_policy")) != NULL)
- attr = ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
- "printer-op-policy", NULL, var);
+ ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
+ "printer-op-policy", NULL, var);
/*
* Do the request and get back a response...
diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c
index cb88aee17..9b40252bf 100644
--- a/cgi-bin/help-index.c
+++ b/cgi-bin/help-index.c
@@ -1297,7 +1297,7 @@ help_sort_by_score(help_node_t *n1, /* I - First node */
n2, n2->score, n2->section ? n2->section : "", n2->text));
if (n1->score != n2->score)
- return (n1->score - n2->score);
+ return (n2->score - n1->score);
if (n1->section && !n2->section)
return (1);
diff --git a/cgi-bin/search.c b/cgi-bin/search.c
index d8f023c28..7d15d639d 100644
--- a/cgi-bin/search.c
+++ b/cgi-bin/search.c
@@ -47,7 +47,14 @@ cgiCompileSearch(const char *query) /* I - Query string */
char *lword; /* Last word in query */
- DEBUG_printf(("help_compile_search(query=\"%s\")\n", query ? query : "(nil)"));
+ DEBUG_printf(("cgiCompileSearch(query=\"%s\")\n", query));
+
+ /*
+ * Range check input...
+ */
+
+ if (!query)
+ return (NULL);
/*
* Allocate a regular expression storage structure...
diff --git a/cgi-bin/websearch.c b/cgi-bin/websearch.c
new file mode 100644
index 000000000..742c3238e
--- /dev/null
+++ b/cgi-bin/websearch.c
@@ -0,0 +1,109 @@
+/*
+ * "$Id$"
+ *
+ * Web search program for www.cups.org.
+ *
+ * Copyright 2007-2008 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products.
+ *
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. 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
+ * file is missing or damaged, see the license at "http://www.cups.org/".
+ *
+ * Usage:
+ *
+ * websearch directory "search string"
+ *
+ * Contents:
+ *
+ * main() - Search a directory of help files.
+ * list_nodes() - List matching nodes.
+ */
+
+/*
+ * Include necessary headers...
+ */
+
+#include "cgi.h"
+
+
+/*
+ * Local functions...
+ */
+
+static void list_nodes(const char *title, cups_array_t *nodes);
+
+
+/*
+ * 'main()' - Test the help index code.
+ */
+
+int /* O - Exit status */
+main(int argc, /* I - Number of command-line args */
+ char *argv[]) /* I - Command-line arguments */
+{
+ help_index_t *hi, /* Help index */
+ *search; /* Search index */
+ char indexname[1024]; /* Name of index file */
+
+
+ if (argc != 3)
+ {
+ puts("Usage: websearch directory \"search terms\"");
+ return (1);
+ }
+
+ /*
+ * Load the help index...
+ */
+
+ snprintf(indexname, sizeof(indexname), "%s/.index", argv[1]);
+ hi = helpLoadIndex(indexname, argv[1]);
+
+ /*
+ * Do any searches...
+ */
+
+ search = helpSearchIndex(hi, argv[2], NULL, NULL);
+
+ if (search)
+ list_nodes(argv[1], search->sorted);
+
+ /*
+ * Return with no errors...
+ */
+
+ return (0);
+}
+
+
+/*
+ * 'list_nodes()' - List nodes in an array...
+ */
+
+static void
+list_nodes(const char *title, /* I - Title string */
+ cups_array_t *nodes) /* I - Nodes */
+{
+ help_node_t *node; /* Current node */
+
+
+ printf("%d\n", cupsArrayCount(nodes));
+ for (node = (help_node_t *)cupsArrayFirst(nodes);
+ node;
+ node = (help_node_t *)cupsArrayNext(nodes))
+ {
+ if (node->anchor)
+ printf("%d|%s#%s|%s\n", node->score, node->filename, node->anchor,
+ node->text);
+ else
+ printf("%d|%s|%s\n", node->score, node->filename, node->text);
+ }
+}
+
+
+/*
+ * End of "$Id$".
+ */
diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in
index c48b70626..649b552ee 100644
--- a/conf/cupsd.conf.in
+++ b/conf/cupsd.conf.in
@@ -6,9 +6,9 @@
# file.
#
-# Log general information in error_log - change "info" to "debug" for
-# troubleshooting...
-LogLevel info
+# Log general information in error_log - change "@CUPS_LOG_LEVEL@" to "debug"
+# for troubleshooting...
+LogLevel @CUPS_LOG_LEVEL@
# Administrator user group...
SystemGroup @CUPS_SYSTEM_GROUPS@
diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4
index a88692f35..e48fc0fe4 100644
--- a/config-scripts/cups-common.m4
+++ b/config-scripts/cups-common.m4
@@ -277,14 +277,30 @@ case $uname in
AC_CHECK_FUNCS(notify_post)
dnl Check for Authorization Services support
+ AC_ARG_WITH(adminkey, [ --with-adminkey set the default SystemAuthKey value],
+ default_adminkey="$withval",
+ default_adminkey="default")
+ AC_ARG_WITH(operkey, [ --with-operkey set the default operator @AUTHKEY value],
+ default_operkey="$withval",
+ default_operkey="default")
+
AC_CHECK_HEADER(Security/Authorization.h, [
AC_DEFINE(HAVE_AUTHORIZATION_H)
- if grep -q system.print.operator /etc/authorization; then
- CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
- CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
+
+ if test "x$default_adminkey" != xdefault; then
+ CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
+ elif grep -q system.print.operator /etc/authorization; then
+ CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
else
+ CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
+ fi
+
+ if test "x$default_operkey" != xdefault; then
+ CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY($default_operkey) @admin @lpadmin"
+ elif grep -q system.print.operator /etc/authorization; then
CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
- CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
+ else
+ CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
fi])
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4
index 80287e806..624b3d6f2 100644
--- a/config-scripts/cups-defaults.m4
+++ b/config-scripts/cups-defaults.m4
@@ -43,6 +43,20 @@ AC_ARG_WITH(log_file_perm, [ --with-log-file-perm set default LogFilePerm va
AC_SUBST(CUPS_LOG_FILE_PERM)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_FILE_PERM, 0$CUPS_LOG_FILE_PERM)
+dnl Default LogLevel
+AC_ARG_WITH(log_level, [ --with-log-level set default LogLevel value, default=warn],
+ CUPS_LOG_LEVEL="$withval",
+ CUPS_LOG_LEVEL="warn")
+AC_SUBST(CUPS_LOG_LEVEL)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
+
+dnl Default AccessLogLevel
+AC_ARG_WITH(log_level, [ --with-access-log-level set default AccessLogLevel value, default=actions],
+ CUPS_LOG_LEVEL="$withval",
+ CUPS_LOG_LEVEL="actions")
+AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
+
dnl Default Browsing
AC_ARG_ENABLE(browsing, [ --enable-browsing enable Browsing by default, default=yes])
if test "x$enable_browsing" = xno; then
diff --git a/config.h.in b/config.h.in
index 7c54621fc..cd801f72e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -42,6 +42,14 @@
#define CUPS_DEFAULT_LOG_FILE_PERM 0644
+/*
+ * Default logging settings...
+ */
+
+#define CUPS_DEFAULT_LOG_LEVEL "warn"
+#define CUPS_DEFAULT_ACCESS_LOG_LEVEL "actions"
+
+
/*
* Default browsing settings...
*/
diff --git a/cups/adminutil.c b/cups/adminutil.c
index 95393afd0..87ff36fd7 100644
--- a/cups/adminutil.c
+++ b/cups/adminutil.c
@@ -389,7 +389,7 @@ cupsAdminCreateWindowsPPD(
{
write_option(dstfp, jclorder ++, "cupsJobSheetsStart", "Start Banner",
"job-sheets", suppattr, defattr, 0, 2);
- write_option(dstfp, jclorder ++, "cupsJobSheetsEnd", "End Banner",
+ write_option(dstfp, jclorder, "cupsJobSheetsEnd", "End Banner",
"job-sheets", suppattr, defattr, 1, 2);
}
@@ -967,7 +967,7 @@ _cupsAdminGetServerSettings(
if (!value && strncmp(line, "", 2))
value = line + strlen(line);
- if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen"))
+ if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) && value)
{
char *port; /* Pointer to port number, if any */
@@ -1023,7 +1023,7 @@ _cupsAdminGetServerSettings(
{
in_policy = 0;
}
- else if (!strcasecmp(line, "gssctx != GSS_C_NO_CONTEXT)
{
- major_status = gss_delete_sec_context(&minor_status, &http->gssctx,
- GSS_C_NO_BUFFER);
+ gss_delete_sec_context(&minor_status, &http->gssctx, GSS_C_NO_BUFFER);
http->gssctx = GSS_C_NO_CONTEXT;
}
@@ -323,14 +322,14 @@ cupsDoAuthentication(http_t *http, /* I - Connection to server or @code CUPS
httpEncode64_2(http->authstring + 10, authsize - 10, output_token.value,
output_token.length);
- major_status = gss_release_buffer(&minor_status, &output_token);
+ gss_release_buffer(&minor_status, &output_token);
}
else
{
DEBUG_printf(("cupsDoAuthentication: Kerberos credentials too large - "
"%d bytes!\n", (int)output_token.length));
- major_status = gss_release_buffer(&minor_status, &output_token);
+ gss_release_buffer(&minor_status, &output_token);
return (-1);
}
@@ -405,12 +404,8 @@ DEBUG_gss_printf(OM_uint32 major_status,/* I - Major status code */
&major_status_string);
if (!GSS_ERROR(err_major_status))
- err_major_status = gss_display_status(&err_minor_status,
- minor_status,
- GSS_C_MECH_CODE,
- GSS_C_NULL_OID,
- &msg_ctx,
- &minor_status_string);
+ gss_display_status(&err_minor_status, minor_status, GSS_C_MECH_CODE,
+ GSS_C_NULL_OID, &msg_ctx, &minor_status_string);
printf("%s: %s, %s\n", message, (char *)major_status_string.value,
(char *)minor_status_string.value);
diff --git a/cups/backend.c b/cups/backend.c
index 477d38ecd..021dad2e2 100644
--- a/cups/backend.c
+++ b/cups/backend.c
@@ -53,7 +53,7 @@ cupsBackendDeviceURI(char **argv) /* I - Command-line arguments */
}
return (_httpResolveURI(device_uri, cg->resolved_uri,
- sizeof(cg->resolved_uri)));
+ sizeof(cg->resolved_uri), 1));
}
diff --git a/cups/debug.c b/cups/debug.c
index cfb8bd6aa..76dec26ee 100644
--- a/cups/debug.c
+++ b/cups/debug.c
@@ -62,7 +62,6 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
{
char *bufptr, /* Pointer to position in buffer */
*bufend, /* Pointer to end of buffer */
- sign, /* Sign of format width */
size, /* Size character (h, l, L) */
type; /* Format type character */
int width, /* Width of field */
@@ -74,6 +73,9 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
int bytes; /* Total number of bytes needed */
+ if (!buffer || bufsize < 2 || !format)
+ return (-1);
+
/*
* Loop through the format string, formatting as needed...
*/
@@ -91,18 +93,14 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
if (*format == '%')
{
- if (bufptr && bufptr < bufend) *bufptr++ = *format;
+ if (bufptr < bufend)
+ *bufptr++ = *format;
bytes ++;
format ++;
continue;
}
else if (strchr(" -+#\'", *format))
- {
- *tptr++ = *format;
- sign = *format++;
- }
- else
- sign = 0;
+ *tptr++ = *format++;
if (*format == '*')
{
@@ -161,8 +159,6 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
}
}
}
- else
- prec = -1;
if (*format == 'l' && format[1] == 'l')
{
@@ -183,6 +179,8 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
size = *format++;
}
+ else
+ size = 0;
if (!*format)
break;
@@ -365,7 +363,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */
{
bytes ++;
- if (bufptr && bufptr < bufend)
+ if (bufptr < bufend)
*bufptr++ = *format;
format ++;
diff --git a/cups/dest.c b/cups/dest.c
index 185bd1a50..66289b2c7 100644
--- a/cups/dest.c
+++ b/cups/dest.c
@@ -120,7 +120,7 @@ cupsAddDest(const char *name, /* I - Destination name */
if (!name || !dests)
return (0);
- if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
+ if (cupsGetDest(name, instance, num_dests, *dests))
return (num_dests);
/*
@@ -980,7 +980,6 @@ appleGetDefault(char *name, /* I - Name buffer */
DEBUG_puts("appleGetDefault: Missing or bad location history array...");
- CFRelease(network);
return (NULL);
}
@@ -992,9 +991,6 @@ appleGetDefault(char *name, /* I - Name buffer */
else
name[0] = '\0';
- CFRelease(locations);
- CFRelease(network);
-
DEBUG_printf(("appleGetDefault: Returning \"%s\"...\n", name));
return (*name ? name : NULL);
@@ -1206,9 +1202,6 @@ appleSetDefault(const char *name) /* I - Default printer/class name */
CFRelease(newlocation);
}
- if (locations)
- CFRelease(locations);
- CFRelease(network);
CFRelease(newprinter);
}
diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c
index effe2e6a8..265107af0 100644
--- a/cups/http-addrlist.c
+++ b/cups/http-addrlist.c
@@ -529,8 +529,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
if (addr)
addr->next = temp;
- else
- addr = temp;
}
}
else if (!hostname)
@@ -584,8 +582,6 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
if (addr)
addr->next = temp;
- else
- addr = temp;
}
}
}
diff --git a/cups/http-private.h b/cups/http-private.h
index 415f25a9e..f44266cce 100644
--- a/cups/http-private.h
+++ b/cups/http-private.h
@@ -264,7 +264,7 @@ extern void _cups_freeifaddrs(struct ifaddrs *addrs);
extern char *_httpEncodeURI(char *dst, const char *src,
size_t dstsize);
extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
- size_t resolved_size);
+ size_t resolved_size, int log);
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
/*
diff --git a/cups/http-support.c b/cups/http-support.c
index 419383899..56e27515c 100644
--- a/cups/http-support.c
+++ b/cups/http-support.c
@@ -1255,23 +1255,37 @@ const char * /* O - Resolved URI */
_httpResolveURI(
const char *uri, /* I - DNS-SD URI */
char *resolved_uri, /* I - Buffer for resolved URI */
- size_t resolved_size) /* I - Size of URI buffer */
+ size_t resolved_size, /* I - Size of URI buffer */
+ int log) /* I - Log progress to stderr? */
{
char scheme[32], /* URI components... */
userpass[256],
hostname[1024],
resource[1024];
int port;
+ http_uri_status_t status; /* URI decode status */
+ DEBUG_printf(("_httpResolveURI(uri=\"%s\", resolved_uri=%p, "
+ "resolved_size=" CUPS_LLFMT ")\n", uri, resolved_uri,
+ CUPS_LLCAST resolved_size));
+
/*
* Get the device URI...
*/
- if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
- userpass, sizeof(userpass), hostname, sizeof(hostname),
- &port, resource, sizeof(resource)) < HTTP_URI_OK)
+ if ((status = httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme,
+ sizeof(scheme), userpass, sizeof(userpass),
+ hostname, sizeof(hostname), &port, resource,
+ sizeof(resource))) < HTTP_URI_OK)
+ {
+ if (log)
+ _cupsLangPrintf(stderr, _("Bad device URI \"%s\"!\n"), uri);
+
+ DEBUG_printf(("_httpResolveURI: httpSeparateURI returned %d!\n", status));
+ DEBUG_puts("_httpResolveURI: Returning NULL");
return (NULL);
+ }
/*
* Resolve it as needed...
@@ -1289,8 +1303,24 @@ _httpResolveURI(
* Separate the hostname into service name, registration type, and domain...
*/
- regtype = strchr(hostname, '.');
- *regtype++ = '\0';
+ for (regtype = strstr(hostname, "._tcp") - 2;
+ regtype > hostname;
+ regtype --)
+ if (regtype[0] == '.' && regtype[1] == '_')
+ {
+ /*
+ * Found ._servicetype in front of ._tcp...
+ */
+
+ *regtype++ = '\0';
+ break;
+ }
+
+ if (regtype <= hostname)
+ {
+ DEBUG_puts("_httpResolveURI: Bad hostname, returning NULL");
+ return (NULL);
+ }
domain = regtype + strlen(regtype) - 1;
if (domain > regtype && *domain == '.')
@@ -1310,6 +1340,14 @@ _httpResolveURI(
resolved_uri[0] = '\0';
+ DEBUG_printf(("_httpResolveURI: Resolving hostname=\"%s\", regtype=\"%s\", "
+ "domain=\"%s\"\n", hostname, regtype, domain));
+ if (log)
+ {
+ fputs("STATE: +connecting-to-device\n", stderr);
+ _cupsLangPrintf(stderr, _("INFO: Looking for \"%s\"...\n"), hostname);
+ }
+
if (DNSServiceResolve(&ref, 0, 0, hostname, regtype, domain,
resolve_callback,
&uribuf) == kDNSServiceErr_NoError)
@@ -1323,11 +1361,25 @@ _httpResolveURI(
DNSServiceRefDeallocate(ref);
}
else
-#endif /* HAVE_DNSSD */
+ uri = NULL;
+
+ if (log)
+ fputs("STATE: -connecting-to-device\n", stderr);
+
+#else
+ /*
+ * No DNS-SD support...
+ */
uri = NULL;
+#endif /* HAVE_DNSSD */
+
+ if (log && !uri)
+ _cupsLangPuts(stderr, _("Unable to find printer!\n"));
}
+ DEBUG_printf(("_httpResolveURI: Returning \"%s\"\n", uri));
+
return (uri);
}
diff --git a/cups/http.c b/cups/http.c
index 7a150a0b1..894f7641a 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -298,8 +298,7 @@ void
httpClose(http_t *http) /* I - Connection to server */
{
#ifdef HAVE_GSSAPI
- OM_uint32 minor_status, /* Minor status code */
- major_status; /* Major status code */
+ OM_uint32 minor_status; /* Minor status code */
#endif /* HAVE_GSSAPI */
@@ -326,11 +325,10 @@ httpClose(http_t *http) /* I - Connection to server */
#ifdef HAVE_GSSAPI
if (http->gssctx != GSS_C_NO_CONTEXT)
- major_status = gss_delete_sec_context(&minor_status, &http->gssctx,
- GSS_C_NO_BUFFER);
+ gss_delete_sec_context(&minor_status, &http->gssctx, GSS_C_NO_BUFFER);
if (http->gssname != GSS_C_NO_NAME)
- major_status = gss_release_name(&minor_status, &http->gssname);
+ gss_release_name(&minor_status, &http->gssname);
#endif /* HAVE_GSSAPI */
#ifdef HAVE_AUTHORIZATION_H
diff --git a/cups/ipp.c b/cups/ipp.c
index d528b6a54..88a42f01c 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -1050,9 +1050,9 @@ ippReadIO(void *src, /* I - Data source */
* Get the request header...
*/
- if ((n = (*cb)(src, buffer, 8)) < 8)
+ if ((*cb)(src, buffer, 8) < 8)
{
- DEBUG_printf(("ippReadIO: Unable to read header (%d bytes read)!\n", n));
+ DEBUG_puts("ippReadIO: Unable to read header!");
return (IPP_ERROR);
}
@@ -1557,6 +1557,12 @@ ippReadIO(void *src, /* I - Data source */
return (IPP_ERROR);
}
+ if (!value)
+ {
+ DEBUG_puts("ippReadIO: NULL value!");
+ return (IPP_ERROR);
+ }
+
value->unknown.length = n;
if (n > 0)
{
diff --git a/cups/langprintf.c b/cups/langprintf.c
index 089eb4859..84956888c 100644
--- a/cups/langprintf.c
+++ b/cups/langprintf.c
@@ -71,9 +71,8 @@ _cupsLangPrintError(const char *message)/* I - Message */
* Format the message...
*/
- bytes = snprintf(buffer, sizeof(buffer), "%s: %s",
- _cupsLangString(cg->lang_default, message),
- strerror(last_errno));
+ snprintf(buffer, sizeof(buffer), "%s: %s",
+ _cupsLangString(cg->lang_default, message), strerror(last_errno));
/*
* Convert and write to stderr...
@@ -120,8 +119,8 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */
*/
va_start(ap, message);
- bytes = vsnprintf(buffer, sizeof(buffer),
- _cupsLangString(cg->lang_default, message), ap);
+ vsnprintf(buffer, sizeof(buffer),
+ _cupsLangString(cg->lang_default, message), ap);
va_end(ap);
/*
diff --git a/cups/ppd.c b/cups/ppd.c
index cbe20558f..c10cbc491 100644
--- a/cups/ppd.c
+++ b/cups/ppd.c
@@ -1088,7 +1088,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
else if (!strcmp(string, "Plus90"))
ppd->landscape = 90;
}
- else if (!strcmp(keyword, "Emulators"))
+ else if (!strcmp(keyword, "Emulators") && string)
{
for (count = 1, sptr = string; sptr != NULL;)
if ((sptr = strchr(sptr, ' ')) != NULL)
@@ -2850,8 +2850,6 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
if (ch == 0x0a)
cupsFileGetChar(fp);
}
-
- ch = '\n';
}
else if (ch < ' ' && ch != '\t' && cg->ppd_conform == PPD_CONFORM_STRICT)
{
diff --git a/cups/request.c b/cups/request.c
index 36b02b912..f8978a627 100644
--- a/cups/request.c
+++ b/cups/request.c
@@ -572,7 +572,6 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
* Loop until we can send the request without authorization problems.
*/
- status = HTTP_ERROR;
expect = HTTP_CONTINUE;
for (;;)
diff --git a/cups/sidechannel.c b/cups/sidechannel.c
index bbb8dab02..acf9743e8 100644
--- a/cups/sidechannel.c
+++ b/cups/sidechannel.c
@@ -218,7 +218,7 @@ cupsSideChannelRead(
*status = CUPS_SC_STATUS_TOO_BIG;
}
- else if (templen > *datalen || templen > (bytes - 4))
+ else if (!datalen || templen > *datalen || templen > (bytes - 4))
{
/*
* Either the response is bigger than the provided buffer or the
diff --git a/cups/testadmin.c b/cups/testadmin.c
index 5091f11b8..f6afd21b9 100644
--- a/cups/testadmin.c
+++ b/cups/testadmin.c
@@ -61,7 +61,7 @@ main(int argc, /* I - Number of command-line args */
if (argc > 1)
{
- for (i = 1, num_settings = 0; i < argc; i ++)
+ for (i = 1, num_settings = 0, settings = NULL; i < argc; i ++)
num_settings = cupsParseOptions(argv[i], num_settings, &settings);
if (cupsAdminSetServerSettings(http, num_settings, settings))
diff --git a/cups/testcups.c b/cups/testcups.c
index 1ac4456bd..087ed4310 100644
--- a/cups/testcups.c
+++ b/cups/testcups.c
@@ -3,7 +3,7 @@
*
* CUPS API test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -155,7 +155,6 @@ main(int argc, /* I - Number of command-line arguments */
if ((dest = cupsGetDest(dests[num_dests / 2].name, NULL, num_dests,
dests)) == NULL)
{
- status = 1;
puts("FAIL");
return (1);
}
@@ -201,8 +200,8 @@ main(int argc, /* I - Number of command-line arguments */
if (cupsPrintFile(dest->name, "../data/testprint.ps", "Test Page",
dest->num_options, dest->options) <= 0)
{
- status = 1;
puts("FAIL");
+ return (1);
}
else
puts("PASS");
@@ -216,7 +215,6 @@ main(int argc, /* I - Number of command-line arguments */
if ((ppdfile = cupsGetPPD(dest->name)) == NULL)
{
- status = 1;
puts("FAIL");
}
else
@@ -282,7 +280,7 @@ dests_equal(cups_dest_t *a, /* I - First destination */
if (a == b)
return (1);
- if ((!a && b) || (a && !b))
+ if (!a || !b)
return (0);
if (strcasecmp(a->name, b->name) ||
@@ -345,5 +343,5 @@ show_diffs(cups_dest_t *a, /* I - First destination */
/*
- * End of "$Id: testfile.c 6192 2007-01-10 19:26:48Z mike $".
+ * End of "$Id$".
*/
diff --git a/cups/testfile.c b/cups/testfile.c
index 117b3c9e5..52bfeedb4 100644
--- a/cups/testfile.c
+++ b/cups/testfile.c
@@ -87,7 +87,7 @@ main(int argc, /* I - Number of command-line arguments */
* Do uncompressed random I/O tests...
*/
- status = random_tests();
+ status += random_tests();
/*
* Test fdopen and close without reading...
diff --git a/cups/testhttp.c b/cups/testhttp.c
index b445bf9d6..302d4fde5 100644
--- a/cups/testhttp.c
+++ b/cups/testhttp.c
@@ -3,7 +3,7 @@
*
* HTTP test program for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -25,7 +25,7 @@
#include
#include
-#include "http.h"
+#include "http-private.h"
#include "string.h"
@@ -452,6 +452,29 @@ main(int argc, /* I - Number of command-line arguments */
return (failures);
}
+ else if (strstr(argv[1], "._tcp"))
+ {
+ /*
+ * Test resolving an mDNS name.
+ */
+
+ char resolved[1024]; /* Resolved URI */
+
+
+ printf("_httpResolveURI(%s): ", argv[1]);
+ fflush(stdout);
+
+ if (!_httpResolveURI(argv[1], resolved, sizeof(resolved)))
+ {
+ puts("FAIL");
+ return (1);
+ }
+ else
+ {
+ printf("PASS (%s)\n", resolved);
+ return (0);
+ }
+ }
/*
* Test HTTP GET requests...
diff --git a/desktop/cups.desktop b/desktop/cups.desktop
index 1a9b33a76..1f264ad0a 100644
--- a/desktop/cups.desktop
+++ b/desktop/cups.desktop
@@ -27,6 +27,8 @@ Name[pl]=ZarzÄ
dzanie drukowaniem
Comment[pl]=Interfejs WWW CUPS
Name[it]=Gestione stampa
Comment[it]=Interfaccia web di CUPS
+Name[ja]=å°å·ã®ç®¡ç
+Comment[ja]=CUPS Web ã¤ã³ã¿ãã§ã¼ã¹
Name[he]=× ×× ××פס×ת
Comment[he]=××שק ×פ××¤× ×©× CUPS
Name[zh_TW]=å°è¡¨ç®¡ç
diff --git a/doc/help/ref-cupsd-conf.html.in b/doc/help/ref-cupsd-conf.html.in
index b61ef0b66..37ddc448a 100644
--- a/doc/help/ref-cupsd-conf.html.in
+++ b/doc/help/ref-cupsd-conf.html.in
@@ -71,6 +71,38 @@ information to the system log instead of a plain file.
@CUPS_LOGDIR@/access_log.
+
+
+Examples
+
+
+AccessLogLevel config
+AccessLogLevel actions
+AccessLogLevel all
+
+
+Description
+
+The AccessLogLevel
directive controls which requests are logged
+to the access log file. The following levels are defined:
+
+
+
+ config
; Log when printers and classes are added,
+ deleted, or modified and when configuration files are accessed or
+ updated.
+
+ actions
; Log when print jobs are submitted,
+ held, released, modified, or canceled, and any of the conditions
+ for config
.
+
+ all
; Log all requests.
+
+
+
+The default access log level is @CUPS_ACCESS_LOG_LEVEL@
.
+
+
Examples
@@ -1884,7 +1916,7 @@ everything under the preceding levels):
notice
- Log temporary error conditions
info
- Log all requests and state
- changes (default)
+ changes
debug
- Log basic debugging
information
@@ -1894,6 +1926,8 @@ everything under the preceding levels):
+The default LogLevel
is @CUPS_LOG_LEVEL@
.
+
diff --git a/driver/cmyk.c b/driver/cmyk.c
index 01b87714d..b5ab4ede4 100644
--- a/driver/cmyk.c
+++ b/driver/cmyk.c
@@ -3,7 +3,7 @@
*
* CMYK color separation code for CUPS.
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1993-2005 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -76,8 +76,6 @@ cupsCMYKDoBlack(const cups_cmyk_t *cmyk,
{
int k; /* Current black value */
const short **channels; /* Copy of channel LUTs */
- const unsigned char *black_lut, /* Black LUT */
- *color_lut; /* Color LUT */
int ink, /* Amount of ink */
ink_limit; /* Ink limit from separation */
@@ -94,8 +92,6 @@ cupsCMYKDoBlack(const cups_cmyk_t *cmyk,
*/
channels = (const short **)cmyk->channels;
- black_lut = cmyk->black_lut;
- color_lut = cmyk->color_lut;
ink_limit = cmyk->ink_limit;
switch (cmyk->num_channels)
@@ -266,8 +262,6 @@ cupsCMYKDoCMYK(const cups_cmyk_t *cmyk,
y, /* Current yellow value */
k; /* Current black value */
const short **channels; /* Copy of channel LUTs */
- const unsigned char *black_lut, /* Black LUT */
- *color_lut; /* Color LUT */
int ink, /* Amount of ink */
ink_limit; /* Ink limit from separation */
@@ -284,8 +278,6 @@ cupsCMYKDoCMYK(const cups_cmyk_t *cmyk,
*/
channels = (const short **)cmyk->channels;
- black_lut = cmyk->black_lut;
- color_lut = cmyk->color_lut;
ink_limit = cmyk->ink_limit;
switch (cmyk->num_channels)
@@ -540,8 +532,6 @@ cupsCMYKDoGray(const cups_cmyk_t *cmyk,
int k, /* Current black value */
kc; /* Current black color value */
const short **channels; /* Copy of channel LUTs */
- const unsigned char *black_lut, /* Black LUT */
- *color_lut; /* Color LUT */
int ink, /* Amount of ink */
ink_limit; /* Ink limit from separation */
@@ -558,8 +548,6 @@ cupsCMYKDoGray(const cups_cmyk_t *cmyk,
*/
channels = (const short **)cmyk->channels;
- black_lut = cmyk->black_lut;
- color_lut = cmyk->color_lut;
ink_limit = cmyk->ink_limit;
switch (cmyk->num_channels)
@@ -775,8 +763,6 @@ cupsCMYKDoRGB(const cups_cmyk_t *cmyk,
kc, /* Current black color value */
km; /* Maximum black value */
const short **channels; /* Copy of channel LUTs */
- const unsigned char *black_lut, /* Black LUT */
- *color_lut; /* Color LUT */
int ink, /* Amount of ink */
ink_limit; /* Ink limit from separation */
@@ -793,8 +779,6 @@ cupsCMYKDoRGB(const cups_cmyk_t *cmyk,
*/
channels = (const short **)cmyk->channels;
- black_lut = cmyk->black_lut;
- color_lut = cmyk->color_lut;
ink_limit = cmyk->ink_limit;
switch (cmyk->num_channels)
diff --git a/driver/rastertoescpx.c b/driver/rastertoescpx.c
index 362086e45..a60901190 100644
--- a/driver/rastertoescpx.c
+++ b/driver/rastertoescpx.c
@@ -913,6 +913,12 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */
band->buffer = calloc(DotRowCount, DotBufferSize);
}
+ if (!DotAvailList)
+ {
+ fputs("ERROR: Unable to allocate band list!\n", stderr);
+ exit(1);
+ }
+
fputs("DEBUG: Pointer list at start of page...\n", stderr);
for (band = DotAvailList; band != NULL; band = band->next)
@@ -1571,7 +1577,6 @@ ProcessLine(ppd_file_t *ppd, /* I - PPD file */
* Perform the color separation...
*/
- offset = 0;
width = header->cupsWidth;
subwidth = header->cupsWidth / DotColStep;
xstep = 3600 / header->HWResolution[0];
diff --git a/filter/image-colorspace.c b/filter/image-colorspace.c
index 01bed936c..8854a90bd 100644
--- a/filter/image-colorspace.c
+++ b/filter/image-colorspace.c
@@ -3,7 +3,7 @@
*
* Colorspace conversions for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1993-2006 by Easy Software Products.
*
* The color saturation/hue matrix stuff is provided thanks to Mr. Paul
@@ -507,8 +507,7 @@ cupsImageRGBAdjust(cups_ib_t *pixels, /* IO - Input/output pixels */
static cups_clut_t *lut = NULL; /* Lookup table for matrix */
- if (saturation != last_sat ||
- hue != last_hue)
+ if (saturation != last_sat || hue != last_hue || !lut)
{
/*
* Build the color adjustment matrix...
diff --git a/filter/image-gif.c b/filter/image-gif.c
index caa39439e..d70230230 100644
--- a/filter/image-gif.c
+++ b/filter/image-gif.c
@@ -372,7 +372,6 @@ gif_get_code(FILE *fp, /* I - File to read from */
lastbit = last_byte * 8;
}
- ret = 0;
for (ret = 0, i = curbit + code_size - 1, j = code_size;
j > 0;
i --, j --)
@@ -611,6 +610,8 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
return (firstcode);
}
+ else if (!table)
+ return (0);
if (sp > stack)
return (*--sp);
diff --git a/filter/pstops.c b/filter/pstops.c
index 7517a4978..c6c1129a4 100644
--- a/filter/pstops.c
+++ b/filter/pstops.c
@@ -1054,7 +1054,7 @@ copy_dsc(cups_file_t *fp, /* I - File to read from */
*/
if (!JobCanceled)
- linelen = copy_trailer(fp, doc, ppd, number, line, linelen, linesize);
+ copy_trailer(fp, doc, ppd, number, line, linelen, linesize);
}
@@ -2227,7 +2227,6 @@ include_feature(
char name[255], /* Option name */
value[255]; /* Option value */
ppd_option_t *option; /* Option in file */
- ppd_choice_t *choice; /* Choice */
/*
@@ -2258,7 +2257,7 @@ include_feature(
return (num_options);
}
- if ((choice = ppdFindChoice(option, value)) == NULL)
+ if (!ppdFindChoice(option, value))
{
fprintf(stderr, _("WARNING: Unknown choice \"%s\" for option \"%s\"!\n"),
value, name + 1);
@@ -2917,10 +2916,7 @@ start_nup(pstops_doc_t *doc, /* I - Document information */
w / bboxw, l / bboxl);
}
else
- {
w = PageWidth;
- l = PageLength;
- }
break;
case 2 :
diff --git a/filter/raster.c b/filter/raster.c
index 015c5a8c4..bcfcd97b5 100644
--- a/filter/raster.c
+++ b/filter/raster.c
@@ -1015,8 +1015,7 @@ cups_raster_write(
*plast; /* Pointer to last pixel */
unsigned char *wptr; /* Pointer into write buffer */
int bpp, /* Bytes per pixel */
- count, /* Count */
- maxrun; /* Maximum run of 128 * bpp */
+ count; /* Count */
DEBUG_printf(("cups_raster_write(r=%p, pixels=%p)\n", r, pixels));
@@ -1049,7 +1048,6 @@ cups_raster_write(
plast = pend - bpp;
wptr = r->buffer;
*wptr++ = r->count - 1;
- maxrun = 128 * bpp;
/*
* Write using a modified TIFF "packbits" compression...
diff --git a/filter/rastertolabel.c b/filter/rastertolabel.c
index a529e281a..20cb77a44 100644
--- a/filter/rastertolabel.c
+++ b/filter/rastertolabel.c
@@ -1030,9 +1030,6 @@ PCLCompress(unsigned char *line, /* I - Line to compress */
comp_ptr += count;
}
- line_ptr = CompBuffer;
- line_end = comp_ptr;
-
/*
* Set the length of the data and write it...
*/
diff --git a/filter/testimage.c b/filter/testimage.c
index 3a538830e..0c5727971 100644
--- a/filter/testimage.c
+++ b/filter/testimage.c
@@ -1,5 +1,5 @@
/*
- * "$Id: testimage.c 4485 2005-01-03 19:30:00Z mike $"
+ * "$Id$"
*
* Image library test program for the Common UNIX Printing System (CUPS).
*
@@ -95,5 +95,5 @@ main(int argc, /* I - Number of command-line arguments */
/*
- * End of "$Id: testimage.c 4485 2005-01-03 19:30:00Z mike $".
+ * End of "$Id$".
*/
diff --git a/filter/texttops.c b/filter/texttops.c
index e3391ad88..c84a447bc 100644
--- a/filter/texttops.c
+++ b/filter/texttops.c
@@ -3,7 +3,7 @@
*
* Text to PostScript filter for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -1005,7 +1005,7 @@ write_line(int row, /* I - Row number (0 to N) */
lchar_t *start; /* First character in sequence */
- for (col = 0, start = line; col < SizeColumns;)
+ for (col = 0; col < SizeColumns;)
{
while (col < SizeColumns && (line->ch == ' ' || line->ch == 0))
{
diff --git a/locale/strings2po.c b/locale/strings2po.c
index ab9b09108..4eeb6a2e4 100644
--- a/locale/strings2po.c
+++ b/locale/strings2po.c
@@ -148,7 +148,7 @@ read_strings(FILE *strings, /* I - .strings file */
if (*bufptr != '\"')
continue;
- *bufptr++ = '\0';
+ *bufptr = '\0';
return (1);
}
diff --git a/man/cupsd.conf.man.in b/man/cupsd.conf.man.in
index 5423988e9..6fbdd31bb 100644
--- a/man/cupsd.conf.man.in
+++ b/man/cupsd.conf.man.in
@@ -33,6 +33,14 @@ AccessLog syslog
.br
Defines the access log filename.
.TP 5
+AccessLogLevel config
+.TP 5
+AccessLogLevel actions
+.TP 5
+AccessLogLevel all
+.br
+Specifies the logging level for the AccessLog file.
+.TP 5
Allow all
.TP 5
Allow none
diff --git a/man/mantohtml.c b/man/mantohtml.c
index 12059ac45..01a475196 100644
--- a/man/mantohtml.c
+++ b/man/mantohtml.c
@@ -3,7 +3,7 @@
*
* Man page to HTML conversion program.
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 2004-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -648,7 +648,6 @@ process_text:
if (blist)
{
fputs("\n\n", outfile);
- blist = 0;
}
if (list)
@@ -659,7 +658,6 @@ process_text:
fputs("\n", outfile);
fputs("\n", outfile);
- list = 0;
}
fputs("