diff options
author | Brian Ginsbach <brian.ginsbach@gmail.com> | 2020-03-22 00:16:34 +0300 |
---|---|---|
committer | Brian Ginsbach <brian.ginsbach@gmail.com> | 2020-03-22 00:16:34 +0300 |
commit | f56c3b5f94c57732ceffe306eb12db4b50df095c (patch) | |
tree | ec8f1ded50bb5be324d626aa118d43ca4edebd5e /include/tests_authentication | |
parent | 044c78452b84758a741855a319c0dade2c64a9b2 (diff) |
Combine NetBSD and OpenBSD AUTH-9234 check
Both NetBSD and OpenBSD have `useradd(8)`, so they can share logic
checking `/etc/usermgmt.conf` for the default user UID range.
Diffstat (limited to 'include/tests_authentication')
-rw-r--r-- | include/tests_authentication | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/include/tests_authentication b/include/tests_authentication index 2b3fcae3..9496380b 100644 --- a/include/tests_authentication +++ b/include/tests_authentication @@ -373,7 +373,7 @@ fi ;; - "NetBSD") + "NetBSD"|"OpenBSD") if [ -f ${ROOTDIR}etc/usermgmt.conf ]; then UID_RANGE=$(${GREPBINARY} "^range" ${ROOTDIR}etc/usermgmt.conf | ${AWKBINARY} '{ sub(/\.\./, "-", $2); print $2 }') fi @@ -386,15 +386,10 @@ 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):" + LogText "${OS} 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) - ;; - "Solaris") LogText "Solaris real users output (ID =0, or 100+, but not 60001/65534):" FIND=$(${AWKBINARY} -F: '($3 >= 100 && $3 != 60001 && $3 != 65534) || ($3 == 0) { print $1","$3 }' /etc/passwd) |