From 114d95c475a8d573fecf098ef4a263876c3a6d8e Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 30 Jun 2016 11:30:58 +0200 Subject: [PATCH] [AUTH-9234] Test for minimal UID number via /etc/login.defs --- include/tests_authentication | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/tests_authentication b/include/tests_authentication index 4e13231a..d4f35326 100644 --- a/include/tests_authentication +++ b/include/tests_authentication @@ -295,8 +295,14 @@ ;; "Linux") - LogText "Linux real users output (ID = 0, or 1000+, but not 65534):" - FIND=`awk -F: '($3 >= 1000 && $3 != 65534) || ($3 == 0) { print $1","$3 }' /etc/passwd` + UID_MIN="" + if [ -f /etc/login.defs ]; then + UID_MIN=$(grep "^UID_MIN" /etc/login.defs | awk '{print $2}') + LogText "Result: found minimal user id specified: ${UID_MIN}" + fi + if [ "${UID_MIN}" = "" ]; then UID_MIN="1000"; fi + LogText "Linux real users output (ID = 0, or ${UID_MIN}+, but not 65534):" + FIND=`awk -v UID_MIN="${UID_MIN}" -F: '($3 >= UID_MIN && $3 != 65534) || ($3 == 0) { print $1","$3 }' /etc/passwd` ;; "OpenBSD")