udev and scanner - only as root since upgrade to -current
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am having a similiar difficulty with my Brother DCP-110C printer/scanner.
As root, everything works just fine.
However, for a normal user (who is a member of the scanner group) to access the scanner, I have found that I need to execute 'chgrp scanner /dev/bus/usb/xxx/yyy' where xxx is the Bus number and yyy is the device number reported by 'lsusb'.
It appears that an alteration to the udev rules is required (maybe in 65-permissions.rules or else by creation of 90-local.rules), but I do not have a solution at this time.
Can you make available a tar.gz from your /dev and your /etc/udev?
this is important to me to see and discover what is happening.
If you can send your /etc/group is good, too.
Well, Robby Workman and Piter PUNK replying to my thread... I'm honored!
udevinfo --query=all --attribute-walk --name /dev/bus/usb/002/005 (after unplugging and plugging my scanner changed to 002/005) gives:
Code:
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:10.1/usb2/2-2':
KERNEL=="2-2"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{product}=="CanoScan"
ATTR{manufacturer}=="Canon"
ATTR{quirks}=="0x1"
ATTR{maxchild}=="0"
ATTR{version}==" 1.10"
ATTR{devnum}=="5"
ATTR{busnum}=="2"
ATTR{speed}=="12"
ATTR{bMaxPacketSize0}=="8"
ATTR{bNumConfigurations}=="1"
ATTR{bDeviceProtocol}=="ff"
ATTR{bDeviceSubClass}=="00"
ATTR{bDeviceClass}=="ff"
ATTR{bcdDevice}=="0100"
ATTR{idProduct}=="220d"
ATTR{idVendor}=="04a9"
ATTR{bMaxPower}=="500mA"
ATTR{bmAttributes}=="a0"
ATTR{bConfigurationValue}=="1"
ATTR{bNumInterfaces}==" 1"
ATTR{configuration}==""
ATTR{dev}=="189:132"
looking at parent device '/devices/pci0000:00/0000:00:10.1/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{serial}=="0000:00:10.1"
ATTRS{product}=="UHCI Host Controller"
ATTRS{manufacturer}=="Linux 2.6.23.1-smp uhci_hcd"
ATTRS{quirks}=="0x0"
ATTRS{maxchild}=="2"
ATTRS{version}==" 1.10"
ATTRS{devnum}=="1"
ATTRS{busnum}=="2"
ATTRS{speed}=="12"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bNumConfigurations}=="1"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceClass}=="09"
ATTRS{bcdDevice}=="0206"
ATTRS{idProduct}=="0000"
ATTRS{idVendor}=="0000"
ATTRS{bMaxPower}==" 0mA"
ATTRS{bmAttributes}=="e0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{configuration}==""
ATTRS{dev}=="189:128"
looking at parent device '/devices/pci0000:00/0000:00:10.1':
KERNELS=="0000:00:10.1"
SUBSYSTEMS=="pci"
DRIVERS=="uhci_hcd"
ATTRS{msi_bus}==""
ATTRS{broken_parity_status}=="0"
ATTRS{enable}=="1"
ATTRS{modalias}=="pci:v00001106d00003038sv00001106sd00003038bc0Csc03i00"
ATTRS{local_cpus}=="ffffffff"
ATTRS{irq}=="18"
ATTRS{class}=="0x0c0300"
ATTRS{subsystem_device}=="0x3038"
ATTRS{subsystem_vendor}=="0x1106"
ATTRS{device}=="0x3038"
ATTRS{vendor}=="0x1106"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
ATTRS{uevent}==""
To Piter:
Quote:
Can you make available a tar.gz from your /dev and your /etc/udev?
this is important to me to see and discover what is happening.
If you can send your /etc/group is good, too.
I can send it to an e-mail address if you want (the one that is in the man page of slackpkg?)
I am a newbie, so please forgive me if I am misunderstanding this. If I am following correctly, the USB device(s) are getting mounted with root access only?
I ask this because I am using the avidownload program from sourceforge to download videos off a hacked 1-time use CVS video camera. If I don't run the application as root, it won't open the device. This all uses libusb.
Because it downloads videos to a directory in the users' directory tree, the user now ends up with files he can't delete, etc., because they are owned by root.
Does this sound like a similar problem (I thought it did)?
BTW - I'm running Ubuntu 7.10. Can you point me to the place where I would make the above change?
Thanks!
Dave
EDIT: SOLVED - yes!, this was the problem. In Ubuntu I had to edit /etc/udev/rules.d/40-permissions.rules. Works like a champ! Thanks, guys!!
Last edited by anewguy; 10-25-2007 at 02:43 AM.
Reason: SOLVED
quite good! This is also the solution for my camera in current udev!
Well, at least I made some people happy.
But I'm not very proud of my solution, it's more like a hack.
Maybe the real experts can give their opinion here about my preoccupation with the security consequences of giving r/w access to a device to everyone.
I know that in a home environment this won't be a problem, but in an office it might be. (In my office I only have read access to the usb ports so that I cannot copy documents to my pendrive)
I thought of changing the rule to give access only to a group called 'usb' (I'd have to create it) with
Code:
MODE="660", GROUP="usb"
in the default-rules line. Then to use the scanner I have to be a member of 'scanner' and 'usb'.
Ok, I'll send the information tonight from home. I agree with your comment in the other thread that what I did is not the ideal solution, just a workaround so that I donīt have to do a chmod everytime I plug in my scanner or reboot.
SYSFS attribute are marked to be obsolete some time ago. Use ATTR is the
preferred way (and now, the only correct way). Some rules shipped with other
packages doesn't fix it yet.
Piter PUNK
Last edited by Piter PUNK; 10-25-2007 at 08:48 PM.
Reason: New information appended
Yes it does. Now the /dev/bus/usb/aaa/bbb is created with mode 664 group plugdev
I'll send the info in a few moments by e-mail.
Thanks for the help until now!
Thank you. At this point, I don't think we need any more information.
We were exchanging random thoughts on IRC and suddenly there was a flash of light, and PiterPunk had the solution. ;-) See his post above.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.