From: Felix Fietkau Date: Sat, 4 Apr 2009 09:35:55 +0000 (+0000) Subject: rename our /bin/login script to /bin/login.sh to avoid collisions with busybox -... X-Git-Tag: reboot~24050 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=de0332f86a7d2017246a6c78ddad480005912e59;p=openwrt%2Fstaging%2Flynxis.git rename our /bin/login script to /bin/login.sh to avoid collisions with busybox - we always use -l on telnetd anyway SVN-Revision: 15097 --- diff --git a/package/base-files/files/bin/login b/package/base-files/files/bin/login deleted file mode 100755 index ff5d3660e4..0000000000 --- a/package/base-files/files/bin/login +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -grep '^root:[^!]' /etc/passwd >&- 2>&- -[ "$?" = "0" -a -z "$FAILSAFE" ] && -{ - echo "Login failed." - exit 0 -} || { -cat << EOF - === IMPORTANT ============================ - Use 'passwd' to set your login password - this will disable telnet and enable SSH - ------------------------------------------ -EOF -} - -exec /bin/ash --login diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh new file mode 100755 index 0000000000..ff5d3660e4 --- /dev/null +++ b/package/base-files/files/bin/login.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +grep '^root:[^!]' /etc/passwd >&- 2>&- +[ "$?" = "0" -a -z "$FAILSAFE" ] && +{ + echo "Login failed." + exit 0 +} || { +cat << EOF + === IMPORTANT ============================ + Use 'passwd' to set your login password + this will disable telnet and enable SSH + ------------------------------------------ +EOF +} + +exec /bin/ash --login diff --git a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit index 89dc3bcfdf..76443836e3 100755 --- a/package/base-files/files/etc/preinit +++ b/package/base-files/files/etc/preinit @@ -11,7 +11,7 @@ failsafe() { [ -n "$ifname" ] && grep "$ifname" /proc/net/dev >/dev/null && { failsafe_ip netmsg 192.168.1.255 "Entering Failsafe!" - telnetd -l /bin/login <> /dev/null 2>&1 + telnetd -l /bin/login.sh <> /dev/null 2>&1 } lock /tmp/.failsafe ash --login diff --git a/package/busybox/files/telnet b/package/busybox/files/telnet index ec99172cfd..082aba7e90 100755 --- a/package/busybox/files/telnet +++ b/package/busybox/files/telnet @@ -7,7 +7,7 @@ start() { awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null || \ ( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] ) then \ - telnetd -l /bin/login + telnetd -l /bin/login.sh fi } diff --git a/target/linux/brcm-2.4/base-files/etc/preinit.arch b/target/linux/brcm-2.4/base-files/etc/preinit.arch index 1b3c924ced..25d11d96ab 100755 --- a/target/linux/brcm-2.4/base-files/etc/preinit.arch +++ b/target/linux/brcm-2.4/base-files/etc/preinit.arch @@ -15,7 +15,7 @@ failsafe() { } netmsg 192.168.1.255 "Entering Failsafe!" - telnetd -l /bin/login <> /dev/null 2>&1 + telnetd -l /bin/login.sh <> /dev/null 2>&1 ash --login }