LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   One scanner can be run as user, the other not (http://www.linuxquestions.org/questions/showthread.php?t=4175445185)

jlinkels 01-11-2013 02:55 PM

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

jlinkels 01-12-2013 02:24 PM

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


All times are GMT -5. The time now is 06:57 PM.