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, 11 Sep 2008 01:34:39 +0000

Bugs item #1902169, was opened at 2008-02-26 09:17
Message generated for change (Comment added) made by thomaspu
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: Paul Thomas (thomaspu)
Date: 2008-09-10 20:34

Message:
I too have encountered this problem. My quick fix was to always retry
channel creation. But this is quite a band-aide approach!

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

Comment By: Tefnet (ekatalog)
Date: 2008-02-28 06: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 06: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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2008-09-11