<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>131756</bug_id>
          
          <creation_ts>2006-04-29 23:12 0000</creation_ts>
          <short_desc>libusb-0.1.12 breaks scanning as non-root</short_desc>
          <delta_ts>2007-04-01 14:12:44 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Library</component>
          <version>2006.0</version>
          <rep_platform>AMD64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>TEST-REQUEST</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>150223</dependson>
    
    <dependson>158626</dependson>
          <blocked>148013</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>mj@neandertech.com</reporter>
          <assigned_to>liquidx@gentoo.org</assigned_to>
          <cc>altstadt@telus.net</cc>
    
    <cc>bjt23@cornell.edu</cc>
    
    <cc>bug.hunter@gmx.net</cc>
    
    <cc>cweiske@cweiske.de</cc>
    
    <cc>dberkholz@gentoo.org</cc>
    
    <cc>decibelshelp@charter.net</cc>
    
    <cc>e.bachmann@xebec.de</cc>
    
    <cc>folken@chaostreff.ch</cc>
    
    <cc>follettoonip@gmail.com</cc>
    
    <cc>gentoo@torangan.de</cc>
    
    <cc>gentoobugs@strawandfrost.com</cc>
    
    <cc>gregkh@gentoo.org</cc>
    
    <cc>hrz@geodata.soton.ac.uk</cc>
    
    <cc>jadamcze@utas.edu.au</cc>
    
    <cc>maxima.bugs@gmail.com</cc>
    
    <cc>mbray451@sbcglobal.net</cc>
    
    <cc>ns@vivid-planet.com</cc>
    
    <cc>robbat2@gentoo.org</cc>
    
    <cc>r_marten@gmx.net</cc>
    
    <cc>tekknokaetzi@web.de</cc>
    
    <cc>vapier@gentoo.org</cc>
    
    <cc>voyageur@gentoo.org</cc>
    
    <cc>wschlich@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>mj@neandertech.com</who>
            <bug_when>2006-04-29 23:12:31 0000</bug_when>
            <thetext>emerging libusb-0.1.12 causes the famous &quot;can&apos;t scan as non-root&quot; permissions problem. Reversion to libusb-0.1.11 fixes the problem.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tekknokaetzi@web.de</who>
            <bug_when>2006-05-01 01:02:06 0000</bug_when>
            <thetext>Same problem here, not only for scanning, I can&apos;t access my digital camera either!

This is what I get with libusb-0.1.12 (as root):
hardcore ~ # sane-find-scanner 

found USB scanner (vendor=0x06b9 [ALCATEL], product=0x4061 [Speed Touch USB ]) at libusb:002:003
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend&apos;s manpage.

hardcore ~ # scanimage -L
device `plustek:libusb:002:004&apos; is a Canon N670U/N676U/LiDE20 USB flatbed scanner

when I try to access my usb-scanner as a normal user:

tekknokaetzi@hardcore ~ $ sane-find-scanner

found USB scanner (vendor=0x04a9, product=0x220d, chip=LM983x?) at libusb:002:004
found USB scanner (vendor=0x06b9, product=0x4061) at libusb:002:003
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend&apos;s manpage.

tekknokaetzi@hardcore ~ $ scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

Same problem for my digital camera: it&apos;s recognised but I can&apos;t access it.

after reverting back to libusb-0.1.11 I can access my scanner and my digital camera as a normal user:

tekknokaetzi@hardcore ~ $ sane-find-scanner

found USB scanner (vendor=0x04a9 [Canon], product=0x220d [CanoScan], chip=LM9832/3) at libusb:002:005
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend&apos;s manpage.

tekknokaetzi@hardcore ~ $ scanimage -L
device `plustek:libusb:002:005&apos; is a Canon N670U/N676U/LiDE20 USB flatbed scanner

emerge --info:
Portage 2.1_pre9-r5 (default-linux/x86/2005.0, gcc-4.0.3, glibc-2.3.6-r3, 2.6.16-beyond-git12 i686)
=================================================================
System uname: 2.6.16-beyond-git12 i686 Intel(R) Pentium(R) 4 CPU 1400MHz
Gentoo Base System version 1.12.0_pre18
ccache version 2.4 [enabled]
dev-lang/python:     2.4.2-r1
dev-util/ccache:     2.4-r1
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-march=pentium4 -mtune=pentium4 -msse -msse2 -pipe -O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident -fforce-addr -falign-functions=4&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-march=pentium4 -mtune=pentium4 -msse -msse2 -pipe -O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident -fforce-addr -falign-functions=4 -fvisibility-inlines-hidden&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig ccache distlocks metadata-transfer sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://gentoo.inode.at/source/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo&quot;
LANG=&quot;de_DE@euro&quot;
LC_ALL=&quot;de_DE@euro&quot;
LDFLAGS=&quot;-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s -Wl,--as-needed&quot;
LINGUAS=&quot;de&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage /usr/local/overlays/gentoo-de&quot;
SYNC=&quot;rsync://rsync.europe.gentoo.org/gentoo-portage&quot;
USE=&quot;x86 X acpi alsa arts atm avi bitmap-fonts cdr cli crypt cups divx4linux dlloader dri dvd encode ffmpeg foomaticdb gdbm gif gphoto2 gpm gtk gtk2 imlib ipv6 isdnlog joystick jpeg kde libg++ libwww mad mmx motif mp3 mpeg ncurses nls nptl nptlonly nsplugin nvidia ogg oggvorbis opengl oss pam pcre pdf pdflib perl pic png pppd python qt quicktime readline real reflection scanner sdl session spell spl sse sse2 ssl svga tcpd tiff truetype truetype-fonts type1-fonts usb vorbis win32codecs wmf xml2 xmms xorg xv zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_de userland_GNU video_cards_nv video_cards_nvidia video_cards_fbdev video_cards_vesa&quot;
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mj@neandertech.com</who>
            <bug_when>2006-05-01 06:30:05 0000</bug_when>
            <thetext>I did some debugging. It seems that the line

