From 5dbe9f58907075034b51743637467fdcdb983e3f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 18 Jan 2008 14:19:59 +0000 Subject: Add comments about share subdirs processed. Change thisdir->thisitem and item->thisparentdir for share sub-sub-sub-items. --- user-init | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'user-init') diff --git a/user-init b/user-init index b87681f..1857534 100755 --- a/user-init +++ b/user-init @@ -309,31 +309,36 @@ for user in $USERS; do esac exceptions="$dirs_world_rw_create/$dirs_group_rw_create/$dirs_group_ro_create/$dirs_group_ro_update/$files_group_ro_update/$dirs_no_access_purge" exception_dirs_create="$dirs_world_rw_create/$dirs_group_rw_create/$dirs_group_ro_create" + # /shares. chown "$user": "$thisdir" chmod a=rX "$thisdir" find "$thisdir" -mindepth 1 -maxdepth 1 -type d -print | (while read thisdir; do + # /shares./ rogroup="`basename \"$thisdir\"`" chown "$user":"$rogroup" "$thisdir" chmod ug=rX,o= "$thisdir" find "$thisdir" -mindepth 1 -maxdepth 1 -type d -print | (while read thisdir; do + # /shares.// rwgroup="`basename \"$thisdir\"`" chown "$user":"$rwgroup" "$thisdir" chmod a=rX,g+s "$thisdir" find "$thisdir" -mindepth 1 -maxdepth 1 -type d -print | (while read thisdir; do + # /shares./// sharename="`basename \"$thisdir\"`" chown "$user":"$rwgroup" "$thisdir" chmod u=rw,go=r,a+X,g+s "$thisdir" ifs="$IFS" # Set default permissions - find "$thisdir" -mindepth 1 -maxdepth 1 -print | (while read thisdir; do - item="`basename \"$thisdir\"`" + find "$thisdir" -mindepth 1 -maxdepth 1 -print | (while read thisitem; do + # /shares.////* + thisparentdir="`basename \"$thisitem\"`" IFS="/"; for exception in $exceptions; do IFS="$ifs"; - if [ "$item" = "$exception" ]; then + if [ "$thisparentdir" = "$exception" ]; then continue 2 fi done - chgrp -R "$rwgroup" "$thisdir" - chmod -R ug=rw,o=r,a+X,g+s "$thisdir" + chgrp -R "$rwgroup" "$thisitem" + chmod -R ug=rw,o=r,a+X,g+s "$thisitem" done) # Handle exception dirs to be created if not existing IFS="/"; for dir in $exception_dirs_create; do IFS="$ifs"; -- cgit v1.2.3