]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/opie-login/files/pre-session
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / opie-login / files / pre-session
1 #!/bin/sh
2
3 USER=$1
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
18 permin ()
19 {
20         if [ -e $1 ]
21         then
22                 chown $USER $1
23         else
24                 echo Warning: $1 does not exist.
25                 return 1
26         fi
27 }
28
29 if [ -e /proc/hal/model ]; then
30         # fix for misconfigured devfsd
31         chmod +x /dev/sound /dev/touchscreen /dev/fb /dev/vc
32         for i in /dev/sound/dsp /dev/sound/mixer /dev/touchscreen/* /dev/fb/0 /dev/vc/0; do
33                 permin $i
34         done
35 else
36         for i in /dev/dsp/* /dev/dsp1 /dev/mixer /dev/ts /dev/fb0 /dev/sharp* /dev/collie*; do
37                 permin $i
38         done
39 fi