mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-25 06:54:29 +01:00
IMP(6.2.8): fix bug where /sbin/nologin was considered as a valid shell
This commit is contained in:
parent
fe568561bf
commit
a7afb1099a
@ -18,7 +18,7 @@ ERRORS=0
|
|||||||
|
|
||||||
# This function will be called if the script status is on enabled / audit mode
|
# This function will be called if the script status is on enabled / audit mode
|
||||||
audit () {
|
audit () {
|
||||||
for dir in $(cat /etc/passwd | /bin/egrep -v '(root|halt|sync|shutdown)' | awk -F: '($7 != "/usr/sbin/nologin" && $7 != "/bin/false" && $7 !="/nonexistent" ) { print $6 }'); do
|
for dir in $(cat /etc/passwd | /bin/egrep -v '(root|halt|sync|shutdown)' | awk -F: '($7 != "/usr/sbin/nologin" && $7 != "/sbin/nologin" && $7 != "/bin/false" && $7 !="/nonexistent" ) { print $6 }'); do
|
||||||
debug "Working on $dir"
|
debug "Working on $dir"
|
||||||
debug "Exceptions : $EXCEPTIONS"
|
debug "Exceptions : $EXCEPTIONS"
|
||||||
debug "echo \"$EXCEPTIONS\" | grep -q $dir"
|
debug "echo \"$EXCEPTIONS\" | grep -q $dir"
|
||||||
@ -57,7 +57,7 @@ audit () {
|
|||||||
|
|
||||||
# This function will be called if the script status is on enabled mode
|
# This function will be called if the script status is on enabled mode
|
||||||
apply () {
|
apply () {
|
||||||
for dir in $(cat /etc/passwd | /bin/egrep -v '(root|halt|sync|shutdown)' | awk -F: '($7 != "/usr/sbin/nologin" && $7 != "/bin/false" && $7 !="/nonexistent" ) { print $6 }'); do
|
for dir in $(cat /etc/passwd | /bin/egrep -v '(root|halt|sync|shutdown)' | awk -F: '($7 != "/usr/sbin/nologin" && $7 != "/sbin/nologin" && $7 != "/bin/false" && $7 !="/nonexistent" ) { print $6 }'); do
|
||||||
debug "Working on $dir"
|
debug "Working on $dir"
|
||||||
debug "Exceptions : $EXCEPTIONS"
|
debug "Exceptions : $EXCEPTIONS"
|
||||||
debug "echo \"$EXCEPTIONS\" | grep -q $dir"
|
debug "echo \"$EXCEPTIONS\" | grep -q $dir"
|
||||||
|
Loading…
Reference in New Issue
Block a user