* Permissions of usb hub and its children
@ 2006-09-05 9:52 Fabian Steiner
2006-09-05 17:54 ` Greg KH
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Fabian Steiner @ 2006-09-05 9:52 UTC (permalink / raw)
To: linux-hotplug
Hello!
I am trying to change the permissions of my usb hub with the follwing
udev rule:
SUBSYSTEM="usb", DEVPATH="/devices/pci0000:00/0000:00:02.1/usb1/1-3",
OWNER="fabi", MODE="600
Doing so I hoped that all usb devices that will be connected to that hub
would receive the same permissions but obviously it doesn't work. Is
there any possibility to achieve this goal using udev?
Unfortunately, I can not write appropriate udev rules for every device
that is connected to that hub ...
Fabian Steiner
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Permissions of usb hub and its children
2006-09-05 9:52 Permissions of usb hub and its children Fabian Steiner
@ 2006-09-05 17:54 ` Greg KH
2006-09-05 21:50 ` Fabian Steiner
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2006-09-05 17:54 UTC (permalink / raw)
To: linux-hotplug
On Tue, Sep 05, 2006 at 11:52:54AM +0200, Fabian Steiner wrote:
> Hello!
>
> I am trying to change the permissions of my usb hub with the follwing
> udev rule:
>
> SUBSYSTEM="usb", DEVPATH="/devices/pci0000:00/0000:00:02.1/usb1/1-3",
> OWNER="fabi", MODE="600
What are you trying to change here? The permissions of the usb hub in
usbfs?
> Doing so I hoped that all usb devices that will be connected to that hub
> would receive the same permissions but obviously it doesn't work.
No, hub permissions do not propagate down to the devices, sorry.
> Is there any possibility to achieve this goal using udev?
Yes, use much the same rule as above :)
thanks,
greg k-h
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Permissions of usb hub and its children
2006-09-05 9:52 Permissions of usb hub and its children Fabian Steiner
2006-09-05 17:54 ` Greg KH
@ 2006-09-05 21:50 ` Fabian Steiner
2006-09-06 0:35 ` Greg KH
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Fabian Steiner @ 2006-09-05 21:50 UTC (permalink / raw)
To: linux-hotplug
Greg KH wrote:
> On Tue, Sep 05, 2006 at 11:52:54AM +0200, Fabian Steiner wrote:
>> Hello!
>>
>> I am trying to change the permissions of my usb hub with the follwing
>> udev rule:
>>
>> SUBSYSTEM="usb", DEVPATH="/devices/pci0000:00/0000:00:02.1/usb1/1-3",
>> OWNER="fabi", MODE="600
>
> What are you trying to change here? The permissions of the usb hub in
> usbfs?
Yes, my intension was to assign proper permissions to the usb hub so
that all devices that are connected to that hub get the same permissions.
>> Doing so I hoped that all usb devices that will be connected to that hub
>> would receive the same permissions but obviously it doesn't work.
>
> No, hub permissions do not propagate down to the devices, sorry.
>
>> Is there any possibility to achieve this goal using udev?
>
> Yes, use much the same rule as above :)
What does the rule have to look like then? ;-) The main problem is that
I don't know what kind of devices are plugged in the hub. So the udev
rule has to match quite a lot of devices (block devices, scanner, mouse,
etc.).
Having a more closer look at different manpages and howtos I have found
a solution that is almost suitable:
SUBSYSTEM="*",
ENV{PHYSDEVPATH}="/devices/pci0000:00/0000:00:02.1/usb1/1-3*",
OWNER:="fabi", MODE:="600"
I am not quite sure whether this rule will fulfill all of my
requirements but so far it looks good. I.e. I don't know for sure
whether ENV{PHYSDEVPATH} is set for all devices and whether it contains
a sysfs address. Perhaps you could give me a hint :-)
Thanks,
Fabian STeiner
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Permissions of usb hub and its children
2006-09-05 9:52 Permissions of usb hub and its children Fabian Steiner
2006-09-05 17:54 ` Greg KH
2006-09-05 21:50 ` Fabian Steiner
@ 2006-09-06 0:35 ` Greg KH
2006-09-06 0:50 ` Kay Sievers
2006-09-06 7:15 ` Fabian Steiner
4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2006-09-06 0:35 UTC (permalink / raw)
To: linux-hotplug
On Tue, Sep 05, 2006 at 11:50:03PM +0200, Fabian Steiner wrote:
> Greg KH wrote:
> > On Tue, Sep 05, 2006 at 11:52:54AM +0200, Fabian Steiner wrote:
> >> Hello!
> >>
> >> I am trying to change the permissions of my usb hub with the follwing
> >> udev rule:
> >>
> >> SUBSYSTEM="usb", DEVPATH="/devices/pci0000:00/0000:00:02.1/usb1/1-3",
> >> OWNER="fabi", MODE="600
> >
> > What are you trying to change here? The permissions of the usb hub in
> > usbfs?
>
> Yes, my intension was to assign proper permissions to the usb hub so
> that all devices that are connected to that hub get the same permissions.
Ah, multi-user type setup?
> >> Doing so I hoped that all usb devices that will be connected to that hub
> >> would receive the same permissions but obviously it doesn't work.
> >
> > No, hub permissions do not propagate down to the devices, sorry.
> >
> >> Is there any possibility to achieve this goal using udev?
> >
> > Yes, use much the same rule as above :)
>
> What does the rule have to look like then? ;-) The main problem is that
> I don't know what kind of devices are plugged in the hub. So the udev
> rule has to match quite a lot of devices (block devices, scanner, mouse,
> etc.).
>
> Having a more closer look at different manpages and howtos I have found
> a solution that is almost suitable:
>
> SUBSYSTEM="*",
> ENV{PHYSDEVPATH}="/devices/pci0000:00/0000:00:02.1/usb1/1-3*",
> OWNER:="fabi", MODE:="600"
>
> I am not quite sure whether this rule will fulfill all of my
> requirements but so far it looks good. I.e. I don't know for sure
> whether ENV{PHYSDEVPATH} is set for all devices and whether it contains
> a sysfs address. Perhaps you could give me a hint :-)
Yes, that should work. But remember, "usb1" the next time you boot
might not be the same root hub you thought it was last time. That all
depends on PCI bus numbering (which can change, but rarely), and USB
host controller driver loading order (which changes often due to the
phase of the moon and such.)
So be careful about that.
good luck,
greg k-h
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Permissions of usb hub and its children
2006-09-05 9:52 Permissions of usb hub and its children Fabian Steiner
` (2 preceding siblings ...)
2006-09-06 0:35 ` Greg KH
@ 2006-09-06 0:50 ` Kay Sievers
2006-09-06 7:15 ` Fabian Steiner
4 siblings, 0 replies; 6+ messages in thread
From: Kay Sievers @ 2006-09-06 0:50 UTC (permalink / raw)
To: linux-hotplug
On Tue, 2006-09-05 at 17:35 -0700, Greg KH wrote:
> On Tue, Sep 05, 2006 at 11:50:03PM +0200, Fabian Steiner wrote:
> > Greg KH wrote:
> > > On Tue, Sep 05, 2006 at 11:52:54AM +0200, Fabian Steiner wrote:
> > >> Hello!
> > >>
> > >> I am trying to change the permissions of my usb hub with the follwing
> > >> udev rule:
> > >>
> > >> SUBSYSTEM="usb", DEVPATH="/devices/pci0000:00/0000:00:02.1/usb1/1-3",
> > >> OWNER="fabi", MODE="600
> > >
> > > What are you trying to change here? The permissions of the usb hub in
> > > usbfs?
> >
> > Yes, my intension was to assign proper permissions to the usb hub so
> > that all devices that are connected to that hub get the same permissions.
>
> Ah, multi-user type setup?
>
> > >> Doing so I hoped that all usb devices that will be connected to that hub
> > >> would receive the same permissions but obviously it doesn't work.
> > >
> > > No, hub permissions do not propagate down to the devices, sorry.
> > >
> > >> Is there any possibility to achieve this goal using udev?
> > >
> > > Yes, use much the same rule as above :)
> >
> > What does the rule have to look like then? ;-) The main problem is that
> > I don't know what kind of devices are plugged in the hub. So the udev
> > rule has to match quite a lot of devices (block devices, scanner, mouse,
> > etc.).
> >
> > Having a more closer look at different manpages and howtos I have found
> > a solution that is almost suitable:
> >
> > SUBSYSTEM="*",
> > ENV{PHYSDEVPATH}="/devices/pci0000:00/0000:00:02.1/usb1/1-3*",
> > OWNER:="fabi", MODE:="600"
> >
> > I am not quite sure whether this rule will fulfill all of my
> > requirements but so far it looks good. I.e. I don't know for sure
> > whether ENV{PHYSDEVPATH} is set for all devices and whether it contains
> > a sysfs address. Perhaps you could give me a hint :-)
>
> Yes, that should work. But remember, "usb1" the next time you boot
> might not be the same root hub you thought it was last time. That all
> depends on PCI bus numbering (which can change, but rarely), and USB
> host controller driver loading order (which changes often due to the
> phase of the moon and such.)
PHYSDEV* values are deprecated and will go away some day. You better
match on the BUS="usb" and ID="1-3*" if you really want that. In short
you can't really solve that problem proper, in a setup which changes
dynamically and you can connect and disconnect everything while the
system is running. Only unique device properties like usb serial numbers
could solve that, but such devices are rare.
Or you do this for every class of device at the individual device level.
But for a device-level permissions-setup, udev is the completely wrong
infrastructure and you would need to plug into HAL, which can classify
devices properly. The kernel or udev will never have this kind of
information, needed to do this at the device level.
Kay
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Permissions of usb hub and its children
2006-09-05 9:52 Permissions of usb hub and its children Fabian Steiner
` (3 preceding siblings ...)
2006-09-06 0:50 ` Kay Sievers
@ 2006-09-06 7:15 ` Fabian Steiner
4 siblings, 0 replies; 6+ messages in thread
From: Fabian Steiner @ 2006-09-06 7:15 UTC (permalink / raw)
To: linux-hotplug
Greg KH wrote:
> On Tue, Sep 05, 2006 at 11:50:03PM +0200, Fabian Steiner wrote:
>> Greg KH wrote:
>>> On Tue, Sep 05, 2006 at 11:52:54AM +0200, Fabian Steiner wrote:
>>>> Hello!
>>>>
>>>> I am trying to change the permissions of my usb hub with the follwing
>>>> udev rule:
>>>>
>>>> SUBSYSTEM="usb", DEVPATH="/devices/pci0000:00/0000:00:02.1/usb1/1-3",
>>>> OWNER="fabi", MODE="600
>>> What are you trying to change here? The permissions of the usb hub in
>>> usbfs?
>> Yes, my intension was to assign proper permissions to the usb hub so
>> that all devices that are connected to that hub get the same permissions.
>
> Ah, multi-user type setup?
Exactly :-) As there is no solution for this so far, we tried to do it
on our own, but as you can see we are not that successful since there
are quite a lot of different aspects to think of.
Our current solution is based on a simple python script which is
executed whenever a user logins (by using the PostLogin mechanism of
GDM). It then reads the environment variables $DISPLAY and $USER which
are set by GDM properly and tries to find out whether a usb hub was
assigned to that particular display. This is done manually by using a
config file.
If someone is interested, I will publish the script.
>> I am not quite sure whether this rule will fulfill all of my
>> requirements but so far it looks good. I.e. I don't know for sure
>> whether ENV{PHYSDEVPATH} is set for all devices and whether it contains
>> a sysfs address. Perhaps you could give me a hint :-)
>
> Yes, that should work. But remember, "usb1" the next time you boot
> might not be the same root hub you thought it was last time. That all
> depends on PCI bus numbering (which can change, but rarely), and USB
> host controller driver loading order (which changes often due to the
> phase of the moon and such.)
>
> So be careful about that.
Oh, I wasn't aware of that so far. I will probably have to rethink the
whole thing, I suppose ... Of course, the system should work under all
circumstances and not when the moon wants it to ;-)
> good luck,
>
> greg k-h
>
Thank you,
Fabian STeiner
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-06 7:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-05 9:52 Permissions of usb hub and its children Fabian Steiner
2006-09-05 17:54 ` Greg KH
2006-09-05 21:50 ` Fabian Steiner
2006-09-06 0:35 ` Greg KH
2006-09-06 0:50 ` Kay Sievers
2006-09-06 7:15 ` Fabian Steiner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).