X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=package%2Fbase-files%2Ffiles%2Fbin%2Flogin.sh;fp=package%2Fbase-files%2Ffiles%2Fbin%2Flogin.sh;h=a64c84e1e2dc918086cbadad0b78366a29cd7f09;hb=49bab2b905d8accb3a35bfd9af586fc42358a4f3;hp=ff5d3660e40df8608032d7c6a2e05f8f7adca69f;hpb=2b5afc4cbc27cdaa9a2e42d6d71274d9f628ceeb;p=openwrt-10.03%2F.git diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh index ff5d3660e..a64c84e1e 100755 --- a/package/base-files/files/bin/login.sh +++ b/package/base-files/files/bin/login.sh @@ -1,18 +1,16 @@ #!/bin/sh -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2010 OpenWrt.org -grep '^root:[^!]' /etc/passwd >&- 2>&- -[ "$?" = "0" -a -z "$FAILSAFE" ] && -{ - echo "Login failed." - exit 0 -} || { +if grep -qs '^root:[^!]' /etc/passwd /etc/shadow && [ -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