Re: localdev and fixed devices

Gideon Romm <[email protected]>
Newsgroups gmane.linux.terminal-server.devel
Message-ID <1220764153.11186.7.camel@romm-desktop>
Hi, everybody.

Please check out this branch for a proposed solution:

lp:~gideon/ltsp/ltspfs-trunk-gadi

I introduce an lts.conf parameter called "LOCALDEV_DENY".  With this
parameter, you can deny local devices based upon udevinfo criteria or
combinations of several udevinfo criteria.

Syntax:

LOCALDEV_DENY = "var1:val1,var2:val2,var3:val3+var4:val4"

Which means:

Deny local devices if:  var1 = val1 OR var2 = val2 OR (var3 = val3 AND
var4 = val4)

So, if I want to block all local scsi hard drives, I simply do:

LOCALDEV_DENY = "ID_TYPE:disk+ID_BUS:scsi"

To block all USB devices:

LOCALDEV_DENY = "ID_BUS:usb"

To block all IDE and SCSI hard drives:

LOCALDEV_DENY = "ID_TYPE:disk+ID_BUS:scsi,ID_TYPE:disk+ID_BUS:ide"

This should allow us to drop the "removable" match in the udev rule, and
control to quite a fine degree the devices we wish to block by default,
while allowing the user to override.

Cheers,

-Gadi

On Fri, 2008-09-05 at 12:49 -0700, Vagrant Cascadian wrote:
> On Fri, Sep 05, 2008 at 01:57:46PM +0200, Helmut Lichtenberg wrote:
> > Oliver Grawert schrieb am 27. Aug 2008 um 14:44:55 CEST:
> > > it used to be without checks for removable devices in the original
> > > implementation, due to massive complaints from skolelinux (schools with
> > > dual booted client machines suddenly gave full acccess to the XP
> > > partition to everyone logged in on a thin client) we decided to accept
> > > their hardcoded patch to disable HDDs completely until someone else
> > > comes up with a better solution ... so patches are indeed appreciated
> > > any happily accepted ;)
>  
> > I sent a patch for this problem to the list, but Jim McQuillan redirected me
> > to ltsp-developers. So here's my suggestion:
> 
> > 1. udev must provide all devices, not only removables. Otherwise we could not
> >    select between them via lts.conf.
> 
> until very recently, we didn't have access to lts.conf values from the
> udev scripts (mainly ltspfs_entry). now that we do, it's probably time
> to reconsider this as a configurable value.
> 
> > 2. It seems easier for me not to allow certain devices but to deny them.
> 
> we'll probably want both allow and deny, i'm guessing.
> 
> > 3. Let's restrict it for now for the two traits 'removable' and 'fixed'.
> >    Introduce a variable in lts.conf like this:
> > 
> >    LOCALDEV_DENY = fixed      # possible values: [fixed|removable]
> 
> > 4. Maybe later we can enhance it for certain named devices or partitions. This
> >    needs a more complicated retrieval of udev information and decisions about
> >    the syntax in lts.conf.
> 
> well, it's more complicated than one might think. USB external
> hard-drive cages are not considered removable according to udev, because
> the hard-drive itself is a fixed device, even though it's attached by
> USB, which is clearly removable. i don't know for sure, but there may be
> other cases like that (firewire devices?).
> 
> maybe this would be why we need a corresponding LOCALDEV_ALLOW.
>  
> > To implement this for the new ltspfs-trunk, Oliver pointed to, there are only
> > two new functions for ltspfs_entry: is_removable() and is_denied().
> > 
> > I've put a first implementation into a shell script, where you can test it
> > easily. 
> 
> the basic idea looks reasonable(if we can account for the
> above-mentioned issues), but i'd prefer to see a patch against
> ltspfs-trunk instead of an example script, if possible. this would make
> it easier to test and see how it would be used.
> 
> live well,
>   vagrant
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _____________________________________________________________________
> Ltsp-developer mailing list.   To un-subscribe, or change prefs, goto:
>       https://lists.sourceforge.net/lists/listinfo/ltsp-developer
> For additional LTSP help,   try #ltsp channel on irc.freenode.net
-- 
Gideon Romm <[email protected]>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_____________________________________________________________________
Ltsp-developer mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-developer
For additional LTSP help,   try #ltsp channel on irc.freenode.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.