Solved -- Permission problem with Avision AV220 Scanner
I had a problem with the permissions set to the Avision AV220 scanner.
When connected, it was recognized, but owner was root:root and permissions of the device were 644.
The AV220 is only supported for sane version >= 1.0.16. When I tried to install this version, dpkg insisted on removing my old 2.4.27 kernel.
Assuming dpkg is right in such things, I installed kernel 2.6.12, but hotplugging of usb is different from 2.4.*
This is (at least partially) how it works:
When a new usb device is detected, /sbin/hotplug is called with parameter 'usb'. This script calls scripts which reside in named /etc/hotplug.d/usb/*.hotplug
The relevant script here is libsane.hotplug.
libsane.hotplug scans the sane config file which is in /etc/sane.d/hotplug/libsane.db
The latter file contains:
(a) the vendor id and product id for each supported scanner
(b) the owner:group and permissions it should assign to each newly created device.
If libsane.hotplug finds the scanned VID and PID here, it assigns the correct owner and permissions to the new device. If not, not and the owner remains root:root with 644 permissions.
(Since the correct driver is loaded, and the scanner can be operated as root, there is some more to hotplugging than what I describe here)
By adding these lines to libsane.db
# Avision AV220
0x0638 0x0a23 root:scanner 0666
the device is created correctly, and all users are able to use the scanner.
Note that I set the permissions to 666. For unknown reasons, 664 won't let me access the scanner, although I am member of the scanner group. Same thing for my other scanners on this machine.
I know a lot of people have problems with these scanner permissions, but I have not seen yet a pointer to change libsane.db.