Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ginsbach <brian.ginsbach@gmail.com>2020-03-20 00:38:37 +0300
committerBrian Ginsbach <brian.ginsbach@gmail.com>2020-03-22 00:10:05 +0300
commit044c78452b84758a741855a319c0dade2c64a9b2 (patch)
treec9f9babf3915f2fa2689d84814fb2be1885fcd17 /include/tests_authentication
parentf3426697777d87de31d6229ebecd875a2fc2f0c4 (diff)
Add AUTH-9234 for NetBSD
Diffstat (limited to 'include/tests_authentication')
-rw-r--r--include/tests_authentication19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/tests_authentication b/include/tests_authentication
index b4520035..2b3fcae3 100644
--- a/include/tests_authentication
+++ b/include/tests_authentication
@@ -331,7 +331,7 @@
# Notes : AIX: 100+
# HPUX: 100+
# macOS doesn't have any user info in /etc/passwd, users are managed with opendirectoryd)
- # OpenBSD/NetBSD: unknown
+ # OpenBSD/NetBSD: 1000-60000, excluding 32767 (default)
# Arch Linux / CentOS / Ubuntu: 1000+
Register --test-no AUTH-9234 --weight L --network NO --category security --description "Query user accounts"
if [ ${SKIPTEST} -eq 0 ]; then
@@ -373,6 +373,23 @@
fi
;;
+ "NetBSD")
+ if [ -f ${ROOTDIR}etc/usermgmt.conf ]; then
+ UID_RANGE=$(${GREPBINARY} "^range" ${ROOTDIR}etc/usermgmt.conf | ${AWKBINARY} '{ sub(/\.\./, "-", $2); print $2 }')
+ fi
+ if [ -n "${UID_RANGE}" ]; then
+ LogText "Result: found configured user id range specified: ${UID_RANGE}"
+ UID_MIN=$(echo $UID_RANGE | ${AWKBINARY} -F- '{ print $1 }')
+ UID_MAX=$(echo $UID_RANGE | ${AWKBINARY} -F- '{ print $2 }')
+ else
+ UID_MIN=1000
+ UID_MAX=60000
+ LogText "Result: no configured user id range specified; using default ${UID_MIN}-${UID_MAX}"
+ fi
+ LogText "NetBSD real users output (ID = 0, or ${UID_MIN}-${UID_MAX}, but not 32767):"
+ FIND=$(${AWKBINARY} -v UID_MIN="${UID_MIN}" -v UID_MAX="${UID_MAX}" -F: '($3 >= UID_MIN && $3 <= UID_MAX && $3 != 32767) || ($3 == 0) { print $1","$3 }' /etc/passwd)
+ ;;
+
"OpenBSD")
LogText "OpenBSD real users output (ID = 0, or 1000-60000, but not 32767):"
FIND=$(${AWKBINARY} -F: '($3 >= 1000 && $3 <= 60000 && $3 != 32767) || ($3 == 0) { print $1","$3 }' /etc/passwd)