base-files: fix check for empty password warning

Now that we know that the password is in /etc/shadow and not in
/etc/passwd, we can properly fix the logic for the empty password check.
Only 'root::' is an empty password, 'root' and 'root:!:' allow no
password login at all.

This fixes the empty password warning still showing after the root password
has been locked using 'passwd -l root' (e.g. to allow public-key auth
only).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
lede-17.01
Matthias Schiffer 2016-09-26 15:25:37 +02:00
parent 77f54eae45
commit 6c1542787d
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
1 changed files with 1 additions and 2 deletions

View File

@ -30,8 +30,7 @@ alias ll='ls -alF --color=auto'
unset FILE unset FILE
} }
if ( grep -qsE '^root:[!x]?:' /etc/shadow && \ if ( grep -qs '^root::' /etc/shadow && \
grep -qsE '^root:[!x]?:' /etc/passwd && \
[ -z "$FAILSAFE" ] ) [ -z "$FAILSAFE" ] )
then then
cat << EOF cat << EOF