X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fsecurity%2Fcool_permissionator.sh;h=e4f345c9dc3d2798156004450d7ce56aad651a7e;hb=92085a5a47db220490e1133e889b04322346f9bf;hp=12fb254446cfc40664688dca1e4189c6bb08c136;hpb=fcd166fbb628f3cb4915da3ef8155096196687f4;p=feisty_meow.git diff --git a/scripts/security/cool_permissionator.sh b/scripts/security/cool_permissionator.sh index 12fb2544..e4f345c9 100644 --- a/scripts/security/cool_permissionator.sh +++ b/scripts/security/cool_permissionator.sh @@ -10,6 +10,9 @@ function reapply_cool_permissions() { local cooluser="$1"; shift +#hmmm: check for non empty name. + local homebase="/home/$cooluser" + # first build a list of dirs based on their location in /home/archives. local arch_builder="archons basement codebarn games imaginations musix pooling prewar_toaster stuffing toaster walrus" local ARCHIVE_TOP=/home/archives @@ -28,14 +31,14 @@ function reapply_cool_permissions() fi # fix some permissions for important security considerations. - if [ -d $HOME/.ssh ]; then - harsh_perm $HOME/.ssh + if [ -d $homebase/.ssh ]; then + harsh_perm $homebase/.ssh fi #hmmm: consider adding feisty meow apex to the dirname list below. # iterate across the list of dirs we want cooluser to own and change their ownership. - for dirname in $HOME \ + for dirname in $homebase \ $DEFAULT_FEISTYMEOW_ORG_DIR \ /usr/local/${cooluser} \ /home/games \ @@ -81,7 +84,7 @@ if [[ $0 =~ .*cool_permissionator\.sh.* ]]; then export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )" source "$THISDIR/../core/launch_feisty_meow.sh" exit_on_error "sourcing the feisty meow launcher" - coolio="$(logname)" + coolio="$USER" reapply_cool_permissions "$coolio" exit_on_error "reapplying cool permissions on $coolio" fi