Bug 438827

Summary: /etc/udev/rules.d/60-libsane.rules is missing
Product: [Fedora] Fedora Reporter: Kevin DeKorte <kdekorte>
Component: sane-backendsAssignee: Nils Philippsen <nphilipp>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-27 13:43:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output of lshal
none
New log after rpms installed none

Description Kevin DeKorte 2008-03-25 14:21:13 UTC
Description of problem:
In Fedora 8 the file /etc/udev/rules.d/60-libsane.rules was provided by
sane-backends. Without this file my scanner (Epson Perfection V200) is only
accessible by root

Version-Release number of selected component (if applicable):
sane-backends-1.0.19-8.fc9.i386

How reproducible:
100%

Steps to Reproduce:
1. plugin scanner
2. run xsane
3. 
  
Actual results:
device is not found

Expected results:
device is found

Additional info:

running as root, or copying the /etc/udev/rules.d/60-libsane.rules from a Fedora
8 machine and then restarting allows the scanner to be run as a normal user

Comment 1 Nils Philippsen 2008-03-25 18:29:16 UTC
Rawhide/F9 sane-backends doesn't use udev for setting the permissions on device
files, but HAL policy and ConsoleKit/PolicyKit to set ACLs (which allows e.g.
multiple logged in persons to use devices).

Please identify the device file, check the permissions on it ("getfacl
/dev/..."), tell us the USB vendor and product ID of the device and attach the
output of "lshal" to this report.

Comment 2 Kevin DeKorte 2008-03-26 14:07:51 UTC
device file: /dev/bus/usb/002/002

getfacl /dev/bus/usb/002/002
getfacl: Removing leading '/' from absolute path names
# file: dev/bus/usb/002/002
# owner: root
# group: root
user::rw-
group::r--
other::r--


 usb_device.product = 'EPSON Scanner'  (string)
  usb_device.product_id = 302  (0x12e)  (int)
  usb_device.speed = 480.0 (480) (double)
  usb_device.speed_bcd = 294912  (0x48000)  (int)
  usb_device.vendor = 'Seiko Epson Corp.'  (string)
  usb_device.vendor_id = 1208  (0x4b8)  (int)



Comment 3 Kevin DeKorte 2008-03-26 14:08:18 UTC
Created attachment 299155 [details]
output of lshal

Comment 4 Kevin DeKorte 2008-03-26 14:11:12 UTC
After putting /etc/udev/rules.d/60-libsane.rules back in place

device file: /dev/bus/usb/002/003

 getfacl /dev/bus/usb/002/003 
getfacl: Removing leading '/' from absolute path names
# file: dev/bus/usb/002/003
# owner: kdekorte
# group: root
user::rw-
group::rw-
other::---


Comment 5 Nils Philippsen 2008-03-26 16:05:00 UTC
The new HAL versions use a different key for differentiating subsystems
(info.subsystem vw. info.bus). I've kicked off a build of
sane-backends-1.0.19-9.fc9 which contains the necessary rules for that. Please
test this version (without having /etc/udev/rules.d/60-libsane.rules as a
workaround). Thanks.

Comment 6 Kevin DeKorte 2008-03-26 17:02:09 UTC
I installed the rpms from koji

rpm -qa sane-back\*
sane-backends-libs-1.0.19-9.fc9.i386
sane-backends-devel-1.0.19-9.fc9.i386
sane-backends-1.0.19-9.fc9.i386
sane-backends-libs-gphoto2-1.0.19-9.fc9.i386

removed the .rules file and it still has the wrong permissions, even after a reboot

getfacl /dev/bus/usb/002/002
getfacl: Removing leading '/' from absolute path names
# file: dev/bus/usb/002/002
# owner: root
# group: root
user::rw-
group::r--
other::r--


 info.vendor = 'Seiko Epson Corp.'  (string)
  linux.device_file = '/dev/bus/usb/002/002'  (string)


Comment 7 Kevin DeKorte 2008-03-26 17:27:28 UTC
Just to be even more clear this is how I am testing

[kdekorte@quad ~]$ sudo scanimage -L
[sudo] password for kdekorte: 
device `epkowa:libusb:002:004' is a Epson Perfection V200 flatbed scanner
[kdekorte@quad ~]$ scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).


As you can see, root has access to the scanner, but my normal user id does not.

same goes for xsane.



Comment 8 Nils Philippsen 2008-03-26 20:14:21 UTC
Please attach the output of "lshal". Thanks.

Comment 9 Kevin DeKorte 2008-03-26 21:14:54 UTC
Created attachment 299233 [details]
New log after rpms installed

Comment 10 Kevin DeKorte 2008-03-26 21:15:28 UTC
Log uploaded

Comment 11 Nils Philippsen 2008-03-27 10:38:06 UTC
It seems that the libsane HAL policy is applied too late so the necessary
hal-acl-tool callouts aren't added. I've renamed 60-libsane.fdi to
19-libsane.fdi to change this in sane-backends-1.0.19-10.fc9 which is building
right now. Please check this version once it's available, thanks.

Comment 12 Kevin DeKorte 2008-03-27 13:02:32 UTC
Nils, that fixed it. My scanner now works correctly for a non-root users. 

Thanks!