summaryrefslogtreecommitdiffstats
path: root/bin/alogin.in
diff options
context:
space:
mode:
authorTar Committer <tar@ocjtech.us>2002-05-02 23:08:06 +0000
committerTar Committer <tar@ocjtech.us>2002-05-02 23:08:06 +0000
commitafcac75e572bcdd3cf269b921b7e8324aa5ffd4c (patch)
treedfffbfceb4f15c22781a599d6352586c8b7ce582 /bin/alogin.in
parent9f2402b0d86333f5f7e9d50437036cd3124bde47 (diff)
downloadrancid-afcac75e572bcdd3cf269b921b7e8324aa5ffd4c.tar.gz
rancid-afcac75e572bcdd3cf269b921b7e8324aa5ffd4c.tar.xz
rancid-afcac75e572bcdd3cf269b921b7e8324aa5ffd4c.zip
Imported from rancid-2.2.1.tar.gz.rancid-2.2.1
Diffstat (limited to 'bin/alogin.in')
-rw-r--r--bin/alogin.in23
1 files changed, 15 insertions, 8 deletions
diff --git a/bin/alogin.in b/bin/alogin.in
index 9ffb9e8..dc5afaa 100644
--- a/bin/alogin.in
+++ b/bin/alogin.in
@@ -331,6 +331,19 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
expect eof
send_user "Error: Unknown host\n"; wait; return 1
}
+ -re "(Host key not found |The authenticity of host .* be established).*\(yes\/no\)\?" {
+ send "yes\r"
+ send_user "\nHost $router added to the list of known hosts.\n"
+ exp_continue }
+ -re "HOST IDENTIFICATION HAS CHANGED.* \(yes\/no\)\?" {
+ 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"
set uprompt_seen 1
@@ -353,20 +366,14 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
catch {close}; wait; return 1 }
-re "$prompt" { break; }
denied { send_user "Error: Check your passwd for $router\n"
- if { $do_command || $do_script } {
- send "exit\r"
- wait
- return 1
- } else {
- return 1
- }
+ catch {close}; wait; return 1
}
"\r\n" { exp_continue; }
}
+ }
set in_proc 0
return 0
}
-}
# Run commands given on the command line.
proc run_commands { prompt command } {