From 1284a0d7d8494cae26daffbfc849100037824336 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Fri, 16 Oct 2009 03:37:24 +0000 Subject: [PATCH] - fixed a bug involving server / client channel assignments git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@50 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Net/SFTP.php | 15 ++------------- phpseclib/Net/SSH2.php | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index f00e19ad..78c7d697 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -48,7 +48,7 @@ * @author Jim Wigginton * @copyright MMIX Jim Wigginton * @license http://www.gnu.org/licenses/lgpl.txt - * @version $Id: SFTP.php,v 1.8 2009-09-17 03:19:20 terrafrost Exp $ + * @version $Id: SFTP.php,v 1.9 2009-10-16 03:37:24 terrafrost Exp $ * @link http://phpseclib.sourceforge.net */ @@ -123,17 +123,6 @@ class Net_SFTP extends Net_SSH2 { */ var $window_size = 0x7FFFFFFF; - /** - * The Client Channel - * - * Net_SSH2::exec() uses 0 - * - * @var Integer - * @see Net_SSH2::exec() - * @access private - */ - var $client_channel = 1; - /** * Packet Size * @@ -335,7 +324,7 @@ class Net_SFTP extends Net_SSH2 { case NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION: $this->_string_shift($response, 4); // skip over client channel list(, $server_channel) = unpack('N', $this->_string_shift($response, 4)); - $this->server_channels[$client_channel] = $server_channel; + $this->server_channels[$this->client_channel] = $server_channel; $this->_string_shift($response, 4); // skip over (server) window size list(, $this->packet_size_client_to_server) = unpack('N', $this->_string_shift($response, 4)); break; diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 5a063893..aa494f4c 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -41,7 +41,7 @@ * @author Jim Wigginton * @copyright MMVII Jim Wigginton * @license http://www.gnu.org/licenses/lgpl.txt - * @version $Id: SSH2.php,v 1.22 2009-09-18 20:14:16 terrafrost Exp $ + * @version $Id: SSH2.php,v 1.23 2009-10-16 03:37:24 terrafrost Exp $ * @link http://phpseclib.sourceforge.net */ @@ -414,6 +414,19 @@ class Net_SSH2 { */ var $get_seq_no = 0; + /** + * The Client Channel + * + * Net_SSH2::exec() uses 0, although since Net_SSH2::exec() doesn't send NET_SSH2_CHANNEL_DATA packets, + * Net_SSH2::_send_channel_packet() isn't actually called by any function in Net/SSH2.php. Classes that + * extend Net_SSH2, however, might call that function, hence it's existence. + * + * @var Integer + * @see Net_SSH2::_send_channel_packet + * @access private + */ + var $client_channel = 1; + /** * Server Channels *