- Applied patch to prevent bad job control files crashing cupsd on start-up

(STR #3253, bug #509741).
- Correctly handle CUPS-Get-PPDs requests for models with '+' in their
    names (STR #3254, bug #509586).
- Accept incorrect device URIs in the (non-libusb) usb backend for
    compatibility with Fedora 11 before bug #507244 was fixed.
- Applied patch to fix incorrect device URIs (STR #3259, bug #507244).
- Applied patch to fix job-hold-until for remote queues (STR #3258, bug
    #497376).
This commit is contained in:
Tim Waugh 2009-07-15 13:27:21 +00:00
parent 697652310f
commit d08cd1d6a2
6 changed files with 178 additions and 4 deletions

47
cups-str3253.patch Normal file
View File

@ -0,0 +1,47 @@
diff -up cups-1.4rc1/scheduler/job.c.str3253 cups-1.4rc1/scheduler/job.c
--- cups-1.4rc1/scheduler/job.c.str3253 2009-07-15 11:19:37.613132688 +0100
+++ cups-1.4rc1/scheduler/job.c 2009-07-15 11:51:42.073132844 +0100
@@ -3443,11 +3443,8 @@ load_job_cache(const char *filename) /*
{
cupsArrayAdd(Jobs, job);
- if (job->state_value <= IPP_JOB_STOPPED)
- {
- cupsArrayAdd(ActiveJobs, job);
- cupsdLoadJob(job);
- }
+ if (job->state_value <= IPP_JOB_STOPPED && cupsdLoadJob(job))
+ cupsArrayAdd(ActiveJobs, job);
job = NULL;
}
@@ -3699,18 +3696,19 @@ load_request_root(void)
* Load the job...
*/
- cupsdLoadJob(job);
-
- /*
- * Insert the job into the array, sorting by job priority and ID...
- */
+ if (cupsdLoadJob(job))
+ {
+ /*
+ * Insert the job into the array, sorting by job priority and ID...
+ */
- cupsArrayAdd(Jobs, job);
+ cupsArrayAdd(Jobs, job);
- if (job->state_value <= IPP_JOB_STOPPED)
- cupsArrayAdd(ActiveJobs, job);
- else
- unload_job(job);
+ if (job->state_value <= IPP_JOB_STOPPED)
+ cupsArrayAdd(ActiveJobs, job);
+ else
+ unload_job(job);
+ }
}
cupsDirClose(dir);

12
cups-str3254.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up cups-1.4rc1/scheduler/ipp.c.str3254 cups-1.4rc1/scheduler/ipp.c
--- cups-1.4rc1/scheduler/ipp.c.str3254 2009-07-15 11:11:32.346008322 +0100
+++ cups-1.4rc1/scheduler/ipp.c 2009-07-15 11:12:14.411132519 +0100
@@ -11170,7 +11170,7 @@ url_encode_string(const char *s, /* I -
while (*s && bufptr < bufend)
{
- if (*s == ' ' || *s == '%')
+ if (*s == ' ' || *s == '%' || *s == '+')
{
if (bufptr >= (bufend - 2))
break;

26
cups-str3258.patch Normal file
View File

@ -0,0 +1,26 @@
diff -up cups-1.4rc1/scheduler/ipp.c.str3258 cups-1.4rc1/scheduler/ipp.c
--- cups-1.4rc1/scheduler/ipp.c.str3258 2009-07-15 09:58:15.559299247 +0100
+++ cups-1.4rc1/scheduler/ipp.c 2009-07-15 09:58:47.981299548 +0100
@@ -1721,8 +1721,7 @@ add_job(cupsd_client_t *con, /* I - Cl
attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD,
"job-hold-until", NULL, val);
}
- if (attr && strcmp(attr->values[0].string.text, "no-hold") &&
- !(printer->type & CUPS_PRINTER_REMOTE))
+ if (attr && strcmp(attr->values[0].string.text, "no-hold"))
{
/*
* Hold job until specified time...
diff -up cups-1.4rc1/scheduler/job.c.str3258 cups-1.4rc1/scheduler/job.c
--- cups-1.4rc1/scheduler/job.c.str3258 2009-07-15 09:58:15.627173602 +0100
+++ cups-1.4rc1/scheduler/job.c 2009-07-15 09:58:47.984298957 +0100
@@ -3095,7 +3095,8 @@ get_options(cupsd_job_t *job, /* I - Jo
attr->value_tag == IPP_TAG_BEGIN_COLLECTION) /* Not yet supported */
continue;
- if (!strncmp(attr->name, "time-", 5))
+ if (!strncmp(attr->name, "time-", 5) ||
+ !strcmp(attr->name, "job-hold-until"))
continue;
if (!strncmp(attr->name, "job-", 4) &&

18
cups-str3259.patch Normal file
View File

@ -0,0 +1,18 @@
diff -up cups-1.4rc1/backend/ieee1284.c.str3259 cups-1.4rc1/backend/ieee1284.c
--- cups-1.4rc1/backend/ieee1284.c.str3259 2008-12-11 23:01:44.000000000 +0000
+++ cups-1.4rc1/backend/ieee1284.c 2009-07-15 10:08:13.147173947 +0100
@@ -306,6 +306,14 @@ backendGetDeviceID(
mfg = temp;
}
+ if (!strncasecmp(mdl, mfg, strlen(mfg)))
+ {
+ mdl += strlen(mfg);
+
+ while (isspace(*mdl & 255))
+ mdl ++;
+ }
+
/*
* Generate the device URI from the manufacturer, make_model, and
* serial number strings.

51
cups-uri-compat.patch Normal file
View File

@ -0,0 +1,51 @@
diff -up cups-1.4rc1/backend/usb-unix.c.uri-compat cups-1.4rc1/backend/usb-unix.c
--- cups-1.4rc1/backend/usb-unix.c.uri-compat 2009-07-15 10:48:46.992133677 +0100
+++ cups-1.4rc1/backend/usb-unix.c 2009-07-15 10:49:05.305008114 +0100
@@ -63,11 +63,34 @@ print_device(const char *uri, /* I - De
int device_fd; /* USB device */
size_t tbytes; /* Total number of bytes written */
struct termios opts; /* Parallel port options */
+ char *fixed_uri = strdup (uri);
+ char *p;
(void)argc;
(void)argv;
+ p = strchr (fixed_uri, ':');
+ if (p++ != NULL)
+ {
+ char *e;
+ p += strspn (p, "/");
+ e = strchr (p, '/');
+ if (e > p)
+ {
+ size_t mfrlen = e - p;
+ e++;
+ if (!strncasecmp (e, p, mfrlen))
+ {
+ char *x = e + mfrlen;
+ if (!strncmp (x, "%20", 3))
+ /* Take mfr name out of mdl name for compatibility with
+ * Fedora 11 before bug #507244 was fixed. */
+ strcpy (e, x + 3); puts(fixed_uri);
+ }
+ }
+ }
+
/*
* Open the USB port device...
*/
@@ -107,10 +130,10 @@ print_device(const char *uri, /* I - De
strncasecmp(hostname, "Minolta", 7);
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
- if (use_bc && !strncmp(uri, "usb:/dev/", 9))
+ if (use_bc && !strncmp(fixed_uri, "usb:/dev/", 9))
use_bc = 0;
- if ((device_fd = open_device(uri, &use_bc)) == -1)
+ if ((device_fd = open_device(fixed_uri, &use_bc)) == -1)
{
if (getenv("CLASS") != NULL)
{

View File

@ -10,7 +10,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.4
Release: 0.%{pre}.9%{?dist}
Release: 0.%{pre}.10%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/test//cups-%{version}%{?pre}%{?svn}-source.tar.bz2
@ -51,7 +51,12 @@ Patch24: cups-str3229.patch
Patch25: cups-filter-debug.patch
Patch26: cups-str3231.patch
Patch27: cups-str3244.patch
Patch28: cups-avahi.patch
Patch28: cups-str3258.patch
Patch29: cups-str3259.patch
Patch30: cups-uri-compat.patch
Patch31: cups-str3254.patch
Patch32: cups-str3253.patch
Patch33: cups-avahi.patch
Patch100: cups-lspp.patch
Epoch: 1
Url: http://www.cups.org/
@ -200,7 +205,12 @@ module.
%patch25 -p1 -b .filter-debug
%patch26 -p1 -b .str3231
%patch27 -p1 -b .str3244
#%patch28 -p1 -b .avahi
%patch28 -p1 -b .str3258
%patch29 -p1 -b .str3259
%patch30 -p1 -b .uri-compat
%patch31 -p1 -b .str3254
%patch32 -p1 -b .str3253
#%patch33 -p1 -b .avahi
%if %lspp
%patch100 -p1 -b .lspp
@ -493,8 +503,18 @@ rm -rf $RPM_BUILD_ROOT
%{php_extdir}/phpcups.so
%changelog
* Wed Jul 15 2009 Tim Waugh <twaugh@redhat.com> 1:1.4-0.rc1.10
- Applied patch to prevent bad job control files crashing cupsd on
start-up (STR #3253, bug #509741).
- Correctly handle CUPS-Get-PPDs requests for models with '+' in their
names (STR #3254, bug #509586).
- Accept incorrect device URIs in the (non-libusb) usb backend for
compatibility with Fedora 11 before bug #507244 was fixed.
- Applied patch to fix incorrect device URIs (STR #3259, bug #507244).
- Applied patch to fix job-hold-until for remote queues (STR #3258,
bug #497376).
* Mon Jul 13 2009 Remi Collet <Fedora@FamilleCollet.com> 1:1.4-0.rc1.9
- rebuild for new PHP 5.3.0 ABI (20090626)
- add PHP ABI check
- use php_extdir
- add php configuration file (/etc/php.d/cups.ini)