summaryrefslogtreecommitdiff
path: root/share
authorkergoth <kergoth>2003-01-16 04:39:25 (UTC)
committer kergoth <kergoth>2003-01-16 04:39:25 (UTC)
commit21cee2677c4a480f00675cdc9160e5d7e97e7122 (patch) (unidiff)
treea2e3b3f9675949fae2cf57e0f7b44441e7bfa06c /share
parent7ffd4623880396f07e34faf195f8c131218cf682 (diff)
downloadopie-21cee2677c4a480f00675cdc9160e5d7e97e7122.zip
opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.tar.gz
opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.tar.bz2
*** empty log message ***
Diffstat (limited to 'share') (more/less context) (ignore whitespace changes)
-rw-r--r--share/opie-login/pre-session42
1 files changed, 41 insertions, 1 deletions
diff --git a/share/opie-login/pre-session b/share/opie-login/pre-session
index 8219f94..6bf9e4c 100644
--- a/share/opie-login/pre-session
+++ b/share/opie-login/pre-session
@@ -1,16 +1,56 @@
1#!/bin/sh 1#!/bin/sh
2 2
3USER=$1 3USER=$1
4 4
5# NOTE about permissions in OpenZaurus
6 # The devices in question here by default
7 #are accessible to everyone in the group in
8 #question. We wish to ensure that, as a policy
9 #choice, a login to opie makes access to these
10 #devices exclusive by 1) changing device ownership
11 #to the user, and 2) removing group access.
12#
13 #A better implementation would probably be to store
14 #existing device permissions at load time, and restore
15 #them at exit, rather than making assumptions about
16 #user/group ownership, or permissions.
17
18permin ()
19{
20 if [ -e $1 ]
21 then
22
23 chown $USER $1
24 chmod g-rw $1
25
26 else
27 return 1
28 fi
29}
30
31permout ()
32{
33 [ -e $1 ]&& chown root $1
34 [ -e $1 ]&& chmod g+rw $1
35}
36
5if [ -e /proc/hal/model ]; then 37if [ -e /proc/hal/model ]; then
6 38
7 # fix for misconfigured devfsd 39 # fix for misconfigured devfsd
8 chmod +x /dev/sound /dev/touchscreen /dev/fb /dev/vc 40 chmod +x /dev/sound /dev/touchscreen /dev/fb /dev/vc
9 41
10 [ -e /dev/sound/dsp ] && chown $USER /dev/sound/dsp 42 [ -e /dev/sound/dsp ] && chown $USER /dev/sound/dsp
11 [ -e /dev/sound/mixer ] && chown $USER /dev/sound/mixer 43 [ -e /dev/sound/mixer ] && chown $USER /dev/sound/mixer
12 [ -e /dev/touchscreen/0 ] && chown $USER /dev/touchscreen/0 44 [ -e /dev/touchscreen/0 ] && chown $USER /dev/touchscreen/0
13 [ -e /dev/fb/0 ] && chown $USER /dev/fb/0 45 [ -e /dev/fb/0 ] && chown $USER /dev/fb/0
14 [ -e /dev/vc/0 ] && chown $USER /dev/vc/0 46 [ -e /dev/vc/0 ] && chown $USER /dev/vc/0
15fi
16 47
48else
49
50 for dev in /dev/dsp /dev/dsp1 /dev/mixer \
51 /dev/ts /dev/fb0
52 do
53 permin( $dev )
54 done
55
56fi