summaryrefslogtreecommitdiff
path: root/share/opie-login/pre-session
authorkergoth <kergoth>2003-01-28 19:41:03 (UTC)
committer kergoth <kergoth>2003-01-28 19:41:03 (UTC)
commitc73371101f28e1c28837b35c62fde18f16dfb32f (patch) (unidiff)
treedb55da47d73692283df2b657963d8b8c85195c37 /share/opie-login/pre-session
parent7cf931b1571a65212f6b085e3c04087f03430d40 (diff)
downloadopie-c73371101f28e1c28837b35c62fde18f16dfb32f.zip
opie-c73371101f28e1c28837b35c62fde18f16dfb32f.tar.gz
opie-c73371101f28e1c28837b35c62fde18f16dfb32f.tar.bz2
Script cleanup
Diffstat (limited to 'share/opie-login/pre-session') (more/less context) (ignore whitespace changes)
-rw-r--r--share/opie-login/pre-session39
1 files changed, 12 insertions, 27 deletions
diff --git a/share/opie-login/pre-session b/share/opie-login/pre-session
index 6bf9e4c..e147afc 100644
--- a/share/opie-login/pre-session
+++ b/share/opie-login/pre-session
@@ -10,47 +10,32 @@ USER=$1
10 #devices exclusive by 1) changing device ownership 10 #devices exclusive by 1) changing device ownership
11 #to the user, and 2) removing group access. 11 #to the user, and 2) removing group access.
12# 12#
13 #A better implementation would probably be to store 13 #A better implementation would probably be to store
14 #existing device permissions at load time, and restore 14 #existing device permissions at load time, and restore
15 #them at exit, rather than making assumptions about 15 #them at exit, rather than making assumptions about
16 #user/group ownership, or permissions. 16 #user/group ownership, or permissions.
17 17
18permin () 18permin ()
19{ 19{
20 if [ -e $1 ] 20 if [ -e $1 ]
21 then 21 then
22 22 chown $USER $1
23 chown $USER $1
24 chmod g-rw $1
25
26 else 23 else
24 echo Warning: $1 does not exist.
27 return 1 25 return 1
28 fi 26 fi
29} 27}
30 28
31permout ()
32{
33 [ -e $1 ]&& chown root $1
34 [ -e $1 ]&& chmod g+rw $1
35}
36
37if [ -e /proc/hal/model ]; then 29if [ -e /proc/hal/model ]; then
38 30 # fix for misconfigured devfsd
39 # fix for misconfigured devfsd 31 chmod +x /dev/sound /dev/touchscreen /dev/fb /dev/vc
40 chmod +x /dev/sound /dev/touchscreen /dev/fb /dev/vc 32 devs = /dev/sound/dsp /dev/sound/mixer /dev/touchscreen/0 \
41 33 /dev/fb/0 /dev/vc/0
42 [ -e /dev/sound/dsp ] && chown $USER /dev/sound/dsp
43 [ -e /dev/sound/mixer ] && chown $USER /dev/sound/mixer
44 [ -e /dev/touchscreen/0 ] && chown $USER /dev/touchscreen/0
45 [ -e /dev/fb/0 ] && chown $USER /dev/fb/0
46 [ -e /dev/vc/0 ] && chown $USER /dev/vc/0
47
48else 34else
49 35 devs = /dev/dsp /dev/dsp1 /dev/mixer /dev/ts /dev/fb0 \
50 for dev in /dev/dsp /dev/dsp1 /dev/mixer \ 36 /dev/sharp* /dev/collie*
51 /dev/ts /dev/fb0
52 do
53 permin( $dev )
54 done
55
56fi 37fi
38
39for i in $devs; do
40 permin( $i )
41done