Scanning permissions problem

Q I have recently changed from SUSE 10.0 to OpenSUSE 10.2 via a re-install. My CanoScan N640P scanner worked well with XSane/SANE under SUSE 10.0, but will now only work with root privileges. SANE support for this scanner is good. The XSane/SANE releases are as supplied by the distro, viz 0.991-32 i586 and 1.0.18-34 i586. I performed an online update soon after the install. The SUSE 10.0 SANE version was 1.0.15-20.2 i586. Yast2 configures the scanner correctly - manually added to give device 'canon_pp: parport0' - and tests OK with scanimage -d canon_pp:parport0 -T.

Also, I can run this command successfully from the command line with root privileges but not as a normal user. When I invoke XSane as a normal user I get the message 'no devices available' with six possible reasons given. Of these the third, 'the permissions of the device file do not allow you to use it - try root' seems most likely. However, I can't find a device file for the scanner. Also, as far as I can tell, all the configuration files are set up correctly. I have tried all four settings of the parallel port - normal, ECP (DMA3), ECP/EPP and EPP in the BIOS, all with the same result.

A You are right in thinking this is a permissions problem. I had exactly the same with my Canon USB scanner. The scanner device should be /dev/parport0 (although it is possible that on some distro setups it is /dev/lp0). Running

ls -l /dev/{par,lp}*

will show you all relevant devices and their permissions. You would normally see something like

'crw-rw---- 1 root lp 99, 0 Jan 27 11:37 /dev/parport0'

This shows that the device is only readable by root and members of the lp group. In this case, the simplest solution is to add yourself to the lp group with

gpasswd -a yourusername lp

Some distros use a 'scanner' group instead of lp, in which case you should make the obvious change to the above command. This only affects new logins, so log out of your desktop and back in again. Then try

scanimage --list-devices

as root and as your normal user. You should see the scanner listed both times. If the device is owned by root:root or the permissions are not rw-rw----, you need to change these, which you can do with a suitable udev rule. Add this line to /etc/udev/rules.d/10/local.rules:

KERNEL=="parport0", GROUP:="scanner",
MODE:="660", SYMLINK:="scanner"

This sets /dev/parport0 to have rw-rw---- permissions and to belong to the scanner group. It also creates a /dev/scanner symlink, which some software looks for. For more details on udev rules, see the answer to Moving Tablet on page 105. If your dDisco inferno!evice is not parport0 or lp0, you should be able to find it with

dmesg | grep -i -C 3 -e parport -e canon -e sane

Back to the list