From 71f00e0988ca7f453968beedddfb528eb1d8e446 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 13 Dec 2001 16:20:19 +0000 Subject: Cleanup of volinit-netatalk: + Support uid's containing dots (use ":" instead of "." in chown commands). + Add description. + Remove old commented out lines. --- volinit-netatalk | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'volinit-netatalk') diff --git a/volinit-netatalk b/volinit-netatalk index cf995ac..f81bad8 100755 --- a/volinit-netatalk +++ b/volinit-netatalk @@ -1,11 +1,21 @@ #!/bin/bash +# Reset access rights of a netatalk archive +# +# The archive should be in subfolders named after read/write and readonly groups +# like this: /var/local/netatalk/files_administered_by_admins/admin/users/ +# +# Also, the file /etc/local/volumes should contain something like the following +# (indicating the root of all netatalk folders): +# +# NDIR="/var/local/netatalk" +# + [ -f /etc/local/volumes ] || exit 1 . /etc/local/volumes [ "x$NDIR" = "x" ] && exit 1 if [ $# -eq 0 ]; then -# echo "$0: directory name(s) required" echo "Usage: $0 [create]" exit 1 fi @@ -28,13 +38,8 @@ if [ "x$3" = "x" ]; then fi GRP=$3 -#GRPUSER="nobody" GRPUSER="admin" -#if [ "x$4" != "x" ]; then -# GRPUSER=$4 -#else - id $GRP >/dev/null && GRPUSER=$GRP -#fi +id $GRP >/dev/null && GRPUSER=$GRP if [ "x$4" != "x" ]; then if [ "x$4" == "xcreate" ]; then @@ -48,16 +53,15 @@ fi test -d $VOL/$ALL/$GRP || exit test -d $VOL/$ALL/$GRP/.AppleDouble || mkdir $VOL/$ALL/$GRP/.AppleDouble test -d $VOL/$ALL/$GRP/.AppleDesktop || mkdir $VOL/$ALL/$GRP/.AppleDesktop -#chown $ALLUSER.$ALL $VOL/$ALL -chown root.$ALL $VOL/$ALL -chown $GRPUSER.$ALL $VOL/$ALL/$GRP +chown root:$ALL $VOL/$ALL +chown $GRPUSER:$ALL $VOL/$ALL/$GRP chmod u=rwX,g=rXs,o= $VOL/$ALL chmod u=rwX,g=rXs,o= $VOL/$ALL/$GRP echo "People in group $GRP has read/write access through AppleShare" test $GRP = $ALL || echo "People in group $ALL has read access through AppleShare" echo "Others have no access" echo -n "Checking permissions..." -chown -R .$GRP $VOL/$ALL/$GRP \ +chown -R :$GRP $VOL/$ALL/$GRP \ && chmod -R u=rwX,g=rwXs,o=rX $VOL/$ALL/$GRP \ && chmod u=rwX,g=rXs,o=rX $VOL/$ALL/$GRP echo "." -- cgit v1.2.3