udev and scanner - only as root since upgrade to -current
Hi to all,
I'm having this silly problem since I upgraded to -current a few days ago. My scanner (Canon LiDE 20) is only working as root, not as any other user. scanimage -L doesn't find my scanner as a normal user. as root it returns: Code:
device `plustek:libusb:002:004' is a Canon N670U/N676U/LiDE20 USB flatbed scanner udev creates /dev/usbdev2.4 with owner=root, group=scanner, mode=660 But I found /dev/bus/usb/002/004 is root.root mode 644 When I do "chmod 666 /dev/bus/usb/002/004" it is recognized by any normal user and evrything works fine until my next boot. I checked /etc/udev/rules.d/80-libsane.rules and there is a line saying: Code:
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="220d", MODE="660", GROUP="scanner" This all worked fine before upgrading to -current Any ideas? |
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. |
Run this and post all output.
This is probably something missing in the 80-libsane.rules (perhaps they haven't caught up to changes in latest udev) Code:
udevinfo --query=all --attribute-walk --name /dev/bus/usb/002/004 |
Hi,
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. Thanks Piter PUNK |
Well, Robby Workman and Piter PUNK replying to my thread... I'm honored! :cool:
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 Quote:
Hopefully we can find a solution! :scratch: Edit: I just found that changing this line: Code:
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" Code:
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0666" But is it supposed to work this way? Now I am giving rw access to everybody... |
Similar problem?
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!! |
Hi niels.horn,
quite good! This is also the solution for my camera in current udev! http://www.linuxquestions.org/questi...-gtkam-594315/ Thank you very much! Fluxx. |
Solved or hacked?
Quote:
Quote:
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" What do you think? |
Please still send the requested information - mail it to PiterPunk (piterpunk@) and CC me (rworkman@)
|
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.
|
For the time being, this *should* work for you - put this in a 90-local.rules file:
Code:
SUBSYSTEM=="usb" \ |
Thanks Robby,
I have just spent a lot of time finding that this works for me. ~$ cat /etc/udev/rules.d/90-local.rules Code:
# Custom rule to assign privileges to scanner device file |
Quote:
http://slackware.com/~piterpunk/udev/testing 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 |
To Robby Workman:
Quote:
I'll send the info in a few moments by e-mail. Thanks for the help until now! |
Quote:
We were exchanging random thoughts on IRC and suddenly there was a flash of light, and PiterPunk had the solution. ;-) See his post above. |
PiterPunk,
I will try the rules tonight after work. It looks as though you have edited the files to use ATTR in place of SYSFS. I did try commenting out the line for my Brother DCP-110C in 80-libsane.rules and replacing it with a line with ATTR in place of SYSFS, but I still needed to apply the custom rule to set the privileges. |
ok, thanks Robby and Piter for your help!
I think we have a decent solution for this little problem now :-) |
To Robby and Piter:
I forgot to mention that I changed the line just a little. Instead of: Code:
GROUP:="plugdev" MODE:="0664" Code:
GROUP="plugdev" MODE="0664" Now a more generic doubt: This works fine for my scanner. But what about any other equipment? If I buy another scanner / digital camera / whatever, do I need to add a new custom rule like this? Or is there a generic rule I can change? |
Quote:
I figured it probably wasn't necessary, but at the time, it couldn't hurt :) Quote:
|
Piter Punk,
Thanks for your involvement in this as well as all the good work you do to benefit us all! To other readers, I apologise for the long post. This is the results of the testing that I have done. First- Output of lsusb and ls -l when /etc/udev/rules.d contains the defaults in Slackware current where my Brother DCP-110C scanner is not available to users other than root. Quote:
Quote:
Quote:
Quote:
The change from SYSFS to ATTR does have have an effect on privileges at the /dev/usbdev* level, but the use of a custom rule allows the privileges to be set at the /dev/bus/usb/* level so that the scanner can be used by users other than root via programs such as scanimage, xsane and kooka. |
I solved this problem changing in /etc/udev/rules.d/80-libsane.rules
Code:
SUBSYSTEM!="usb_device", GOTO="libsane_rules_end" Code:
SUBSYSTEM!="usb", GOTO="libsane_rules_end" |
I am still having this problem. I have not yet replied to this post, because I had to role back to an older kernel due to my wireless card, and I was afraid that was why these solutions weren't working. Anyway, I've got the card working on 2.6.25, so I'd like to fix this problem now.
I have tried all the solutions mentioned here to no avail. The only thing here that changes my computer's behavior at all is Piter Punk's rules, which cause the /dev/usb* entry to show root group instead of scanner group. One thing I notice is that you are all talking about /dev/bus/usb/xxx/yyy, but on my computer I do not have this directory, rather I have /proc/bus/usb/xxx/yyy. So do I have a misconfigured kernel? Everything else is stock slackware. This is not an upgrade from a prior Slack version (well, it is an upgrade from 12.1 rc1 or rc2). Brian |
Quote:
|
I just found this thread, while trying to get my scanner working as regular user, instead of only root.
Scanner is Canon LIDE25, OS is Slackware 12.1 I found the simple solution; just add your username to the scanner group. Open /etc/group, find the line that starts "scanner", and append your username to the end of the line (after a comma if you are not the only user in this group). Then logout, and log in again (or reboot). Posting this in case it helps someone. |
All times are GMT -5. The time now is 02:16 PM. |