ret = ioctl(dev-&gt;fd, IOCTL_USB_SETCONFIG, &amp;configuration);

in usb_set_configuration in linux.c returns a different error as non-root for libusb-0.1.12 and libusb-0.1.11. libusb-0.1.12 returns E_PERM.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mj@neandertech.com</who>
            <bug_when>2006-05-01 21:39:37 0000</bug_when>
            <thetext>OK, I found out why this is happening, but the answer is not pleasant. It turns out that libusb-0.1.11 is looking for usb devices at /proc/bus/usb while libusb-0.1.12 is looking at /dev/bus/usb.

All the documentation and hotplug scripts call for changing permissions at /proc/bus/usb.

One solution is to change all the documentation and hotplug scripts to change permissions at /dev/bus/usb instead.

I don&apos;t know the extent or consequences ot this change. Comments?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mj@neandertech.com</who>
            <bug_when>2006-05-03 06:01:26 0000</bug_when>
            <thetext>OK, here&apos;s how I fixed this problem. I added the file 10-scanner.rules to /etc/udev/rules.d consisting of the line:

BUS=&quot;usb&quot;, SYSFS{idVendor}=&quot;04b8&quot;, SYSFS{idProduct}=&quot;0818&quot;, PROGRAM=&quot;/bin/sh -c &apos;K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}&apos;&quot;, NAME=&quot;%c&quot;, MODE=&quot;0660&quot;, GROUP=&quot;scanner&quot;


</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jadamcze@utas.edu.au</who>
            <bug_when>2006-06-11 19:15:43 0000</bug_when>
            <thetext>Can confirm this bug with gphoto.

Changing perms on /dev/bus/usb/appropriate/file allows non-root access again.

Don&apos;t have a pretty, general solution.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>liquidx@gentoo.org</who>
            <bug_when>2006-08-11 01:37:16 0000</bug_when>
            <thetext>http://libusb.cvs.sourceforge.net/libusb/libusb/linux.c?r1=1.77&amp;r2=1.78

this is the change that did it. which documentation says to change the permissions on /proc/bus/usb? on my machine both permissions are the same, no root write access, am I missing something?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mj@neandertech.com</who>
            <bug_when>2006-08-11 08:00:16 0000</bug_when>
            <thetext>(In reply to comment #6)
&gt; http://libusb.cvs.sourceforge.net/libusb/libusb/linux.c?r1=1.77&amp;r2=1.78
&gt; 
&gt; this is the change that did it. which documentation says to change the
&gt; permissions on /proc/bus/usb? on my machine both permissions are the same, no
&gt; root write access, am I missing something?
&gt; 

The code changes that you reference seem to be related to determining whether usb is found or not, either /proc/bus/usb or /dev/bus/usb. The change that seems to cause the problem is code determining the permissions of the usb devices, which have changed from /proc/bus/usb to /dev/bus/usb. The permissions are now checked on /dev/bus/usb. On your machine, are you looking at /proc/bus/usb, /dev/bus/usb, or both?

The workaround here, and in the forums, is to write a special udev rule to create the /dev/bus/usb devices with the proper permissions for the new usb device. This is unsatisfactory as it is not general and depends on writing special udev rules for each specific usb device.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>liquidx@gentoo.org</who>
            <bug_when>2006-08-11 10:14:32 0000</bug_when>
            <thetext>I agree that the udev rules is not a good solution. I&apos;ll see if I can get upstream to look at this.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kocur666@tlen.pl</who>
            <bug_when>2006-09-24 15:21:45 0000</bug_when>
            <thetext>i got the same problem, downgrading to libsusb-0.1.11 works fine for me, on 0.1.12 i couldn&apos; acces even my camera had to do udev rule but this is not ok</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>liquidx@gentoo.org</who>
            <bug_when>2006-09-24 16:58:15 0000</bug_when>
            <thetext>vapier, you might not want to mark libusb-0.1.12 stable for sh, s390 and arm because of this bug.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-09-24 20:54:42 0000</bug_when>
            <thetext>isnt udev broken ?  shouldnt this line:

SUBSYSTEM==&quot;usb_device&quot;, PROGRAM=&quot;/bin/sh -c &apos;K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}&apos;&quot;, NAME=&quot;%c&quot;, MODE=&quot;0644&quot;

