Bug 512516 - xsane only launches when user is sudo root
Summary: xsane only launches when user is sudo root
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: sane-backends
Version: rawhide
Hardware: x86_64
OS: Linux
low
high
Target Milestone: ---
Assignee: Nils Philippsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 525769 527031 530734 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-18 12:19 UTC by Liam Dennehy
Modified: 2018-04-11 17:09 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-10-23 16:54:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 205496 0 None None None Never

Description Liam Dennehy 2009-07-18 12:19:53 UTC
Description of problem:
xsane attached to a usb scanner will not launch if the user is not root (and warns you of the risks if you do sudo root). scanimage has the same problem.

Version-Release number of selected component (if applicable):
1.0.19

How reproducible:
Always

Steps to Reproduce:
1. Log in as a normal user
2. Attempt to launch any scanner tool as the normal user
3.
  
Actual results:
no scanner device found/recognised

Expected results:
Scanner available to the user

Additional info
I have chmodded the entire /proc/bus/usb tree +rwx, as well as every node in /dev/*usb*, no luck

sane tools also do not give any meaningful output that would help debug this problem

Comment 1 Joachim Backes 2009-09-06 13:43:04 UTC
downgrading from xsane.i586 0:0.997-1.fc11 to xsane-0.996-7.fc11.i586 helps.

Comment 2 Matěj Cepl 2009-09-17 10:37:49 UTC
The problem is apparently in hal. See Launchpad bug for more details.

Comment 3 Joachim Backes 2009-09-17 11:11:05 UTC
Got rid from this problem after having installed
all F11 updates (until September 17, 2009), including xsane-0.997-1.fc11.i586

Comment 4 Matěj Cepl 2009-09-17 13:38:14 UTC
But still too present in Rawhide (probably from different reasons then)

Comment 5 Mike C 2009-10-04 16:40:31 UTC
Has there been any progress on this issue?  I have a Samsung scx-4500w which was working fine as a scanner in f10.  I just upgraded to f11 and it fails to work.

I added lines to /etc/sane.d/xerox_mfp.conf
as
#Samsung SCX-4500W
usb 0x04e8 0x342b

Then cd /usr/share/hal/fdi/information/20thirdparty/
and added lines in Samsung section of 19-libsane.fdi
        <!-- Samsung SCX-4500W -->
        <match key="usb.product_id" int="0x342b">
          <append key="info.capabilities" type="strlist">scanner</append>
        </match>

This should work but as user I xsane cannot find the device - and yet if I do
sane-find-scanner as normal user I get lines included in the terminal:

found USB scanner (vendor=0x04e8 [Samsung Electronics Co., Ltd.], product=0x342b [SCX-4500W Series]) at libusb:001:005
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

So I did scanimage -L which gave:
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).

I have not tried as root as this is a production machine - and using the scanner as root would be a security risk.

I would like to know if this is currently being worked on?  Also is there any workaround?  The HAL method ought to work surely?

Comment 6 Mike C 2009-10-04 16:44:40 UTC
My comment #5 was with xsane-0.997-1.fc11.i586 and with all f11 updates current as at 4th October 2009.

I don't know if downgrading xsane as per #1 would work - I did not try that - but I would like to move forward on this. There is nothing relevant in /var/log/messages to help diagnose this as far as I can see.

Comment 7 Mike C 2009-10-04 21:07:58 UTC
I have managed to make the Samsung scanner work - 

I found that the dll.conf files in /etc/sane.d/ were interesting.

There were two files in my system - which were:
-rw-r--r--. 1 root root  916 2009-10-03 12:13 dll.conf
-rw-r--r--. 1 root root  664 2009-06-23 09:04 dll.conf.rpmnew

I note that dll.conf was dated later than dll.conf.rpmnew - and the dll.conf file did not include xerox_mfp, whereas the earlier dated dll.conf.rpmnew did include this and in my case this is needed for the driver!

So I simply did the following:
mv dll.conf dll.conf.orig
cp dll.conf.rpmnew dll.conf

To make the .rpmnew version current and fired up GIMP and asked for a scan - and it worked just fine.

Is this merely a packaging error for the rpm??

Comment 8 Nils Philippsen 2009-10-19 11:31:50 UTC
Sorry for the late reply, I've been on vacation.

(In reply to comment #7)
> I have managed to make the Samsung scanner work - 
> 
> I found that the dll.conf files in /etc/sane.d/ were interesting.
> 
> There were two files in my system - which were:
> -rw-r--r--. 1 root root  916 2009-10-03 12:13 dll.conf
> -rw-r--r--. 1 root root  664 2009-06-23 09:04 dll.conf.rpmnew
> 
> I note that dll.conf was dated later than dll.conf.rpmnew - and the dll.conf
> file did not include xerox_mfp, whereas the earlier dated dll.conf.rpmnew did
> include this and in my case this is needed for the driver!
> 
> So I simply did the following:
> mv dll.conf dll.conf.orig
> cp dll.conf.rpmnew dll.conf
> 
> To make the .rpmnew version current and fired up GIMP and asked for a scan -
> and it worked just fine.
> 
> Is this merely a packaging error for the rpm??

IMO, the package is correct in this regard -- the dll.conf file is marked as %config(noreplace) which means the following when updating the package:

- If the installed dll.conf file isn't modified, it just gets replaced with the new version.
- If there are modifications to that file (e.g. the admin edited it), the old version will remain and the new one will be written to dll.conf.rpmnew. The admin is responsible to merge local modifications and additions to the config file. Unfortunately, some other packages modified dll.conf in the past, triggering that behaviour (there's no way for RPM to know whether modifications were done manually or by other packages).

Did you have to modify permissions on the device files for this to be working?

Comment 9 Mike C 2009-10-19 14:58:05 UTC
As far as I remember I had not changed anything on the files from the point of installing f11 - and the only point at which I changed the files was as I reported above.

Comment 10 Nils Philippsen 2009-10-22 10:10:50 UTC
*** Bug 527031 has been marked as a duplicate of this bug. ***

Comment 11 Nils Philippsen 2009-10-22 10:11:16 UTC
*** Bug 525769 has been marked as a duplicate of this bug. ***

Comment 12 Nils Philippsen 2009-10-22 10:24:53 UTC
I'm shipping adapted udev (instead of HAL) rules which should fix this in sane-backends-1.0.20-8, which is building right now.

Comment 13 Nils Philippsen 2009-10-22 11:02:55 UTC
You can find packages of 1.0.20-8 at the descendant build tasks for your architecture at:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1762582

After updating to this version, you need to unplug/replug or power-cycle your USB scanner for the changes to be effective.

Please try them out and report back, once I have positive reports, I'll submit this for inclusion in F-12 GA (instead of pushing this as an update). Thanks.

Comment 14 Nils Philippsen 2009-10-22 12:36:07 UTC
Make that 1.0.20-9, this is at:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1762797

It's still building, but should be finished in a few mins.

Comment 15 Kevin DeKorte 2009-10-22 13:02:16 UTC
The new sane-backends is not bi-arch compatible. I get conflicts when installing 

sane-backends-1.0.20-9.fc12.i686.rpm
sane-backends-1.0.20-9.fc12.x86_64.rpm

I need the .i686 as a requirement from picasa. All the man pages conflict and the new .rules

Example

file /lib/udev/rules.d/65-libsane.rules conflicts between attempted installs of sane-backends-1.0.20-9.fc12.i686 and sane-backends-1.0.20-9.fc12.x86_64
	file /usr/share/doc/sane-backends-1.0.20/sane-backends-external.html conflicts between attempted installs of sane-backends-1.0.20-9.fc12.i686 and sane-backends-1.0.20-9.fc12.x86_64
	file /usr/share/doc/sane-backends-1.0.20/sane-backends.html conflicts between attempted installs of sane-backends-1.0.20-9.fc12.i686 and sane-backends-1.0.20-9.fc12.x86_64

Comment 16 Kevin DeKorte 2009-10-22 13:06:58 UTC
However, forcing the packages to install does seem to correct the permission issue

Comment 17 Nils Philippsen 2009-10-22 14:05:42 UTC
(In reply to comment #15)
> The new sane-backends is not bi-arch compatible. I get conflicts when
> installing 
> 
> sane-backends-1.0.20-9.fc12.i686.rpm
> sane-backends-1.0.20-9.fc12.x86_64.rpm
> 
> I need the .i686 as a requirement from picasa. All the man pages conflict and
> the new .rules

You shouldn't need to install sane-backends.i?86 -- all libraries etc. (which should be what Picasa needs) are in the sane-backends-libs packages (which are multilib clean). Would you please check this?

Comment 18 Kevin DeKorte 2009-10-22 14:13:23 UTC
Nils,

You are correct, after upgrading all the sane packages I could remove sane-backends

[kdekorte@quad ~]$ rpm -qa sane\*
sane-backends-libs-gphoto2-1.0.20-9.fc12.i686
sane-backends-libs-1.0.20-9.fc12.i686
sane-backends-1.0.20-9.fc12.x86_64
sane-backends-libs-gphoto2-1.0.20-9.fc12.x86_64
sane-backends-devel-1.0.20-9.fc12.i686
sane-backends-libs-1.0.20-9.fc12.x86_64
sane-backends-1.0.20-9.fc12.i686
sane-backends-devel-1.0.20-9.fc12.x86_64
[kdekorte@quad ~]$ sudo rpm -e sane-backends-1.0.20-9.fc12.i686
[sudo] password for kdekorte: 
[kdekorte@quad ~]$ sudo rpm -e sane-backends-libs-1.0.20-9.fc12.i686
error: Failed dependencies:
	libsane.so.1 is needed by (installed) picasa-3.0.5744-02.i386
	libsane.so.1 is needed by (installed) sane-backends-devel-1.0.20-9.fc12.i686
	sane-backends-libs(x86-32) = 1.0.20-9.fc12 is needed by (installed) sane-backends-libs-gphoto2-1.0.20-9.fc12.i686
	sane-backends-libs(x86-32) = 1.0.20-9.fc12 is needed by (installed) sane-backends-devel-1.0.20-9.fc12.i686


but I could not do this prior to upgrading the packages.

Comment 19 Nils Philippsen 2009-10-22 14:28:17 UTC
That may be due to how you installed the updated packages... I guess because you downloaded sane-backends.i686 as well and ran rpm/yum on it it attempted installing it. Through normal update channels, it wouldn't do that.

I take it that it works for you (Kevin) now. Anybody else who tried it out?

Comment 20 Nils Philippsen 2009-10-22 15:14:22 UTC
Tim Waugh reminded me that setting a mode and having ACLs in udev rules isn't reliable so I've kicked off a new build of sane-backends-1.0.20-10 which doesn't do that:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1763069

Should be ready in a few minutes, please test.

Comment 21 Kevin DeKorte 2009-10-22 15:31:34 UTC
1.0.20-10 appears to work fine for me.

Comment 22 Alesh Slovak 2009-10-22 23:38:34 UTC
I have confirmed that with 1.0.20-10 I can scan as a regular user.

Comment 23 Nils Philippsen 2009-10-23 07:23:14 UTC
Thanks for the testing, I've submitted this for inclusion in F-12 final:

https://fedorahosted.org/rel-eng/ticket/2666

Comment 24 Nils Philippsen 2009-10-28 09:26:43 UTC
*** Bug 530734 has been marked as a duplicate of this bug. ***


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