Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
Define ACL through heredoc
Browse files Browse the repository at this point in the history
  • Loading branch information
andsens committed Aug 12, 2017
1 parent 3fec86f commit 81b1b15
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions create-secure-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ $undo"
printf "Setting permissions on mountpoint\n"
chmod -P -R go-rwx "$mountpoint"
chflags -P -R -v -v hidden "$mountpoint"
acl="user:$SUDO_USER:allow delete,readattr,writeattr"
acl="$acl,readextattr,writeextattr,readsecurity,writesecurity"
acl="$acl,chown,list,search,add_file,add_subdirectory,delete_child"
acl="$acl,read,write,execute,append,file_inherit,directory_inherit"
acl="$acl
everyone:deny delete,readattr,writeattr"
acl="$acl,readextattr,writeextattr,readsecurity,writesecurity"
acl="$acl,chown,list,search,add_file,add_subdirectory,delete_child"
acl="$acl,read,write,execute,append,file_inherit,directory_inherit"
acl=$(cat <<EOA
user:$SUDO_USER:allow delete,readattr,writeattr,readextattr,writeextattr,\
readsecurity,writesecurity,chown,list,search,add_file,add_subdirectory,\
delete_child,read,write,execute,append,file_inherit,directory_inherit
everyone:deny delete,readattr,writeattr,\
readextattr,writeextattr,readsecurity,writesecurity,\
chown,list,search,add_file,add_subdirectory,delete_child,\
read,write,execute,append,file_inherit,directory_inherit
EOA
)
chmod -P -R -E "$mountpoint" <<<"$acl"

printf "Telling Spotlight to not index the volume\n"
Expand Down

0 comments on commit 81b1b15

Please sign in to comment.