Hi Matt!

Matt Zimmerman [2005-01-10  8:57 -0800]:
> tags 289666 - security
> thanks
> 
> Martin; didn't we fix this in Ubuntu?

Debian's version still uses the "I guesstimate the device number and
am wrong in 50% of the cases" approach. In Mataró I uploaded an
untested sane-backends package with an updated
/etc/hotplug/usb/libusbscanner script (see the attached dpatch) which
uses sysfs to look up the correct device number.

I did not receive any feedback about this until now, so it does not
seem to be overly broken.

libsane maintainer, since you certainly have a scanner, can you please
test this patch and adopt it if it works?

Other than that the bug report is very vague, so if the reporter means
something else, much more information is necessary to debug his
problem. We have always used 2.6 in Warty and a scanner module is not
needed in any way to make scanners work. This is just a matter of
writing a matching libusb.usermap, which is shipped by default.

Martin

-- 
Martin Pitt                       http://www.piware.de
Ubuntu Developer            http://www.ubuntulinux.org
Debian GNU/Linux Developer       http://www.debian.org
#! /bin/sh /usr/share/dpatch/dpatch-run
## 33_sysfs_libusbscanner.dpatch by  <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: use sysfs to look up device numbers instead of guesstimating them

@DPATCH@
diff -urNad sane-backends-1.0.15/tools/hotplug/libusbscanner 
/tmp/dpep.ePcTwU/sane-backends-1.0.15/tools/hotplug/libusbscanner
--- sane-backends-1.0.15/tools/hotplug/libusbscanner    2004-05-11 
21:03:18.000000000 +0200
+++ /tmp/dpep.ePcTwU/sane-backends-1.0.15/tools/hotplug/libusbscanner   
2004-12-07 11:43:41.320324176 +0100
@@ -16,8 +16,7 @@
 # latest hotplug doesn't set DEVICE on 2.6.x kernels
 if [ -z "$DEVICE" ] ; then
   IF=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\2/'`
-  DEV=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\3/'`
-  DEV=`expr $DEV + 1`
+  DEV=$(cat /sys/${DEVPATH}/devnum)
   DEVICE=`printf '/proc/bus/usb/%.03d/%.03d' $IF $DEV`
 fi
 

Reply via email to