diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-11-14 19:02:01 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-11-14 19:02:01 +0000 |
commit | 8b20bfafdf804598199364d05ab83a6f27882a42 (patch) | |
tree | 26f30fd65f04f268f5cdcf15b614846ac7bce6ae | |
parent | 79a4642b40e41af5c8c9c057aa494312d61f6cae (diff) | |
download | upstream-8b20bfafdf804598199364d05ab83a6f27882a42.tar.gz upstream-8b20bfafdf804598199364d05ab83a6f27882a42.tar.bz2 upstream-8b20bfafdf804598199364d05ab83a6f27882a42.zip |
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.
SVN-Revision: 29130
-rw-r--r-- | package/base-files/Makefile | 2 | ||||
-rwxr-xr-x | package/base-files/files/bin/login.sh | 5 | ||||
-rw-r--r-- | package/base-files/files/etc/passwd | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index c515dcf7b1..90c68cd175 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=base-files -PKG_RELEASE:=93 +PKG_RELEASE:=94 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ PKG_BUILD_DEPENDS:=opkg/host 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 diff --git a/package/base-files/files/etc/passwd b/package/base-files/files/etc/passwd index ca4fbad1b8..1d06a80361 100644 --- a/package/base-files/files/etc/passwd +++ b/package/base-files/files/etc/passwd @@ -1,4 +1,4 @@ -root::0:0:root:/root:/bin/ash +root:x:0:0:root:/root:/bin/ash daemon:*:1:1:daemon:/var:/bin/false ftp:*:55:55:ftp:/home/ftp:/bin/false network:*:101:101:network:/var:/bin/false |