summaryrefslogtreecommitdiff
path: root/user-init
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2003-03-13 03:14:48 +0000
committerJonas Smedegaard <dr@jones.dk>2003-03-13 03:14:48 +0000
commit73fbc48a85efd952694b9d3d50a9fefc5dc2f4c0 (patch)
tree052e7e94a971bc56bb489df29e1c8709e3968546 /user-init
parentec6fb2e684efc2996b79f325524e9c84b29855c6 (diff)
Correct owner for exceptions created. Check and recreate if exceptions are not of right type. Improve comments.
Diffstat (limited to 'user-init')
-rwxr-xr-xuser-init15
1 files changed, 12 insertions, 3 deletions
diff --git a/user-init b/user-init
index 3be2fc6..5cc7fcf 100755
--- a/user-init
+++ b/user-init
@@ -208,20 +208,29 @@ for user in $USERS; do
chgrp -R "$rwgroup" "$thisdir"
chmod -R ug=rw,o=r,a+X,g+s "$thisdir"
done)
- # Handle exceptions
+ # Handle exception dirs to be created if not existing
+ IFS="/"; for dir in $dirs_group_rw_create/$dirs_group_ro_create; do IFS="$ifs";
+ if [ ! -d "$thisdir/$dir" ]; then
+ rm -f "$thisdir/$dir"
+ fi
+ if [ ! -e "$thisdir/$dir" ]; then
+ mkdir "$thisdir/$dir"
+ chown "$user":"$rwgroup" "$thisdir/$dir"
+ fi
+ done
IFS="/"; for dir in $dirs_group_rw_create; do IFS="$ifs";
- mkdir -p -m ug=rw,o=r,a+X,g+s "$thisdir/$dir"
chmod -R ug=rw,o=r,a+X,g+s "$thisdir/$dir"
done
IFS="/"; for dir in $dirs_group_ro_create; do IFS="$ifs";
- mkdir -p -m u=rw,go=r,a+X,g+s "$thisdir/$dir"
chmod -R u=rw,go=r,a+X,g+s "$thisdir/$dir"
done
+ # Handle exception files to be updated if already there
IFS="/"; for file in $files_group_ro_update; do IFS="$ifs";
if [ -f "$thisdir/$file" ]; then
chmod u=rw,go=r,g+s "$thisdir/$file"
fi
done
+ # Handle exception dirs to be purged and recreated
IFS="/"; for dir in $dirs_no_access_purge; do IFS="$ifs";
rm -rf "$thisdir/$dir"
mkdir -m a= "$thisdir/$dir"