From d08cd1d6a2c158336f2585c6e2929c790a9f18ec Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Jul 15 2009 13:27:21 +0000 Subject: - 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). --- diff --git a/cups-str3253.patch b/cups-str3253.patch new file mode 100644 index 0000000..ffa71d8 --- /dev/null +++ b/cups-str3253.patch @@ -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); diff --git a/cups-str3254.patch b/cups-str3254.patch new file mode 100644 index 0000000..6ca2566 --- /dev/null +++ b/cups-str3254.patch @@ -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; diff --git a/cups-str3258.patch b/cups-str3258.patch new file mode 100644 index 0000000..64dacb1 --- /dev/null +++ b/cups-str3258.patch @@ -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) && diff --git a/cups-str3259.patch b/cups-str3259.patch new file mode 100644 index 0000000..b318165 --- /dev/null +++ b/cups-str3259.patch @@ -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. diff --git a/cups-uri-compat.patch b/cups-uri-compat.patch new file mode 100644 index 0000000..dd55b66 --- /dev/null +++ b/cups-uri-compat.patch @@ -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) + { diff --git a/cups.spec b/cups.spec index a658ff5..cd8f181 100644 --- a/cups.spec +++ b/cups.spec @@ -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 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 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)