[package] base-files: prime root password with "x" to notify programs that there...
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 14 Nov 2011 19:02:01 +0000 (19:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 14 Nov 2011 19:02:01 +0000 (19:02 +0000)
Solves broken key based dropbear login with empty password after r28935.

SVN-Revision: 29130

package/base-files/Makefile
package/base-files/files/bin/login.sh
package/base-files/files/etc/passwd

index c515dcf7b16c633752fdc75dda499a67183ca168..90c68cd1759b17d9a45c02f5561324cb05a6ca50 100644 (file)
@@ -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
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
index ca4fbad1b8041bebd8fec67586bf35da20adb3cb..1d06a803615f4e524bd60f2d72cdb99b54915a99 100644 (file)
@@ -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