Hi
I'm trying to compile the ssh2 extension for PHP, but am getting an error on compiling. The relevant part of the error message is this:
Quote:
/usr/local/ssh2-0.10/ssh2.c:481: error: too many arguments to function 'libssh2_session_methods'
|
So I opened ssh2.c and found line 481. The section is this:
(line beginning " libssh2_session_methods(session... " is line 481).
Quote:
#if LIBSSH2_APINO < 200412301450
libssh2_session_methods(session, &kex, &hostkey, &crypt_cs, &crypt_sc, &mac_cs, &mac_sc, &comp_cs, &comp_sc, &lang_cs, &lang_sc);
#else
kex = libssh2_session_methods(session, LIBSSH2_METHOD_KEX);
hostkey = libssh2_session_methods(session, LIBSSH2_METHOD_HOSTKEY);
crypt_cs = libssh2_session_methods(session, LIBSSH2_METHOD_CRYPT_CS);
crypt_sc = libssh2_session_methods(session, LIBSSH2_METHOD_CRYPT_SC);
mac_cs = libssh2_session_methods(session, LIBSSH2_METHOD_MAC_CS);
mac_sc = libssh2_session_methods(session, LIBSSH2_METHOD_MAC_SC);
comp_cs = libssh2_session_methods(session, LIBSSH2_METHOD_COMP_CS);
comp_sc = libssh2_session_methods(session, LIBSSH2_METHOD_COMP_SC);
lang_cs = libssh2_session_methods(session, LIBSSH2_METHOD_LANG_CS);
lang_sc = libssh2_session_methods(session, LIBSSH2_METHOD_LANG_SC);
#endif
|
I tried removing some of these "too many" arguments from the function (got rid of " &crypt_cs, &crypt_sc, &mac_cs, &mac_sc, &comp_cs, &comp_sc, &lang_cs, &lang_sc " and also the word "session", plus the corresponding lines below to make it look like this:
Quote:
#if LIBSSH2_APINO < 200412301450
libssh2_session_methods(&kex, &hostkey);
#else
kex = libssh2_session_methods(session, LIBSSH2_METHOD_KEX);
hostkey = libssh2_session_methods(session, LIBSSH2_METHOD_HOSTKEY);
|
Now it compiled. However,
I have no programming experience, and am wary of arbitrarily modifying the code of a program when I don't know how my changes will affect how it runs, especially when the app is related to my pc's security - this being a ssh / php extension.
I have a feeling that the problem with the libssh2_session_methods function is quite simple, but as I can't program, I don't know how the function should be modified.
Can anyone help me clean up the code for the program and fix this bug? (I'd ask the developer, but I don't think it's maintained).
I'm using Ubuntu 7.04
amd64, by the way.
Thanks