- 1.3.4 (bug #361681).

This commit is contained in:
Tim Waugh 2007-11-01 16:08:41 +00:00
parent a9ef41d125
commit abbc6d3451
5 changed files with 7 additions and 153 deletions

View File

@ -28,3 +28,4 @@ cups-1.3rc2-source.tar.bz2
cups-1.3.0-source.tar.bz2
cups-1.3.2-source.tar.bz2
cups-1.3.3-source.tar.bz2
cups-1.3.4-source.tar.bz2

View File

@ -1,135 +0,0 @@
diff -up cups-1.3.3/backend/ieee1284.c.parallel-id cups-1.3.3/backend/ieee1284.c
--- cups-1.3.3/backend/ieee1284.c.parallel-id 2007-07-11 22:46:42.000000000 +0100
+++ cups-1.3.3/backend/ieee1284.c 2007-10-10 12:15:21.000000000 +0100
@@ -32,6 +32,10 @@
# include <linux/lp.h>
# define IOCNR_GET_DEVICE_ID 1
# define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
+# include <linux/parport.h>
+# include <linux/ppdev.h>
+# include <unistd.h>
+# include <fcntl.h>
#endif /* __linux */
#ifdef __sun
@@ -68,6 +72,7 @@ backendGetDeviceID(
int manulen; /* Length of manufacturer string */
#ifdef __linux
int length; /* Length of device ID info */
+ int got_id = 0;
#endif /* __linux */
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
struct ecpp_device_id did; /* Device ID buffer */
@@ -93,9 +98,6 @@ backendGetDeviceID(
if (make_model)
*make_model = '\0';
- if (uri)
- *uri = '\0';
-
if (fd >= 0)
{
/*
@@ -105,7 +107,74 @@ backendGetDeviceID(
*device_id = '\0';
#ifdef __linux
- if (!ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
+ if (ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
+ {
+# ifdef DEBUG
+ printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
+# endif /* DEBUG */
+
+ if (!strcmp (scheme, "parallel") &&
+ uri && !strncmp (uri, "parallel:/dev/", 14))
+ {
+ const char *n;
+ char devparport[16];
+ int devparportfd;
+ n = uri + strcspn (uri, "0123456789");
+ strcpy (devparport, "/dev/parport");
+ strncpy (devparport + 12, n, 3);
+ devparport[15] = '\0';
+ devparportfd = open (devparport, O_RDWR | O_NOCTTY);
+ if (devparportfd != -1)
+ {
+ /* Put the device into Device ID mode */
+ int err = ioctl (devparportfd, PPCLAIM);
+ int m = IEEE1284_MODE_COMPAT;
+
+ if (err)
+ {
+ close (devparportfd);
+ devparportfd = -1;
+ }
+
+ if (!err)
+ err = ioctl (devparportfd, PPNEGOT, &m);
+
+ if (!err)
+ {
+ m = IEEE1284_MODE_NIBBLE | IEEE1284_DEVICEID;
+ err = ioctl (devparportfd, PPNEGOT, &m);
+ }
+
+ /* Make the file descriptor non-blocking to guard against
+ * bugs in the device. */
+ if (!err)
+ {
+ int f = fcntl (devparportfd, F_GETFL);
+ f |= O_NONBLOCK;
+ err = fcntl (devparportfd, F_SETFL, f);
+ }
+
+ /* Read the ID */
+ if (!err)
+ {
+ if (read (devparportfd, device_id, device_id_size) < 2)
+ err = 1;
+ else
+ got_id = 1;
+ }
+
+ if (devparportfd > -1)
+ {
+ ioctl (devparportfd, PPRELEASE);
+ close (devparportfd);
+ }
+ }
+ }
+ }
+ else
+ got_id = 1;
+
+ if (got_id)
{
/*
* Extract the length of the device ID string from the first two
@@ -168,6 +237,9 @@ backendGetDeviceID(
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
+ if (uri)
+ *uri = '\0';
+
if (!*device_id)
return (-1);
diff -up cups-1.3.3/backend/parallel.c.parallel-id cups-1.3.3/backend/parallel.c
--- cups-1.3.3/backend/parallel.c.parallel-id 2007-08-22 19:34:34.000000000 +0100
+++ cups-1.3.3/backend/parallel.c 2007-10-10 12:14:23.000000000 +0100
@@ -350,9 +350,12 @@ list_devices(void)
* Now grab the IEEE 1284 device ID string...
*/
+ char device_uri[255 + 9];
+ strcpy (device_uri, "parallel:");
+ strcpy (device_uri + 9, device);
if (!backendGetDeviceID(fd, device_id, sizeof(device_id),
make_model, sizeof(make_model),
- NULL, NULL, 0))
+ "parallel", device_uri, sizeof (device_uri)))
printf("direct parallel:%s \"%s\" \"%s LPT #%d\" \"%s\"\n", device,
make_model, make_model, i + 1, device_id);
else

View File

@ -1,11 +0,0 @@
diff -up cups-1.3.2/scheduler/dirsvc.c.str2512 cups-1.3.2/scheduler/dirsvc.c
--- cups-1.3.2/scheduler/dirsvc.c.str2512 2007-09-21 13:46:23.000000000 +0100
+++ cups-1.3.2/scheduler/dirsvc.c 2007-09-21 13:46:54.000000000 +0100
@@ -912,6 +912,7 @@ cupsdSendBrowseList(void)
cupsArraySave(Printers);
cupsdDeletePrinter(p, 1);
cupsArrayRestore(Printers);
+ cupsdWritePrintcap();
}
}
}

View File

@ -5,8 +5,8 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.3.3
Release: 3%{?dist}
Version: 1.3.4
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/test//cups-%{version}-source.tar.bz2
@ -38,10 +38,8 @@ Patch11: cups-paps.patch
Patch12: cups-wbuffer.patch
Patch13: cups-direct-usb.patch
Patch14: cups-lpr-help.patch
Patch15: cups-str2512.patch
Patch16: cups-pid.patch
Patch17: cups-foomatic-recommended.patch
Patch18: cups-parallel-id.patch
Patch19: cups-eggcups.patch
Patch20: cups-getpass.patch
Patch21: cups-driverd-timeout.patch
@ -150,10 +148,8 @@ lpd emulation.
%patch12 -p1 -b .wbuffer
%patch13 -p1 -b .direct-usb
%patch14 -p1 -b .lpr-help
%patch15 -p1 -b .str2512
%patch16 -p1 -b .pid
%patch17 -p1 -b .foomatic-recommended
%patch18 -p1 -b .parallel-id
%patch19 -p1 -b .eggcups
%patch20 -p1 -b .getpass
%patch21 -p1 -b .driverd-timeout
@ -449,6 +445,9 @@ rm -rf $RPM_BUILD_ROOT
%{cups_serverbin}/daemon/cups-lpd
%changelog
* Thu Nov 1 2007 Tim Waugh <twaugh@redhat.com> 1:1.3.4-1
- 1.3.4 (bug #361681).
* Wed Oct 10 2007 Tim Waugh <twaugh@redhat.com> 1:1.3.3-3
- Use ppdev instead of libieee1284 for parallel port Device ID
retrieval (bug #311671). This avoids SELinux audit messages.

View File

@ -1,2 +1,2 @@
b0bb017098e8e76b8a25e666c41ce540 postscript.ppd.gz
d4911e68b6979d16bc7a55f68d16cc53 cups-1.3.3-source.tar.bz2
4bd20d69bb083b42632346a383b6aefb cups-1.3.4-source.tar.bz2