summaryrefslogtreecommitdiff
path: root/user-init
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-01-20 00:37:44 +0000
committerJonas Smedegaard <dr@jones.dk>2008-01-20 00:37:44 +0000
commitd3a938ecbfdb0713b14b8322ede59a7246598bf6 (patch)
tree20c6e41e648133d450ca6b26ddeddc0cec2adbb4 /user-init
parent5dbe9f58907075034b51743637467fdcdb983e3f (diff)
Implement new variable RELAXEDPERMS: When non-empty the root dir of netatalk shares are group writable.
Diffstat (limited to 'user-init')
-rwxr-xr-xuser-init22
1 files changed, 20 insertions, 2 deletions
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"
# <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"