From 639cf75264354795e3869e945b7aa51aaa658bb2 Mon Sep 17 00:00:00 2001 From: jow Date: Mon, 14 Nov 2011 19:02:01 +0000 Subject: [package] 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. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29130 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/bin/login.sh | 5 ++++- package/base-files/files/etc/passwd | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'package/base-files/files') diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh index b46769a01..6682b022b 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 ca4fbad1b..1d06a8036 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 -- cgit v1.2.3