From 77dc1d29dd9b536197a680a50f857ac76233631c Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 15 Mar 2016 07:38:29 +0100 Subject: [PATCH] Update check_permissions.sh --- lgsm/functions/check_permissions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index d4f3a5423..09eae2f67 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -8,13 +8,14 @@ lgsm_version="150316" # Description: Checks script, files and folders ownership and permissions. # Initializing useful variables -currentuser="$(sh -c 'whoami')" +currentuser="$(whoami)" scriptfullpath="${rootdir}/${selfname}" permissionerror="0" fn_check_ownership(){ if [ "${currentuser}" != "$(stat -c %U "${scriptfullpath}")" ] && [ "${currentuser}" != "$(stat -c %G "${scriptfullpath}")" ]; then permissionerror="1" + fn_scriptlog "Attempted to run as ${currentuser}" fn_print_fail_nl "Permission denied" echo " * To check allowed user and group run ls -l ${selfname}" fi