LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-11-2013, 02:55 PM   #1
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,086

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
One scanner can be run as user, the other not


Running Debian Squeeze, kernel 2.6.32-5-amd64. Sane version 1.0.14.

I have a Canon scanner which is working as user. Using plustek backend.

I have an Avision AV220 sheetfed scanner which is working as root only.

These are the devices in /dev/bus/usb:
Code:
Canon (as user):
crw-rw-r--+ 1 root scanner 189, 257 Jan 11 20:43 /dev/bus/usb/003/002
Avision (only as root):
crw-rw-r-- 1 root scanner 189, 6 Jan 11 20:43 /dev/bus/usb/001/007
Permissions are identical, except for the '+' at the end of the Canon permissions. No idea what it means. It should be ACL, but I don't use ACL at the system.

These are the relevant lines from /lib/udev/rules.d/libsane.rules:
Code:
Canon:
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2220", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
Avision:
ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a23", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
Output from udevadm:
Canon:
Code:
P: /devices/pci0000:00/0000:00:1d.1/usb3/3-2
N: bus/usb/003/002
S: char/189:257
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-2
E: MAJOR=189
E: MINOR=257
E: DEVNAME=/dev/bus/usb/003/002
E: DEVTYPE=usb_device
E: DRIVER=usb
E: DEVICE=/proc/bus/usb/003/002
E: PRODUCT=4a9/2220/100
E: TYPE=255/0/255
E: BUSNUM=003
E: DEVNUM=002
E: SUBSYSTEM=usb
E: ID_VENDOR=Canon
E: ID_VENDOR_ENC=Canon
E: ID_VENDOR_ID=04a9
E: ID_MODEL=CanoScan
E: ID_MODEL_ENC=CanoScan
E: ID_MODEL_ID=2220
E: ID_REVISION=0100
E: ID_SERIAL=Canon_CanoScan
E: ID_BUS=usb
E: ID_USB_INTERFACES=:ff00ff:
E: libsane_matched=yes
E: DEVLINKS=/dev/char/189:257
E: TAGS=:udev-acl:
Avision:
Code:
P: /devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8.3
N: bus/usb/001/007
S: char/189:6
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8.3
E: MAJOR=189
E: MINOR=6
E: DEVNAME=/dev/bus/usb/001/007
E: DEVTYPE=usb_device
E: DRIVER=usb
E: DEVICE=/proc/bus/usb/001/007
E: PRODUCT=638/a23/1
E: TYPE=0/0/0
E: BUSNUM=001
E: DEVNUM=007
E: SUBSYSTEM=usb
E: ID_VENDOR=AVISION
E: ID_VENDOR_ENC=AVISION\x20
E: ID_VENDOR_ID=0638
E: ID_MODEL=AV220
E: ID_MODEL_ENC=AV220
E: ID_MODEL_ID=0a23
E: ID_REVISION=0001
E: ID_SERIAL=AVISION_AV220_0000000000000000
E: ID_SERIAL_SHORT=0000000000000000
E: ID_BUS=usb
E: ID_USB_INTERFACES=:000000:
E: libsane_matched=yes
E: DEVLINKS=/dev/char/189:6
E: TAGS=:udev-acl:
The only way I can make this Avision working as user is to give the world access to /dev/bus/usb/001/007.

Somehow I think the '+' at the end of the permissions for Canon is providing the access, but I don't see why Canon does get that '+' while Avision is not. Udev rules and anything else seem identical to me.

jlinkels
 
Old 01-12-2013, 02:24 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,086

Original Poster
Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
It turned out that on the system, the scanner group had a GID of 117. However since the users are authenticated by NIS the users were member of the NIS scanner group, which had a different GID. For some obscure reasons.

When UDEV set the permissions, it used the local definition for the scanner GID, while the users used the NIS definition. Setting the correct GID on the NIS server solved the problem.

Why one scanner could be accessed and the other not is still unclear. At a certain moment in the debugging process the Canon stopped being accessible as well. Which is not understood, but at least it became consistent.

The '+' character in the permissions string is not understood either, but at least I noticed that this '+' does appear when the devices (both now) are plugged in during booting. It does not appear while a scanner (either one) is being plugged in after boot.

jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run printer or scanner in linux tarunrai31 Linux - Newbie 3 01-01-2008 06:42 AM
why do i have to unload usblp module to run scanner? SharpyWarpy Fedora 0 12-07-2007 07:55 PM
scanner under user level ohcarol Linux - Hardware 1 11-29-2005 03:58 PM
Canon scanner won't run in Suse ruthmck Linux - Newbie 2 10-24-2005 09:42 PM
How to run CanoScan 3200F scanner? Linuxshark Linux - Hardware 2 07-13-2004 06:47 AM


All times are GMT -5. The time now is 05:12 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration