Re: sane access for non-root user

2005-12-14 Thread Darryl Clarke
On 12/14/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> On Tuesday, 13 December 2005 at 20:53:09 -0500, Darryl Clarke wrote:
> > On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> > > On Tuesday, 13 December 2005 at 14:01:06 -0500, Darryl Clarke wrote:
> > > >
> > > > udev isn't setting permissions properly on the device, I would imagine.
> > > >
> > > > I forget exactly where though... /etc/udev/ would be a starting point.
> > >
> > > I had already looked there, and /etc/udev/rules.d contains the line:
> > >
> > > # Epson Corp.|Perfection 1260
> > > SYSFS{idVendor}=="04b8", SYSFS{idProduct}=="011d", MODE="660", GROUP="sca\
> > > nner", RUN+="/etc/hotplug.d/usb/libsane.hotplug"
> > >
> > > Which sounds perfect to me.  Must be more to it than that, I guess.
> >
> > Sounds perfect, but it's not.  Did you check and see what damage
> > /etc/hotplug.d/usb/libsane.hotplug might be doing?  It _could_ be
> > undoing the permissions.
>
> I am fumbling here, but /etc/hotplug.d/usb/libsane.hotplug is not too long
> and says around line 27
> chown $3 $DEVICE && chmod $4 $DEVICE
>
> Can it be that this relates to the info taken from /etc/udev/rules.d
> (see above), cos if so $3 and $4 are reversed? Or is that too obvious...

That's about where I cheated and changed it to:
chown root:scanner $DEVICE && chmod 0660 $DEVICE

I'm not exactly sure the order parameters are passed to the RUN+
script from udev, so I can't say whether $3 and $4 are actually
correct.

On the other hand, if udev only provides a group, and $3 is that
group, then 'chown $3' is technically wrong and could very well be the
cause.


--
~ Darryl  ~ [EMAIL PROTECTED]
http://smartssa.com / http://darrylclarke.com



Re: sane access for non-root user

2005-12-14 Thread Richard Lyons
On Tuesday, 13 December 2005 at 20:53:09 -0500, Darryl Clarke wrote:
> On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> > On Tuesday, 13 December 2005 at 14:01:06 -0500, Darryl Clarke wrote:
> > >
> > > udev isn't setting permissions properly on the device, I would imagine.
> > >
> > > I forget exactly where though... /etc/udev/ would be a starting point.
> >
> > I had already looked there, and /etc/udev/rules.d contains the line:
> >
> > # Epson Corp.|Perfection 1260
> > SYSFS{idVendor}=="04b8", SYSFS{idProduct}=="011d", MODE="660", GROUP="sca\
> > nner", RUN+="/etc/hotplug.d/usb/libsane.hotplug"
> >
> > Which sounds perfect to me.  Must be more to it than that, I guess.
> 
> Sounds perfect, but it's not.  Did you check and see what damage
> /etc/hotplug.d/usb/libsane.hotplug might be doing?  It _could_ be
> undoing the permissions.

I am fumbling here, but /etc/hotplug.d/usb/libsane.hotplug is not too long 
and says around line 27
chown $3 $DEVICE && chmod $4 $DEVICE

Can it be that this relates to the info taken from /etc/udev/rules.d
(see above), cos if so $3 and $4 are reversed? Or is that too obvious...

-- 
richard


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: sane access for non-root user

2005-12-14 Thread Richard Lyons
On Tuesday, 13 December 2005 at 18:42:38 -0800, Karsten M. Self wrote:
> 
> There's the 'newgrp' command if you want to avoid losing your X session
> and can stand winning just one shell at a time.  'sg' is somewhat
> analagous to 'su', though at atomic number 106.

I think that was Rf when I was at school.  Who was Seaborg anyway?
Still, I suppose he has the labs, so he doesn't need the element too.

But I did not know about sg, which is obviously useful.  Thanks Karsten.

-- 
richard


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: sane access for non-root user

2005-12-13 Thread Daniel Nilsson

Quoting Darryl Clarke <[EMAIL PROTECTED]>:

On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:

On Tuesday, 13 December 2005 at 14:01:06 -0500, Darryl Clarke wrote:
> On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
[...]
> > Installed xsane
> > and can only access it as root.  Added myself to scanner group, but
> > still xsane finds 'no devices available' as ordinary user.  Can someone
> > remind me or point me at the relevant instructions.
> >
> > uname -r says 2.6.12-1-386. udevd is running -- I suppose that is
> > obvious as the scanner works for root.  What else is important?
>
> udev isn't setting permissions properly on the device, I would imagine.
>
> I forget exactly where though... /etc/udev/ would be a starting point.

I had already looked there, and /etc/udev/rules.d contains the line:

# Epson Corp.|Perfection 1260
SYSFS{idVendor}=="04b8", SYSFS{idProduct}=="011d", MODE="660", GROUP="sca\
nner", RUN+="/etc/hotplug.d/usb/libsane.hotplug"

Which sounds perfect to me.  Must be more to it than that, I guess.


Sounds perfect, but it's not.  Did you check and see what damage
/etc/hotplug.d/usb/libsane.hotplug might be doing?  It _could_ be
undoing the permissions.


This sounds exactly like the same issue as I reported a few days ago on this
list with gphoto2 and a USB camera. The USB device node was not updated 
to have

the correct group ownership by the hotplug scripts. I didn't receive an answer
on that question though. Maybe this is more of a generic issue where
permissions on USB device are not set correctly, regardless of whether it's a
camera or scanner?

/Daniel



This message was sent using IMP, the Internet Messaging Program.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: sane access for non-root user

2005-12-13 Thread Karsten M. Self
on Tue, Dec 13, 2005 at 04:49:46PM -0500, Paul Smith ([EMAIL PROTECTED]) wrote:
> %% Richard Lyons <[EMAIL PROTECTED]> writes:
> 
>   >> You may have to log out of your Xsession and log in again to get
>   >> shells spawned using the new/updated group assignments.  (Is there
>   >> a more efficient way to do this?  This seems really inelegant.)
> 
>   rl> More than that, I logged out and back on again from console and
>   rl> then restarted X.  I had a feeling that was necessary, but perhaps
>   rl> it was overkill.  But yes, it is inelegant.
> 
> You do have to log out, but you don't have to restart X.  Going back to
> your GDM or XDM or whatever screen and logging in again is good enough.
> 
> And yes, it's inelegant that you have to do this, but no there's no
> better way.  You can test it with the "ssh localhost" trick, but you
> have to log out to have it set for your session.

There's the 'newgrp' command if you want to avoid losing your X session
and can stand winning just one shell at a time.  'sg' is somewhat
analagous to 'su', though at atomic number 106.


Peace.

-- 
Karsten M. Self http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
Yes sir, Officer Obie, I cannot tell a lie. I put that envelope
under that garbage.
- A. Guthrie


signature.asc
Description: Digital signature


Re: sane access for non-root user

2005-12-13 Thread Darryl Clarke
On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> On Tuesday, 13 December 2005 at 14:01:06 -0500, Darryl Clarke wrote:
> > On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> [...]
> > > Installed xsane
> > > and can only access it as root.  Added myself to scanner group, but
> > > still xsane finds 'no devices available' as ordinary user.  Can someone
> > > remind me or point me at the relevant instructions.
> > >
> > > uname -r says 2.6.12-1-386. udevd is running -- I suppose that is
> > > obvious as the scanner works for root.  What else is important?
> >
> > udev isn't setting permissions properly on the device, I would imagine.
> >
> > I forget exactly where though... /etc/udev/ would be a starting point.
>
> I had already looked there, and /etc/udev/rules.d contains the line:
>
> # Epson Corp.|Perfection 1260
> SYSFS{idVendor}=="04b8", SYSFS{idProduct}=="011d", MODE="660", GROUP="sca\
> nner", RUN+="/etc/hotplug.d/usb/libsane.hotplug"
>
> Which sounds perfect to me.  Must be more to it than that, I guess.

Sounds perfect, but it's not.  Did you check and see what damage
/etc/hotplug.d/usb/libsane.hotplug might be doing?  It _could_ be
undoing the permissions.

It's been a while since I messed with my scanner, but I think I
remember having something similar happen, I just edited the libsane
script and forced the permissions at the end.  not very graceful, but
I was annoyed. :)

> > use 'lsusb' to show the device list
> >
> > When the scanner is plugged in check /proc/bus/usb/XXX/NNN where XXX
> > is the bus and NNN is the device listed in lsusb output... and find
> > the device and see what the permissions actually are.
> >
> > you can manually change the permissions on the device too, just chgrp
> > scanner NNN and chmod g+rw NNN
>
> That worked.  But I hope I don't have to do it manually every time I
> reboot or hotplug the device.

You will :) Until the script(s) are sorted out, you will...

--
~ Darryl  ~ [EMAIL PROTECTED]
http://smartssa.com / http://darrylclarke.com



Re: sane access for non-root user

2005-12-13 Thread Brad Sawatzky
On Tue, 13 Dec 2005, Richard Lyons wrote:

> On Tuesday, 13 December 2005 at 14:28:18 -0500, Brad Sawatzky wrote:
> > > On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> [...]
> > > > Installed xsane
> > > > and can only access it as root.  Added myself to scanner group, but
> > > > still xsane finds 'no devices available' as ordinary user. 
> > 
> > Are you sure that the group change (ie. adding yourself to 'scanner') has
> > been applied to the shell you're running xsane from?  (Check the output of
> > 'groups' or 'id -Gn').
> 
> Yes, did that.
> > 
> > You may have to log out of your Xsession and log in again to get shells
> > spawned using the new/updated group assignments.  (Is there a more efficient
> > way to do this?  This seems really inelegant.)
> 
> More than that, I logged out and back on again from console and then
> restarted X.  I had a feeling that was necessary, but perhaps it was
> overkill.  But yes, it is inelegant.

Hmm.  It might be useful to post the output of
  'sane-find-scanner', and
  'sudo sane-find-scanner'(or however you want to run the command as root)

What are the 'default' permissions and group (assigned by udev) on your
scanner device?

Perhaps you could try unplugging the scanner and confirming that the
appropriate device file is being removed/created by udev.  If udev is
indeed handling the device, then the application of the rules file
(/etc/udev/rules.d/025_libsane.rules on my box) is either borked (reinstall
libsane and/or udev), or there are multiple rules matching your scanner
(and the last one is screwing up the permissions set by libsane.rules).

-- Brad


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: sane access for non-root user

2005-12-13 Thread Paul Smith
%% Richard Lyons <[EMAIL PROTECTED]> writes:

  >> You may have to log out of your Xsession and log in again to get
  >> shells spawned using the new/updated group assignments.  (Is there
  >> a more efficient way to do this?  This seems really inelegant.)

  rl> More than that, I logged out and back on again from console and
  rl> then restarted X.  I had a feeling that was necessary, but perhaps
  rl> it was overkill.  But yes, it is inelegant.

You do have to log out, but you don't have to restart X.  Going back to
your GDM or XDM or whatever screen and logging in again is good enough.

And yes, it's inelegant that you have to do this, but no there's no
better way.  You can test it with the "ssh localhost" trick, but you
have to log out to have it set for your session.

-- 
---
 Paul D. Smith <[EMAIL PROTECTED]>   HASMAT--HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
---
These are my opinions--Nortel takes no responsibility for them.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: sane access for non-root user

2005-12-13 Thread jlquinn

Brad Sawatzky wrote:

Are you sure that the group change (ie. adding yourself to 'scanner') has
been applied to the shell you're running xsane from?  (Check the output of
'groups' or 'id -Gn').

You may have to log out of your Xsession and log in again to get shells
spawned using the new/updated group assignments.  (Is there a more efficient
way to do this?  This seems really inelegant.)

A quick workaround to initialize an up-to-date login environment is to 
'ssh -X localhost' from within a local shell...


Use 'newgrp '.  That essentially puts you in a new shell with 
all the environment carried forward but recognizes the specified group 
and also makes it the primary group for that shell.


Jerry Quinn


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: sane access for non-root user

2005-12-13 Thread Richard Lyons
On Tuesday, 13 December 2005 at 14:01:06 -0500, Darryl Clarke wrote:
> On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
[...]
> > Installed xsane
> > and can only access it as root.  Added myself to scanner group, but
> > still xsane finds 'no devices available' as ordinary user.  Can someone
> > remind me or point me at the relevant instructions.
> >
> > uname -r says 2.6.12-1-386. udevd is running -- I suppose that is
> > obvious as the scanner works for root.  What else is important?
> 
> udev isn't setting permissions properly on the device, I would imagine.
> 
> I forget exactly where though... /etc/udev/ would be a starting point.

