diff options
Diffstat (limited to 'user-init')
-rwxr-xr-x | user-init | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -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" # <home>/shares.<sharetype> chown "$user": "$thisdir" @@ -326,7 +335,11 @@ for user in $USERS; do # <home>/shares.<sharetype>/<rogroup>/<rwgroup>/<sharename> 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" |