net-ssh 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,18 @@
1
+ 2008-02-26 07:54 jamis
2
+
3
+ * Fix invalid use of socket.send (closes #17857, thanks to
4
+ Zbigniew Zemła)
5
+
6
+ 2007-07-11 09:52 jamis
7
+
8
+ * nevermind
9
+
10
+ 2007-07-11 08:57 jamis
11
+
12
+ * Make sure packets are split in such a way as to preserve a
13
+ minimum packet size, to prevent hmacs being split and
14
+ causing grief
15
+
1
16
  2007-06-18 12:07 jamis
2
17
 
3
18
  * version bump
data/NEWS CHANGED
@@ -1,6 +1,9 @@
1
1
  Net:SSH
2
2
  http://rubyforge.org/projects/net-ssh
3
3
 
4
+ [1.1.3] 29 Apr 2008
5
+ * Fixed bug #17857 (Invalid use of @socket.send) [Zbigniew Zemla]
6
+
4
7
  [1.1.2] 18 June 2007
5
8
  * Fixed bug #6156 (ruby -w warnings)
6
9
 
data/bin/rb-keygen CHANGED
File without changes
@@ -111,7 +111,16 @@ module Net
111
111
 
112
112
  encrypted_data = @cipher.update( unencrypted_data ) << @cipher.final
113
113
  message = encrypted_data + mac
114
- @socket.send message, 0
114
+
115
+ # send package, in case package was only partially transferred, retry
116
+ counter = message.size
117
+ while counter > 0
118
+ begin
119
+ counter -= @socket.send message[(message.size-counter)..message.size], 0
120
+ rescue Errno::EINTR
121
+ retry
122
+ end
123
+ end
115
124
 
116
125
  increment_sequence_number
117
126
  end
@@ -195,13 +204,17 @@ module Net
195
204
 
196
205
  def read( length )
197
206
  if IO === @socket
198
- data = ""
199
- while data.length < length
200
- break if @socket.closed?
201
- if ( IO.select([@socket],nil,nil,0.01) rescue nil )
202
- data << @socket.read(length-data.length)
207
+ data = ""
208
+ begin
209
+ while data.length < length
210
+ break if @socket.closed?
211
+ if ( IO.select([@socket],nil,nil,0.01) rescue nil )
212
+ data << @socket.read(length-data.length)
213
+ end
203
214
  end
204
- end
215
+ rescue Error::EINTR
216
+ retry
217
+ end
205
218
  else
206
219
  data = @socket.recv(length)
207
220
  end
@@ -20,7 +20,7 @@ module Net
20
20
 
21
21
  MAJOR = 1
22
22
  MINOR = 1
23
- TINY = 2
23
+ TINY = 3
24
24
 
25
25
  STRING = [ MAJOR, MINOR, TINY ].join( "." )
26
26
 
@@ -106,6 +106,7 @@ module PacketStream_Mock
106
106
 
107
107
  def send( text, arg )
108
108
  @send_buffer << text
109
+ text.length
109
110
  end
110
111
  end
111
112
 
metadata CHANGED
@@ -1,33 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: net-ssh
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.1.2
7
- date: 2007-06-18 00:00:00 -06:00
8
- summary: Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.
9
- require_paths:
10
- - lib
11
- email: jamis@37signals.com
12
- homepage: http://net-ssh.rubyforge.org
13
- rubyforge_project:
14
- description:
15
- autorequire: net/ssh
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.1.3
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Jamis Buck
8
+ autorequire: net/ssh
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-29 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: needle
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.2.0
23
+ version:
24
+ description:
25
+ email: jamis@37signals.com
26
+ executables:
27
+ - rb-keygen
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
31
32
  files:
32
33
  - bin/rb-keygen
33
34
  - doc/LICENSE-BSD
@@ -77,18 +78,6 @@ files:
77
78
  - doc/manual/stylesheets/manual.css
78
79
  - doc/manual/stylesheets/ruby.css
79
80
  - doc/manual/tutorial.erb
80
- - doc/manual-html
81
- - doc/manual-html/chapter-1.html
82
- - doc/manual-html/chapter-2.html
83
- - doc/manual-html/chapter-3.html
84
- - doc/manual-html/chapter-4.html
85
- - doc/manual-html/chapter-5.html
86
- - doc/manual-html/chapter-6.html
87
- - doc/manual-html/chapter-7.html
88
- - doc/manual-html/index.html
89
- - doc/manual-html/stylesheets
90
- - doc/manual-html/stylesheets/manual.css
91
- - doc/manual-html/stylesheets/ruby.css
92
81
  - lib/net
