summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklós Fazekas <mfazekas@szemafor.com>2019-03-07 08:34:44 +0100
committerGitHub <noreply@github.com>2019-03-07 08:34:44 +0100
commita1c7b36e1b7510cd4aaba960e46920fe631e3c8f (patch)
tree52d215075469eb878a3c94af0abaea96995f3801
parent3eb4a3e2729273343a2cef4ac3e0650fefec571c (diff)
parentf964edfb913b60e725c33a4a4779c6b056e854bc (diff)
downloadnet-ssh-5.2.0.rc2.tar.gz
Merge pull request #665 from mfazekas/5_2_0_rc2-preparev5.2.0.rc2
5 2 0 rc2 prepare
-rw-r--r--CHANGES.txt4
-rw-r--r--lib/net/ssh/config.rb9
-rw-r--r--lib/net/ssh/version.rb2
-rw-r--r--test/test_config.rb10
4 files changed, 23 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 197a102..32977f5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,7 @@
+=== 5.2.0.rc2
+
+ * Read check_host_ip from ssh config files
+
=== 5.2.0.rc1
* Interpret * and ? in know_hosts file [Romain Tartière, #660]
diff --git a/lib/net/ssh/config.rb b/lib/net/ssh/config.rb
index 03b7fb7..53070b0 100644
--- a/lib/net/ssh/config.rb
+++ b/lib/net/ssh/config.rb
@@ -24,6 +24,7 @@ module Net
# * IdentityFile => maps to the :keys option
# * IdentityAgent => :identity_agent
# * IdentitiesOnly => :keys_only
+ # * CheckHostIP => :check_host_ip
# * Macs => maps to the :hmac option
# * PasswordAuthentication => maps to the :auth_methods option password
# * Port => :port
@@ -76,6 +77,10 @@ module Net
# #translate for how to convert the OpenSSH options into Net::SSH
# options.)
def load(path, host, settings={}, base_dir = nil)
+ translated_globals = {
+ "checkhostip" => "check_host_ip"
+ }
+
file = File.expand_path(path)
base_dir ||= File.dirname(file)
return settings unless File.readable?(file)
@@ -96,6 +101,7 @@ module Net
next if value.nil?
key.downcase!
+ key = translated_globals[key] || key
value = unquote(value)
value = case value.strip
@@ -202,7 +208,8 @@ module Net
fingerprinthash: :fingerprint_hash,
port: :port,
user: :user,
- userknownhostsfile: :user_known_hosts_file
+ userknownhostsfile: :user_known_hosts_file,
+ checkhostip: :check_host_ip
}
case key
when :ciphers
diff --git a/lib/net/ssh/version.rb b/lib/net/ssh/version.rb
index b812fdf..16e81fb 100644
--- a/lib/net/ssh/version.rb
+++ b/lib/net/ssh/version.rb
@@ -56,7 +56,7 @@ module Net
# The prerelease component of this version of the Net::SSH library
# nil allowed
- PRE = "rc1"
+ PRE = "rc2"
# The current version of the Net::SSH library as a Version instance
CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
diff --git a/test/test_config.rb b/test/test_config.rb
index d44fbce..b85f3c3 100644
--- a/test/test_config.rb
+++ b/test/test_config.rb
@@ -55,6 +55,16 @@ class TestConfig < NetSSHTest
end
end
+ def test_check_host_ip
+ data = %q{
+ CheckHostIP no
+ }
+ with_config_from_data data do |f|
+ config = Net::SSH::Config.load(f, 'foo')
+ assert_equal false, config['check_host_ip']
+ end
+ end
+
def test_load_with_regex_chars
data = %q{
Host |