From 0ad861d74c822f641837e8492c64f49ba03fee01 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Sat, 18 Jun 2005 11:30:31 +0000 Subject: [PATCH] libssh2_userauth_list should return char*, not the const char* --- include/libssh2.h | 2 +- src/userauth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libssh2.h b/include/libssh2.h index d5d4e8e..d6d4616 100644 --- a/include/libssh2.h +++ b/include/libssh2.h @@ -272,7 +272,7 @@ LIBSSH2_API int libssh2_session_last_error(LIBSSH2_SESSION *session, char **errm LIBSSH2_API int libssh2_session_flag(LIBSSH2_SESSION *session, int flag, int value); /* Userauth API */ -LIBSSH2_API const char *libssh2_userauth_list(LIBSSH2_SESSION *session, const char *username, int username_len); +LIBSSH2_API char *libssh2_userauth_list(LIBSSH2_SESSION *session, const char *username, int username_len); LIBSSH2_API int libssh2_userauth_authenticated(LIBSSH2_SESSION *session); LIBSSH2_API int libssh2_userauth_password_ex(LIBSSH2_SESSION *session, const char *username, int username_len, const char *password, int password_len, LIBSSH2_PASSWD_CHANGEREQ_FUNC((*passwd_change_cb))); #define libssh2_userauth_password(session, username, password) libssh2_userauth_password_ex((session), (username), strlen(username), (password), strlen(password), NULL) diff --git a/src/userauth.c b/src/userauth.c index d49911b..90a36d1 100644 --- a/src/userauth.c +++ b/src/userauth.c @@ -49,7 +49,7 @@ * Not a common configuration for any SSH server though * username should be NULL, or a null terminated string */ -LIBSSH2_API const char *libssh2_userauth_list(LIBSSH2_SESSION *session, const char *username, int username_len) +LIBSSH2_API char *libssh2_userauth_list(LIBSSH2_SESSION *session, const char *username, int username_len) { unsigned char reply_codes[3] = { SSH_MSG_USERAUTH_SUCCESS, SSH_MSG_USERAUTH_FAILURE, 0 }; unsigned long data_len = username_len + 31; /* packet_type(1) + username_len(4) + service_len(4) + service(14)"ssh-connection" +