summaryrefslogtreecommitdiff
path: root/user-init
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2003-03-21 01:17:03 +0000
committerJonas Smedegaard <dr@jones.dk>2003-03-21 01:17:03 +0000
commit333a4f4452ac4e977149455c449f45337c371e86 (patch)
tree3122d73def86cdb568779f123df6bbd56c778d7c /user-init
parentc2d02f6b1b8fc09fe9b02ec8fbc82bd980964f36 (diff)
Add workaround for netatalk requiring write access to .AppleDB even for read-only access.
Diffstat (limited to 'user-init')
-rwxr-xr-xuser-init14
1 files changed, 11 insertions, 3 deletions
diff --git a/user-init b/user-init
index 118b26d..16186af 100755
--- a/user-init
+++ b/user-init
@@ -173,7 +173,8 @@ for user in $USERS; do
# Define dir and file exceptions
case "$sharetype" in
mac)
- dirs_group_rw_create='.AppleDB/.AppleDesktop/Temporary Items/TheFindByContentFolder'
+ dirs_world_rw_create='.AppleDB'
+ dirs_group_rw_create='.AppleDesktop/Temporary Items/TheFindByContentFolder'
dirs_group_ro_create='TheVolumeSettingsFolder'
dirs_group_ro_update='.AppleDouble'
files_group_ro_update=':2eDS_Store'
@@ -185,8 +186,8 @@ for user in $USERS; do
continue
;;
esac
- exceptions="$dirs_group_rw_create/$dirs_group_ro_create/$dirs_group_ro_update/$files_group_ro_update/$dirs_no_access_purge"
- exception_dirs_create="$dirs_group_rw_create/$dirs_group_ro_create"
+ 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"
chown "$user": "$thisdir"
chmod a=rX "$thisdir"
find "$thisdir" -mindepth 1 -maxdepth 1 -type d -print | (while read thisdir; do
@@ -223,6 +224,13 @@ for user in $USERS; do
fi
chown "$user":"$rwgroup" "$thisdir/$dir"
done
+ IFS="/"; for dir in $dirs_world_rw_create; do IFS="$ifs";
+ if [ "$rogroup" = "$rwgroup" ]; then
+ chmod -R ug=rw,o=r,a+X,g+s "$thisdir/$dir"
+ else
+ chmod -R a=rw,a+X,g+s "$thisdir/$dir"
+ fi
+ done
IFS="/"; for dir in $dirs_group_rw_create; do IFS="$ifs";
chmod -R ug=rw,o=r,a+X,g+s "$thisdir/$dir"
done