[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltsp-discuss
Subject:    Re: [Ltsp-discuss] local usb but not hdd
From:       Helmut Lichtenberg <Helmut.Lichtenberg () fli ! bund ! de>
Date:       2008-08-28 12:48:10
Message-ID: 20080828124810.GI17793 () tzv ! fal ! de
[Download RAW message or body]

Hi Oliver,

Oliver Grawert schrieb am 27. Aug 2008 um 14:44:55 CEST:
> it used to be without checks for removable devices in teh 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 apperciated
> any happily accepted ;)

What about this:

1. udev must provide all devices, not only removables. Otherwise we could not
   select between them via lts.conf.

2. It seems easier for me not to allow certain devices but to deny them.

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.

To implement this for the new ltspfs-trunk, you pointed to, there are only
two new functions for ltspfs_entry: is_removable() and is_denied().

You then can decide, if the script should run start_ltspfsd and call_ltspfsmounter.

I've put a first implementation into a shell script, where you can test it
easily. See attachment.

Comments wellcome.
Helmut

-- 
-------------------------------------------------------------------------
Helmut Lichtenberg  <Helmut.Lichtenberg@fli.bund.de>  Tel.: 05034/871-128
Institut für Nutztiergenetik (FLI)         31535 Neustadt         Germany
-------------------------------------------------------------------------


#!/bin/sh

DEVICENAME=sda1         # from udev
LOCALDEV_DENY=fixed     # from lts.conf [removable|fixed]

is_denied()
{
    test -z "$LOCALDEV_DENY" && return 1

    case $LOCALDEV_DENY in
        fixed)
            is_removable $1 && return 1
            return 0
            ;;
        removable)
            is_removable $1 && return 0
            return 1
            ;;
        *)
            return 1
            ;;
    esac
}

is_removable()
{
    IS_REM=`udevadm info --attribute-walk -n $1 \
        |grep removable \
        |sed -e 's/.*\([0|1]\).*/\1/'`
    test $IS_REM = 1 && return 0   # true  (is removable)
    return 1                       # false (is not removable)
}

if is_denied $DEVICENAME ; then
    echo "Don't run call_ltspfsmounter on device $DEVICENAME in ltspfs_entry"
    # ignore this device in add_device()
else
    echo "Run call_ltspfsmounter on device $DEVICENAME in ltspfs_entry"
    # do the real work:
    # start_ltspfsd
    # call_ltspfsmounter add ${MOUNTPOINT}

fi


-------------------------------------------------------------------------
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-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic