From 0c80297c9f2b7822d95ac3e92be07ca058843d6f Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Thu, 19 Sep 2024 07:24:56 -0400 Subject: [PATCH] Quote vars in user account manager --- tabs/utils/user-account-manager/add_to_group.sh | 5 +++-- tabs/utils/user-account-manager/add_user.sh | 5 +++-- tabs/utils/user-account-manager/change_password.sh | 5 +++-- tabs/utils/user-account-manager/delete_user.sh | 5 +++-- tabs/utils/user-account-manager/remove_from_group.sh | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tabs/utils/user-account-manager/add_to_group.sh b/tabs/utils/user-account-manager/add_to_group.sh index dd8a2a743..3da13b65c 100755 --- a/tabs/utils/user-account-manager/add_to_group.sh +++ b/tabs/utils/user-account-manager/add_to_group.sh @@ -28,8 +28,9 @@ groups_to_add=$(echo "$groups" | tr ' ' ',') read -p "Are you sure you want to add user $username to $groups_to_add? [Y/N]: " confirm confirmAction || exit 1 -$ESCALATION_TOOL usermod -aG $groups_to_add "$username" +"$ESCALATION_TOOL" usermod -aG $groups_to_add "$username" printf "%b\n" "${GREEN}User successfully added to the $groups_to_add${RC}" -checkEnv \ No newline at end of file +checkEnv +checkEscalationTool \ No newline at end of file diff --git a/tabs/utils/user-account-manager/add_user.sh b/tabs/utils/user-account-manager/add_user.sh index 83f31ca44..25db8a34f 100755 --- a/tabs/utils/user-account-manager/add_user.sh +++ b/tabs/utils/user-account-manager/add_user.sh @@ -17,10 +17,11 @@ fi password=$(promptPassword) || exit 1 -$ESCALATION_TOOL useradd -m "$username" -g users -s /bin/bash -echo "$username:$password" | $ESCALATION_TOOL chpasswd +"$ESCALATION_TOOL" useradd -m "$username" -g users -s /bin/bash +echo "$username:$password" | "$ESCALATION_TOOL" chpasswd printf "%b\n" "${GREEN}User $username created successfully${RC}" printf "%b\n" "${GREEN}To add additional groups use Add User To Groups${RC}" checkEnv +checkEscalationTool diff --git a/tabs/utils/user-account-manager/change_password.sh b/tabs/utils/user-account-manager/change_password.sh index ef05a55b7..867e93a9a 100755 --- a/tabs/utils/user-account-manager/change_password.sh +++ b/tabs/utils/user-account-manager/change_password.sh @@ -13,7 +13,8 @@ password=$(promptPassword) || exit 1 read -p "Are you sure you want to change password for $username? [Y/N]: " confirm confirmAction || exit 1 -echo "$username:$password" | $ESCALATION_TOOL chpasswd +echo "$username:$password" | "$ESCALATION_TOOL" chpasswd printf "%b\n" "${GREEN}Password changed successfully${RC}" -checkEnv \ No newline at end of file +checkEnv +checkEscalationTool \ No newline at end of file diff --git a/tabs/utils/user-account-manager/delete_user.sh b/tabs/utils/user-account-manager/delete_user.sh index cb68bdf91..894205263 100755 --- a/tabs/utils/user-account-manager/delete_user.sh +++ b/tabs/utils/user-account-manager/delete_user.sh @@ -20,7 +20,8 @@ fi read -p "Are you sure you want to delete user $username? [Y/N]: " confirm confirmAction || exit 1 -$ESCALATION_TOOL userdel --remove "$username" 2>/dev/null +"$ESCALATION_TOOL" userdel --remove "$username" 2>/dev/null printf "%b\n" "${GREEN}User $username deleted successfully${RC}" -checkEnv \ No newline at end of file +checkEnv +checkEscalationTool \ No newline at end of file diff --git a/tabs/utils/user-account-manager/remove_from_group.sh b/tabs/utils/user-account-manager/remove_from_group.sh index 4d3c65c37..041bc5366 100755 --- a/tabs/utils/user-account-manager/remove_from_group.sh +++ b/tabs/utils/user-account-manager/remove_from_group.sh @@ -23,8 +23,9 @@ groups_to_remove=$(echo "$groups" | tr ' ' ',') read -p "Are you sure you want to remove user $username from $groups_to_remove? [Y/N]: " confirm confirmAction || exit 1 -$ESCALATION_TOOL usermod -rG $groups_to_remove "$username" +"$ESCALATION_TOOL" usermod -rG $groups_to_remove "$username" printf "%b\n" "${GREEN}User successfully removed from $groups_to_remove${RC}" -checkEnv \ No newline at end of file +checkEnv +checkEscalationTool \ No newline at end of file