From 73fbc48a85efd952694b9d3d50a9fefc5dc2f4c0 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 13 Mar 2003 03:14:48 +0000 Subject: Correct owner for exceptions created. Check and recreate if exceptions are not of right type. Improve comments. --- user-init | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'user-init') 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" -- cgit v1.2.3