mirror of
https://github.com/inspec/inspec
synced 2024-11-30 00:20:28 +00:00
Merge pull request #5414 from inspec/cw/ssh_conf_first_value
This commit is contained in:
commit
b425f1d6b9
3 changed files with 9 additions and 1 deletions
|
@ -39,7 +39,7 @@ module Inspec::Resources
|
|||
def convert_hash(hash)
|
||||
new_hash = {}
|
||||
hash.each do |k, v|
|
||||
new_hash[k.downcase] = v
|
||||
new_hash[k.downcase] ||= v
|
||||
end
|
||||
new_hash
|
||||
end
|
||||
|
|
3
test/fixtures/files/ssh_config
vendored
3
test/fixtures/files/ssh_config
vendored
|
@ -4,3 +4,6 @@ Host *
|
|||
SendEnv LANG LC_*
|
||||
HashKnownHosts yes
|
||||
GSSAPIAuthentication no
|
||||
HostBasedAuthentication yes
|
||||
HostbasedAuthentication no
|
||||
HostbasedAuthentication no
|
||||
|
|
|
@ -18,6 +18,11 @@ describe "Inspec::Resources::SshConfig" do
|
|||
_(resource.gssapiauthentication).must_equal "no"
|
||||
_(resource.GSSAPIAuthentication).must_equal "no"
|
||||
end
|
||||
|
||||
it "uses the first value encountered" do
|
||||
resource = load_resource("ssh_config")
|
||||
_(resource.HostBasedAuthentication).must_equal "yes"
|
||||
end
|
||||
end
|
||||
|
||||
describe "sshd_config" do
|
||||
|
|
Loading…
Reference in a new issue