From 483d6b6154489df7e20f44ecd3fe93041e532e70 Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Fri, 11 Apr 2025 21:05:50 -0400 Subject: [PATCH] slight improvements and generality increases enabled checkin on files in cool permissionator, rather than just directories, although the intended purpose of fixing the crontabs file for my user in one weird scenario (where my original uid had changed, and then a new user was added with the old uid, meaning my crontab was inaccessible to me) did not work, since the permissions on the crontabs directory keeps normal users from seeing things in there, including their own crontab file. --- scripts/security/cool_permissionator.sh | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/scripts/security/cool_permissionator.sh b/scripts/security/cool_permissionator.sh index d7ffef9b..5b13d98b 100644 --- a/scripts/security/cool_permissionator.sh +++ b/scripts/security/cool_permissionator.sh @@ -50,17 +50,21 @@ function reapply_cool_permissions() # iterate across the list of dirs we want cooluser to own and change their ownership. #hmmm: below are components of the uber list of things to fix perms on... - for dirname in $homebase \ - $DEFAULT_FEISTYMEOW_ORG_DIR \ - /usr/local/${cooluser} \ - /home/games \ - $arch_addin; do - if [ -d "$dirname" -o -L "$dirname" ]; then - echo "revising ownership on '$dirname'" - sudo chown -R ${cooluser}:${cooluser} "$dirname" - continue_on_error "chowning '$dirname' for ${cooluser}" - sudo chmod g+rx,o+rx "$dirname" - continue_on_error "chmodding '$dirname' for ${cooluser}" + for the_name in \ + $homebase \ + $DEFAULT_FEISTYMEOW_ORG_DIR \ + /usr/local/${cooluser} \ + /home/games \ + /var/spool/cron/crontabs/${cooluser} \ + $arch_addin; do + if [ -d "$the_name" -o -L "$the_name" -o -f "$the_name" ]; then + echo "revising ownership on '$the_name'" + sudo chown -R ${cooluser}:${cooluser} "$the_name" + continue_on_error "chowning '$the_name' for ${cooluser}" + sudo chmod g+rx,o+rx "$the_name" + continue_on_error "chmodding '$the_name' for ${cooluser}" +# else +# echo "saw no item '$the_name' for $cooluser" fi done @@ -68,7 +72,6 @@ function reapply_cool_permissions() sudo bash $FEISTY_MEOW_SCRIPTS/security/normal_perm.sh /var/log continue_on_error "setting normal perms on /var/log" } - #### # this block executes when the script is actually run, rather than when it's just being sourced. -- 2.34.1