root can scan, user not...

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

root can scan, user not...

Thomas Dahlén
hi,
i have a Fujitsu fi -7160 and the latest version of Debian jessie installed.
(i also have a Fujitsu Scansnap S1100 but that can wait until i can scan with my fi-7160)

After installing sane-frontends and backends i can scan as root but not as user.
I tried everything, that I can think of so if anyone can help me with this I would be greatful.

My installation steps:
sudo apt-get install sane sane-utils libsane-extras xsane
I checked that the backend for fujitsu is enabled in /etc/sane.d/dll.conf

sudo sane-find-scanner
found USB scanner (vendor=0x0a5c [Broadcom Corp], product=0x21f3 [BCM20702A0]) at libusb:006:002
found USB scanner (vendor=0x04c5, product=0x132e) at libusb:003:002
found USB scanner (vendor=0x04c5 [FUJITSU], product=0x1200 [ScanSnap S1100]) at libusb:001:003

sane-find-scanner
could not open USB device 0x1d6b/0x0001 at 007:001: Access denied (insufficient permissions)
could not open USB device 0x5986/0x0299 at 004:003: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 004:001: Access denied (insufficient permissions)
could not open USB device 0x0a5c/0x21f3 at 006:002: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 006:001: Access denied (insufficient permissions)
could not open USB device 0x04c5/0x132e at 003:002: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 003:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0001 at 005:001: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0003 at 002:001: Access denied (insufficient permissions)
could not open USB device 0x045e/0x0745 at 001:002: Access denied (insufficient permissions)
could not open USB device 0x04c5/0x1200 at 001:004: Access denied (insufficient permissions)
could not open USB device 0x1d6b/0x0002 at 001:001: Access denied (insufficient permissions)

I edit /etc/sane.d/fujitsu.conf
#fi-7160
usb 0x04c5 0x132e

and /etc/sane.d/epjitsu.conf
# Fujitsu S1100
firmware /usr/share/sane/epjitsu/1100_0A00.nal
usb 0x04c5 0x1200

then i create the library epjitsu
thomas@ws2:/usr/share/sane$ sudo mkdir epjitsu
and copy 1100_0A00.nal into the library
thomas@ws2:/usr/share/sane/epjitsu$ ls
1100_0A00.nal