read MODE=&quot;0664&quot; and GROUP=&quot;usb&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>prote@fmi.uni-stuttgart.de</who>
            <bug_when>2006-10-02 06:07:23 0000</bug_when>
            <thetext>The same error here. But after

  echo &quot;=media-gfx/sane-backends-1.0.18-r2 ~x86&quot; &gt;&gt; /etc/portage/package.keywords
  emerge -pu sane-backends

  These are the packages that would be merged, in order:

  Calculating dependencies... done!
  [ebuild     U ] media-gfx/sane-backends-1.0.18-r2 [1.0.17]
  emerge -u sane-backends
  etc-update
  reboot

scanning as non-root with libusb-0.1.12 works again for me.
(According to Bug 148608 sane-backends-1.0.18-r2 should become x86 stable soon.)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-10-02 06:45:55 0000</bug_when>
            <thetext>gregkh: check out Comment #11</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zarhan@iki.fi</who>
            <bug_when>2006-10-03 02:55:26 0000</bug_when>
            <thetext>Also encountered this issue with gphoto and a Canon camera. USB permissions under /proc/bus/usb are correct, but apparently libusb checks them at /dev/bus/usb.

Can 0.1.12 be marked back to testing for time being, until solution is found, perhaps upstream?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>liquidx@gentoo.org</who>
            <bug_when>2006-10-03 11:32:45 0000</bug_when>
            <thetext>*** Bug 149968 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>liquidx@gentoo.org</who>
            <bug_when>2006-10-03 11:34:18 0000</bug_when>
            <thetext>arch teams, can you please not mark 0.1.12 stable for your respective architectures. this problem needs to be solved otherwise your users are going to complain.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wormo@gentoo.org</who>
            <bug_when>2006-10-03 15:57:08 0000</bug_when>
            <thetext>libusb-0.1.12 back to ~ppc for now; has upstream given any feedback on this issue yet?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2006-10-03 16:50:35 0000</bug_when>
            <thetext>sane needs udev rules written. they aren&apos;t hard to do.

the move to /dev/bus/usb was reasonably announced by upstream, and other packages have responded in kind. I&apos;ve been trying to get nut-2.0.4* stable, because it finally supports a lot of newer USB UPSes. It ships with this udev rule file (/etc/udev/rules.d/70-nut-usbups.rules), that sane will need to implement something like for libusb:

# udev rules for the NUT USB drivers
SUBSYSTEM!=&quot;usb_device&quot;, ACTION!=&quot;add&quot;, GOTO=&quot;nut-usbups_rules_end&quot;
# MGE UPS SYSTEMS - usbhid-ups
SYSFS{idVendor}==&quot;0463&quot;, SYSFS{idProduct}==&quot;ffff&quot;, MODE=&quot;660&quot;, GROUP=&quot;nut&quot;
SYSFS{idVendor}==&quot;0463&quot;, SYSFS{idProduct}==&quot;0001&quot;, MODE=&quot;660&quot;, GROUP=&quot;nut&quot;
# APC - usbhid-ups
SYSFS{idVendor}==&quot;051d&quot;, SYSFS{idProduct}==&quot;0002&quot;, MODE=&quot;660&quot;, GROUP=&quot;nut&quot;
# Powerware - bcmxcp_usb
SYSFS{idVendor}==&quot;0592&quot;, SYSFS{idProduct}==&quot;0002&quot;, MODE=&quot;660&quot;, GROUP=&quot;nut&quot;
# Tripp Lite - tripplite_usb
SYSFS{idVendor}==&quot;09ae&quot;, SYSFS{idProduct}==&quot;0001&quot;, MODE=&quot;660&quot;, GROUP=&quot;nut&quot;
LABEL=&quot;nut-usbups_rules_end&quot;

Sane should have it MUCH easier than NUT however, as IIRC all scanners should show up with a bInterfaceClass of USB_CLASS_STILL_IMAGE (6), which means you can cover every scanner with a single udev rule.

If two or three people with USB scanners could attach tarballs of their /sys directory, I&apos;ll gladly whip up some udev rules for you, so that libusb can move forward, instead of backwards.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zarhan@iki.fi</who>
            <bug_when>2006-10-03 23:13:06 0000</bug_when>
            <thetext>Apparently gphoto 2.2.0 also does the UDEV rules:

http://www.gphoto.org/news/

So if you want to move this to stable, gphoto 2.2 should be stabilized at the same time.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>decibelshelp@charter.net</who>
            <bug_when>2006-10-04 23:13:09 0000</bug_when>
            <thetext>Could libusb-0.1.12 be marked back ~amd64 also. This bit me today also. 

The only reason the scanner worked is because had a local udev rule in there from long time ago. 

What about what SpanKY said in #11? That is already there and shouldn&apos;t it be written that way from the getgo? :

SUBSYSTEM==&quot;usb_device&quot;, PROGRAM=&quot;/bin/sh -c &apos;K=%k; K=$${K#usbdev}; printf
bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}&apos;&quot;, NAME=&quot;%c&quot;, MODE=&quot;0644&quot;

