LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   "Bugfix" for sane package in Slackware-14.0 (http://www.linuxquestions.org/questions/slackware-14/bugfix-for-sane-package-in-slackware-14-0-a-4175467306/)

joenew 06-25-2013 06:51 AM

"Bugfix" for sane package in Slackware-14.0
 
Hi all! :)
I've sent two mail to slackware dev team:
One to: volkerdi at slackware dot com
And the other to: info at slackware dot com
Last mail is sent on june 18, but I have not received any reply yet.
So I've decided to report it on this forum, so that someone can help me to contact slack developers.
This first time I report a bug, so... hope there's some user knows how to report it to slackware team.

Anyway I'll report my mail message there, look at following lines ;)
Sorry for my bad english in advance!!!
Bye!

Quote:

Hi!
I'm a slackware user. I've nocticed a problem with my USB scanner:
1- when I plug scanner after system boot all works fine.
2- when scanner is cannected before PC power on I can only use it as "root".

I've asked for a solution at slacky.eu/forum (an Italian/international slackware community). And I've found a similar behavior also on linuxquestion.org.
We have solved by editing udev rules file included in sane package:

sane-1.0.22-i486-5

An other user said you have add a bugfix to this udev rules file:
/lib/udev/rules.d/80-libsane.rules

But this fix affects just current branch of slackware.
---------------------------------------------
Tue Jun 11 21:36:35 UTC 2013

a/ntfs-3g-2013.1.13-i486-1.txz: Upgraded.
Removed the HAL 10-ntfs-3g-policy.fdi file.
xap/sane-1.0.23-i486-3.txz: Rebuilt.
Fixed the build script to apply the add|change fix to 80-libsane.rules
correctly. Thanks to Phil Bevan.
Removed the HAL 10-libsane.fdi file.

--------------------------------------------------------------------

I think there are many stable users too would like to use their scanners properly... ;-)

I've edited that files like your Sane slackbuild script does (I'll report slackbuild lines).

----------------------------------------------------------

# Add the default udev rules. Use group "lp" rather than "scanner" to avoid
# breaking CUPS access for multifunction printer/scanner devices (possibly
# the most common type of scanner these days)
#
# Use ACTION!="add|change" to avoid skipping these rules if coming from an
# initrd where udev was started.
mkdir -p $PKG/lib/udev/rules.d
cat tools/udev/libsane.rules \
| sed -e "s/GROUP=\"scanner\"/GROUP=\"lp\"/g" \
| sed -e "s/MODE=\"0664\"/MODE=\"0660\"/g" \
| sed -e "s/ACTION!=\"add\"/ACTION!=\"add|change\"/g" \
> $PKG/lib/udev/rules.d/80-libsane.rules

------------------------------------

Ok. For my needs I've solved just using ACTION="add|change" instead "ACTION!=add".
Now I can let my scanner connected to my pc usb port and use it also as simple user...
What do you think about a rebuilt of sane package also for slackware stable tree, as you have done for current one?

Hope this report could help you to make slackware better. Thanks for your work!
Sorrry, for my bad english, anyway hope it is clear enough...

Regards! :-D

H_TeXMeX_H 06-26-2013 12:42 PM

So, it doesn't work if you add yourself to the 'scanner' group ?

joenew 06-26-2013 06:27 PM

Hi!
First of all, I've solved. Hope It was clear.
Exactly, it itsn't a problem strictly related to groups but anyway it ragards permissions of scanner device file...
I think right group user must belong is "lp" not "scanner"
Udev should change that file permissions to "root:lp" if I well remember.
And it does it when you plug scanner via usb after system boot.
But it does not if scanner is connected before boot, in this case you have to replug usb scanner cable to use it as simple user, otherwise it works just as root.
I'll report my actual fine working permissions etc:
Code:

root@darkstar:~# lsusb |grep Mustek
Bus 001 Device 005: ID 055f:0002 Mustek Systems, Inc. ScanExpress 600 CU
root@darkstar:~# ls -l /dev/bus/usb/001/005
crw-rw-r-- 1 root lp 189, 4 giu 26 09:15 /dev/bus/usb/001/005
root@darkstar:~# grep -A10 -i mustek.*600.*cu /lib/udev/rules.d/80-libsane.rules |grep 0002
ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0002", MODE="0660", GROUP="lp", ENV{libsane_matched}="yes"

But I've now solved by editing udev rule file. Before this permissions were:
Code:

crw-rw-r-- 1 root root 189, 4 giu 26 09:15 /dev/bus/usb/001/005
Udev rule file involved is
Code:

/lib/udev/rules.d/80-libsane.rules
Above you can see what exactly Pat patch does:
Code:

cat tools/udev/libsane.rules \
| sed -e "s/GROUP=\"scanner\"/GROUP=\"lp\"/g" \
| sed -e "s/MODE=\"0664\"/MODE=\"0660\"/g" \
| sed -e "s/ACTION!=\"add\"/ACTION!=\"add|change\"/g" \
> $PKG/lib/udev/rules.d/80-libsane.rules

I've manually solved by editing that udev rule file changing:
Code:

ACTION!="add"
in
Code:

ACTION!="add|change"
Now udev changes group owning from "root" to "lp" even when scanner is connected before I power on my PC.

A part of this explained.
My post was for ask how exactly let staff know about this bug and suggest to patch also stable branch of slackware not only current one.

How to report a bug (not security related) and suggest a solution to slackware development team?

Anyway thanks for your reply! :)

ljb643 06-26-2013 06:36 PM

Sounds like the same issue as discussed in this thread. A USB scanner was generating a CHANGE rather than ADD action, which did not trigger the sane-provided rule to set the permissions. It is probably specific to certain scanners and/or PCs.

joenew 06-27-2013 03:56 AM

Yes, I've read that thread when I've noticed this problem.
But look at slackware current changelog:
http://slackware.com/changelog/current.php?cpu=i386
I'll report lines about sane package:
Code:

+--------------------------+
Tue Jun 11 21:36:35 UTC 2013
a/ntfs-3g-2013.1.13-i486-1.txz: Upgraded.
      Removed the HAL 10-ntfs-3g-policy.fdi file.
xap/sane-1.0.23-i486-3.txz: Rebuilt.
      Fixed the build script to apply the add|change fix to 80-libsane.rules
      correctly. Thanks to Phil Bevan.
      Removed the HAL 10-libsane.fdi file.
+--------------------------+

So, Pat patched this "bug" about 20 days ago.
If you look at my post above I've reported also a piece of Pat sane slackbuild in which you can see how exactly 80-libsane.rules is edited to fix this bug.
Now, the question is:
why slackware stable branch sane package has not been involved by this fix?
How can I report this directly to slackware staff?

allend 06-27-2013 07:47 AM

Quote:

why slackware stable branch sane package has not been involved by this fix?
Traditionally, Slackware stable releases are only patched with security updates.
A fix for an idiosyncratic local device that can be readily implemented with a custom udev rule does not constitute a security update.


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