Changeset 22279


Ignore:
Timestamp:
2010-07-18T17:18:38+02:00 (8 years ago)
Author:
cshore
Message:

[package] base-files & telnet: Fixed telnet starting even with root password when shadow passwords in use.

Location:
trunk/package
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/files/bin/login.sh

    r15245 r22279  
    22# Copyright (C) 2006 OpenWrt.org 
    33 
     4 
     5regpassresult="0" 
    46grep '^root:[^!]' /etc/passwd >&- 2>&- 
    5 [ "$?" = "0" -a -z "$FAILSAFE" ]  &&   
    6 { 
     7regpassresult="$?" 
     8shadowresult="0" 
     9if [ -e "/etc/shadow" ]; then 
     10        grep '^root:[^!]' /etc/shadow >&- 2>&- 
     11        shadowresult="$?" 
     12fi 
     13[ "$regpassresult" = "0" ] && [ "$shadowresult" = "0" ] && [ -z "$FAILSAFE" ] && { 
    714    echo "Login failed." 
    815    exit 0 
  • trunk/package/busybox/files/telnet

    r15245 r22279  
    55start() { 
    66        if      [ \! -f /etc/passwd ] || \ 
    7                 awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null || \ 
     7                ( awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null && \ 
     8                awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/shadow 2>/dev/null ) || \ 
    89                ( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] ) 
    910        then \ 
Note: See TracChangeset for help on using the changeset viewer.