Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#3600 - sane permissions problem

Attached to Project: Arch Linux
Opened by Matiss Piesins (piesis) - Thursday, 08 December 2005, 22:31 GMT
Last edited by Dale Blount (dale) - Friday, 09 December 2005, 02:24 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

There are two permission-related problems with sane package:

1) scanner group not added after initial install

2) wrong group id on /usr/var/lock/sane

The first arises from, IMHO, a mistake in sane.install script (here the original):
**************************************************************************
# arg 1: the new package version
post_install() {
/bin/cat <<THEEND
NOTE
----
If you use a usb scanner and hotplug then add your user to group 'scanner'
or change the /etc/hotplug/usb/libusbscanner to your needs. If your scanner
is not listed in /etc/hotplug/usb/libsane.usermap add a line for it.
THEEND
}

# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
post_install $1
if [ ! "`grep scanner etc/group`" ]; then
echo "adding new group: scanner"
usr/sbin/groupadd -g 96 scanner >/dev/null 2>&1
fi
}

# arg 1: the old package version
pre_remove() {
/bin/true
}

# arg 1: the old package version
post_remove() {
/bin/true
}

op=$1
shift
$op $*
********************************************************
I think the part which checks for the scanner group and adds it should be inside of post_install() { that is - here }.
Currently it, supposedly, gets executed only after an upgrade - however, I am new to Arch...

BTW- since migration to udev with sane-1.0.16-3 that text needs corrections.

The second problem was my main grief with this - group permissions on usb device and me were correct, yet I couldn't use my scanner as a user.
The solution was to
# chown root:scanner /usr/var/lock/sane
because, by default, it belongs to some mystical group "14"...
This, from what I understood from `strace scanimage -L`, affects only sane-plustek supported scanners, including Canon LiDE 20
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Monday, 19 December 2005, 07:36 GMT
Reason for closing:  Fixed
Comment by Tobias Powalowski (tpowa) - Friday, 09 December 2005, 06:32 GMT
hmm my scanner works here, are you using udev-076?
if yes have you installed everything else like kernel from testing too?
the message will be changed with next sane major release that happens in 11 days.
add the scanner group and put your user into it and try again.
yes the group is not there, seems scanner was removed from initial group file, so it's needed on install again.
Comment by Matiss Piesins (piesis) - Friday, 09 December 2005, 08:27 GMT
Yes, I have both kernel and udev from testing, though it's not relevant to the second problem.
I'm also in the scanner group myself, and I had the scanner group in /etc/group, as I (rather unclearly :) wrote.
The permissions on /proc/bus/usb/BBB/DDD were set correctly too.

The fact is - the "plustek" backend needs that lock directory writable, else it won't do a thing.
Supposedly, not all backends need this directory, therefore some scanners may work, some may not.
Comment by Jan de Groot (JGC) - Friday, 09 December 2005, 08:39 GMT
Checking for scanner group shouldn't be done using grep /etc/group, but with a nice "getent group scanner" command. Look in the hal .install file how to do this.
when using getent to resolve the group, it also looks in additional NSS modules, which is wanted by those people who use ldap or NIS or whatever central account storage they use.

Loading...