1
1

some changes to resolve bugs reported by webyog

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@192 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
Aris Adamantiadis 2008-12-14 21:46:31 +00:00
родитель f7700f2bc2
Коммит 16a3379a61
4 изменённых файлов: 21 добавлений и 11 удалений

Просмотреть файл

@ -152,6 +152,7 @@ u32 sftp_async_read_begin(SFTP_FILE *file, int len);
int sftp_async_read(SFTP_FILE *file, void *data, int len, u32 id);
int sftp_write(SFTP_FILE *file, const void *source, int len);
void sftp_seek(SFTP_FILE *file, int new_offset);
void sftp_seek64(SFTP_FILE *file, u64 new_offset);
unsigned long sftp_tell(SFTP_FILE *file);
void sftp_rewind(SFTP_FILE *file);
int sftp_rm(SFTP_SESSION *sftp, char *file);

Просмотреть файл

@ -109,7 +109,7 @@ static int wait_auth_status(SSH_SESSION *session,int kbdint){
cont=0;
break;
}
/* continue through success */
/* continue through success */
case SSH2_MSG_USERAUTH_SUCCESS:
err=SSH_AUTH_SUCCESS;
cont=0;
@ -143,6 +143,12 @@ int ssh_auth_list(SSH_SESSION *session) {
return session->auth_methods;
}
int ssh_userauth_list(SSH_SESSION *session, const char *username){
if(session->auth_methods==0)
ssh_userauth_none(session,username);
return ssh_auth_list(session);
}
/* use the "none" authentication question */
/** \brief Try to authenticate through the "none" method
@ -302,8 +308,8 @@ int ssh_userauth_pubkey(SSH_SESSION *session, const char *username, STRING *publ
service=string_from_char("ssh-connection");
method=string_from_char("publickey");
algo=string_from_char(ssh_type_to_char(privatekey->type));
/* we said previously the public key was accepted */
buffer_add_u8(session->out_buffer,SSH2_MSG_USERAUTH_REQUEST);
buffer_add_ssh_string(session->out_buffer,user);
@ -542,7 +548,7 @@ static void kbdint_free(struct ssh_kbdint *kbd){
}
free(kbd);
}
static void kbdint_clean(struct ssh_kbdint *kbd){
int i,n=kbd->nprompts;
if(kbd->name){
@ -759,7 +765,7 @@ int ssh_userauth_kbdint(SSH_SESSION *session, const char *user, const char *subm
return err;
}
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
* function returns the questions from the server
* \brief get the number of prompts (questions) the server has given
* \param session ssh session
@ -770,7 +776,7 @@ int ssh_userauth_kbdint_getnprompts(SSH_SESSION *session){
return session->kbdint->nprompts;
}
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
* function returns the questions from the server
* \brief get the "name" of the message block
* \param session ssh session
@ -781,7 +787,7 @@ char *ssh_userauth_kbdint_getname(SSH_SESSION *session){
return session->kbdint->name;
}
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
* function returns the questions from the server
* \brief get the "instruction" of the message block
* \param session ssh session
@ -792,7 +798,7 @@ char *ssh_userauth_kbdint_getinstruction(SSH_SESSION *session){
return session->kbdint->instruction;
}
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
* function returns the questions from the server
* \brief get a prompt from a message block
* \param session ssh session
@ -811,7 +817,7 @@ char *ssh_userauth_kbdint_getprompt(SSH_SESSION *session, int i,
return session->kbdint->prompts[i];
}
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
/** You have called ssh_userauth_kbdint() and got SSH_AUTH_INFO. this
* function returns the questions from the server
* \brief set the answer for a question from a message block.
* \param session ssh session

Просмотреть файл

@ -29,7 +29,7 @@ MA 02111-1307, USA. */
#define _WIN32_WINNT 0x0501 //getaddrinfo, freeaddrinfo, getnameinfo
#include <winsock2.h>
#include <ws2tcpip.h>
//#include "wspiapi.h"
#include "wspiapi.h" //workaround for w2k systems
#else
#include <netdb.h>
#include <sys/socket.h>

Просмотреть файл

@ -133,7 +133,6 @@ int sftp_server_init(SFTP_SESSION *sftp){
void sftp_free(SFTP_SESSION *sftp){
struct request_queue *ptr;
channel_send_eof(sftp->channel);
channel_free(sftp->channel);
ptr=sftp->queue;
while(ptr){
struct request_queue *old;
@ -142,6 +141,7 @@ void sftp_free(SFTP_SESSION *sftp){
free(ptr);
ptr=old;
}
channel_free(sftp->channel);
memset(sftp,0,sizeof(*sftp));
free(sftp);
}
@ -1253,6 +1253,9 @@ void sftp_seek(SFTP_FILE *file, int new_offset){
file->offset=new_offset;
}
void sftp_seek64(SFTP_FILE *file, u64 new_offset){
file->offset=new_offset;
}
unsigned long sftp_tell(SFTP_FILE *file){
return file->offset;
}