Subject: RE: libss2 debug level

RE: libss2 debug level

From: Xu, Qiang (FXSGSC) <Qiang.Xu_at_fujixerox.com>
Date: Fri, 11 Sep 2009 15:02:26 +0800

Just found out the bitmasks are defined in "include/libssh2.h":
===============================================
/* NOTE NOTE NOTE
   libssh2_trace() has no function in builds that aren't built with debug
   enabled
 */
LIBSSH2_API int libssh2_trace(LIBSSH2_SESSION *session, int bitmask);
#define LIBSSH2_TRACE_TRANS (1<<1)
#define LIBSSH2_TRACE_KEX (1<<2)
#define LIBSSH2_TRACE_AUTH (1<<3)
#define LIBSSH2_TRACE_CONN (1<<4)
#define LIBSSH2_TRACE_SCP (1<<5)
#define LIBSSH2_TRACE_SFTP (1<<6)
#define LIBSSH2_TRACE_ERROR (1<<7)
#define LIBSSH2_TRACE_PUBLICKEY (1<<8)
===============================================
So, if "./configure --enable-debug" is done beforehand, I can get the debug output by passing the bitmask (for example, LIBSSH2_TRACE_ERROR) to the second argument of libssh2_trace(). By the way, if the mask is ~0, as "libssh2_trace(session, ~0 )" in "example/simple/ssh2_exec.c", does it mean I will get maximum output?

My problem is the excutable compiled under "example/simple/" doesn't work:
===============================================
qxu_at_durian(pts/2):~/opensrc/libssh2-1.2/example/simple[132]$ ./sftp 13.198.98.190 qxu fair123
Fingerprint: 0B F2 D3 94 9D 0F 75 BE 69 15 33 42 B8 0D 88 CA
Authentication methods: publickey,gssapi-with-mic,password
libssh2_sftp_init()!
Unable to init SFTP session
all done
===============================================
I don't know which link in the whole process goes wrong. Must I add the call of libssh2_trace(), with appropriate bitmask, to every suspicious location? Since I am not familiar with the code, that task seems insurmountable.

Is there some run-time command to let me get maximum debug output before run the sftp session?

Thanks,
Xu Qiang
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-09-11