[package] base-files: prime root password with "x" to notify programs that there...
[openwrt/svn-archive/archive.git] / package / base-files / files / bin / login.sh
index b46769a012912259109c893bc26fbb1ab796a742..6682b022bad6ff314c36c5b0c0af916227c7bc2b 100755 (executable)
@@ -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