aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/login.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/bin/login.sh')
-rwxr-xr-xpackage/base-files/files/bin/login.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh
index b46769a012..6682b022ba 100755
--- a/package/base-files/files/bin/login.sh
+++ b/package/base-files/files/bin/login.sh
@@ -1,7 +1,10 @@
#!/bin/sh
# Copyright (C) 2006-2011 OpenWrt.org
-if grep -qs '^root:[^!:]' /etc/passwd /etc/shadow && [ -z "$FAILSAFE" ]; then
+if ( ! grep -qs '^root::' /etc/shadow || \
+ ! grep -qs '^root:[!x]\?:' /etc/passwd ) && \
+ [ -z "$FAILSAFE" ]
+then
echo "Login failed."
exit 0
else