xsane and simple-scan only working as root

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

xsane and simple-scan only working as root

Christian Jaeger
Hi

I can't figure out why xsane and simple-scan only work as root, on Ubuntu 13.10. The programs report that they don't find a scanner if run as normal user. I've tried 'adduser normaluser scanner' as well as 'adduser normaluser saned' and 'adduser saned scanner', then 'sux - normaluser' to get the new group ids before starting xsane / simple-scan, to no avail.

Anyone knows the solution?

Christian.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: xsane and simple-scan only working as root

Marius Gedminas-2
On Tue, Oct 22, 2013 at 04:37:34AM +0100, Christian Jaeger wrote:
> I can't figure out why xsane and simple-scan only work as root, on Ubuntu
> 13.10. The programs report that they don't find a scanner if run as normal
> user. I've tried 'adduser normaluser scanner' as well as 'adduser
> normaluser saned' and 'adduser saned scanner', then 'sux - normaluser' to
> get the new group ids before starting xsane / simple-scan, to no avail.
>
> Anyone knows the solution?

FWIW 'newgrp scanner' is the canonical way of activating the new group
in a subshell, if you don't want to log out and log back in.


IIRC the way scanners work is that

1. you plug in a scanner
2. udev notices a new device and runs some scripts
3. that check for users who are logged in locally (using ConsoleKit in
   older Ubuntus, probably using logind in 13.10)
4. and grant access to those users via filesystem access control lists
   on the device (you can see those with getfacl /dev/... if you know
   the scanner device name)

I've encountered a bug (twice) where somehow ConsoleKit lost track of my
user session (running ck-list-sessions did not show my login), and as a
result I could not use the scanner.  Logging out and logging back in
fixed this.  That was in an older Ubuntu version.

I don't think 13.04 uses ConsoleKit any more (ck-list-sessions produces
empty output right now for me, and I see a systemd-logind process
running).  I hope whichever component is responsible for setting up
scanner access has been updated accordingly.

What's a bit frustrating is that I can't _find_ the script responsible
for this.  /lib/udev/rules.d/40-libsane.rules only does

  /bin/setfacl -m g:scanner:rw $DEVNAME

i.e. grants the scanner group access.


Do you know your scanner device name?  Can you check the permissions
with getfacl?

Marius Gedminas
--
Dijkstra probably hates me
                -- Linus Torvalds, in kernel/sched.c

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

signature.asc (197 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xsane and simple-scan only working as root

Christian Jaeger
Thanks for your hints. I noticed that the only device in /dev/usb/ was owned by the group "lp", and adding my user to "lp" in fact made scanning work. (This is a combined printer/scanner, so I guess that's the reason.)

Well, except that simple-scan exits with an error message along the lines of "stack smashing detected, exiting" unless running as root. But, I don't care much as xsane works.

Ch.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: xsane and simple-scan only working as root

Marius Gedminas-2
On Fri, Oct 25, 2013 at 08:13:53PM +0100, Christian Jaeger wrote:
> Thanks for your hints. I noticed that the only device in /dev/usb/ was
> owned by the group "lp", and adding my user to "lp" in fact made scanning
> work. (This is a combined printer/scanner, so I guess that's the reason.)

Wow, I never even thought about this possibility.

I would file a bug about that.

Actually, we've got one of those printer/scanner/fax combo devices in
the office.  I plug it into my laptop, and scanning Just Works (or at
least used to before I upgraded to 13.10; haven't had the need to scan
since).

> Well, except that simple-scan exits with an error message along the lines
> of "stack smashing detected, exiting" unless running as root.

*headdesk*

Another bug?  Oh, joy.

> But, I don't
> care much as xsane works.

Marius Gedminas
--
Never trust a computer you can't repair yourself.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

signature.asc (197 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xsane and simple-scan only working as root

Christian Jaeger

2013/10/29 Marius Gedminas <[hidden email]>
Actually, we've got one of those printer/scanner/fax combo devices in
the office.  I plug it into my laptop, and scanning Just Works (or at
least used to before I upgraded to 13.10; haven't had the need to scan
since).

The scanner was working with simple-scan (but not xsane) on the last LTS version of Ubuntu (12.04) the first time we ran simple-scan. Although I did try quite some time to get xsane working before that, and might have added the lp group during that.

I wonder which package to file a bug against. Sometimes I'm kinda hoping that maintainers are skimming ubuntu-user etc. if they're not overly busy handling existing bug reports already, that would save me some work and perhaps them, too...

Ch.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: xsane and simple-scan only working as root

Marius Gedminas-2
On Sun, Nov 10, 2013 at 09:16:35AM +0000, Christian Jaeger wrote:

> 2013/10/29 Marius Gedminas <[hidden email]>
>
> > Actually, we've got one of those printer/scanner/fax combo devices in
> > the office.  I plug it into my laptop, and scanning Just Works (or at
> > least used to before I upgraded to 13.10; haven't had the need to scan
> > since).
> >
>
> The scanner was working with simple-scan (but not xsane) on the last LTS
> version of Ubuntu (12.04) the first time we ran simple-scan. Although I did
> try quite some time to get xsane working before that, and might have added
> the lp group during that.
Oh, interesting.

If you have time, you may want to try booting from a Live CD, to see if
the problem is with Ubuntu, or with the changes you've made a long time
ago in a galaxy ^W^W^W trying to make it work with xsane :)

> I wonder which package to file a bug against. Sometimes I'm kinda hoping
> that maintainers are skimming ubuntu-user etc. if they're not overly busy
> handling existing bug reports already, that would save me some work and
> perhaps them, too...

In my experience filing bugs (that mostly get ignored), there are way too
many users and too many bug reports for the few maintainers to handle.  :(

Marius Gedminas
--
To err is human, but to really foul things up requires a computer.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

signature.asc (197 bytes) Download Attachment