summaryrefslogtreecommitdiff
path: root/package/base-files/files/bin
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-14 19:02:01 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-14 19:02:01 +0000
commit639cf75264354795e3869e945b7aa51aaa658bb2 (patch)
tree81122dc43f5c4c0ddfbc71ff8652ffe70fa7d4a6 /package/base-files/files/bin
parent8b1ffd8dab93a800007e46fd12a4453707e2b337 (diff)
[package] base-files: prime root password with "x" to notify programs that there is a shadow record, fix /bin/login.sh password detection accordingly.
Solves broken key based dropbear login with empty password after r28935. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29130 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/bin')
-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