diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-08-25 16:18:44 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-08-25 16:18:44 +0300 |
commit | dfb025a863cbde5b0a42cb5eb3fc01f99c72961e (patch) | |
tree | 48e7d9d768110b288bd3096eca461ccb0344ec77 | |
parent | f591924115485ac460adebde23c3054828fc7bfc (diff) |
[AUTH-9204] style changes and add data to report
-rw-r--r-- | include/tests_authentication | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/tests_authentication b/include/tests_authentication index 321c1283..8fdc7512 100644 --- a/include/tests_authentication +++ b/include/tests_authentication @@ -40,14 +40,15 @@ if [ ${SKIPTEST} -eq 0 ]; then # Search accounts with UID 0 LogText "Test: Searching accounts with UID 0" - FIND=`grep ':0:' /etc/passwd | egrep -v '^#|^root:|^(\+:\*)?:0:0:::' | cut -d ":" -f1,3 | grep ':0'` + FIND=(${GREPBINARY} ':0:' /etc/passwd | egrep -v '^#|^root:|^(\+:\*)?:0:0:::' | cut -d ":" -f1,3 | grep ':0') if [ ! "${FIND}" = "" ]; then Display --indent 2 --text "- Administrator accounts" --result "${STATUS_WARNING}" --color RED LogText "Result: Found more than one administrator accounts" ReportWarning "${TEST_NO}" "Multiple users with UID 0 found in passwd file" - for I in ${FIND}; do - LogText "Administrator account: ${I}" - if [ "${I}" = "toor" ]; then + for USER in ${FIND}; do + LogText "Administrator account: ${USER}" + Report "user_with_uid_zero[]=${USER}" + if [ "${USER}" = "toor" ]; then LogText "BSD note: default there is a user 'toor' installed. This account is considered useless unless it" LogText "is assigned a password and used for daily operations or emergencies. ie: bad shell for root user." ReportSuggestion ${TEST_NO} "Use vipw to delete the 'toor' user if not used." |