93
82
  - lib/net/ssh
94
83
  - lib/net/ssh/connection
@@ -274,25 +263,31 @@ files:
274
263
  - NEWS
275
264
  - THANKS
276
265
  - ChangeLog
277
- test_files:
278
- - test/ALL-TESTS.rb
266
+ has_rdoc: true
267
+ homepage: http://net-ssh.rubyforge.org
268
+ post_install_message:
279
269
  rdoc_options: []
280
270
 
281
- extra_rdoc_files: []
282
-
283
- executables:
284
- - rb-keygen
285
- extensions: []
286
-
271
+ require_paths:
272
+ - lib
273
+ required_ruby_version: !ruby/object:Gem::Requirement
274
+ requirements:
275
+ - - ">="
276
+ - !ruby/object:Gem::Version
277
+ version: "0"
278
+ version:
279
+ required_rubygems_version: !ruby/object:Gem::Requirement
280
+ requirements:
281
+ - - ">="
282
+ - !ruby/object:Gem::Version
283
+ version: "0"
284
+ version:
287
285
  requirements: []
288
286
 
289
- dependencies:
290
- - !ruby/object:Gem::Dependency
291
- name: needle
292
- version_requirement:
293
- version_requirements: !ruby/object:Gem::Version::Requirement
294
- requirements:
295
- - - ">="
296
- - !ruby/object:Gem::Version
297
- version: 1.2.0
298
- version:
287
+ rubyforge_project:
288
+ rubygems_version: 1.1.1
289
+ signing_key:
290
+ specification_version: 2
291
+ summary: Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.
292
+ test_files:
293
+ - test/ALL-TESTS.rb
@@ -1,388 +0,0 @@
1
- <html>
2
- <head>
3
- <title>Net::SSH Manual :: Chapter 1: Introduction</title>
4
- <link type="text/css" rel="stylesheet" href="stylesheets/manual.css" />
5
- </head>
6
-
7
- <body>
8
- <div id="banner">
9
- <table border='0' cellpadding='0' cellspacing='0' width='100%'>
10
- <tr><td valign='top' align='left'>
11
- <div class="title">
12
- <span class="product">Net::SSH&mdash;</span><br />
13
- <span class="tagline">Secure Shell for Ruby</span>
14
- </div>
15
- </td><td valign='middle' align='right'>
16
- <div class="info">
17
- Net::SSH Version: <strong>1.1.2</strong><br />
18
- Manual Last Updated: <strong>2007-06-18 18:12 UTC</strong>
19
- </div>
20
- </td></tr>
21
- </table>
22
- </div>
23
-
24
- <table border='0' width='100%' cellpadding='0' cellspacing='0'>
25
- <tr><td valign='top'>
26
-
27
- <div id="navigation">
28
- <h1>Net::SSH Manual</h1>
29
-
30
- <h2>Chapters</h2>
31
- <ol type="I">
32
-
33
- <li><strong>
34
- <a href="chapter-1.html">
35
- Introduction
36
- </a>
37
- </strong> <big>&larr;</big>
38
- <ol type="1">
39
-
40
- <li><a href="chapter-1.html#s1">What is Net::SSH?</a></li>
41
-
42
- <li><a href="chapter-1.html#s2">What isn&#8217;t Net::SSH?</a></li>
43
-
44
- <li><a href="chapter-1.html#s3">Getting Net::SSH</a></li>
45
-
46
- <li><a href="chapter-1.html#s4">License Information</a></li>
47
-
48
- <li><a href="chapter-1.html#s5">Support</a></li>
49
-
50
- <li><a href="chapter-1.html#s6">About the Author</a></li>
51
-
52
- </ol>
53
- </li>
54
-
55
- <li>
56
- <a href="chapter-2.html">
57
- Starting a Session
58
- </a>
59
-
60
- <ol type="1">
61
-
62
- <li><a href="chapter-2.html#s1">Using Net::SSH.start</a></li>
63
-
64
- <li><a href="chapter-2.html#s2">Using a Public/Private Key</a></li>
65
-
66
- <li><a href="chapter-2.html#s3">Options</a></li>
67
-
68
- <li><a href="chapter-2.html#s4">Using Net::SSH::Session</a></li>
69
-
70
- </ol>
71
- </li>
72
-
73
- <li>
74
- <a href="chapter-3.html">
75
- Channels
76
- </a>
77
-
78
- <ol type="1">
79
-
80
- <li><a href="chapter-3.html#s1">What are Channels?</a></li>
81
-
82
- <li><a href="chapter-3.html#s2">Session.loop</a></li>
83
-
84
- <li><a href="chapter-3.html#s3">Channel Types</a></li>
85
-
86
- <li><a href="chapter-3.html#s4">Opening a Channel</a></li>
87
-
88
- <li><a href="chapter-3.html#s5">Callbacks</a></li>
89
-
90
- <li><a href="chapter-3.html#s6">Channel Operations</a></li>
91
-
92
- </ol>
93
- </li>
94
-
95
- <li>
96
- <a href="chapter-4.html">
97
- Executing Commands
98
- </a>
99
-
100
- <ol type="1">
101
-
102
- <li><a href="chapter-4.html#s1">Using Channels</a></li>
103
-
104
- <li><a href="chapter-4.html#s2">Using #process.open</a></li>
105
-
106
- <li><a href="chapter-4.html#s3">Using #process.popen3</a></li>
107
-
108
- </ol>
109
- </li>
110
-
111
- <li>
112
- <a href="chapter-5.html">
113
- User Shells
114
- </a>
115
-
116
- <ol type="1">
117
-
118
- <li><a href="chapter-5.html#s1">Introduction</a></li>
119
-
120
- <li><a href="chapter-5.html#s2">Using Channels</a></li>
121
-
122
- <li><a href="chapter-5.html#s3">Shell Service</a></li>
123
-
124
- <li><a href="chapter-5.html#s4">SyncShell Service</a></li>
125
-
126
- <li><a href="chapter-5.html#s5">Terminal Clients</a></li>
127
-
128
- </ol>
129
- </li>
130
-
131
- <li>
132
- <a href="chapter-6.html">
133
- Port Forwarding
134
- </a>
135
-
136
- <ol type="1">
137
-
138
- <li><a href="chapter-6.html#s1">Introduction</a></li>
139
-
140
- <li><a href="chapter-6.html#s2">Local-to-Remote</a></li>
141
-
142
- <li><a href="chapter-6.html#s3">Remote-to-Local</a></li>
143
-
144
- <li><a href="chapter-6.html#s4">Direct Channels</a></li>
145
-
146
- <li><a href="chapter-6.html#s5">Remote-to-Local Handlers</a></li>
147
-
148
- </ol>
149
- </li>
150
-
151
- <li>
152
- <a href="chapter-7.html">
153
- Using Proxies
154
- </a>
155
-
156
- <ol type="1">
157
-
158
- <li><a href="chapter-7.html#s1">Introduction</a></li>
159
-
160
- <li><a href="chapter-7.html#s2"><span class="caps">HTTP</span></a></li>
161
-
162
- <li><a href="chapter-7.html#s3"><span class="caps">SOCKS</span></a></li>
163
-
164
- </ol>
165
- </li>
166
-
167
- </ol>
168
-
169
- <h2>Other Documentation</h2>
170
-
171
- <ul>
172
- <li><a href="http://net-ssh.rubyforge.org/api/index.html">Net::SSH API</a></li>
173
- <li><a href="http://rubyforge.org/tracker/?atid=1842&group_id=274&func=browse">Net::SSH FAQ</a></li>
174
- </ul>
175
-
176
- <h2>Tutorials</h2>
177
- <ol>
178
-
179
- </ol>
180
-
181
- <p align="center"><strong>More To Come...</strong></p>
182
-
183
- <div class="license">
184
- <a href="http://creativecommons.org/licenses/by-sa/2.0/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights" /></a><br />
185
- This manual is licensed under a <a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons License</a>.
186
- </div>
187
- </div>
188
-
189
- </td><td valign='top' width="100%">
190
-
191
- <div id="content">
192
-
193
- <div class="top"><div class="prevnext">
194
-
195
- <a href="index.html">Up</a>
196
-
197
- | <a href="chapter-2.html">Next (2. Starting a Session)</a>
198
-
199
- </div></div>
200
-
201
- <h1>1. Introduction</h1>
202
-
203
-
204
-
205
- <h2>
206
- <a name="s1"></a>
207
- 1.1. What is Net::SSH?
208
- </h2>
209
-
210
-
211
-
212
- <div class="section">
213
- <p>Net::SSH is a pure-Ruby implementation of the <span class="caps">SSH2</span> client protocol. It supports the following features:</p>
214
-
215
-
216
- <ul>
217
- <li>User authentication via explicit username/password, or using a public-key/private-key pair.</li>
218
- <li>Port forwarding, both from the local host to a remote computer via the remote host, and from the remote host to the local host.</li>
219
- <li>Execute processes on the remote machine, both interactively and non-interactively (&#8220;batch&#8221;).</li>
220
- </ul>
221
- </div>
222
-
223
-
224
-
225
- <h2>
226
- <a name="s2"></a>
227
- 1.2. What isn&#8217;t Net::SSH?
228
- </h2>
229
-
230
-
231
-
232
- <div class="section">
233
- <p>Net::SSH is only a <em>client</em> implementation, not a server. Given sufficient motivation and encouragement from the community, perhaps it will someday include an <span class="caps">SSH</span> server, but as of right now, it does not.</p>
234
-
235
-
236
- <p>Furthermore, it is only an <em><span class="caps">SSH2</span></em> client. This means that it cannot connect to <span class="caps">SSH</span> servers that only understand the older <span class="caps">SSH1</span> protocol.</p>
237
- </div>
238
-
239
-
240
-
241
- <h2>
242
- <a name="s3"></a>
243
- 1.3. Getting Net::SSH
244
- </h2>
245
-
246
-
247
-
248
- <div class="section">
249
- <h3>Prerequisites:</h3>
250
-
251
-
252
- <p>In order to use Net::SSH, you must be using a supported version of Ruby&#8217;s OpenSSL module. The version distributed with Ruby 1.8.1 and earlier is not sufficient, and is lacking several features that Net::SSH relies on. If you are using Ruby 1.8.1 (or earlier), you should either upgrade to 1.8.2, or download and install an updated version of the OpenSSL module. You can download a usable snapshot from the <a href="http://rubyforge.org/projects/net-ssh">Net::SSH downloads page</a>.</p>
253
-
254
-
255
- <p>Furthermore, you must make sure that Ruby&#8217;s OpenSSL module has been compiled against <em>at least</em> version 0.9.7 of the OpenSSL library. Prior versions lacked functionality that Net::SSH depends on (notably, the &#8216;padding&#8217; property of ciphers).</p>
256
-
257
-
258
- <p>Optionally, you can install the <a href="http://raa.ruby-lang.org/project/ruby-termios">ruby-termios</a>. If you do, then your passwords won&#8217;t be echoed to the screen when prompting you for the passphrases needed to load your keys (if your keys have passphrases).</p>
259
-
260
-
261
- <h3>Using <a href="http://rubygems.rubyforge.org">RubyGems</a></h3>
262
-
263
-
264
- <p>If you have <a href="http://rubygems.rubyforge.org">RubyGems</a> installed, installing Net::SSH is simple:</p>
265
-
266
-
267
- <div class='figure'>
268
- <span class='caption'>Using Rubygems to install Net::SSH [shell]</span>
269
- <div class='body'><link rel='stylesheet' type='text/css' href='stylesheets/shell.css' /><div class='shell'><pre>gem install net-ssh</pre></div></div></div>
270
-
271
-
272
- <p>You still need to make sure you have a working version of Ruby&#8217;s OpenSSL module, but other than that, you should be good to go!</p>
273
-
274
-
275
- <h3>Using <a href="http://rpa-base.rubyforge.org">rpa-base</a></h3>
276
-
277
-
278
- <p>If you have <a href="http://rpa-base.rubyforge.org">rpa-base</a> installed:</p>
279
-
280
-
281
- <div class='figure'>
282
- <span class='caption'>Using RPA to install Net::SSH [shell]</span>
283
- <div class='body'><link rel='stylesheet' type='text/css' href='stylesheets/shell.css' /><div class='shell'><pre>rpa install net-ssh</pre></div></div></div>
284
-
285
-
286
- <p>As with the gem install, you still need to make sure you have a working version of Ruby&#8217;s OpenSSL module, but other than that, you should be good to go!</p>
287
-
288
-
289
- <h3>Doing it the hard way</h3>
290
-
291
-
292
- <p>If you don&#8217;t have <a href="http://rubygems.rubyforge.org">RubyGems</a> or <a href="http://rpa-base.rubyforge.org">rpa-base</a>, or if you just prefer to install things by hand, you can always go to the <a href="http://rubyforge.org/projects/net-ssh">Net::SSH downloads page</a> and grab the package of your choice: <code>tar.gz</code>, <code>tar.bz2</code>, or <code>zip</code>.</p>
293
-
294
-
295
- <p>Then, unpack the archive and run the <code>setup.rb</code> script:</p>
296
-
297
-
298
- <div class='figure'>
299
- <span class='caption'>Using setup.rb to install Net::SSH [shell]</span>
300
- <div class='body'><link rel='stylesheet' type='text/css' href='stylesheets/shell.css' /><div class='shell'><pre>ruby setup.rb config
301
- ruby setup.rb setup
302
- ruby setup.rb install</pre></div></div></div>
303
- </div>
304
-
305
-
306
-
307
- <h2>
308
- <a name="s4"></a>
309
- 1.4. License Information
310
- </h2>
311
-
312
-
313
-
314
- <div class="section">
315
- <p>Net::SSH is made available under either the <span class="caps">BSD</span> license, or the same license Ruby (which, by extension, also allows the <span class="caps">GPL</span> as a permissable license as well). You can view the full text of any of these licenses in the <code>doc</code> subdirectory of the Net::SSH distrubtion. The texts of the <span class="caps">BSD</span> and <span class="caps">GPL</span> licenses are also available online: <a href="http://www.opensource.org/licenses/bsd-license.php"><span class="caps">BSD</span></a> and <a href="http://www.opensource.org/licenses/gpl-license.php"><span class="caps">GPL</span></a>.</p>
316
-
317
-
318
- <p>This manual (in any form, be it source or otherwise) and the scripts and templates used to generate it, are all distributed under the <a href="http://creativecommons.org">Creative Commons</a> <a href="http://creativecommons.org/licenses/by-sa/2.0">Attribution-ShareAlike</a> license.</p>
319
-
320
-
321
- <p>If you desire permission to use either Net::SSH or the manual in a manner incompatible with these licenses, please contact the copyright holder (<a href="mailto:jamis@37signals.com">Jamis Buck</a>) in order to negotiate a more compatible license.</p>
322
- </div>
323
-
324
-
325
-
326
- <h2>
327
- <a name="s5"></a>
328
- 1.5. Support
329
- </h2>
330
-
331
-
332
-
333
- <div class="section">
334
- <p>Mailing lists, bug trackers, feature requests, and public forums are all available (courtesty of <a href="http://rubyforge.org">RubyForge</a>) at the <a href="http://rubyforge.org/projects/net-ssh">Net::SSH project page</a>.</p>
335
-
336
-
337
- <h3>Mailing Lists</h3>
338
-
339
-
340
- <table>
341
- <tr>
342
- <th><strong>List Name</strong> </th>
343
- <th>&#8212;</th>
344
- <th><strong>Description</strong> </th>
345
- </tr>
346
- <tr>
347
- <td style="vertical-align:top;text-align:center;"><a href="http://rubyforge.org/pipermail/net-ssh-users">net-ssh-users</a></td>
348
- <td style="vertical-align:top;text-align:center;"><a href="http://rubyforge.org/mailman/listinfo/net-ssh-users">subscribe / unsubscribe</a></td>
349
- <td> The Net::SSH users list is devoted to the discussion of and questions about the usage of the Net::SSH module. If you can&#8217;t quite figure out how to get a feature of Net::SSH to work, this is the list you would go to in order to ask your questions.</td>
350
- </tr>
351
- <tr>
352
- <td style="vertical-align:top;text-align:center;"><a href="http://rubyforge.org/pipermail/net-ssh-devel">net-ssh-devel</a></td>
353
- <td style="vertical-align:top;text-align:center;"><a href="http://rubyforge.org/mailman/listinfo/net-ssh-devel">subscribe / unsubscribe</a></td>
354
- <td> The Net::SSH developers list is devoted to the discussion of Net::SSH&#8217;s implementation. If you have created a patch that you would like to discuss, or if you would like to discuss a new feature, this is the list for you.</td>
355
- </tr>
356
- </table>
357
- </div>
358
-
359
-
360
-
361
- <h2>
362
- <a name="s6"></a>
363
- 1.6. About the Author
364
- </h2>
365
-
366
-
367
-
368
- <div class="section">
369
- <p>Net::SSH was written by <a href="mailto:jamis@37signals.com">Jamis Buck</a>. Feel free to send him compliments, candy, money, praise, or new feature patches&#8212;he likes all those things. You can send him questions and suggestions, too, if you really want to. However, for bug reports and general feature requests, please use the trackers on the <a href="http://rubyforge.org/projects/net-ssh">Net::SSH project page</a>.</p>
370
- </div>
371
-
372
-
373
-
374
- <div class="bottom"><div class="prevnext">
375
-
376
- <a href="index.html">Up</a>
377
-
378
- | <a href="chapter-2.html">Next (2. Starting a Session)</a>
379
-
380
- </div></div>
381
-
382
-
383
- </div>
384
-
385
- </td></tr>
386
- </table>
387
- </body>
388
- </html>