Bug 182210 - Epson 4490 Photo scanner works in FC4, but not in FC5T3
Epson 4490 Photo scanner works in FC4, but not in FC5T3
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: sane-frontends (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nils Philippsen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-20 20:24 EST by Gerry Tool
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-06 21:25:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gerry Tool 2006-02-20 20:24:09 EST
Description of problem: The Epson 4490 Photo flatbed scanner is supported by the
most recent version of  iscan from http://www.avasys.jp/english/index_e.html.
The scanner works in both iscan and xsane in FC4, but will not work in FC5T3
with the same setup.  It did not work in FC5T2 either, but since T3 was just
about to be released, I waited until I could install FC5T3 before further testing.


Version-Release number of selected component (if applicable):
[gerry@gstpc-fc4 ~]$ rpm -q sane-frontends
sane-frontends-1.0.13-2
NOTE: this is the version in FC4 where I am sending this from.  I do not know
the version in FC5T3 without rebooting there.  This is a fresh install from the
currently available DVD - no updates available yet.

[gerry@gstpc-fc4 ~]$ rpm -q iscan
iscan-1.18.0-1.c2


How reproducible: Always


Steps to Reproduce:
1.See detailed scenario in Additional Info below:
2.
3.
  
Actual results:


Expected results:


Additional info: The Epson 4490 Photo flatbed scanner is supported by the most
recent version of  iscan from http://www.avasys.jp/english/index_e.html.

[gerry@gstpc-fc4 ~]$ rpm -q iscan
iscan-1.18.0-1.c2

The scanner works in both iscan and xsane in FC4, but will not work in FC5T3
with the same setup.  It did not work in FC5T2 either, but since T3 was just
about to be released, I waited until I could install FC5T3 before further
testing and reporting.

I know that epkowa.conf is the proper config file because the scanner does not
work in FC4 if I rename this file.  As shown below, the files are the same.

[gerry@fc5t3 sane.d]$ diff epkowa.conf /mnt/fc4/etc/sane.d/epkowa.conf
[gerry@fc5t3 sane.d]$

If I do:

[root@fc5t3 ~]# 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.

found USB scanner (vendor=0x04b8 [EPSON], product=0x0119 [EPSON Scanner]) at
libusb:007:002
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

then

[root@fc5t3 ~]# chmod 0666 /proc/bus/usb/007/002

[gerry@fc5t3 sane.d]$ xsane &
results in no devices available.

[gerry@fc5t3 sane.d]$ iscan &
results in Could not send command to scanner.  Check the scanner's status.

After the above steps, the scanner works great in FC4.
Comment 1 Nils Philippsen 2006-02-21 03:51:08 EST
Is SELinux enabled? Please post the output of "/usr/sbin/getenforce" from both
of your systems.
Comment 2 Gerry Tool 2006-02-21 08:16:52 EST
Here are the results:

[root@fc5t3 gerry]# /usr/sbin/getenforce
Enforcing

[root@gstpc-fc4 ~]# /usr/sbin/getenforce
Enforcing

I had hope from your request that the fix might be that simple.  Bummer.
Comment 3 Nils Philippsen 2006-02-21 08:52:26 EST
Hmm, please try whether it works on your FC5 system with "setenforce 0", i.e.
SELinux enforcing disabled.
Comment 4 Gerry Tool 2006-02-21 09:34:32 EST
The results are the same.  Before trying the scanner, I also checked the
permissions on /proc/bus/usb/007/002 and found that it was not writable except
by root.  I changed the mode to 0666 before trying the scanner.  On my FC4
system, these permissions are persistent, but not on the FC5T3 system. 
sane-find-scanner finds the same usb device numbers each time.

[root@fc5t3 ~]# setenforce 0
[root@fc5t3 ~]# /usr/sbin/getenforce
Permissive
[root@fc5t3 ~]# ls -l /proc/bus/usb/007/002
-rw-r--r-- 1 root root 50 Feb 21 08:08 /proc/bus/usb/007/002
[root@fc5t3 ~]# chmod 0666 /proc/bus/usb/007/002
[root@fc5t3 ~]# ls -l /proc/bus/usb/007/002
-rw-rw-rw- 1 root root 50 Feb 21 08:08 /proc/bus/usb/007/002

[root@fc5t3 ~]# sane-find-scanner

found USB scanner (vendor=0x04b8 [EPSON], product=0x0119 [EPSON Scanner]) at
libusb:007:002
Comment 5 John Rosich 2006-02-27 10:41:21 EST
I have the same problem with an Epson 3490 PHOTO under FC4. Selinux is disabled.
On some boots I'll get 'libusb:001:005' while on others it will be
'libusb:001:002'. The product and vendor codes are constant and correct in
either case.

Changing permissions doesn't enable the scanner. Neither iscan nor xsane
recognize the scanner.

Using a Soltek MoBo with an AMD 939 processor, FC4 with the lates updates.

Help!

John
Comment 6 John Rosich 2006-02-27 10:44:20 EST
I have the same problem with an Epson 3490 PHOTO under FC4. Selinux is disabled.
On some boots I'll get 'libusb:001:005' while on others it will be
'libusb:001:002'. The product and vendor codes are constant and correct in
either case.

Changing permissions doesn't enable the scanner. Neither iscan nor xsane
recognize the scanner.

Using a Soltek MoBo with an AMD 939 processor, FC4 with the lates updates.

Help!

John
Comment 7 Gerry Tool 2006-03-03 09:15:48 EST
I have made some progress: root can now run my Epson Perfection 4490 Photo
scanner with both xsane and iscan, but a user cannot.

I have currently booted with selinux=0 appended to the grub kernel line (running
kernel 2008).  I will later remove this and see if the behaviour described below
is the same.  My FC5T3 system is up to date as of this morning.

[root@fc5t3 ~]# sane-find-scanner

found USB scanner (vendor=0x04b8 [EPSON], product=0x0119 [EPSON Scanner]) at
libusb:001:002

[root@fc5t3 ~]# scanimage -L
device `epkowa:libusb:001:002' is a Epson Perfection 4490 flatbed scanner
device `epson:libusb:001:002' is a Epson  flatbed scanner

Note the two results.  When I ran xsane as root with this situation, an
interface opened, but xsane could not get response from the scanner.  I found
that the epson.conf file had a specific line
usb 0x4b8 0x119
uncommented instead of the plain usb line.  I uncommented usb and commented the
specific line in epson.conf.  Then,

[root@fc5t3 ~]# scanimage -L
device `epkowa:libusb:001:002' is a Epson Perfection 4490 flatbed scanner

now gives just the epkowa.conf result, which I believe is the way it should be
for this scanner.

My scanner is currently on USB port 001:002 rather than 007:002 for some reason
- I wish it would not be detected differently from time to time as this thwarts
simple scripting to set permissions.

[root@fc5t3 ~]# ls -l /proc/bus/usb/001/002
-rw-r--r-- 1 root root 50 Mar  3 07:50 /proc/bus/usb/001/002
[root@fc5t3 ~]# chmod a+w /proc/bus/usb/001/002
[root@fc5t3 ~]# ls -l /proc/bus/usb/001/002
-rw-rw-rw- 1 root root 50 Mar  3 07:50 /proc/bus/usb/001/002

With this situation, both xsane and iscan will run the scanner as root, but not
as a user.  As a user, I stll get "no devices available" from xsane and "Could
not send command to scanner. Check the scanner's status." from iscan. 

I don't know if Comments 5 and 6 above are the same problem as that report is
from FC4.
Comment 8 Gerry Tool 2006-03-03 09:49:36 EST
SELinux definitely does affect the operation.  With SELinux enabled,

[root@fc5t3 ~]# sane-find-scanner

 found USB scanner (vendor=0x04b8 [EPSON], product=0x0119 [EPSON Scanner]) at
libusb:007:002

[root@fc5t3 ~]# ls -l /proc/bus/usb/007/002
-rw-r--r-- 1 root root 50 Mar  3 08:24 /proc/bus/usb/007/002
[root@fc5t3 ~]# chmod a+w /proc/bus/usb/007/002
[root@fc5t3 ~]# ls -l /proc/bus/usb/007/002
-rw-rw-rw- 1 root root 50 Mar  3 08:24 /proc/bus/usb/007/002
[root@fc5t3 ~]# scanimage -L

No scanners were identified. 

scanimage could not find the scanner, and xsane and iscan could not either.

I retested with selinux=0 and got the same results described in Comment #7
above.  The scanner has again been detected as USB 007:002.

Now to get it to work as a user, I am probably missing some simple procedure.
Comment 9 J. Rutten 2006-03-05 14:15:34 EST
My Brother MFC 5440CN has almost the same problem.
If I login as root I can use the scanner, only I get a warning that it is
dangerous to use Sane as root.
When I login as user, Sane gives a warning that it can not find my scanner.
Selinux is enabled in both the accounts.
Comment 10 Takaki Hiroshi 2006-03-05 15:31:04 EST
Please, check here.

1. switch on the scanner before login. (#183063)

2. delete, or move /etc/sane.d/epkowa.conf. sane-backends-1.0.17-4 isn't
including it.

3. permission of /dev/bus/usb/007/002. (not /proc/...)

4. type 'xsane epson' or 'xsane epson:/dev/bus/usb/007/002'. (not only 'xsane')
Comment 11 Gerry Tool 2006-03-05 17:55:28 EST
OK, the above did not work, but it lead me to a procedure that does.  My epson
4490 does not work with the epson.conf file.  The scanner interface opens, even
as user after the steps  above, but I get a message "Failed to start scanner:
invalid argument."  To get even this far, I had to comment the "usb" line and
uncomment the "usb 0x4b8 0x119" line in epson.conf.

However, if I return epson.conf to its previous state and restore the
epkowa.conf file (with only the "usb" line uncommented) and use chmod a+w on
dev/bus/usb/007/002 as you specified, then both xsane and iscan work as a user.
 I can use "xsane" or "xsane epkowa" and it will work with either.  I have the
version of sane-backends you specified.

[root@fc5t3 sane.d]# rpm -q sane-backends
sane-backends-1.0.17-4

I am happy to have the scanner working in FC5T3 finally, but where was I
supposed to learn that dev/bus/usb/007/002 is to be used in FC5 whereas
/proc/bus/usb/007/002 worked in previous FC releases?  That was really the
missing key in this whole bug report, once iscan-1.18.0-1.c2 was released to
support this scanner.

I probably missed some announcement or failed to read some new documentation
somewhere?

I still have selinux=0 appended to the kernel boot line.  Is this necessary, or
is there some way to use the scanner with selinux enabled?

Thanks.  Gerry
Comment 12 Takaki Hiroshi 2006-03-05 23:45:03 EST
(In reply to comment #11)

I suppose your /etc/sane.d/* little differ from original sane-backends-1.0.17-4.
You can check it by rpm -qf and rpm -V.

> I am happy to have the scanner working in FC5T3 finally, but where was I
> supposed to learn that dev/bus/usb/007/002 is to be used in FC5 whereas
> /proc/bus/usb/007/002 worked in previous FC releases?

strace tell me it.

> I still have selinux=0 appended to the kernel boot line.  Is this necessary, or
> is there some way to use the scanner with selinux enabled?

It's not necessary. sane works for me in Enforcing mode.
Comment 13 Gerry Tool 2006-03-06 10:20:03 EST
I believe the epkowa.conf file in sane.d was installed by iscan, the scanner
interface provided by avasys, the epson subsidiary providing linux scanner
support.  Until the most recent version of iscan was released, there was no
support for the Epson Perfection 4490 PHOTO scanner that I have.

[root@fc5t3 sane.d]# rpm -q iscan
iscan-1.18.0-1.c2

rpm -V iscan does list /etc/sane.d/epkowa.conf.

As far as I can tell, without iscan installed, this particular scanner will not
work in xsane.

Later I will test if I can enable selinux and have the scanner still work.

Thanks for your replies, Takaki Hiroshi.
Comment 14 Takaki Hiroshi 2006-03-06 13:09:42 EST
I see. I understood about iscan now. I'm sorry for make you go round.

The iscan seems to depend on hotplug. But FC5 threw away it on my understanding.
You might better do the following:

1.
cat <<EOF > /etc/udev/rules.d/60-libsane.epkowa.rules
# Epson Corp.|Perfection 4490 Photo (GT-X750)
SYSFS{idVendor}=="04b8", SYSFS{idProduct}=="0119", SYMLINK+="scanner-%k"
EOF

2. turn off scanner and then turn on scanner

3. logout from X and then login

You maybe don't have to change permission /dev/bus/usb/...
Comment 15 Gerry Tool 2006-03-06 14:48:52 EST
That worked great!  A bonus is that I do not now have to identify which device
file to use.  In this case, the scanner was now identified as
/dev/bus/usb/007/003 and the rules file you created took care of it automatically.

Thanks a lot for your help.  I suspect a lot of scanner users are going to
encounter this hitch when they move to FC5 unless the release notes mention how
to handle it.
Comment 16 Takaki Hiroshi 2006-03-06 16:09:35 EST
Yes, I think so too. Close here, and enjoy with me at next hitch (bug 183063).
Comment 17 Gerry Tool 2006-03-06 21:25:28 EST
Closing because no software mods required.  Everything works if the correct way
to use it is known.  There should be some description of the new udev based way
to use scanners in the release notes.
Comment 18 Gerry Tool 2006-03-07 12:06:15 EST
After installing today's updates, including a new kernel, I rebooted without the
selinux-0 on the kernel boot line.  The scanner would not operate as a user
until I setenforce 0.

Perhaps this needs to be reopened against a different component?
Comment 19 Takaki Hiroshi 2006-03-07 14:21:34 EST
If you want to investigate what component wrong, '/var/log/audit/audit.log' will
be help.
Comment 20 Gerry Tool 2006-03-07 16:28:27 EST
So, here is the section of audit.log that pertains to xsane use.  Now if I only
had a clue what this all means.

type=AVC msg=audit(1140358808.790:230): avc:  denied  { execmod } for  pid=32760
comm="xsane" name="libsane-epkowa.so.1.0.15" dev=hda8 ino=1396052
scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0
tclass=file
type=SYSCALL msg=audit(1140358808.790:230): arch=40000003 syscall=125 success=no
exit=-13 a0=612000 a1=1d000 a2=5 a3=bfa48c10 items=0 pid=32760 auid=500 uid=500
gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 comm="xsane"
exe="/usr/bin/xsane"
type=AVC_PATH msg=audit(1140358808.790:230): 
path="/usr/lib/sane/libsane-epkowa.so.1.0.15"
type=AVC msg=audit(1140359041.149:231): avc:  denied  { execmod } for  pid=329
comm="iscan" name="libsane-epkowa.so.1.0.15" dev=hda8 ino=1396052
scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0
tclass=file
type=SYSCALL msg=audit(1140359041.149:231): arch=40000003 syscall=125 success=no
exit=-13 a0=691000 a1=1d000 a2=5 a3=bff4c070 items=0 pid=329 auid=500 uid=500
gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 comm="iscan"
exe="/usr/bin/iscan"
type=AVC_PATH msg=audit(1140359041.149:231): 
path="/usr/lib/sane/libsane-epkowa.so.1.0.15"
type=AVC msg=audit(1140359061.605:232): avc:  denied  { execmod } for  pid=335
comm="xsane" name="libsane-epkowa.so.1.0.15" dev=hda8 ino=1396052
scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0
tclass=file
type=SYSCALL msg=audit(1140359061.605:232): arch=40000003 syscall=125 success=no
exit=-13 a0=549000 a1=1d000 a2=5 a3=bf858810 items=0 pid=335 auid=500 uid=500
gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 comm="xsane"
exe="/usr/bin/xsane"
type=AVC_PATH msg=audit(1140359061.605:232): 
path="/usr/lib/sane/libsane-epkowa.so.1.0.15"
type=AVC msg=audit(1140359219.045:233): avc:  denied  { execmod } for  pid=352
comm="xsane" name="libsane-epkowa.so.1.0.15" dev=hda8 ino=1396052
scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0
tclass=file
type=SYSCALL msg=audit(1140359219.045:233): arch=40000003 syscall=125 success=no
exit=-13 a0=580000 a1=1d000 a2=5 a3=bfe485d0 items=0 pid=352 auid=500 uid=500
gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 comm="xsane"
exe="/usr/bin/xsane"
type=AVC_PATH msg=audit(1140359219.045:233): 
path="/usr/lib/sane/libsane-epkowa.so.1.0.15"
type=AVC msg=audit(1140359460.576:234): avc:  denied  { execmod } for  pid=375
comm="kooka" name="libsane-epkowa.so.1.0.15" dev=hda8 ino=1396052
scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0
tclass=file
type=SYSCALL msg=audit(1140359460.576:234): arch=40000003 syscall=125 success=no
exit=-13 a0=4d4000 a1=1d000 a2=5 a3=bfae5670 items=0 pid=375 auid=500 uid=500
gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 comm="kooka"
exe="/usr/bin/kooka"
type=AVC_PATH msg=audit(1140359460.576:234): 
path="/usr/lib/sane/libsane-epkowa.so.1.0.15"
Comment 21 Takaki Hiroshi 2006-03-10 02:00:34 EST
The libsane-epkowa.so.1.0.15 has text relocation.

# LANG=C readelf -d /usr/lib/sane/libsane-epkowa.so.1.0.15 | grep TEXTREL
 0x00000016 (TEXTREL)                    0x0

A permission of execmod is needed, if The entry point executable want to link
such libraries. The unconfined_t domain is not allowed to use execmod to the
lib_t domain or something of indicating the libsane-epkowa.so.1.0.15, so xsane
can't link it. I'm not sure, but it's such a story in rough.

Note You need to log in before you can comment on or make changes to this bug.