Subject: [libssh2] [ libssh2-Bugs-1902169 ] second channel creation fails

[libssh2] [ libssh2-Bugs-1902169 ] second channel creation fails

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 28 Feb 2008 03:47:42 -0800

Bugs item #1902169, was opened at 2008-02-26 15:17
Message generated for change (Comment added) made by ekatalog
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1902169&group_id=125852

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: API
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tefnet (ekatalog)
Assigned to: Nobody/Anonymous (nobody)
Summary: second channel creation fails

Initial Comment:
As shown in included source code, libssh2 won't create a channel for the second time.

this is what appears in openssh daemon logs:

Feb 26 15:01:34 biuro sshd[3155]: error: buffer_get_string_ret: bad string length 1702663341
Feb 26 15:01:34 biuro sshd[3155]: fatal: buffer_get_string: buffer error
Feb 26 15:01:34 biuro sshd[3155]: pam_unix(sshd:session): session closed for user tefnet

on second channel creation in a program, it would return a NULL channel pointer and give no hint in last_error.

software versions:
libssh2-0.18
openssh-4.7_p1
linux-2.6.17.13

----------------------------------------------------------------------

>Comment By: Tefnet (ekatalog)
Date: 2008-02-28 12:47

Message:
Logged In: YES
user_id=1264460
Originator: YES

I haven't found any other references to direct_state except for this
function. It looks like it's not used. Can we safely skip this part of
code?

----------------------------------------------------------------------

Comment By: Tefnet (ekatalog)
Date: 2008-02-28 12:40

Message:
Logged In: YES
user_id=1264460
Originator: YES

There is a quick fix when running a single channel at a time. Changing
libssh2_channel_direct_tcpip_ex() in tunnel.c from:

if (session->direct_state == libssh2_NB_state_idle)

to:

if (session->direct_state == libssh2_NB_state_idle || 1)

fixes the problem. Something with direct_stare is messed up. Investigation
continues...

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=703942&aid=1902169&group_id=125852

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2008-02-28