I had already looked there, and /etc/udev/rules.d contains the line:

# Epson Corp.|Perfection 1260
SYSFS{idVendor}=="04b8", SYSFS{idProduct}=="011d", MODE="660", GROUP="sca\
nner", RUN+="/etc/hotplug.d/usb/libsane.hotplug"

Which sounds perfect to me.  Must be more to it than that, I guess.
> 
> use 'lsusb' to show the device list
> 
> When the scanner is plugged in check /proc/bus/usb/XXX/NNN where XXX
> is the bus and NNN is the device listed in lsusb output... and find
> the device and see what the permissions actually are.
> 
> you can manually change the permissions on the device too, just chgrp
> scanner NNN and chmod g+rw NNN

That worked.  But I hope I don't have to do it manually every time I
reboot or hotplug the device.

Thanks a million.

-- 
richard


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: sane access for non-root user

2005-12-13 Thread Richard Lyons
On Tuesday, 13 December 2005 at 14:28:18 -0500, Brad Sawatzky wrote:
> > On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
[...]
> > > Installed xsane
> > > and can only access it as root.  Added myself to scanner group, but
> > > still xsane finds 'no devices available' as ordinary user. 
> 
> Are you sure that the group change (ie. adding yourself to 'scanner') has
> been applied to the shell you're running xsane from?  (Check the output of
> 'groups' or 'id -Gn').

Yes, did that.
> 
> You may have to log out of your Xsession and log in again to get shells
> spawned using the new/updated group assignments.  (Is there a more efficient
> way to do this?  This seems really inelegant.)

More than that, I logged out and back on again from console and then
restarted X.  I had a feeling that was necessary, but perhaps it was
overkill.  But yes, it is inelegant.
> 
> A quick workaround to initialize an up-to-date login environment is to 
> 'ssh -X localhost' from within a local shell...

I didn't know that.  Thanks.

-- 
richard


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: sane access for non-root user

2005-12-13 Thread Brad Sawatzky
> On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> > I've just spent over an hour googling in vain.  And I am sure I should
> > know the answer to this...
> >
> > New sid install (on a not-new Dell Inspiron 8200 FWIW).  Installed xsane
> > and can only access it as root.  Added myself to scanner group, but
> > still xsane finds 'no devices available' as ordinary user.  Can someone
> > remind me or point me at the relevant instructions.
> >
> > uname -r says 2.6.12-1-386. udevd is running -- I suppose that is
> > obvious as the scanner works for root.  What else is important?

Are you sure that the group change (ie. adding yourself to 'scanner') has
been applied to the shell you're running xsane from?  (Check the output of
'groups' or 'id -Gn').

You may have to log out of your Xsession and log in again to get shells
spawned using the new/updated group assignments.  (Is there a more efficient
way to do this?  This seems really inelegant.)

A quick workaround to initialize an up-to-date login environment is to 
'ssh -X localhost' from within a local shell...

FWIW,
-- Brad


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: sane access for non-root user

2005-12-13 Thread Darryl Clarke
On 12/13/05, Richard Lyons <[EMAIL PROTECTED]> wrote:
> I've just spent over an hour googling in vain.  And I am sure I should
> know the answer to this...
>
> New sid install (on a not-new Dell Inspiron 8200 FWIW).  Installed xsane
> and can only access it as root.  Added myself to scanner group, but
> still xsane finds 'no devices available' as ordinary user.  Can someone
> remind me or point me at the relevant instructions.
>
> uname -r says 2.6.12-1-386. udevd is running -- I suppose that is
> obvious as the scanner works for root.  What else is important?

udev isn't setting permissions properly on the device, I would imagine.

I forget exactly where though... /etc/udev/ would be a starting point.

use 'lsusb' to show the device list

When the scanner is plugged in check /proc/bus/usb/XXX/NNN where XXX
is the bus and NNN is the device listed in lsusb output... and find
the device and see what the permissions actually are.

you can manually change the permissions on the device too, just chgrp
scanner NNN and chmod g+rw NNN

--
~ Darryl  ~ [EMAIL PROTECTED]
http://smartssa.com / http://darrylclarke.com