thomas@ws2:~$ sudo scanimage -L
device `v4l:/dev/video0' is a Noname Integrated Camera virtual device
device `fujitsu:fi-7160:13013' is a FUJITSU fi-7160 scanner
device `epjitsu:libusb:001:007' is a FUJITSU ScanSnap S1100 scanner

thomas@ws2:~$ sudo scanimage --device-name=fujitsu --format tiff > testimage1.tiff
thomas@ws2:~$ xdg-open testimage1.tiff
perfect result!

thomas@ws2:~$ sudo scanimage --device-name=epjitsu --format tiff > testimage2.tiff
scanimage: sane_start: Out of memory
that problem can wait!

here is my main problem
thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff > testimage3.tiff
scanimage: open of device fujitsu failed: Invalid argument

I check /etc/group
lp:x:7:thomas
saned:x:120:
scanner:x:105:saned,thomas

[hidden email] lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 003: ID 5986:0299 Acer, Inc
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 002: ID 0a5c:21f3 Broadcom Corp.
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 04c5:132e Fujitsu, Ltd
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 045e:0745 Microsoft Corp. Nano Transceiver v1.0 for Bluetooth
Bus 001 Device 008: ID 04c5:1200 Fujitsu, Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I check permissions
[hidden email] ls -la /dev/bus/usb/003/002
crw-rw-r-- 1 root root 189, 257 okt 20 10:20 /dev/bus/usb/003/002

I change permissons
[hidden email] sudo chmod 666 /dev/bus/usb/003/002
[hidden email] sudo chmod 666 /dev/bus/usb/001/008

[hidden email] scanimage --device-name=fujitsu --format tiff > testimage3.tiff
it works! But not after reboot

[hidden email] scanimage --device-name=epjitsu --format tiff > testimage2.tiff
scanimage: sane_start: Out of memory

reboot
thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff > testimage6.tiff
scanimage: open of device fujitsu failed: Invalid argument

thomas@ws2:~$ sudo chmod 666 /dev/bus/usb/003/002
[sudo] password for thomas:
thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff > testimage6.tiff
now it works but is there a better way to solve the problem permanently than to chmod after start.

/Thomas
--

- - - - - - - - - - -
Thomas Dahlén


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

Olaf Meeuwissen-4
Thomas Dahlén writes:

> hi,
> i have a Fujitsu fi -7160 and the latest version of Debian jessie installed.
> [snip]

> thomas@ws2:~$ sudo chmod 666 /dev/bus/usb/003/002
> [sudo] password for thomas:
> thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff >
> testimage6.tiff
> now it works but is there a better way to solve the problem permanently
> than to chmod after start.

Add yourself to the scanner group as below, log out and back in again.

  sudo adduser thomas scanner

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
Support Free Software               Support the Free Software Foundation
https://my.fsf.org/donate                        https://my.fsf.org/join
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

Thomas Dahlén
On 2015-10-20 15:34, Olaf Meeuwissen wrote:
Thomas Dahlén writes:

hi,
i have a Fujitsu fi -7160 and the latest version of Debian jessie installed.
[snip]

      
thomas@ws2:~$ sudo chmod 666 /dev/bus/usb/003/002
[sudo] password for thomas:
thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff > 
testimage6.tiff
now it works but is there a better way to solve the problem permanently 
than to chmod after start.
Add yourself to the scanner group as below, log out and back in again.

  sudo adduser thomas scanner

Hope this helps,
I am already in the scanner group:
"I check /etc/group
lp:x:7:thomas
saned:x:120:
scanner:x:105:saned,thomas"

/Thomas

--

- - - - - - - - - - -
Thomas Dahlén
070-710 64 54

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

m. allan noah-3
Probably the scanner is not owned by scanner group. You need to check
the udev/hal/whatever rules and make sure this scanner is listed.

allan

On Tue, Oct 20, 2015 at 10:09 AM, Thomas Dahlén
<[hidden email]> wrote:

> On 2015-10-20 15:34, Olaf Meeuwissen wrote:
>
> Thomas Dahlén writes:
>
> hi,
> i have a Fujitsu fi -7160 and the latest version of Debian jessie installed.
> [snip]
>
> thomas@ws2:~$ sudo chmod 666 /dev/bus/usb/003/002
> [sudo] password for thomas:
> thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff >
> testimage6.tiff
> now it works but is there a better way to solve the problem permanently
> than to chmod after start.
>
> Add yourself to the scanner group as below, log out and back in again.
>
>   sudo adduser thomas scanner
>
> Hope this helps,
>
> I am already in the scanner group:
> "I check /etc/group
> lp:x:7:thomas
> saned:x:120:
> scanner:x:105:saned,thomas"
>
> /Thomas
>
> --
>
> - - - - - - - - - - -
> Thomas Dahlén
> 070-710 64 54
>
> --
> sane-devel mailing list: [hidden email]
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>              to [hidden email]



--
"well, I stand up next to a mountain- and I chop it down with the edge
of my hand"

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

Yury Tarasievich-3
In reply to this post by Thomas Dahlén
You could check also if my post to the list on
September 12 helps any.

Yury

On 10/20/2015 05:09 PM, Thomas Dahlén wrote:
...
> I am already in the scanner group:
> "I check /etc/group
> lp:x:7:thomas
> saned:x:120:
> scanner:x:105:saned,thomas"

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

Thomas Dahlén
In reply to this post by m. allan noah-3
On 2015-10-20 17:48, m. allan noah wrote:
Probably the scanner is not owned by scanner group. You need to check
the udev/hal/whatever rules and make sure this scanner is listed.

allan
I am not sure that I understand...I can't find any library udev/hal/
 I thought that hal was deprecated by all  major distributions.

I tested to create /etc/udev/rules.d/40-scanner.rules
containing the following (values from lsusb 04c5 0132e):

SUBSYSTEMS=="usb", ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="0132e", ENV{libsane_matched}="yes", GROUP="scanner"
 but that did not solve my problem. Then I tested to create /etc/udev/rules.d/91-local.rules
with the following content (also tested with MODE="0664"

SYSFS{idVendor}==04c5", SYSFS{idProduct}=="0132e", MODE="666", GROUP="scanner", ENV{libsane_matched}="yes"

I am stucked here

/Thomas
On Tue, Oct 20, 2015 at 10:09 AM, Thomas Dahlén
[hidden email] wrote:
On 2015-10-20 15:34, Olaf Meeuwissen wrote:

Thomas Dahlén writes:

hi,
i have a Fujitsu fi -7160 and the latest version of Debian jessie installed.
[snip]

thomas@ws2:~$ sudo chmod 666 /dev/bus/usb/003/002
[sudo] password for thomas:
thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff >
testimage6.tiff
now it works but is there a better way to solve the problem permanently
than to chmod after start.

Add yourself to the scanner group as below, log out and back in again.

  sudo adduser thomas scanner

Hope this helps,

I am already in the scanner group:
"I check /etc/group
lp:x:7:thomas
saned:x:120:
scanner:x:105:saned,thomas"

/Thomas

--

- - - - - - - - - - -
Thomas Dahlén
070-710 64 54

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]




--

- - - - - - - - - - -
Thomas Dahlén
070-710 64 54

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

Yury Tarasievich-3
Do your udev rules generate the device node with
correct permissions?
Did you check for udev rules leftovers from
older SANE versions, like in my case?

-Yury

On 10/20/2015 11:56 PM, Thomas Dahlén wrote:
...
> I tested to create
> /etc/udev/rules.d/40-scanner.rules
...

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

Johannes Meixner
In reply to this post by Thomas Dahlén

Hello,

On Oct 20 22:56 Thomas Dahlén wrote (excerpt):
> udev
...
> I am stucked here

In general regarding
"USB scanner access permissions via udev"
and a
"workaround to get those kind of issues out of sight"
you may have a look at
https://en.opensuse.org/SDB:Configuring_Scanners

Regardless that this article is for openSUSE the general
ideas behind should be same on other Linux distributions.


Kind Regards
Johannes Meixner
--
SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard,
Graham Norton - HRB 21284 (AG Nuernberg)

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: root can scan, user not...

Thomas Dahlén
On 2015-10-21 10:54, Johannes Meixner wrote:

Hello,

On Oct 20 22:56 Thomas Dahlén wrote (excerpt):
udev
...
I am stucked here

In general regarding
"USB scanner access permissions via udev"
and a
"workaround to get those kind of issues out of sight"
you may have a look at
https://en.opensuse.org/SDB:Configuring_Scanners

Regardless that this article is for openSUSE the general
ideas behind should be same on other Linux distributions.


Kind Regards
Johannes Meixner


I tried to follow the instructions in https://en.opensuse.org/SDB:Configuring_Scanners
In my Debian/Jessie there is no /etc/udev/rules.d/whatever-libsane.rules
I found /lib/udev/rules.d/60-libsane.rules and tested to create
/etc/udev/rules.d/60-libsane.rules
with the following content:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="0132e", ENV{libsane_matched}="yes", GROUP="scanner", MODE="0660"

It still have the same problem:
thomas@ws2:~$ scanimage --device-name=fujitsu --format tiff > testimage7.tiffscanimage: open of device fujitsu failed: Invalid argument
but it works as root
 
/Thomas
--

- - - - - - - - - - -
Thomas Dahlén
070-710 64 54

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Loading...