net-ssh 0.6.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/manual-html/chapter-1.html +59 -24
- data/doc/manual-html/chapter-2.html +116 -77
- data/doc/manual-html/chapter-3.html +80 -41
- data/doc/manual-html/chapter-4.html +111 -71
- data/doc/manual-html/chapter-5.html +267 -155
- data/doc/manual-html/chapter-6.html +211 -75
- data/doc/manual-html/chapter-7.html +331 -0
- data/doc/manual-html/index.html +39 -13
- data/doc/manual-html/{manual.css → stylesheets/manual.css} +81 -8
- data/doc/manual-html/stylesheets/ruby.css +17 -0
- data/doc/manual/chapter.erb +20 -0
- data/doc/manual/manual.rb +80 -9
- data/doc/manual/manual.yml +12 -2
- data/doc/manual/page.erb +1 -1
- data/doc/manual/parts/channels_callbacks.txt +11 -11
- data/doc/manual/parts/channels_loop.txt +6 -6
- data/doc/manual/parts/channels_open.txt +9 -9
- data/doc/manual/parts/exec_channels.txt +15 -15
- data/doc/manual/parts/exec_open.txt +17 -18
- data/doc/manual/parts/exec_popen3.txt +18 -18
- data/doc/manual/parts/forward_direct.txt +16 -16
- data/doc/manual/parts/forward_intro.txt +7 -7
- data/doc/manual/parts/forward_local.txt +9 -9
- data/doc/manual/parts/forward_remote.txt +9 -9
- data/doc/manual/parts/intro_getting.txt +11 -11
- data/doc/manual/parts/proxy_http.txt +27 -27
- data/doc/manual/parts/proxy_socks.txt +17 -17
- data/doc/manual/parts/session_key.txt +13 -14
- data/doc/manual/parts/session_options.txt +14 -14
- data/doc/manual/parts/session_session.txt +9 -9
- data/doc/manual/parts/session_start.txt +27 -27
- data/doc/manual/parts/shells_channels.txt +72 -0
- data/doc/manual/parts/shells_clients.txt +51 -0
- data/doc/manual/parts/shells_intro.txt +7 -0
- data/doc/manual/parts/shells_shell.txt +50 -0
- data/doc/manual/parts/shells_sync.txt +42 -0
- data/doc/manual/{manual.css → stylesheets/manual.css} +81 -8
- data/doc/manual/stylesheets/ruby.css +17 -0
- data/examples/channel-demo.rb +1 -1
- data/examples/port-forward.rb +1 -1
- data/examples/process-demo.rb +1 -1
- data/examples/remote-net-port-forward.rb +1 -1
- data/examples/remote-port-forward.rb +1 -1
- data/examples/shell-demo.rb +46 -0
- data/examples/ssh-client.rb +67 -0
- data/examples/sync-shell-demo.rb +69 -0
- data/examples/tail-demo.rb +1 -1
- data/lib/net/ssh.rb +1 -1
- data/lib/net/ssh/connection/channel.rb +61 -7
- data/lib/net/ssh/connection/constants.rb +1 -1
- data/lib/net/ssh/connection/driver.rb +61 -8
- data/lib/net/ssh/connection/services.rb +1 -1
- data/lib/net/ssh/connection/term.rb +1 -1
- data/lib/net/ssh/errors.rb +1 -1
- data/lib/net/ssh/proxy/errors.rb +1 -1
- data/lib/net/ssh/proxy/http.rb +1 -1
- data/lib/net/ssh/proxy/socks4.rb +1 -1
- data/lib/net/ssh/proxy/socks5.rb +1 -1
- data/lib/net/ssh/service/forward/driver.rb +1 -1
- data/lib/net/ssh/service/forward/local-network-handler.rb +1 -1
- data/lib/net/ssh/service/forward/remote-network-handler.rb +1 -1
- data/lib/net/ssh/service/forward/services.rb +1 -1
- data/lib/net/ssh/service/process/driver.rb +1 -1
- data/lib/net/ssh/service/process/open.rb +1 -1
- data/lib/net/ssh/service/process/popen3.rb +20 -2
- data/lib/net/ssh/service/process/services.rb +1 -1
- data/lib/net/ssh/service/services.rb +3 -1
- data/lib/net/ssh/service/shell/driver.rb +86 -0
- data/lib/net/ssh/service/shell/services.rb +54 -0
- data/lib/net/ssh/service/shell/shell.rb +213 -0
- data/lib/net/ssh/service/shell/sync.rb +114 -0
- data/lib/net/ssh/session.rb +9 -1
- data/lib/net/ssh/transport/algorithm-negotiator.rb +1 -1
- data/lib/net/ssh/transport/compress/compressor.rb +1 -1
- data/lib/net/ssh/transport/compress/decompressor.rb +1 -1
- data/lib/net/ssh/transport/compress/none-compressor.rb +1 -1
- data/lib/net/ssh/transport/compress/none-decompressor.rb +1 -1
- data/lib/net/ssh/transport/compress/services.rb +1 -1
- data/lib/net/ssh/transport/compress/zlib-compressor.rb +1 -1
- data/lib/net/ssh/transport/compress/zlib-decompressor.rb +1 -1
- data/lib/net/ssh/transport/constants.rb +1 -1
- data/lib/net/ssh/transport/errors.rb +1 -1
- data/lib/net/ssh/transport/identity-cipher.rb +1 -1
- data/lib/net/ssh/transport/kex/dh-gex.rb +1 -1
- data/lib/net/ssh/transport/kex/dh.rb +1 -1
- data/lib/net/ssh/transport/kex/services.rb +1 -1
- data/lib/net/ssh/transport/ossl/buffer-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/buffer.rb +1 -1
- data/lib/net/ssh/transport/ossl/cipher-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/digest-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac-factory.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/hmac.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/md5-96.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/md5.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/none.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/services.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/sha1-96.rb +1 -1
- data/lib/net/ssh/transport/ossl/hmac/sha1.rb +1 -1
- data/lib/net/ssh/transport/ossl/key-factory.rb +5 -2
- data/lib/net/ssh/transport/ossl/services.rb +1 -1
- data/lib/net/ssh/transport/packet-stream.rb +1 -1
- data/lib/net/ssh/transport/services.rb +1 -1
- data/lib/net/ssh/transport/session.rb +10 -1
- data/lib/net/ssh/transport/version-negotiator.rb +1 -1
- data/lib/net/ssh/userauth/agent.rb +1 -1
- data/lib/net/ssh/userauth/constants.rb +1 -1
- data/lib/net/ssh/userauth/driver.rb +1 -1
- data/lib/net/ssh/userauth/methods/hostbased.rb +1 -1
- data/lib/net/ssh/userauth/methods/keyboard-interactive.rb +104 -0
- data/lib/net/ssh/userauth/methods/password.rb +1 -1
- data/lib/net/ssh/userauth/methods/publickey.rb +1 -1
- data/lib/net/ssh/userauth/methods/services.rb +28 -6
- data/lib/net/ssh/userauth/services.rb +8 -5
- data/lib/net/ssh/userauth/userkeys.rb +1 -1
- data/lib/net/ssh/util/buffer.rb +1 -1
- data/lib/net/ssh/util/openssl.rb +1 -1
- data/lib/net/ssh/util/prompter.rb +1 -1
- data/lib/net/ssh/version.rb +2 -2
- data/test/ALL-TESTS.rb +1 -1
- data/test/connection/tc_channel.rb +1 -1
- data/test/connection/tc_driver.rb +1 -1
- data/test/connection/tc_integration.rb +1 -1
- data/test/proxy/tc_http.rb +1 -1
- data/test/proxy/tc_socks4.rb +1 -1
- data/test/proxy/tc_socks5.rb +1 -1
- data/test/service/forward/tc_driver.rb +1 -1
- data/test/service/forward/tc_local_network_handler.rb +1 -1
- data/test/service/forward/tc_remote_network_handler.rb +1 -1
- data/test/service/process/tc_driver.rb +1 -1
- data/test/service/process/tc_integration.rb +1 -1
- data/test/service/process/tc_open.rb +1 -1
- data/test/service/process/tc_popen3.rb +13 -13
- data/test/tc_integration.rb +1 -1
- data/test/transport/compress/tc_none_compress.rb +1 -1
- data/test/transport/compress/tc_none_decompress.rb +1 -1
- data/test/transport/compress/tc_zlib_compress.rb +1 -1
- data/test/transport/compress/tc_zlib_decompress.rb +1 -1
- data/test/transport/kex/tc_dh.rb +2 -1
- data/test/transport/kex/tc_dh_gex.rb +1 -1
- data/test/transport/ossl/hmac/tc_hmac.rb +1 -1
- data/test/transport/ossl/hmac/tc_md5.rb +1 -1
- data/test/transport/ossl/hmac/tc_md5_96.rb +1 -1
- data/test/transport/ossl/hmac/tc_none.rb +1 -1
- data/test/transport/ossl/hmac/tc_sha1.rb +1 -1
- data/test/transport/ossl/hmac/tc_sha1_96.rb +1 -1
- data/test/transport/ossl/tc_buffer.rb +1 -1
- data/test/transport/ossl/tc_buffer_factory.rb +1 -1
- data/test/transport/ossl/tc_cipher_factory.rb +1 -1
- data/test/transport/ossl/tc_digest_factory.rb +1 -1
- data/test/transport/ossl/tc_hmac_factory.rb +1 -1
- data/test/transport/ossl/tc_key_factory.rb +1 -1
- data/test/transport/tc_algorithm_negotiator.rb +1 -1
- data/test/transport/tc_identity_cipher.rb +1 -1
- data/test/transport/tc_integration.rb +1 -1
- data/test/transport/tc_packet_stream.rb +1 -1
- data/test/transport/tc_session.rb +1 -1
- data/test/transport/tc_version_negotiator.rb +1 -1
- data/test/userauth/methods/tc_hostbased.rb +1 -1
- data/test/userauth/methods/tc_password.rb +1 -1
- data/test/userauth/methods/tc_publickey.rb +1 -1
- data/test/userauth/tc_agent.rb +1 -1
- data/test/userauth/tc_driver.rb +1 -1
- data/test/userauth/tc_integration.rb +15 -1
- data/test/userauth/tc_userkeys.rb +1 -1
- data/test/util/tc_buffer.rb +5 -5
- metadata +26 -6
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -0,0 +1,104 @@
|
|
1
|
+
#--
|
2
|
+
# =============================================================================
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
7
|
+
# library for Ruby. This file (and the library as a whole) may be used only as
|
8
|
+
# allowed by either the BSD license, or the Ruby license (or, by association
|
9
|
+
# with the Ruby license, the GPL). See the "doc" subdirectory of the Net::SSH
|
10
|
+
# distribution for the texts of these licenses.
|
11
|
+
# -----------------------------------------------------------------------------
|
12
|
+
# net-ssh website : http://net-ssh.rubyforge.org
|
13
|
+
# project website: http://rubyforge.org/projects/net-ssh
|
14
|
+
# =============================================================================
|
15
|
+
#++
|
16
|
+
|
17
|
+
require 'net/ssh/errors'
|
18
|
+
require 'net/ssh/userauth/constants'
|
19
|
+
|
20
|
+
module Net
|
21
|
+
module SSH
|
22
|
+
module UserAuth
|
23
|
+
module Methods
|
24
|
+
|
25
|
+
# Implements the "keyboard-interactive" SSH authentication method.
|
26
|
+
class KeyboardInteractive
|
27
|
+
include Net::SSH::UserAuth::Constants
|
28
|
+
|
29
|
+
# Represents an information request from the server
|
30
|
+
InfoRequest = Struct.new( :name, :instruction, :password, :prompts )
|
31
|
+
|
32
|
+
# Represents a single prompt in an InfoRequest.
|
33
|
+
Prompt = Struct.new( :prompt, :echo )
|
34
|
+
|
35
|
+
USERAUTH_INFO_REQUEST = 60
|
36
|
+
USERAUTH_INFO_RESPONSE = 61
|
37
|
+
|
38
|
+
# The messenger to use when communicating.
|
39
|
+
attr_writer :messenger
|
40
|
+
|
41
|
+
# Create a new Password authenticator. It will use the given buffers
|
42
|
+
# factory to create new buffer instances. The +callback+ should be
|
43
|
+
# a proc object to use to specialize the behavior of this
|
44
|
+
# authentication method.
|
45
|
+
def initialize( buffers, callback )
|
46
|
+
@buffers = buffers
|
47
|
+
@callback = callback
|
48
|
+
end
|
49
|
+
|
50
|
+
# Attempt to authenticate the given user for the given service. The
|
51
|
+
# data hash must specify a <tt>:password</tt> value, otherwise this
|
52
|
+
# will always return false.
|
53
|
+
def authenticate( next_service, username, data={} )
|
54
|
+
password = data[:password]
|
55
|
+
|
56
|
+
msg = @buffers.writer
|
57
|
+
msg.write_byte USERAUTH_REQUEST
|
58
|
+
msg.write_string username
|
59
|
+
msg.write_string next_service
|
60
|
+
msg.write_string "keyboard-interactive"
|
61
|
+
msg.write_string ""
|
62
|
+
msg.write_string ""
|
63
|
+
@messenger.send_message msg
|
64
|
+
|
65
|
+
loop do
|
66
|
+
message = @messenger.wait_for_message
|
67
|
+
|
68
|
+
case message.message_type
|
69
|
+
when USERAUTH_SUCCESS
|
70
|
+
return true
|
71
|
+
when USERAUTH_FAILURE
|
72
|
+
return false
|
73
|
+
when USERAUTH_INFO_REQUEST
|
74
|
+
name = message.buffer.read_string
|
75
|
+
instruction = message.buffer.read_string
|
76
|
+
req = InfoRequest.new( name, instruction, password, [] )
|
77
|
+
password = nil # only use the given password once
|
78
|
+
|
79
|
+
lang_tag = message.buffer.read_string
|
80
|
+
message.buffer.read_long.times do
|
81
|
+
prompt = message.buffer.read_string
|
82
|
+
echo = message.buffer.read_bool
|
83
|
+
req.prompts << Prompt.new( prompt, echo )
|
84
|
+
end
|
85
|
+
|
86
|
+
responses = @callback.call( req )
|
87
|
+
msg = @buffers.writer
|
88
|
+
msg.write_byte USERAUTH_INFO_RESPONSE
|
89
|
+
msg.write_long responses.length
|
90
|
+
msg.write_string *responses
|
91
|
+
@messenger.send_message msg
|
92
|
+
else
|
93
|
+
raise Net::SSH::Exception,
|
94
|
+
"unexpected reply in keyboard interactive: " +
|
95
|
+
message.inspect
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -29,11 +29,33 @@ module Net
|
|
29
29
|
method
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
b.keyboard_interactive do |c,p|
|
33
|
+
require 'net/ssh/userauth/methods/keyboard-interactive'
|
34
|
+
method = KeyboardInteractive.new( c[:transport][:buffers],
|
35
|
+
c[:keyboard_interactive_callback] )
|
36
|
+
method.messenger = c[:userauth][:driver]
|
37
|
+
method
|
38
|
+
end
|
39
|
+
|
40
|
+
b.keyboard_interactive_prompter do
|
41
|
+
require 'net/ssh/util/prompter'
|
42
|
+
Net::SSH::Util::Prompter.new
|
43
|
+
end
|
44
|
+
|
45
|
+
b.keyboard_interactive_callback do |c,p|
|
46
|
+
proc do |req|
|
47
|
+
responses = []
|
48
|
+
puts req.name unless req.name.empty?
|
49
|
+
puts req.instruction unless req.instruction.empty?
|
50
|
+
req.prompts.each do |prompt|
|
51
|
+
response = prompt.echo ?
|
52
|
+
gets.chomp :
|
53
|
+
c[:keyboard_interactive_prompter].password( prompt.prompt )
|
54
|
+
responses << response
|
55
|
+
end
|
56
|
+
responses
|
57
|
+
end
|
58
|
+
end
|
37
59
|
|
38
60
|
b.publickey do |c,p|
|
39
61
|
require 'net/ssh/userauth/methods/publickey'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -38,13 +38,16 @@ module Net
|
|
38
38
|
b.default_agent_version { 2 }
|
39
39
|
|
40
40
|
b.agent( :model => :prototype ) do |c,p|
|
41
|
-
|
41
|
+
socket_factory = c[:agent_socket_factory]
|
42
|
+
socket_name = c[:default_agent_socket_name]
|
43
|
+
|
44
|
+
if socket_name && socket_factory
|
42
45
|
require 'net/ssh/userauth/agent'
|
43
46
|
require 'net/ssh/transport/services'
|
44
47
|
|
45
48
|
agent = Agent.new
|
46
49
|
agent.socket_factory = socket_factory
|
47
|
-
agent.socket_name =
|
50
|
+
agent.socket_name = socket_name
|
48
51
|
agent.version = c[:default_agent_version]
|
49
52
|
agent.buffers = c[:transport][:buffers]
|
50
53
|
agent.keys = c[:transport][:keys]
|
@@ -93,9 +96,9 @@ module Net
|
|
93
96
|
|
94
97
|
b.authentication_method_order do
|
95
98
|
[ "publickey",
|
96
|
-
"
|
99
|
+
"hostbased",
|
97
100
|
"password",
|
98
|
-
"
|
101
|
+
"keyboard-interactive" ]
|
99
102
|
end
|
100
103
|
|
101
104
|
b.driver do |c,p|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
data/lib/net/ssh/util/buffer.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
data/lib/net/ssh/util/openssl.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
data/lib/net/ssh/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -19,7 +19,7 @@ module Net
|
|
19
19
|
module Version
|
20
20
|
|
21
21
|
MAJOR = 0
|
22
|
-
MINOR =
|
22
|
+
MINOR = 9
|
23
23
|
TINY = 0
|
24
24
|
|
25
25
|
STRING = [ MAJOR, MINOR, TINY ].join( "." )
|
data/test/ALL-TESTS.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
data/test/proxy/tc_http.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
data/test/proxy/tc_socks4.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
data/test/proxy/tc_socks5.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#--
|
2
2
|
# =============================================================================
|
3
|
-
# Copyright (c) 2004, Jamis Buck (
|
3
|
+
# Copyright (c) 2004,2005 Jamis Buck (jamis_buck@byu.edu)
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
6
6
|
# This source file is distributed as part of the Net::SSH Secure Shell Client
|
@@ -47,7 +47,7 @@ class TC_Process_POpen3 < Test::Unit::TestCase
|
|
47
47
|
|
48
48
|
class TC_SSHStdinPipe < Test::Unit::TestCase
|
49
49
|
def setup
|
50
|
-
@channel =
|
50
|
+
@channel = Channel.new
|
51
51
|
@pipe = Net::SSH::Service::Process::POpen3Manager::SSHStdinPipe.new(
|
52
52
|
@channel )
|
53
53
|
end
|
@@ -76,9 +76,11 @@ class TC_Process_POpen3 < Test::Unit::TestCase
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_read_empty
|
79
|
+
klass = class << @channel.connection; self; end
|
80
|
+
pipe = @pipe
|
81
|
+
klass.send(:define_method,:process) { pipe.instance_variable_set( :@data, "foo" ) }
|
79
82
|
s = @pipe.read
|
80
|
-
assert_equal "", s
|
81
|
-
assert_equal [ [ :loop, :with_block ] ], @channel.connection.events
|
83
|
+
assert_equal "foo", s
|
82
84
|
end
|
83
85
|
|
84
86
|
def test_read_full
|
@@ -97,16 +99,14 @@ class TC_Process_POpen3 < Test::Unit::TestCase
|
|
97
99
|
end
|
98
100
|
|
99
101
|
def test_read_empty
|
102
|
+
klass = class << @channel.connection; self; end
|
103
|
+
pipe = @pipe
|
104
|
+
klass.send(:define_method,:process) do
|
105
|
+
data = pipe.instance_variable_get( :@data )
|
106
|
+
pipe.instance_variable_set( :@data, (data||"") + "foo" )
|
107
|
+
end
|
100
108
|
s = @pipe.read
|
101
|
-
assert_equal "", s
|
102
|
-
assert_equal [ [ :loop, :with_block ] ], @channel.connection.events
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_read_non_stderr
|
106
|
-
@pipe.do_data @channel, 0, "foo"
|
107
|
-
s = @pipe.read
|
108
|
-
assert_equal "", s
|
109
|
-
assert_equal [ [ :loop, :with_block ] ], @channel.connection.events
|
109
|
+
assert_equal "foo", s
|
110
110
|
end
|
111
111
|
|
112
112
|
def test_read_stderr
|