Bug 223875

Summary: scanning only working for root (yast/sane/kooka/SuSEconfig)
Product: [openSUSE] openSUSE 10.2 Reporter: First Name Last Name <sinderbox+novell>
Component: YaST2Assignee: Johannes Meixner <jsmeix>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: lnussel
Version: RC 2   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: yast logs
/usr/lib/YaST2/bin/test_and_set_scanner_access_permissions
80-scanner.fdi
lshal.out
test_and_set_scanner_access_permissions.out

Description First Name Last Name 2006-11-27 14:24:43 UTC
This bug exists for several weeks at least.
Reinstalled my scanner with latest yast

Normaluser> sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.
[chopped]

root> sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

found SCSI processor "EPSON SCANNER GT-7000 1.14" at /dev/sg2
  # Your SCSI scanner was detected. It may or may not be supported by SANE. Try
  # scanimage -L and read the backend's manpage.
[chopped]

ls -l /dev/sg2
crw-r----- 1 root disk 21, 2 Nov 27 15:14 /dev/sg2

=======================================

Of course, if I do the following the problem is solved:

chmod 660 /dev/sg2
chgrp dialout /dev/sg2
crw-rw---- 1 root dialout 21, 2 Nov 27 15:14 /dev/sg2

Normaluser> sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

found SCSI processor "EPSON SCANNER GT-7000 1.14" at /dev/sg2
  # Your SCSI scanner was detected. It may or may not be supported by SANE. Try
  # scanimage -L and read the backend's manpage.
[chopped]

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

I guess SUSE 10.2 cannot be released without a working scanning system. Set the severity to blocker. I wonder, no one has encountered this problem before? Every time I upgrade to the latest beta, my scanner permissions are overwritten with non working ones (by SuSEconfig I presumed).
Comment 1 Matej Horvath 2006-11-27 19:14:56 UTC
Please attach your yast log files and output of the 'hwinfo --scanner' (as root, while your scanner is connected).
http://en.opensuse.org/Bugs/YaST

Thank you
Comment 2 First Name Last Name 2006-11-27 21:11:30 UTC
# hwinfo --scanner
23: SCSI 401.0: 10c04 Scanner
  [Created at scsi.1546]
  UDI: /org/freedesktop/Hal/devices/pci_9004_5078_scsi_device_lun0_scsi_generic
  Unique ID: olmp.NBRjDO9kTJ5
  Parent ID: hH_P.WsvlrmNH3M8
  SysFS ID: /class/scsi_generic/sg2
  SysFS BusID: 4:0:1:0
  Hardware Class: scanner
  Model: "EPSON SCANNER GT-7000"
  Vendor: "EPSON"
  Device: "SCANNER GT-7000"
  Revision: "1.14"
  Driver: "aic7xxx"
  Driver Modules: "aic7xxx"
  Device File: /dev/sg2
  Device Number: char 21:2
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #20 (SCSI storage controller)

I will attach y2logs, however it will probably not help since after removing my scanner with yast and installing it again, the permissions for /dev/sg2 remain as I artificially set them.

# ls -l /dev/sg2
crw-rw---- 1 root dialout 21, 2 Nov 27 15:14 /dev/sg2

after a massive system upgrades it returns to
crw------- 1 root disk ,,,,
so I cannot be certain which package resets the permissions. Probably sane.

Comment 3 First Name Last Name 2006-11-27 21:12:55 UTC
Created attachment 107099 [details]
yast logs
Comment 4 Johannes Meixner 2006-11-29 08:37:58 UTC
YaST sets scanner access permissions by calling
/usr/lib/YaST2/bin/test_and_set_scanner_access_permissions
which checks if the scanner is already listed in
/etc/hal/fdi/policy/10osvendor/70-scanner.fdi
and if not it writes
/etc/hal/fdi/policy/10osvendor/80-scanner.fdi
to set up HAL to trigger resmgr to grant access for normal users,
see bug #218393 for background information.

Regarding YaST, attach
/etc/hal/fdi/policy/10osvendor/80-scanner.fdi
as mime type "text plain" to this bug.

Regarding HAL, do as root
lshal >/tmp/lshal.out
and attach /tmp/lshal.out as mime type "text plain" to this bug.

Comment 5 Johannes Meixner 2006-11-29 08:57:44 UTC
Additionally change in
/usr/lib/YaST2/bin/test_and_set_scanner_access_permissions
the line
#set -x
to
set -x
and run it as follows (type it on one single command line)
-------------------------------------------------------------------------------
/usr/lib/YaST2/bin/test_and_set_scanner_access_permissions \
 'epkowa:/dev/sg2;unknown;' &>/tmp/test_and_set_scanner_access_permissions.out
-------------------------------------------------------------------------------
and attach
/tmp/test_and_set_scanner_access_permissions.out
as mime type "text plain" to this bug.
Comment 6 Johannes Meixner 2006-11-29 09:15:32 UTC
Created attachment 107339 [details]
/usr/lib/YaST2/bin/test_and_set_scanner_access_permissions

I have an idea what might cause the problem.

Therefore here a new version of
/usr/lib/YaST2/bin/test_and_set_scanner_access_permissions
which might solve the problem.

Please test this one.
Comment 7 Johannes Meixner 2006-11-29 13:55:16 UTC
Submitted yast2-scanner with the fix according to attachment #107339 [details] to STABLE.
Regardless whether it solves the problem in this bug, there was a bug
in test_and_set_scanner_access_permissions which is now fixed.
Comment 8 Johannes Meixner 2006-12-04 09:17:19 UTC
Got no info.
Therefore I assume it is fixed (see comment #6).
Additionally have a look at
https://bugzilla.novell.com/show_bug.cgi?id=218393#c26
Comment 9 First Name Last Name 2006-12-07 21:22:50 UTC
I am sorry I couldn't follow up.
It still doesn't work. 
I next comment I provide the requeste info.
Comment 10 First Name Last Name 2006-12-07 21:24:30 UTC
Created attachment 108769 [details]
80-scanner.fdi
Comment 11 First Name Last Name 2006-12-07 21:25:51 UTC
Created attachment 108770 [details]
lshal.out
Comment 12 First Name Last Name 2006-12-07 21:27:02 UTC
Created attachment 108771 [details]
test_and_set_scanner_access_permissions.out
Comment 13 First Name Last Name 2006-12-07 21:30:22 UTC
device permissions were again reset.
# l /dev/sg2
crw-r----- 1 root disk 21, 2 Dec  7 08:18 /dev/sg2
Comment 14 Johannes Meixner 2006-12-08 09:00:35 UTC
Attachment #108771 [details] shows that you still use the old
/usr/lib/YaST2/bin/test_and_set_scanner_access_permissions
which doesn't work in your particular case.
Therefore I made the fix according to comment #6 which is
included in the openSUSE 10.2 final version.

Obviously you must update it (either with attachment #107339 [details]
or install the openSUSE 10.2 final version).
Therefore I still think it is fixed.

If it doesn't work even with attachment #107339 [details] or with
the openSUSE 10.2 final version, it might be a duplicate
of bug #226044

In problematic cases there is always the following workaround:

YaST scanner config:
-> [Other]
-> "Scanning via Network"
-> [Local Host Configuration]
-> [Next]
-> [Finish]

See
http://en.opensuse.org/SDB:Configuring_Scanners_from_SUSE_LINUX_9.2
in the "ibusb + resmgr + PAM" section the info about "saned".