read MODE=&quot;0664&quot; and GROUP=&quot;usb&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2006-10-04 23:34:06 0000</bug_when>
            <thetext>decibelshelp: changing that rule per spanky&apos;s request is one fix. the alternative fix like nut uses would end up with the similar result.

spanky: maybe open a new bug to gregkh to get it fixed quicker?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jm.beaune@gmail.com</who>
            <bug_when>2006-10-05 03:35:53 0000</bug_when>
            <thetext>Hi,

I had the same problem and found on forums another work around :

# echo &quot;export USB_DEVFS_PATH=/proc/bus/usb&quot; &gt;&gt; ~/.bash_profile</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gregkh@gentoo.org</who>
            <bug_when>2006-10-05 13:29:19 0000</bug_when>
            <thetext>Don&apos;t use that environment variable, just fix the packages to do it properly.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dang@gentoo.org</who>
            <bug_when>2006-10-05 14:13:47 0000</bug_when>
            <thetext>Okay, back to ~amd64.  (sorry, got lost in the shuffle)  Add us back when you want it stable again...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2006-10-08 10:20:58 0000</bug_when>
            <thetext>*** Bug 150463 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>follettoonip@gmail.com</who>
            <bug_when>2006-10-09 10:32:43 0000</bug_when>
            <thetext>(In reply to comment #9)
&gt; i got the same problem, downgrading to libsusb-0.1.11 works fine for me, on
&gt; 0.1.12 i couldn&apos; acces even my camera had to do udev rule but this is not ok
&gt; 

Downgrading didn&apos;t help (x86). I&apos;m still not able to acces my ZenExtra as normal user. I did a revdep-rebuild too.

Any suggestion?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>e.bachmann@xebec.de</who>
            <bug_when>2006-10-12 07:56:31 0000</bug_when>
            <thetext>What do the different upstreams (kernel/udev/libusb/lsb) say about this?

seems /proc/bus/usb (and usbfs) is now not longer needed, as udev can provide all of its functions from userspace, and /dev would be a more suitable namespace for usb device nodes anyways.

If usbfs really is deprecated/scheduled for removal, we should start fixing the udev rules now instead of waiting till a new kernel rev. breaks stuff.

just my 2</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>e.bachmann@xebec.de</who>
            <bug_when>2006-10-12 07:56:31 0000</bug_when>
            <thetext>What do the different upstreams (kernel/udev/libusb/lsb) say about this?

seems /proc/bus/usb (and usbfs) is now not longer needed, as udev can provide all of its functions from userspace, and /dev would be a more suitable namespace for usb device nodes anyways.

If usbfs really is deprecated/scheduled for removal, we should start fixing the udev rules now instead of waiting till a new kernel rev. breaks stuff.

just my 2¢,
/Ernst</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>bugs@stalag99.net</who>
            <bug_when>2006-10-15 10:19:27 0000</bug_when>
            <thetext>Strange.  I have both sane-backends, gphoto2-2.2.0, and libusb-0.1.12 on amd64, and I can find my scanner as non-root.

Of course, the scanner in /dev/bus/usb/xxx/yyy is chgrp&apos;ed &quot;scanner&quot; and the user I use (tygris) is part of the scanner group, so I don&apos;t have a permissions problem.

Someone double-check that:  Locate your scanner, where it&apos;s plugged in as root, and then ls -l the device in /dev/bus/usb to see if it&apos;s chgrp&apos;ed &quot;scanner&quot;.  Then check to see if the non-root user is in the &quot;scanner&quot; group in /etc/group.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zarhan@iki.fi</who>
            <bug_when>2006-10-15 13:07:45 0000</bug_when>
            <thetext>(In reply to comment #28)
&gt; Strange.  I have both sane-backends, gphoto2-2.2.0, and libusb-0.1.12 on amd64,
&gt; and I can find my scanner as non-root.

  That&apos;s because gphoto 2.2.0 has been made to work with the udev stuff - like I said earlier - it should have been marked stable at the same time as libusb-0.1.12.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>decibelshelp@charter.net</who>
            <bug_when>2006-10-15 13:17:27 0000</bug_when>
            <thetext>(In reply to comment #28)
&gt; Someone double-check that:  Locate your scanner, where it&apos;s plugged in as root,
&gt; and then ls -l the device in /dev/bus/usb to see if it&apos;s chgrp&apos;ed &quot;scanner&quot;. 
&gt; Then check to see if the non-root user is in the &quot;scanner&quot; group in /etc/group.
&gt; 
Mine does:
/dev/bus/usb/002:
total 0
crw-r--r-- 1 root root    189, 128 Oct 15 01:28 001
crw-rw---- 1 root scanner 189, 133 Oct 15 15:10 006

and non-root user is in the scanner group

But that is only because I have a rule for the scanner. Had to write a rule a long time back to get it working. Wasn&apos;t the case with my camera though, before the libusb change it worked without a rule using gphoto2.

You sure you don&apos;t have a rule for the scanner that is making this work? 
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>empx@gmx.de</who>
            <bug_when>2006-10-16 10:54:28 0000</bug_when>
            <thetext>(In reply to comment #29)
&gt; That&apos;s because gphoto 2.2.0 has been made to work with the udev stuff

Hm, i have gphoto 2.2.0 and nevertheless i had to manually create an udev rule so the usb device for my camera is created with the right group.. (it defaults to being owned by group root)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zarhan@iki.fi</who>
            <bug_when>2006-10-16 13:05:33 0000</bug_when>
            <thetext>(In reply to comment #31)
&gt; (In reply to comment #29)
&gt; &gt; That&apos;s because gphoto 2.2.0 has been made to work with the udev stuff
&gt; 
&gt; Hm, i have gphoto 2.2.0 and nevertheless i had to manually create an udev rule
&gt; so the usb device for my camera is created with the right group.. (it defaults
&gt; to being owned by group root)
&gt; 

Ah, then the package maintainer for gphoto hasnt added the stuff referred to in http://www.gphoto.org/news/


Build system (packagers beware!)

    * You should generate HAL FDI, linux-hotplug usb.usermap, and udev rules now via our program:

       	  ${libdir}/print-camera-list (hal-fdi|usb-usermap|udev-rules)
This obsoletes print-usb-usermap and print-udev-rules.
The hal FDI file should be put into:

	/usr/share/hal/fdi/information/10freedesktop/10-camera-libgphoto2.fdi

...so yes, udev rules need to be created but gphoto has the capability to do it automatically in 2.2.0. If the gphoto ebuild does not do it, I think a new bug should be filed.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zarhan@iki.fi</who>
            <bug_when>2006-10-16 13:07:04 0000</bug_when>
            <thetext>BTW, did you update libgphoto as well when you tested the 2.2?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>empx@gmx.de</who>
            <bug_when>2006-10-16 13:50:52 0000</bug_when>
            <thetext>(In reply to comment #33)
&gt; BTW, did you update libgphoto as well when you tested the 2.2?

Yes, it&apos;s a dependency.

Well, i did some further research now.
the udev rules from libgphoto (i&apos;ve manually added them) just call the /etc/hotplug/usb/usbcam script, however that is already called from another source, so gentoo already had the correct rules i guess.
The usbcam script changes the group of $DEVICE to plugdev - however, $DEVICE is always /proc/bus/usb/..., never /dev/bus/usb/...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>krissn@op.pl</who>
            <bug_when>2006-10-22 13:10:07 0000</bug_when>
            <thetext>Created an attachment (id=100235)
usbcam

&gt; 
&gt; Well, i did some further research now.
&gt; the udev rules from libgphoto (i&apos;ve manually added them) just call the
&gt; /etc/hotplug/usb/usbcam script, however that is already called from another
&gt; source, so gentoo already had the correct rules i guess.
&gt; The usbcam script changes the group of $DEVICE to plugdev - however, $DEVICE is
&gt; always /proc/bus/usb/..., never /dev/bus/usb/...
&gt; 

The script is called, but there is something missing. When it&apos;s called from the hotplug agent, $DEVICE is set to /proc/bus/usb...., but when called from udev the device path resides in $DEVNAME.
This updated /etc/hotplug/usb/usbcam script does the job.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>krissn@op.pl</who>
            <bug_when>2006-10-22 13:15:45 0000</bug_when>
            <thetext>Created an attachment (id=100236)
usbcam

Removed some debug stuff I accidentally left behind.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrick.lorazo@polymtl.ca</who>
            <bug_when>2006-10-28 16:15:54 0000</bug_when>
            <thetext>(In reply to comment #26)
&gt; (In reply to comment #9)
&gt; &gt; i got the same problem, downgrading to libsusb-0.1.11 works fine for me, on
&gt; &gt; 0.1.12 i couldn&apos; acces even my camera had to do udev rule but this is not ok
&gt; &gt; 
&gt; 
&gt; Downgrading didn&apos;t help (x86). I&apos;m still not able to acces my ZenExtra as
&gt; normal user. I did a revdep-rebuild too.
&gt; 
&gt; Any suggestion?
&gt; 

Hello,

I confirm: downgrading to libusb-0.1.11 (or even libusb-0.1.10a) also did NOT fix the problem (x86). However, setting &quot;USB_DEVFS_PATH=/proc/bus/usb&quot; does provide a temporary solution.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>empx@gmx.de</who>
            <bug_when>2006-10-29 06:09:18 0000</bug_when>
            <thetext>(In reply to comment #36)
&gt; Created an attachment (id=100236) [edit]
&gt; usbcam

I can confirm that this works, together with gphotos udev rules which you get by doing:

/usr/lib/libgphoto2/print-camera-list udev-rules &gt; /etc/udev/rules.d/libgphoto2.rules</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>manouchk@gmail.com</who>
            <bug_when>2006-10-31 18:45:04 0000</bug_when>
            <thetext>I have libusb-0.1.12  installed and can scan with my HP 1410 as normal user. Looks like I cannot reproduce the problem here.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>constantine@soon.com</who>
            <bug_when>2006-11-01 00:58:40 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; emerging libusb-0.1.12 causes the famous &quot;can&apos;t scan as non-root&quot; permissions
&gt; problem. Reversion to libusb-0.1.11 fixes the problem.

Running amd64, libusb-0.1.11, libgphoto2-2.1.6-r1, gphoto2-2.1.6 =&gt; non-root user can NOT access a digital camera whereas root can.

Entries in /proc/bus/usb are 664 root:plugdev
Entries in /dev/bus/usb are 664 root:root

chmod&apos;ing the /dev/bus/usb to 666 gives access, presumably changing the group to plugdev would do the same.

I don&apos;t really know how to interpret the 50-udev.rules file but there is only one entry for usb_devices that I can see.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrick.lorazo@polymtl.ca</who>
            <bug_when>2006-11-01 09:36:28 0000</bug_when>
            <thetext>(In reply to comment #39)
&gt; I have libusb-0.1.12  installed and can scan with my HP 1410 as normal user.
&gt; Looks like I cannot reproduce the problem here.
&gt; 
With libusb-0.1.12 (x86), I can as well scan with my HP PSC 1210. However, I cannot access my digital camera (unless I become root).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cweiske@cweiske.de</who>
            <bug_when>2006-11-02 12:21:47 0000</bug_when>
            <thetext>I do have the same problem: not being able to access the digital camera via gphoto2. I did have libusb-0.1.12 installed, but downgrading to 0.1.11 doesn&apos;t help. Changing permissions of /dev/bus/usb/ did actually help, so it seems to me as if libusb-0.1.11 does have the same problem.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cweiske@cweiske.de</who>
            <bug_when>2006-11-02 12:32:55 0000</bug_when>
            <thetext>Ok, it also doesn&apos;t change when going back to 0.1.10a or 0.1.8 - so the root of the problem must be something different.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mbray451@sbcglobal.net</who>
            <bug_when>2006-11-04 21:25:53 0000</bug_when>
            <thetext>(In reply to comment #42)
&gt; I do have the same problem: not being able to access the digital camera via
&gt; gphoto2. I did have libusb-0.1.12 installed, but downgrading to 0.1.11 doesn&apos;t
&gt; help. Changing permissions of /dev/bus/usb/ did actually help, so it seems to
&gt; me as if libusb-0.1.11 does have the same problem.
&gt; 

Or the problem lies at least partly elsewhere.  Using either libusb 0.1.12 or 0.1.11, I can only access my camera as non-root with stable udev and a line in 10-local.rules for my camera.  Until recently was able to do so without the local rule and using udev 096-r1.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrick.lorazo@polymtl.ca</who>
            <bug_when>2006-12-24 05:51:01 0000</bug_when>
            <thetext>The problem appears to be fixed since upgrade to gphoto2-2.2.0 and libgphoto2-2.2.1-r1. I can now fully access my digital camera (Nikon Coolpix 4600) as a regular user.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ns@vivid-planet.com</who>
            <bug_when>2006-12-28 07:50:38 0000</bug_when>
            <thetext>libgphoto2-2.2.1-r1 fixed the problem for mee to. (Canon Digital Ixus 55)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-01-15 10:56:06 0000</bug_when>
            <thetext>So... everyone having the problem test w/ libgphoto2-2.2.1-r1 and report back please...
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cweiske@cweiske.de</who>
            <bug_when>2007-01-15 14:18:23 0000</bug_when>
            <thetext>/me still thinks udev is broken. I needed to change the usb_device rule in 50-udev.rules as Spanky suggested it in comment #11</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>decibelshelp@charter.net</who>
            <bug_when>2007-01-15 20:51:54 0000</bug_when>
            <thetext>The only problem I&apos;m having with libgphoto2-2.2.1-r1 is the rules: get whole bunch of these during gentoo part of bootup: udevd[1094]: add_to_rules: unknown key &apos;ATTRS{idVendor}&apos;, in &apos;ATTRS{idVendor}&apos;

Was helping out someone else getting this and they had this version. I upgraded and got it also. Can&apos;t remember order of things right now, but downgraded back to orig and still got it (perhaps orphaned udev rule file) and then removed 99-libgphoto2.rules file and error messages gone. Camera still worked, didn&apos;t need rules.

Was just thinking. I don&apos;t need a rule for my camera, perhaps this error is because don&apos;t have a rule?? If I don&apos;t have to have a rule for my camera I don&apos;t think udev or libgphoto2 should be forcing me to make one just so it doesn&apos;t produce those errors. Camera worked with or without the error messages anyway. 

Otherwise, camera works with that version of libgphoto2, but 2 boxes I know of get that output during boot with it. But right now haven&apos;t tested downgrading again after deleting the udev rule file to see if it puts one there or leaves an orphaned file. 

Ice storm of the centry hit us and have been without power for 2 1/2 days, will test out later. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>bjt23@cornell.edu</who>
            <bug_when>2007-01-21 03:08:16 0000</bug_when>
            <thetext>I&apos;m having the same problem, and spent several hours searching the forums and other sources for a solution.  The USB_DEFVS_PATH env var works, but as mentioned here, isn&apos;t ideal.  This udev rule works for me:

SUBSYSTEM==&quot;usb_device&quot;, DRIVER!=&quot;usbhid&quot;, DRIVER!=&quot;hub&quot;, DRIVER!=&quot;hci_usb&quot;, PROGRAM=&quot;/bin/sh -c &apos;K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}&apos;&quot;, NAME=&quot;%c&quot;, GROUP=&quot;plugdev&quot;, MODE=&quot;0664&quot;

I put it in /etc/udev/rules.d/10-local.rules.  The idea here is that it doesn&apos;t set change the permissions on things like mice, keyboards, the USB hub itself, and (in my case) the hci_usb Bluetooth device.  It&apos;s probably not security-conscious enough for everyone, but it lets me have access to any camera plugged in, not just particular models.  Other libusb-based devices should work just as well.

Since the original rule is still in 50-udev.rules, other devices will get the default permissions.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nixnut@gentoo.org</who>
            <bug_when>2007-03-02 20:01:37 0000</bug_when>
            <thetext>Removing ppc from. Feel free to add us back if something ppc specific needs to be done.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nixnut@gentoo.org</who>
            <bug_when>2007-03-02 20:58:27 0000</bug_when>
            <thetext>really removing ppc now :/
sorry for the bugspam</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-03-16 12:21:29 0000</bug_when>
            <thetext>Reopen if you can reproduce with &gt;=udev-104-r12; make sure you have *no* stale/orphaned files in /etc/udev/rules.d, that you&apos;ve emerged udev with --noconfmem, that you&apos;ve run etc-update or dispatch-conf after the upgrade and merged all the updated properly and rebooted the box after that.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mj@neandertech.com</who>
            <bug_when>2007-03-18 17:59:30 0000</bug_when>
            <thetext>Works fine for me now!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>altstadt@telus.net</who>
            <bug_when>2007-04-01 14:12:44 0000</bug_when>
            <thetext>(Spring cleaning.)

This works for me too.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>100235</attachid>
            <date>2006-10-22 13:10 0000</date>
            <desc>usbcam</desc>
            <filename>usbcam</filename>
            <type>text/plain</type>
            <data encoding="base64">IyEvYmluL2Jhc2gKIyAkSWQ6IHVzYmNhbS5ncm91cCA2NzY2IDIwMDMtMDktMTYgMTY6NDI6NDRa
IGh1biAkCiMKIyAvZXRjL2hvdHBsdWcvdXNiL3VzYmNhbQojCiMgU2V0cyB1cCBuZXdseSBwbHVn
Z2VkIGluIFVTQiBjYW1lcmEgc28gdGhhdCBvbmx5IG1lbWJlcnMgb2YgdGhlIAojIGdyb3VwCgpH
Uk9VUD1wbHVnZGV2CgojIGNhbiBhY2Nlc3MgaXQgZnJvbSB1c2VyIHNwYWNlLiAoUmVwbGFjZSBj
YW1lcmEgd2l0aCB0aGUgbmFtZSBvZiB0aGUKIyBncm91cCB5b3Ugd2FudCB0byBoYXZlIGFjY2Vz
cyB0byB0aGUgY2FtZXJhcy4pCiMKIyBOb3RlIHRoYXQgZm9yIHRoaXMgc2NyaXB0IHRvIHdvcmss
IHlvdSdsbCBuZWVkIGFsbCBvZiB0aGUgZm9sbG93aW5nOgojIGEpIGEgbGluZSBpbiB0aGUgZmls
ZSAvZXRjL2hvdHBsdWcvdXNlcm1hcCB0aGF0IGNvcnJlc3BvbmRzIHRvIHRoZSAKIyAgICBjYW1l
cmEgeW91IGFyZSB1c2luZy4gWW91IGNhbiBnZXQgdGhlIGNvcnJlY3QgbGluZXMgZm9yIGFsbCBj
YW1lcmFzIAojICAgIHN1cHBvcnRlZCBieSBsaWJncGhvdG8yIGJ5IHJ1bm5pbmcgInByaW50LXVz
Yi11c2VybWFwIi4KIyBiKSBhIGdyb3VwICJjYW1lcmEiIHdoZXJlIGFsbCB1c2VycyBhbGxvd2Vk
IGFjY2VzcyB0byB0aGUKIyAgICBjYW1lcmEgYXJlIGxpc3RlZAojIGMpIGEgTGludXgga2VybmVs
IHN1cHBvcnRpbmcgaG90cGx1ZyBhbmQgdXNiZGV2ZnMKIyBkKSB0aGUgaG90cGx1ZyBwYWNrYWdl
IChodHRwOi8vbGludXgtaG90cGx1Zy5zb3VyY2Vmb3JnZS5uZXQvKQojCiMgSW4gdGhlIHVzZXJt
YXAgZmlsZSwgdGhlIGZpcnN0IGZpZWxkICJ1c2IgbW9kdWxlIiBzaG91bGQgYmUgbmFtZWQgCiMg
InVzYmNhbSIgbGlrZSB0aGlzIHNjcmlwdC4KIyAKCiNlY2hvICJBY3Rpb246ICR7QUNUSU9OfSwg
ZGV2aWNlOiAke0RFVklDRX0sIGRldnBhdGg6ICR7S0VSTkVMfSIgPj4gL3RtcC91c2JjYW0ubG9n
CiNzZXQgPj4gL3RtcC91c2JjYW0ubG9nCgppZiBbICIke0FDVElPTn0iID0gImFkZCIgXSAmJiBb
IC1mICIke0RFVklDRX0iIF0KdGhlbgogICAgY2htb2Qgby1yd3ggIiR7REVWSUNFfSIKICAgIGNo
Z3JwICIke0dST1VQfSIgIiR7REVWSUNFfSIKICAgIGNobW9kIGcrcncgIiR7REVWSUNFfSIKZmkK
CmlmIFsgIiR7QUNUSU9OfSIgPSAiYWRkIiBdICYmIFsgLWMgIiR7REVWTkFNRX0iIF0KdGhlbgog
ICAgY2htb2Qgby1yd3ggIiR7REVWTkFNRX0iCiAgICBjaGdycCAiJHtHUk9VUH0iICIke0RFVk5B
TUV9IgogICAgY2htb2QgZytydyAiJHtERVZOQU1FfSIKZmkK
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>100236</attachid>
            <date>2006-10-22 13:15 0000</date>
            <desc>usbcam</desc>
            <filename>usbcam</filename>
            <type>text/plain</type>
            <data encoding="base64">IyEvYmluL2Jhc2gKIyAkSWQ6IHVzYmNhbS5ncm91cCA2NzY2IDIwMDMtMDktMTYgMTY6NDI6NDRa
IGh1biAkCiMKIyAvZXRjL2hvdHBsdWcvdXNiL3VzYmNhbQojCiMgU2V0cyB1cCBuZXdseSBwbHVn
Z2VkIGluIFVTQiBjYW1lcmEgc28gdGhhdCBvbmx5IG1lbWJlcnMgb2YgdGhlIAojIGdyb3VwCgpH
Uk9VUD1wbHVnZGV2CgojIGNhbiBhY2Nlc3MgaXQgZnJvbSB1c2VyIHNwYWNlLiAoUmVwbGFjZSBj
YW1lcmEgd2l0aCB0aGUgbmFtZSBvZiB0aGUKIyBncm91cCB5b3Ugd2FudCB0byBoYXZlIGFjY2Vz
cyB0byB0aGUgY2FtZXJhcy4pCiMKIyBOb3RlIHRoYXQgZm9yIHRoaXMgc2NyaXB0IHRvIHdvcmss
IHlvdSdsbCBuZWVkIGFsbCBvZiB0aGUgZm9sbG93aW5nOgojIGEpIGEgbGluZSBpbiB0aGUgZmls
ZSAvZXRjL2hvdHBsdWcvdXNlcm1hcCB0aGF0IGNvcnJlc3BvbmRzIHRvIHRoZSAKIyAgICBjYW1l
cmEgeW91IGFyZSB1c2luZy4gWW91IGNhbiBnZXQgdGhlIGNvcnJlY3QgbGluZXMgZm9yIGFsbCBj
YW1lcmFzIAojICAgIHN1cHBvcnRlZCBieSBsaWJncGhvdG8yIGJ5IHJ1bm5pbmcgInByaW50LXVz
Yi11c2VybWFwIi4KIyBiKSBhIGdyb3VwICJjYW1lcmEiIHdoZXJlIGFsbCB1c2VycyBhbGxvd2Vk
IGFjY2VzcyB0byB0aGUKIyAgICBjYW1lcmEgYXJlIGxpc3RlZAojIGMpIGEgTGludXgga2VybmVs
IHN1cHBvcnRpbmcgaG90cGx1ZyBhbmQgdXNiZGV2ZnMKIyBkKSB0aGUgaG90cGx1ZyBwYWNrYWdl
IChodHRwOi8vbGludXgtaG90cGx1Zy5zb3VyY2Vmb3JnZS5uZXQvKQojCiMgSW4gdGhlIHVzZXJt
YXAgZmlsZSwgdGhlIGZpcnN0IGZpZWxkICJ1c2IgbW9kdWxlIiBzaG91bGQgYmUgbmFtZWQgCiMg
InVzYmNhbSIgbGlrZSB0aGlzIHNjcmlwdC4KIyAKCmlmIFsgIiR7QUNUSU9OfSIgPSAiYWRkIiBd
ICYmIFsgLWYgIiR7REVWSUNFfSIgXQp0aGVuCiAgICBjaG1vZCBvLXJ3eCAiJHtERVZJQ0V9Igog
ICAgY2hncnAgIiR7R1JPVVB9IiAiJHtERVZJQ0V9IgogICAgY2htb2QgZytydyAiJHtERVZJQ0V9
IgpmaQoKaWYgWyAiJHtBQ1RJT059IiA9ICJhZGQiIF0gJiYgWyAtYyAiJHtERVZOQU1FfSIgXQp0
aGVuCiAgICBjaG1vZCBvLXJ3eCAiJHtERVZOQU1FfSIKICAgIGNoZ3JwICIke0dST1VQfSIgIiR7
REVWTkFNRX0iCiAgICBjaG1vZCBnK3J3ICIke0RFVk5BTUV9IgpmaQo=
</data>        

          </attachment>
    </bug>

</bugzilla>