Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scanner permission problems with gnome 3.x [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Mon Nov 07, 2011 4:42 am    Post subject: scanner permission problems with gnome 3.x [solved] Reply with quote

So I haven't been able to get my USB scanner or other USB scanners to work with the 3.x kernels. I have the following options set for the USB file permissions:

Code:

# CONFIG_USB_DEVICEFS is not set
# CONFIG_USB_DEVICE_CLASS is not set


So I have the file that is built from media-gfx/sane-backends-1.0.22-r1 in /lib/udev/rules.d/41-libsane.rules
and the scanner for the Epson 3490 Photo is listed. My user account is in the scanner group but yet only root can access the scanner. Something has changed but I haven't been able to find where the change needs to be done to fix the permission problem.

The important package versions are:

dev-libs/libusb-0.1.12-r5
dev-libs/libusb-1.0.8
sys-fs/udev-171-r2
_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.


Last edited by rapsure on Tue Nov 29, 2011 5:50 pm; edited 2 times in total
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6194

PostPosted: Mon Nov 07, 2011 3:34 pm    Post subject: Reply with quote

Care to share permissions and acls on the scanner's nodes ?
Back to top
View user's profile Send private message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Mon Nov 07, 2011 4:05 pm    Post subject: Reply with quote

-rw-r--r-- 1 root root 4096 Nov 6 22:09 uevent

or the udevadm info
Code:

  looking at device '/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.4/1-4.4.1':
    KERNEL=="1-4.4.1"
    SUBSYSTEM=="usb"
    DRIVER=="usb"
    ATTR{configuration}==""
    ATTR{bNumInterfaces}==" 1"
    ATTR{bConfigurationValue}=="1"
    ATTR{bmAttributes}=="c0"
    ATTR{bMaxPower}=="100mA"
    ATTR{urbnum}=="9"
    ATTR{idVendor}=="04b8"
    ATTR{idProduct}=="0122"
    ATTR{bcdDevice}=="0000"
    ATTR{bDeviceClass}=="ff"
    ATTR{bDeviceSubClass}=="ff"
    ATTR{bDeviceProtocol}=="ff"
    ATTR{bNumConfigurations}=="1"
    ATTR{bMaxPacketSize0}=="64"
    ATTR{speed}=="480"
    ATTR{busnum}=="1"
    ATTR{devnum}=="17"
    ATTR{devpath}=="4.4.1"
    ATTR{version}==" 2.00"
    ATTR{maxchild}=="0"
    ATTR{quirks}=="0x0"
    ATTR{avoid_reset_quirk}=="0"
    ATTR{authorized}=="1"
    ATTR{manufacturer}=="EPSON"
    ATTR{product}=="EPSON Scanner"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.4':
    KERNELS=="1-4.4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{urbnum}=="162"
    ATTRS{idVendor}=="05e3"
    ATTRS{idProduct}=="0608"
    ATTRS{bcdDevice}=="7764"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="10"
    ATTRS{devpath}=="4.4"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="4"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{product}=="USB2.0 Hub"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-4':
    KERNELS=="1-4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{urbnum}=="33"
    ATTRS{idVendor}=="05e3"
    ATTRS{idProduct}=="0608"
    ATTRS{bcdDevice}=="7764"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="5"
    ATTRS{devpath}=="4"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="4"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{product}=="USB2.0 Hub"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="74"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0002"
    ATTRS{bcdDevice}=="0301"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="10"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 3.1.0-gentoo ehci_hcd"
    ATTRS{product}=="EHCI Host Controller"
    ATTRS{serial}=="0000:00:02.1"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:02.1':
    KERNELS=="0000:00:02.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{vendor}=="0x10de"
    ATTRS{device}=="0x005b"
    ATTRS{subsystem_vendor}=="0x1043"
    ATTRS{subsystem_device}=="0x815a"
    ATTRS{class}=="0x0c0320"
    ATTRS{irq}=="21"
    ATTRS{local_cpus}=="ff"
    ATTRS{local_cpulist}=="0-7"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="31"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""
    ATTRS{companion}==""
    ATTRS{uframe_periodic_max}=="100"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6194

PostPosted: Mon Nov 07, 2011 5:16 pm    Post subject: Reply with quote

:roll: 'uevent' isn't a device node and I don't see what that 'udevadm info' output has to do with either permissions or acls.
Back to top
View user's profile Send private message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Mon Nov 07, 2011 5:48 pm    Post subject: Reply with quote

I found the device node. The permissions are:

crw-rw-r-- 1 root scanner 189, 17 Nov 7 10:59 /dev/bus/usb/001/018
_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6194

PostPosted: Mon Nov 07, 2011 7:04 pm    Post subject: Reply with quote

Well, according to your problem' description the permissions are correct.

What about acls ?

Also, what exactly fails to access the scanner ?
the error messages, cups logs, etc. welcomed
Back to top
View user's profile Send private message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Tue Nov 08, 2011 1:28 am    Post subject: Reply with quote

So here is the acl for the device. I suppose it is no longer a permission problem but a question of why won't sane access the scanner. I haven't seen any error messages for scanimage -L but it only sees my webcam.

Code:

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

_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.
Back to top
View user's profile Send private message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Sat Nov 12, 2011 5:47 pm    Post subject: Reply with quote

I got the problem partially solved. The issue is that firmware has to be loaded into the scanner for it to work. Only root is able to load the firmware into the scanner and so until that has taken place a normal user is unable to use the scanner. Now I just need it so that a normal user can load firmware.
_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6194

PostPosted: Sun Nov 13, 2011 4:54 am    Post subject: Reply with quote

Unless I'm missing something, you're going the wrong way about it.

Simply write a udev rule to load the firmware upon its discovery.
Back to top
View user's profile Send private message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Tue Nov 22, 2011 4:36 am    Post subject: Reply with quote

Well it may not entirely be a firmware loading issue. For whatever reason as long as root is the first to touch the scanner I can use it as a normal user in the scanner group. I've unplugged the scanner both the power and usb and after plugging the scanner in my user account can still use the scanner. The scanner uses the snapscan driver from sane backends and that the backend is what loads the firmware. I'm not entirely sure but I don't think that udev can load the firmware in this case. It would be nice if udev could load the firmware. I'll now need to reboot the computer to re-trigger the bug I'm experiencing. :?
_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.
Back to top
View user's profile Send private message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Tue Nov 29, 2011 5:20 pm    Post subject: Reply with quote

The applicable error messages from snapscan.

Code:
[sanei_debug] Setting debug level of snapscan to 2.
[snapscan] snapscani_mutex_open: semget failed: Permission denied
[snapscan] snapscani_usb_open: Can't get semaphore
[snapscan] add_usb_device: error opening device libusb:001:011: Invalid argument

_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.
Back to top
View user's profile Send private message
rapsure
Apprentice
Apprentice


Joined: 29 Apr 2004
Posts: 167
Location: Logan, UT USA

PostPosted: Tue Nov 29, 2011 5:50 pm    Post subject: Reply with quote

I got the problem solved. The issue had to do with an IPC semaphore permission problem. In gnome 3.x colord starts a semaphore with permissions 660 under the user colord, and group colord. snapscan tries to use the same semaphore and any user that isn't in the group colord can't access the scanner. I added myself to the colord group and the problem is resolved.
_________________
:) Hindi ko naintindihan, pakiulit. Sometimes my code works.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum