X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/fcd35cb0612843f78e375122e501ee602e8fc692..77ec3b2de9bb1880b258ec6aaf4949f146f6fd8d:/package/base-files/files/bin/login.sh diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh index ff5d3660e..04b3fe250 100755 --- a/package/base-files/files/bin/login.sh +++ b/package/base-files/files/bin/login.sh @@ -1,18 +1,19 @@ #!/bin/sh -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org -grep '^root:[^!]' /etc/passwd >&- 2>&- -[ "$?" = "0" -a -z "$FAILSAFE" ] && -{ - echo "Login failed." - exit 0 -} || { +if ( ! grep -qs '^root:[!x]\?:' /etc/shadow || \ + ! grep -qs '^root:[!x]\?:' /etc/passwd ) && \ + [ -z "$FAILSAFE" ] +then + echo "Login failed." + exit 0 +else cat << EOF === IMPORTANT ============================ Use 'passwd' to set your login password this will disable telnet and enable SSH ------------------------------------------ EOF -} +fi exec /bin/ash --login