author | kergoth <kergoth> | 2003-01-16 04:39:25 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-01-16 04:39:25 (UTC) |
commit | 21cee2677c4a480f00675cdc9160e5d7e97e7122 (patch) (unidiff) | |
tree | a2e3b3f9675949fae2cf57e0f7b44441e7bfa06c /share | |
parent | 7ffd4623880396f07e34faf195f8c131218cf682 (diff) | |
download | opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.zip opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.tar.gz opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.tar.bz2 |
*** empty log message ***
-rw-r--r-- | share/opie-login/pre-session | 42 |
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 | |||
@@ -2,6 +2,38 @@ | |||
2 | 2 | ||
3 | USER=$1 | 3 | USER=$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 | |||
18 | permin () | ||
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 | |||
31 | permout () | ||
32 | { | ||
33 | [ -e $1 ]&& chown root $1 | ||
34 | [ -e $1 ]&& chmod g+rw $1 | ||
35 | } | ||
36 | |||
5 | if [ -e /proc/hal/model ]; then | 37 | if [ -e /proc/hal/model ]; then |
6 | 38 | ||
7 | # fix for misconfigured devfsd | 39 | # fix for misconfigured devfsd |
@@ -12,5 +44,13 @@ if [ -e /proc/hal/model ]; then | |||
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 |
15 | fi | ||
16 | 47 | ||
48 | else | ||
49 | |||
50 | for dev in /dev/dsp /dev/dsp1 /dev/mixer \ | ||
51 | /dev/ts /dev/fb0 | ||
52 | do | ||
53 | permin( $dev ) | ||
54 | done | ||
55 | |||
56 | fi | ||