net-ssh 4.0.0 → 4.0.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ca3b9e413b9e081ec60080e8a7f076fdea0326e
4
- data.tar.gz: 37e873e6a678e995281ffacdc8941a8a1c6edf99
3
+ metadata.gz: 2a85d8ffe356b4c518f3b9f03e5db8e988d305c8
4
+ data.tar.gz: 814f1bd93b849e89d6210d84ec53a4eafa617a91
5
5
  SHA512:
6
- metadata.gz: 775e2a31a2aa12784784a85eccbfe4fb8153dcf992dacc1e3d89ad859dc9f6bc6fb11fe55582a86d4d4a6c7c834d3b7e11df43acf1d5fcc03c8bb7281a95a34e
7
- data.tar.gz: 4f5cf221ac378298931376187780566306f7310a6a1eccc972cb2d7ced4e4b875e5605a88b6aca29974253c65dd80f93b9b983713af564c1d0e2affb3e0b6291
6
+ metadata.gz: 59055d104360f2ddb71cb09747dc4a0cc3df52714d97b966cce35e13cc731d913114f873c6ccc3a937c2ecb2bce2ed84850bcbfe5a9e5f554ada3f725eb47c15
7
+ data.tar.gz: 0f7d6af33dfe71f9d34a06d2a7eddbd3350cf135bb9da9e13e494c1c1284db46a4f226bbfbed5d8c608ab4eb963bd4dfeb3099a167a5b58d8b7dae3cdd519521
checksums.yaml.gz.sig CHANGED
@@ -1,4 +1,3 @@
1
- ��+Ͱ����С%��"��mEb��@��gA�����3�����O����.$���Gm���x��
2
- �[� W��-���#D�N��emJ\f
3
-
4
- �8��vi�Ww�T�|�m�o1˧?��a&4M
1
+ �2��Ik�z�Q6�:�6tvx��e�* ^�� 18�x��K犐��9�#�Uv�\`'̫=����a�W;8�Us�9>lb��W��_V�����~�8)]Pcif�\�(�͑0b��<�: c~?,���P�=�%������w���n��Y���
2
+ >��� �䯯郂�gF+��ƽ���������p�N��
3
+ ����g�j
data.tar.gz.sig CHANGED
Binary file
data/.travis.yml CHANGED
@@ -32,15 +32,15 @@ matrix:
32
32
  install:
33
33
  - export JRUBY_OPTS='--client -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -Xcext.enabled=false -J-Xss2m -Xcompile.invokedynamic=false'
34
34
  - sudo pip install ansible
35
- - gem install bundler -v "= 1.11.2"
36
- - bundle _1.11.2_ install
37
- - BUNDLE_GEMFILE=./Gemfile.norbnacl bundle _1.11.2_ install
35
+ - gem install bundler -v "= 1.13.7"
36
+ - bundle _1.13.7_ install
37
+ - BUNDLE_GEMFILE=./Gemfile.norbnacl bundle _1.13.7_ install
38
38
  - sudo ansible-galaxy install rvm_io.ruby
39
39
  - sudo chown -R travis:travis /home/travis/.ansible
40
40
  - ansible-playbook ./test/integration/playbook.yml -i "localhost," --become -c local -e 'no_rvm=true' -e 'myuser=travis' -e 'mygroup=travis' -e 'homedir=/home/travis'
41
41
 
42
42
  script:
43
- - bundle _1.11.2_ exec rake test
44
- - BUNDLE_GEMFILE=./Gemfile.norbnacl bundle _1.11.2_ exec rake test
45
- - bundle _1.11.2_ exec rake test_test
46
- - bundle _1.11.2_ exec rubocop
43
+ - bundle _1.13.7_ exec rake test
44
+ - BUNDLE_GEMFILE=./Gemfile.norbnacl bundle _1.13.7_ exec rake test
45
+ - bundle _1.13.7_ exec rake test_test
46
+ - bundle _1.13.7_ exec rubocop
data/CHANGES.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 4.0.1.rc1
2
+
3
+ * support of rbnacl 4.0 and better error message [#479]
4
+ * support include in config files [Kimura Masayuki, #475]
5
+ * fixed issue with ruby 2.2 or older on windows [#472]
6
+
7
+ === 4.0.0
1
8
  === 4.0.0.rc3
2
9
 
3
10
  * parse `+` character in config files [Christoph Lupprich, #470, #314]
data/Gemfile CHANGED
@@ -7,6 +7,10 @@ if !Gem.win_platform? && RUBY_ENGINE == "mri"
7
7
  gem 'byebug', group: [:development, :test]
8
8
  end
9
9
 
10
+ if (Gem::Version.new(RUBY_VERSION) <=> Gem::Version.new("2.2.6")) < 0
11
+ gem 'rbnacl', '< 4.0'
12
+ end
13
+
10
14
  if ENV["CI"]
11
15
  gem 'codecov', require: false, group: :test
12
16
  gem 'simplecov', require: false, group: :test
@@ -1,29 +1,29 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- net-ssh (4.0.0.rc1)
4
+ net-ssh (4.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.2.0)
9
+ ast (2.3.0)
10
10
  metaclass (0.0.4)
11
- minitest (5.8.4)
12
- mocha (1.1.0)
11
+ minitest (5.10.1)
12
+ mocha (1.2.1)
13
13
  metaclass (~> 0.0.1)
14
- parser (2.3.1.0)
14
+ parser (2.3.3.1)
15
15
  ast (~> 2.2)
16
16
  powerpack (0.1.1)
17
17
  rainbow (2.1.0)
18
- rake (11.1.2)
19
- rubocop (0.39.0)
20
- parser (>= 2.3.0.7, < 3.0)
18
+ rake (12.0.0)
19
+ rubocop (0.46.0)
20
+ parser (>= 2.3.1.1, < 3.0)
21
21
  powerpack (~> 0.1)
22
22
  rainbow (>= 1.99.1, < 3.0)
23
23
  ruby-progressbar (~> 1.7)
24
24
  unicode-display_width (~> 1.0, >= 1.0.1)
25
- ruby-progressbar (1.8.0)
26
- unicode-display_width (1.0.5)
25
+ ruby-progressbar (1.8.1)
26
+ unicode-display_width (1.1.2)
27
27
 
28
28
  PLATFORMS
29
29
  ruby
@@ -31,11 +31,11 @@ PLATFORMS
31
31
 
32
32
  DEPENDENCIES
33
33
  bundler (~> 1.11)
34
- minitest (~> 5.0)
35
- mocha (>= 1.1.0)
34
+ minitest (~> 5.10)
35
+ mocha (>= 1.2.1)
36
36
  net-ssh!
37
- rake (~> 11.1)
38
- rubocop (~> 0.39.0)
37
+ rake (~> 12.0)
38
+ rubocop (~> 0.46.0)
39
39
 
40
40
  BUNDLED WITH
41
41
  1.13.6
data/appveyor.yml CHANGED
@@ -7,6 +7,7 @@ environment:
7
7
  - ruby_version: "jruby-9.1.2.0"
8
8
  - ruby_version: "23"
9
9
  - ruby_version: "23-x64"
10
+ - ruby_version: "22-x64"
10
11
 
11
12
  #init:
12
13
  # - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
@@ -21,14 +22,14 @@ platform:
21
22
  install:
22
23
  - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
23
24
  - if "%ruby_version%" == "jruby-9.1.2.0" ( cinst javaruntime -i )
24
- - if "%ruby_version%" == "jruby-9.1.2.0" ( cinst jruby --version 9.1.2.0 -i )
25
+ - if "%ruby_version%" == "jruby-9.1.2.0" ( cinst jruby --version 9.1.2.0 -i --allow-empty-checksums )
25
26
  - if "%ruby_version%" == "jruby-9.1.2.0" ( SET "PATH=C:\jruby-9.1.2.0\bin\;%PATH%" )
26
27
  - ruby --version
27
28
  - gem install bundler --no-document -v 1.13.5
28
29
  - SET BUNDLE_GEMFILE=Gemfile.norbnacl
29
30
  - bundle _1.13.5_ install --retry=3
30
31
  - cinst freesshd
31
- - cinst putty
32
+ - cinst putty --allow-empty-checksums
32
33
  - ps: |
33
34
  if ($env:Processor_Architecture -eq "x86")
34
35
  {
@@ -1,6 +1,5 @@
1
- gem 'rbnacl-libsodium', '>= 1.0.10'
2
- gem 'rbnacl', '>= 3.2.0', '< 4.0'
3
- gem 'bcrypt_pbkdf', '~> 1.0.0' unless RUBY_PLATFORM == "java"
1
+ gem 'rbnacl', '>= 3.2.0', '< 5.0'
2
+ gem 'bcrypt_pbkdf', '~> 1.0' unless RUBY_PLATFORM == "java"
4
3
 
5
4
  require 'rbnacl/libsodium'
6
5
  require 'rbnacl'
@@ -1,7 +1,7 @@
1
1
  module Net; module SSH; module Authentication
2
2
 
3
3
  # Loads ED25519 support which requires optinal dependecies like
4
- # rbnacl-libsodium, rbnacl, bcrypt_pbkdf
4
+ # rbnacl, bcrypt_pbkdf
5
5
  module ED25519Loader
6
6
 
7
7
  begin
@@ -14,8 +14,18 @@ rescue LoadError => e
14
14
  end
15
15
 
16
16
  def self.raiseUnlessLoaded(message)
17
- raise NotImplementedError, "#{message} -- see #{ERROR}" unless LOADED
17
+ description = dependenciesRequiredForED25519 if ERROR.is_a?(Gem::LoadError)
18
+ description << "#{ERROR.class} : \"#{ERROR.message}\"\n" if ERROR
19
+ raise NotImplementedError, "#{message}\n#{description}" unless LOADED
18
20
  end
19
21
 
22
+ def self.dependenciesRequiredForED25519
23
+ result = "net-ssh requires the following gems for ed25519 support:\n"
24
+ result << " * rbnacl (>= 3.2, < 5.0)\n"
25
+ result << " * rbnacl-libsodium, if your system doesn't have libsodium installed.\n"
26
+ result << " * bcrypt_pbkdf (>= 1.0, < 2.0)\n" unless RUBY_PLATFORM == "java"
27
+ result << "See https://github.com/net-ssh/net-ssh/issues/478 for more information\n"
20
28
  end
21
- end; end; end
29
+
30
+ end
31
+ end; end; end
@@ -98,8 +98,8 @@ module Net; module SSH; module Authentication
98
98
 
99
99
  # args: hFile, (ignored), flProtect, dwMaximumSizeHigh,
100
100
  # dwMaximumSizeLow, lpName
101
- extern "HANDLE CreateFileMapping#{SUFFIX}(HANDLE, void *, DWORD, ' +
102
- 'DWORD, DWORD, LPCTSTR)"
101
+ extern "HANDLE CreateFileMapping#{SUFFIX}(HANDLE, void *, DWORD, " +
102
+ "DWORD, DWORD, LPCTSTR)"
103
103
 
104
104
  # args: hFileMappingObject, dwDesiredAccess, dwFileOffsetHigh,
105
105
  # dwfileOffsetLow, dwNumberOfBytesToMap
@@ -112,8 +112,8 @@ module Net; module SSH; module Authentication
112
112
  extern 'BOOL CloseHandle(HANDLE)'
113
113
 
114
114
  # args: hWnd, Msg, wParam, lParam, fuFlags, uTimeout, lpdwResult
115
- extern "LRESULT SendMessageTimeout#{SUFFIX}(HWND, UINT, WPARAM, LPARAM, ' +
116
- 'UINT, UINT, PDWORD_PTR)"
115
+ extern "LRESULT SendMessageTimeout#{SUFFIX}(HWND, UINT, WPARAM, LPARAM, " +
116
+ "UINT, UINT, PDWORD_PTR)"
117
117
 
118
118
  # args: none
119
119
  extern 'DWORD GetLastError()'
@@ -73,10 +73,11 @@ module Net; module SSH
73
73
  # options.)
74
74
  def load(path, host, settings={})
75
75
  file = File.expand_path(path)
76
+ base_dir = File.dirname(file)
76
77
  return settings unless File.readable?(file)
77
78
 
78
79
  globals = {}
79
- matched_host = nil
80
+ host_matched = false
80
81
  seen_host = false
81
82
  IO.foreach(file) do |line|
82
83
  next if line =~ /^\s*(?:#.*)?$/
@@ -107,25 +108,35 @@ module Net; module SSH
107
108
 
108
109
  # Check for negative patterns first. If the host matches, that overrules any other positive match.
109
110
  # The host substring code is used to strip out the starting "!" so the regexp will be correct.
110
- negative_match = negative_hosts.select { |h| host =~ pattern2regex(h[1..-1]) }.first
111
+ negative_matched = negative_hosts.any? { |h| host =~ pattern2regex(h[1..-1]) }
111
112
 
112
- if negative_match
113
- matched_host = nil
113
+ if negative_matched
114
+ host_matched = false
114
115
  else
115
- matched_host = positive_hosts.select { |h| host =~ pattern2regex(h) }.first
116
+ host_matched = positive_hosts.any? { |h| host =~ pattern2regex(h) }
116
117
  end
117
118
 
118
119
  seen_host = true
119
120
  settings[key] = host
120
121
  elsif !seen_host
121
- if key == 'identityfile'
122
+ case key
123
+ when 'identityfile'
122
124
  (globals[key] ||= []) << value
125
+ when 'include'
126
+ included_file_paths(base_dir, value).each do |file_path|
127
+ globals = load(file_path, host, globals)
128
+ end
123
129
  else
124
130
  globals[key] = value unless settings.key?(key)
125
131
  end
126
- elsif !matched_host.nil?
127
- if key == 'identityfile'
132
+ elsif host_matched
133
+ case key
134
+ when 'identityfile'
128
135
  (settings[key] ||= []) << value
136
+ when 'include'
137
+ included_file_paths(base_dir, value).each do |file_path|
138
+ settings = load(file_path, host, settings)
139
+ end
129
140
  else
130
141
  settings[key] = value unless settings.key?(key)
131
142
  end
@@ -214,7 +225,7 @@ module Net; module SSH
214
225
  require 'net/ssh/proxy/command'
215
226
  hash[:proxy] = Net::SSH::Proxy::Command.new(value)
216
227
  end
217
- when 'pubkeyauthentication'
228
+ when 'pubkeyauthentication'
218
229
  if value
219
230
  (hash[:auth_methods] << 'publickey').uniq!
220
231
  else
@@ -288,6 +299,13 @@ module Net; module SSH
288
299
  end
289
300
  hash
290
301
  end
302
+
303
+ def included_file_paths(base_dir, config_path)
304
+ paths = Dir.glob(File.expand_path(config_path)).select { |f| File.file?(f) }
305
+ paths += Dir.glob(File.join(base_dir, config_path)).select { |f| File.file?(f) }
306
+ paths.uniq
307
+ end
308
+
291
309
  end
292
310
  end
293
311
 
@@ -51,11 +51,11 @@ module Net; module SSH
51
51
  MINOR = 0
52
52
 
53
53
  # The tiny component of this version of the Net::SSH library
54
- TINY = 0
54
+ TINY = 1
55
55
 
56
56
  # The prerelease component of this version of the Net::SSH library
57
57
  # nil allowed
58
- PRE = nil
58
+ PRE = "rc1"
59
59
 
60
60
  # The current version of the Net::SSH library as a Version instance
61
61
  CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
data/net-ssh.gemspec CHANGED
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  unless ENV['NET_SSH_NO_RBNACL']
32
- spec.add_development_dependency("rbnacl-libsodium", "~> 1.0.10")
33
- spec.add_development_dependency("rbnacl", "~> 3.4.0")
34
- spec.add_development_dependency("bcrypt_pbkdf", "~> 1.0.0") unless RUBY_PLATFORM == "java"
32
+ spec.add_development_dependency("rbnacl-libsodium", "~> 1.0.11")
33
+ spec.add_development_dependency("rbnacl", ['>= 3.2.0','< 5.0'])
34
+ spec.add_development_dependency("bcrypt_pbkdf", "~> 1.0") unless RUBY_PLATFORM == "java"
35
35
  end
36
36
 
37
37
  spec.add_development_dependency "bundler", "~> 1.11"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamis Buck
@@ -32,14 +32,14 @@ cert_chain:
32
32
  L4d54WIy4HkZCqQXoTSiK5HZMIdXkPk3F1bZdJ8Dy1sMRru0rUkkM5mW7TQ75mfW
33
33
  Zp0QrZyNZhtitrXFbZneGRrIA/8G2Krft5Ly/A==
34
34
  -----END CERTIFICATE-----
35
- date: 2016-12-26 00:00:00.000000000 Z
35
+ date: 2017-01-01 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 1.0.10
42
+ version: 1.0.11
43
43
  name: rbnacl-libsodium
44
44
  prerelease: false
45
45
  type: :development
@@ -47,21 +47,27 @@ dependencies:
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 1.0.10
50
+ version: 1.0.11
51
51
  - !ruby/object:Gem::Dependency
52
52
  requirement: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - "~>"
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 3.4.0
56
+ version: 3.2.0
57
+ - - "<"
58
+ - !ruby/object:Gem::Version
59
+ version: '5.0'
57
60
  name: rbnacl
58
61
  prerelease: false
59
62
  type: :development
60
63
  version_requirements: !ruby/object:Gem::Requirement
61
64
  requirements:
62
- - - "~>"
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 3.2.0
68
+ - - "<"
63
69
  - !ruby/object:Gem::Version
64
- version: 3.4.0
70
+ version: '5.0'
65
71
  - !ruby/object:Gem::Dependency
66
72
  requirement: !ruby/object:Gem::Requirement
67
73
  requirements:
@@ -259,9 +265,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
259
265
  version: '2.0'
260
266
  required_rubygems_version: !ruby/object:Gem::Requirement
261
267
  requirements:
262
- - - ">="
268
+ - - ">"
263
269
  - !ruby/object:Gem::Version
264
- version: '0'
270
+ version: 1.3.1
265
271
  requirements: []
266
272
  rubyforge_project:
267
273
  rubygems_version: 2.6.8
metadata.gz.sig CHANGED
Binary file