[AUTH-9234] style and enhanced support for macOS

This commit is contained in:
Michael Boelen 2016-10-27 09:13:57 +02:00
parent ef7a120997
commit 0d66aec62c

View File

@ -306,7 +306,15 @@
"MacOS") "MacOS")
LogText "macOS real users output (ID = 0, or 500-599)" LogText "macOS real users output (ID = 0, or 500-599)"
FIND=$(dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]') FIND_USERS=$(dscacheutil -q user | ${GREPBINARY} -A 3 -B 2 -e "^uid: 5[0-9][0-9]" | ${GREPBINARY} "^name: " | ${AWKBINARY} '{print $2}')
if [ ! -z "${FIND_USERS}" ]; then
for FUSERNAME in ${FIND_USERS}; do
FDETAILS=$(dscacheutil -q user -a name ${FUSERNAME} | ${GREPBINARY} "^uid: " | ${AWKBINARY} '{print $2}')
FIND="${FDETAILS},${FUSERNAME} ${FIND}"
done
else
FIND=""
fi
;; ;;
"OpenBSD") "OpenBSD")
@ -326,15 +334,17 @@
esac esac
# Check if we got any output # Check if we got any output
if [ "${FIND}" = "" ]; then if [ -z "${FIND}" ]; then
Display --indent 4 --text "Result: No users found/unknown result" Display --indent 4 --text "Result: No users found/unknown result"
LogText "Result: Querying of system users skipped" LogText "Result: Querying of system users skipped"
Display --indent 2 --text "- Query system users (non daemons)" --result "${STATUS_UNKNOWN}" --color YELLOW Display --indent 2 --text "- Query system users (non daemons)" --result "${STATUS_UNKNOWN}" --color YELLOW
else else
Display --indent 2 --text "- Query system users (non daemons)" --result "${STATUS_DONE}" --color GREEN Display --indent 2 --text "- Query system users (non daemons)" --result "${STATUS_DONE}" --color GREEN
for I in ${FIND}; do for I in ${FIND}; do
if [ -z "${I}" ]; then
LogText "Real user: ${I}" LogText "Real user: ${I}"
Report "real_user[]=${I}" Report "real_user[]=${I}"
fi
done done
fi fi
fi fi