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:
authorMichael Boelen <michael.boelen@cisofy.com>2016-06-30 12:30:58 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-06-30 12:30:58 +0300
commit114d95c475a8d573fecf098ef4a263876c3a6d8e (patch)
treee74ca79408922d19e1285d3bf3fc7ae25c08ffdc /include
parentf25bc250a2d71715db1350d3e05f9c462c43d34a (diff)
[AUTH-9234] Test for minimal UID number via /etc/login.defs
Diffstat (limited to 'include')
-rw-r--r--include/tests_authentication10
1 files 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")