-CHANGES.txt - 2011-06-05
+CHANGES.txt - 2011-06-14
------------------------
CHANGES IN CUPS V1.5rc1
+ - Compile fixes (STR #3849, STR #3850)
+ - The scheduler didn't check for empty values for several configuration
+ directives (STR #3861)
+ - ipptool didn't generate valid XML when a test was skipped.
+ - Added additional error checking to the 1284 device ID code (STR #3858)
+ - Fixed some compatibility issues migrating from the old usblp backend
+ to the libusb backend (STR #3860)
+ - Fixed the wake-from-sleep printing behavior on Mac OS X.
+ - The scheduler incorrectly allowed jobs to be held from a terminating
+ state.
+ - The cups-driverd program could crash when a PPD was renamed.
- The dnssd backend took too long to discover printers on large or busy
networks with the new default timeout used by lpinfo and the web
interface. This resulted in "lost" printers.
-INSTALL - CUPS v1.5rc1 - 2011-06-05
+INSTALL - CUPS v1.5rc1 - 2011-06-14
-----------------------------------
This file describes how to compile and install CUPS from source code. For more
-README - CUPS v1.5rc1 - 2011-06-05
+README - CUPS v1.5rc1 - 2011-06-14
----------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
struct ecpp_device_id did; /* Device ID buffer */
# endif /* __sun && ECPPIOC_GETDEVID */
+ char *ptr; /* Pointer into device ID */
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
* and then limit the length to the size of our buffer...
*/
- if (length > device_id_size)
+ if (length > device_id_size || length < 14)
length = (((unsigned)device_id[1] & 255) << 8) +
((unsigned)device_id[0] & 255);
device_id[length] = '\0';
}
}
-# ifdef DEBUG
else
+ {
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
strerror(errno)));
-# endif /* DEBUG */
+ *device_id = '\0';
+ }
# endif /* __linux */
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
# endif /* __sun && ECPPIOC_GETDEVID */
}
+ /*
+ * Check whether device ID is valid. Turn line breaks and tabs to spaces and
+ * reject device IDs with non-printable characters.
+ */
+
+ for (ptr = device_id; *ptr; ptr ++)
+ if (_cups_isspace(*ptr))
+ *ptr = ' ';
+ else if ((*ptr & 255) < ' ' || *ptr == 127)
+ {
+ DEBUG_printf(("backendGetDeviceID: Bad device_id character %d.",
+ *ptr & 255));
+ *device_id = '\0';
+ break;
+ }
+
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
if (scheme && uri)
{
fd_set input; /* Input set for reading */
time_t curtime, /* Current time */
- snmp_update = 0;
-#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
- struct sigaction action; /* Actions for POSIX signals */
-#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+ snmp_update = 0; /* Last SNMP status update */
fprintf(stderr, "DEBUG: backendWaitLoop(snmp_fd=%d, addr=%p, side_cb=%p)\n",
*mdl, /* Model */
*des, /* Description */
*sern; /* Serial number */
+ size_t mfglen; /* Length of manufacturer string */
char tempmfg[256], /* Temporary manufacturer string */
tempsern[256], /* Temporary serial number string */
*tempptr; /* Pointer into temp string */
mfg = tempmfg;
}
+ mfglen = strlen(mfg);
+
+ if (!strncasecmp(mdl, mfg, mfglen) && _cups_isspace(mdl[mfglen]))
+ {
+ mdl += mfglen + 1;
+
+ while (_cups_isspace(*mdl))
+ mdl ++;
+ }
+
/*
* Generate the device URI from the manufacturer, model, serial number,
* and interface number...
const char *device_id, /* I - IEEE-1284 device ID */
const void *data) /* I - User data (make, model, S/N) */
{
- return (!strcmp((char *)data, device_uri));
+ char requested_uri[1024], /* Requested URI */
+ *requested_ptr, /* Pointer into requested URI */
+ detected_uri[1024], /* Detected URI */
+ *detected_ptr; /* Pointer into detected URI */
+
+
+ /*
+ * If we have an exact match, stop now...
+ */
+
+ if (!strcmp((char *)data, device_uri))
+ return (1);
+
+ /*
+ * Work on copies of the URIs...
+ */
+
+ strlcpy(requested_uri, (char *)data, sizeof(requested_uri));
+ strlcpy(detected_uri, device_uri, sizeof(detected_uri));
+
+ /*
+ * libusb-discovered URIs can have an "interface" specification and this
+ * never happens for usblp-discovered URIs, so remove the "interface"
+ * specification from the URI which we are checking currently. This way a
+ * queue for a usblp-discovered printer can now be accessed via libusb.
+ *
+ * Similarly, strip "?serial=NNN...NNN" as needed.
+ */
+
+ if ((requested_ptr = strstr(requested_uri, "?interface=")) == NULL)
+ requested_ptr = strstr(requested_uri, "&interface=");
+ if ((detected_ptr = strstr(detected_uri, "?interface=")) == NULL)
+ detected_ptr = strstr(detected_uri, "&interface=");
+
+ if (!requested_ptr && detected_ptr)
+ {
+ /*
+ * Strip "[?&]interface=nnn" from the detected printer.
+ */
+
+ *detected_ptr = '\0';
+ }
+ else if (requested_ptr && !detected_ptr)
+ {
+ /*
+ * Strip "[?&]interface=nnn" from the requested printer.
+ */
+
+ *requested_ptr = '\0';
+ }
+
+ if ((requested_ptr = strstr(requested_uri, "?serial=?")) != NULL)
+ {
+ /*
+ * Strip "?serial=?" from the requested printer. This is a special
+ * case, as "?serial=?" means no serial number and not the serial
+ * number '?'. This is not covered by the checks below...
+ */
+
+ *requested_ptr = '\0';
+ }
+
+ if ((requested_ptr = strstr(requested_uri, "?serial=")) == NULL &&
+ (detected_ptr = strstr(detected_uri, "?serial=")) != NULL)
+ {
+ /*
+ * Strip "?serial=nnn" from the detected printer.
+ */
+
+ *detected_ptr = '\0';
+ }
+ else if (requested_ptr && !detected_ptr)
+ {
+ /*
+ * Strip "?serial=nnn" from the requested printer.
+ */
+
+ *requested_ptr = '\0';
+ }
+
+ return (!strcmp(requested_uri, detected_uri));
}
case "$COMPONENTS" in
all)
- BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data locale man doc examples templates"
+ BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
;;
core)
else
AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
OLDCFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wno-tautological-compare"
+ CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
AC_TRY_COMPILE(,,
[OPTIM="$OPTIM -Wno-tautological-compare"
AC_MSG_RESULT(yes)],
* Resolver loop!
*/
- DEBUG_printf(("1ppdResolveConflicts: Resolver loop with %s!",
+ DEBUG_printf(("1cupsResolveConflicts: Resolver loop with %s!",
consts->resolver));
goto error;
}
if ((resolver = ppdFindAttr(ppd, "cupsUIResolver",
consts->resolver)) == NULL)
{
- DEBUG_printf(("1ppdResolveConflicts: Resolver %s not found!",
+ DEBUG_printf(("1cupsResolveConflicts: Resolver %s not found!",
consts->resolver));
goto error;
}
if (!resolver->value)
{
- DEBUG_printf(("1ppdResolveConflicts: Resolver %s has no value!",
+ DEBUG_printf(("1cupsResolveConflicts: Resolver %s has no value!",
consts->resolver));
goto error;
}
if (!changed)
{
- DEBUG_puts("1ppdResolveConflicts: Unable to automatically resolve "
+ DEBUG_puts("1cupsResolveConflicts: Unable to automatically resolve "
"constraint!");
goto error;
}
snprintf(data, sizeof(data), "%s:%d:%s:%d:%04x:%04x", server,
port, name ? name : server, number,
- CUPS_RAND() & 0xffff, CUPS_RAND() & 0xffff);
+ (unsigned)CUPS_RAND() & 0xffff, (unsigned)CUPS_RAND() & 0xffff);
_cupsMD5Init(&md5state);
_cupsMD5Append(&md5state, (unsigned char *)data, strlen(data));
if (map_to_utf8 != (iconv_t)-1)
{
+ char *altdestptr = (char *)dest; /* Silence bogus GCC type-punned */
+
srclen = strlen(src);
outBytesLeft = maxout - 1;
- iconv(map_to_utf8, (char **)&src, &srclen, (char **)&destptr,
- &outBytesLeft);
- *destptr = '\0';
+ iconv(map_to_utf8, (char **)&src, &srclen, &altdestptr, &outBytesLeft);
+ *altdestptr = '\0';
_cupsMutexUnlock(&map_mutex);
- return ((int)(destptr - dest));
+ return ((int)(altdestptr - (char *)dest));
}
_cupsMutexUnlock(&map_mutex);
if (map_from_utf8 != (iconv_t)-1)
{
+ char *altsrc = (char *)src; /* Silence bogus GCC type-punned */
+
srclen = strlen((char *)src);
outBytesLeft = maxout - 1;
- iconv(map_from_utf8, (char **)&src, &srclen, &destptr, &outBytesLeft);
+ iconv(map_from_utf8, &altsrc, &srclen, &destptr, &outBytesLeft);
*destptr = '\0';
_cupsMutexUnlock(&map_mutex);
#
# Original version by Jason McMullan <jmcc@ontv.com>.
#
-# Copyright 2007-2010 by Apple Inc.
+# Copyright 2007-2011 by Apple Inc.
# Copyright 1999-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
%description
CUPS is the standards-based, open source printing system developed by
-Apple Inc. for Mac OS¨ X and other UNIX¨-like operating systems.
+Apple Inc. for Mac OS® X and other UNIX®-like operating systems.
%description devel
This package provides the CUPS headers and development environment.
%dir /usr/lib/cups
%dir /usr/lib/cups/backend
/usr/lib/cups/backend/http
+/usr/lib/cups/backend/https
%attr(0700,root,root) /usr/lib/cups/backend/ipp
+/usr/lib/cups/backend/ipps
%attr(0700,root,root) /usr/lib/cups/backend/lpd
/usr/lib/cups/backend/parallel
-/usr/lib/cups/backend/scsi
/usr/lib/cups/backend/serial
/usr/lib/cups/backend/snmp
/usr/lib/cups/backend/socket
%dir /usr/lib/cups/daemon
/usr/lib/cups/daemon/cups-deviced
/usr/lib/cups/daemon/cups-driverd
+/usr/lib/cups/daemon/cups-exec
/usr/lib/cups/daemon/cups-polld
%dir /usr/lib/cups/driver
%dir /usr/lib/cups/filter
/usr/share/man/man5/*.conf.5.gz
/usr/share/man/man5/ipptoolfile.5.gz
/usr/share/man/man5/mime.*.5.gz
-%dir /usr/share/man/man7
-/usr/share/man/man7/drv*
%dir /usr/share/man/man8
/usr/share/man/man8/accept.8.gz
/usr/share/man/man8/cupsaddsmb.8.gz
gnutls_certificate_set_x509_key_file(*credentials, ServerCertificate,
ServerKey, GNUTLS_X509_FMT_PEM);
- gnutls_init(&con->http.tls), GNUTLS_SERVER);
+ gnutls_init(&con->http.tls, GNUTLS_SERVER);
gnutls_set_default_priority(con->http.tls);
gnutls_credentials_set(con->http.tls, GNUTLS_CRD_CERTIFICATE, *credentials);
gnutls_transport_set_ptr(con->http.tls, (gnutls_transport_ptr)HTTP(con));
"FaxRetryLimit is deprecated; use "
"JobRetryLimit on line %d.", linenum);
}
- else if (!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")
+ else if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")
#ifdef HAVE_SSL
|| !_cups_strcasecmp(line, "SSLPort") || !_cups_strcasecmp(line, "SSLListen")
#endif /* HAVE_SSL */
- )
+ ) && value)
{
/*
* Add listening address(es) to the list...
else if (!_cups_strcasecmp(line, "</Limit>") ||
!_cups_strcasecmp(line, "</LimitExcept>"))
loc = parent;
+ else if (!value)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value on line %d.", linenum);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
else if (!parse_aaa(loc, line, value, linenum))
{
cupsdLogMessage(CUPSD_LOG_ERROR,
op = NULL;
}
+ else if (!value)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value on line %d.", linenum);
+ if (FatalErrors & CUPSD_FATAL_CONFIG)
+ return (0);
+ }
else if (!_cups_strcasecmp(line, "JobPrivateAccess") ||
!_cups_strcasecmp(line, "JobPrivateValues") ||
!_cups_strcasecmp(line, "SubscriptionPrivateAccess") ||
else if ((diff = cupsdCompareNames(p0->record.make_and_model,
p1->record.make_and_model)) != 0)
return (diff);
+ else if ((diff = strcmp(p0->record.languages[0],
+ p1->record.languages[0])) != 0)
+ return (diff);
else
- return (strcmp(p0->record.languages[0], p1->record.languages[0]));
+ return (compare_names(p0, p1));
}
* Add a dummy entry for the file...
*/
- add_ppd(name, name, "", "", "", "", "", "", mtime, size, 0,
+ httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "drv", "", "", 0,
+ "/%s", name);
+ add_ppd(name, uri, "", "", "", "", "", "", mtime, size, 0,
PPD_TYPE_DRV, "drv");
ChangedPPD = 1;
return;
}
+ /*
+ * See if the job is in a state that allows holding...
+ */
+
+ if (job->state_value > IPP_JOB_STOPPED)
+ {
+ /*
+ * Return a "not-possible" error...
+ */
+
+ send_ipp_status(con, IPP_NOT_POSSIBLE,
+ _("Job #%d is finished and cannot be altered."),
+ job->id);
+ return;
+ }
+
/*
* Hold the job and return...
*/
if (!cupsdLoadJob(job))
return;
- /*
- * Don't do anything if the state is unchanged and we aren't purging the
- * job...
- */
-
- oldstate = job->state_value;
- if (newstate == oldstate && action != CUPSD_JOB_PURGE)
- return;
+ /*
+ * Don't do anything if the state is unchanged and we aren't purging the
+ * job...
+ */
+
+ oldstate = job->state_value;
+ if (newstate == oldstate && action != CUPSD_JOB_PURGE)
+ return;
/*
* Stop any processes that are working on the current job...
if (job)
newbusy |= 2;
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
+ "cupsdSetBusyState: newbusy=\"%s\", busy=\"%s\"",
+ busy_text[newbusy], busy_text[busy]);
+
/*
* Manage state changes...
*/
vtran = 0;
}
#endif /* HAVE_VPROC_TRANSACTION_BEGIN */
+ }
#ifdef kIOPMAssertionTypeDenySystemSleep
- if ((busy & 2) && !dark_wake)
- {
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "Asserting dark wake.");
- IOPMAssertionCreateWithName(kIOPMAssertionTypeDenySystemSleep,
- kIOPMAssertionLevelOn,
- CFSTR("org.cups.cupsd"), &dark_wake);
- }
- else if (!(busy & 2) && dark_wake)
- {
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "Releasing dark wake assertion.");
- IOPMAssertionRelease(dark_wake);
- dark_wake = 0;
- }
-#endif /* kIOPMAssertionTypeDenySystemSleep */
-
- cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdSetBusyState: %s", busy_text[busy]);
+ if (cupsArrayCount(PrintingJobs) > 0 && !dark_wake)
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Asserting dark wake.");
+ IOPMAssertionCreateWithName(kIOPMAssertionTypeDenySystemSleep,
+ kIOPMAssertionLevelOn,
+ CFSTR("org.cups.cupsd"), &dark_wake);
}
+ else if (cupsArrayCount(PrintingJobs) == 0 && dark_wake)
+ {
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Releasing dark wake assertion.");
+ IOPMAssertionRelease(dark_wake);
+ dark_wake = 0;
+ }
+#endif /* kIOPMAssertionTypeDenySystemSleep */
}
#
# IPP/1.1 test suite.
#
-# Copyright 2007-2010 by Apple Inc.
+# Copyright 2007-2011 by Apple Inc.
# Copyright 2001-2006 by Easy Software Products. All rights reserved.
#
# These coded instructions, statements, and computer programs are the
# ./ipptool -f filename -t printer-uri ipp-1.1.test
#
+# Regular expression for IPP URI schemes
+# Matches strings beginning with ipp:// or ipps://
+DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
+
# Test that a request-id value of 0 is not accepted.
#
# Required by: RFC 2911 section 3.1.1
ATTR uri printer-uri $uri
STATUS successful-ok
- EXPECT printer-uri-supported OF-TYPE uri
+ EXPECT printer-uri-supported OF-TYPE uri WITH-VALUE "$IPP_URI_SCHEME"
}
STATUS successful-ok
STATUS client-error-document-format-not-supported
- EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag
+ EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag
WITH-VALUE >0
EXPECT job-state OF-TYPE enum COUNT 1 IN-GROUP job-attributes-tag
EXPECT printer-state OF-TYPE enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5
EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag
EXPECT printer-up-time OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
- EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-security-supported
+ EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-security-supported WITH-VALUE "$IPP_URI_SCHEME"
EXPECT queued-job-count OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
EXPECT uri-authentication-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
EXPECT uri-security-supported OF-TYPE keyword IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-authentication-supported
STATUS successful-ok
- EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag
+ EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
EXPECT !printer-name
}
STATUS successful-ok
EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
- EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+ EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
EXPECT !job-printer-uri
EXPECT !job-more-info
EXPECT !job-name
STATUS successful-ok
EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
- EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+ EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
EXPECT ?job-more-info OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
STATUS successful-ok
EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
- EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+ EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
EXPECT !job-printer-uri
EXPECT !job-more-info
EXPECT !job-name
STATUS successful-ok
EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
- EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+ EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
EXPECT !job-printer-uri
EXPECT !job-more-info
EXPECT !job-name
STATUS successful-ok
EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
- EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+ EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
EXPECT !job-printer-uri
EXPECT !job-more-info
EXPECT !job-name
STATUS successful-ok
STATUS client-error-document-format-not-supported
- EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag
+ EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag
WITH-VALUE >0
EXPECT job-state OF-TYPE enum COUNT 1 IN-GROUP job-attributes-tag
STATUS successful-ok
EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
- EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+ EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
EXPECT ?job-more-info OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
puts("</array>");
}
+ skip_error:
+
if (Output == _CUPS_OUTPUT_PLIST)
puts("</dict>");
- skip_error:
-
ippDelete(response);
response = NULL;