From d3a938ecbfdb0713b14b8322ede59a7246598bf6 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 20 Jan 2008 00:37:44 +0000 Subject: Implement new variable RELAXEDPERMS: When non-empty the root dir of netatalk shares are group writable. --- user-init | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'user-init') diff --git a/user-init b/user-init index 1857534..e47ae81 100755 --- a/user-init +++ b/user-init @@ -47,6 +47,10 @@ server_userconf=".winpassword" QUOTASOFT="0" QUOTAHARD="0" +# Relax permissions +# Currently allows group write access to root of mac shares +RELAXEDPERMS='' + ### No servicable parts below this line! ### if [ -e /etc/adduser.conf ]; then @@ -297,6 +301,11 @@ for user in $USERS; do dirs_world_rw_create='.AppleDB' dirs_group_rw_create='.AppleDesktop/Temporary Items/TheFindByContentFolder' dirs_group_ro_create='TheVolumeSettingsFolder' + if [ -n "$RELAXEDPERMS" ]; then + dirs_group_rw_update='.AppleDouble' + else + dirs_group_ro_update='.AppleDouble' + fi dirs_group_ro_update='.AppleDouble' files_group_ro_update=':2eDS_Store' dirs_no_access_purge='Network Trash Folder' @@ -307,7 +316,7 @@ for user in $USERS; do continue ;; 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" + exceptions="$dirs_world_rw_create/$dirs_group_rw_create/$dirs_group_ro_create/$dirs_group_rw_update/$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" @@ -326,7 +335,11 @@ for user in $USERS; do # /shares./// sharename="`basename \"$thisdir\"`" chown "$user":"$rwgroup" "$thisdir" - chmod u=rw,go=r,a+X,g+s "$thisdir" + if [ -n "$RELAXEDPERMS" ]; then + chmod ug=rw,o=r,a+X,g+s "$thisdir" + else + chmod u=rw,go=r,a+X,g+s "$thisdir" + fi ifs="$IFS" # Set default permissions find "$thisdir" -mindepth 1 -maxdepth 1 -print | (while read thisitem; do @@ -364,6 +377,11 @@ for user in $USERS; do chmod -R u=rw,go=r,a+X,g+s "$thisdir/$dir" done # Handle exception dirs to be updated if already there + IFS="/"; for dir in $dirs_group_rw_update; do IFS="$ifs"; + if [ -e "$thisdir/$dir" ]; then + chmod ug=rw,o=r,a+X,g+s "$thisdir/$dir" + fi + done IFS="/"; for dir in $dirs_group_ro_update; do IFS="$ifs"; if [ -e "$thisdir/$dir" ]; then chmod u=rw,go=r,a+X,g+s "$thisdir/$dir" -- cgit v1.2.3