From afdb85aa69154dcafb4148537bead4879128e57e Mon Sep 17 00:00:00 2001 From: delano Date: Sat, 19 Jun 2010 13:40:39 -0400 Subject: [PATCH] FIXED: Authentication would never succeed if the first password attempt failed. --- CHANGES.txt | 4 ++++ lib/rye/box.rb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f8d370f..e34eb66 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,9 @@ RYE, CHANGES +#### 0.8.18 (2010-06-19) ############################# + +* FIXED: Authentication would never succeed if the first password attempt failed. + #### 0.8.17 (2010-05-19) ############################# * FIXED: authorize_keys_remote was using incorrect home directory diff --git a/lib/rye/box.rb b/lib/rye/box.rb index c840921..fa9a10f 100644 --- a/lib/rye/box.rb +++ b/lib/rye/box.rb @@ -650,9 +650,9 @@ def connect(reconnect=true) retried += 1 if STDIN.tty? && retried <= 3 STDERR.puts "Passwordless login failed for #{@rye_user}" - @rye_opts[:password] = highline.ask("Password: ") { |q| q.echo = '' } + @rye_opts[:password] = highline.ask("Password: ") { |q| q.echo = '' }.strip @rye_opts[:auth_methods] ||= [] - @rye_opts[:auth_methods] << 'password' + @rye_opts[:auth_methods].push *['keyboard-interactive', 'password'] retry else raise Net::SSH::AuthenticationFailed