aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/bin')
-rwxr-xr-xpackage/base-files/files/bin/login.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh
index ff5d3660e4..00f2f81ab4 100755
--- a/package/base-files/files/bin/login.sh
+++ b/package/base-files/files/bin/login.sh
@@ -1,9 +1,16 @@
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
+
+regpassresult="0"
grep '^root:[^!]' /etc/passwd >&- 2>&-
-[ "$?" = "0" -a -z "$FAILSAFE" ] &&
-{
+regpassresult="$?"
+shadowresult="0"
+if [ -e "/etc/shadow" ]; then
+ grep '^root:[^!]' /etc/shadow >&- 2>&-
+ shadowresult="$?"
+fi
+[ "$regpassresult" = "0" ] && [ "$shadowresult" = "0" ] && [ -z "$FAILSAFE" ] && {
echo "Login failed."
exit 0
} || {