From afcac75e572bcdd3cf269b921b7e8324aa5ffd4c Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Thu, 2 May 2002 23:08:06 +0000 Subject: Imported from rancid-2.2.1.tar.gz. --- bin/hlogin.in | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'bin/hlogin.in') diff --git a/bin/hlogin.in b/bin/hlogin.in index caabd31..a3c00ac 100755 --- a/bin/hlogin.in +++ b/bin/hlogin.in @@ -372,6 +372,10 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } { send "no\r" send_user "\nError: The host key for $router has changed. Update the SSH known_hosts file accordingly.\n" return 1 } + -re "Offending key for .* \(yes\/no\)\?" { + send "no\r" + send_user "\nError: host key mismatch for $router. Update the SSH known_hosts file accordingly.\n" + return 1 } -re "$u_prompt" { send "$user\r" expect { eof { send_user "\nError: Couldn't login\n"; wait; return 1 } @@ -396,19 +400,7 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } { } "$prompt" { break; } denied { send_user "\nError: Check your passwd for $router\n" - if { $do_command || $do_script } { - send "exit\r" - expect { - "Do you want to log out" { - send "y\r" - exp_continue - } - } - wait - return 1 - } else { - return 1 - } + catch {close}; wait; return 1 } "% Bad passwords" {send_user "\nError: Check your passwd for $router\n"; return 1 } } -- cgit