Fix several build warnings.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@214 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
5e03a95a93
Коммит
974a160fd3
@ -271,7 +271,7 @@ SSH_SESSION *channel_get_session(CHANNEL *channel);
|
||||
typedef int (*ssh_auth_callback) (const char *prompt, char *buf, size_t len,
|
||||
int echo, int verify, void *userdata);
|
||||
|
||||
SSH_OPTIONS *ssh_options_new();
|
||||
SSH_OPTIONS *ssh_options_new(void);
|
||||
SSH_OPTIONS *ssh_options_copy(SSH_OPTIONS *opt);
|
||||
int ssh_options_set_wanted_algos(SSH_OPTIONS *opt, int algo, const char *list);
|
||||
void ssh_options_set_username(SSH_OPTIONS *opt, const char *username);
|
||||
@ -290,6 +290,7 @@ void ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow);
|
||||
void ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow);
|
||||
void ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, const char *dsakey);
|
||||
void ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey);
|
||||
void ssh_options_set_banner(SSH_OPTIONS *opt, const char *banner);
|
||||
void ssh_options_set_log_function(SSH_OPTIONS *opt,
|
||||
void (*callback)(const char *message, SSH_SESSION *session, int verbosity ));
|
||||
void ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity);
|
||||
@ -339,8 +340,9 @@ void ssh_userauth_kbdint_setanswer(SSH_SESSION *session, unsigned int i, const c
|
||||
|
||||
|
||||
/* init.c */
|
||||
int ssh_finalize();
|
||||
int ssh_finalize(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* _LIBSSH_H */
|
||||
|
@ -633,7 +633,7 @@ int ssh_userauth1_password(SSH_SESSION *session, char *username,
|
||||
char *password);
|
||||
/* in misc.c */
|
||||
/* gets the user home dir. */
|
||||
char *ssh_get_user_home_dir();
|
||||
char *ssh_get_user_home_dir(void);
|
||||
int ssh_file_readaccess_ok(char *file);
|
||||
|
||||
/* macro for byte ordering */
|
||||
|
@ -33,7 +33,7 @@ MA 02111-1307, USA. */
|
||||
* \brief finalize and cleanup all libssh and cryptographic data structures
|
||||
* \returns 0
|
||||
*/
|
||||
int ssh_finalize()
|
||||
int ssh_finalize(void)
|
||||
{
|
||||
ssh_crypto_finalize();
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
|
@ -348,7 +348,7 @@ static int modulus_smaller(PUBLIC_KEY *k1, PUBLIC_KEY *k2){
|
||||
}
|
||||
|
||||
#define ABS(A) ( (A)<0 ? -(A):(A) )
|
||||
STRING *encrypt_session_key(SSH_SESSION *session, PUBLIC_KEY *svrkey,
|
||||
static STRING *encrypt_session_key(SSH_SESSION *session, PUBLIC_KEY *svrkey,
|
||||
PUBLIC_KEY *hostkey,int slen, int hlen ){
|
||||
unsigned char buffer[32];
|
||||
int i;
|
||||
|
@ -466,6 +466,9 @@ int read_dsa_privatekey(FILE *fp, gcry_sexp_t *r, ssh_auth_callback cb, void *us
|
||||
static int pem_get_password(char *buf, int size, int rwflag, void *userdata) {
|
||||
SSH_SESSION *session = userdata;
|
||||
|
||||
/* unused flag */
|
||||
(void) rwflag;
|
||||
|
||||
ZERO_STRUCTP(buf);
|
||||
|
||||
if (session && session->options->auth_function) {
|
||||
|
@ -360,7 +360,7 @@ STRING *publickey_to_string(PUBLIC_KEY *key){
|
||||
|
||||
/* Signature decoding functions */
|
||||
|
||||
STRING *signature_to_string(SIGNATURE *sign){
|
||||
static STRING *signature_to_string(SIGNATURE *sign){
|
||||
STRING *str;
|
||||
STRING *rs;
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
@ -692,6 +692,10 @@ STRING *ssh_encrypt_rsa1(SSH_SESSION *session, STRING *data, PUBLIC_KEY *key){
|
||||
RSA_public_encrypt(len,data->string,ret->string,key->rsa_pub,
|
||||
RSA_PKCS1_PADDING);
|
||||
#endif
|
||||
|
||||
/* unused member variable */
|
||||
(void) session;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -43,9 +43,7 @@
|
||||
* and * as wildcards), and zero if it does not match.
|
||||
*/
|
||||
|
||||
int
|
||||
match_pattern(const char *s, const char *pattern)
|
||||
{
|
||||
static int match_pattern(const char *s, const char *pattern) {
|
||||
for (;;) {
|
||||
/* If at end of pattern, accept if also at end of string. */
|
||||
if (!*pattern)
|
||||
@ -108,10 +106,8 @@ match_pattern(const char *s, const char *pattern)
|
||||
* a positive match, 0 if there is no match at all.
|
||||
*/
|
||||
|
||||
int
|
||||
match_pattern_list(const char *string, const char *pattern, u_int len,
|
||||
int dolower)
|
||||
{
|
||||
static int match_pattern_list(const char *string, const char *pattern,
|
||||
u_int len, int dolower) {
|
||||
char sub[1024];
|
||||
int negated;
|
||||
int got_positive;
|
||||
@ -168,8 +164,6 @@ match_pattern_list(const char *string, const char *pattern, u_int len,
|
||||
* indicate negation). Returns -1 if negation matches, 1 if there is
|
||||
* a positive match, 0 if there is no match at all.
|
||||
*/
|
||||
int
|
||||
match_hostname(const char *host, const char *pattern, u_int len)
|
||||
{
|
||||
static int match_hostname(const char *host, const char *pattern, u_int len) {
|
||||
return match_pattern_list(host, pattern, len, 1);
|
||||
}
|
||||
|
@ -169,11 +169,13 @@ int ssh_message_auth_reply_success(SSH_MESSAGE *msg,int partial){
|
||||
}
|
||||
|
||||
static SSH_MESSAGE *handle_channel_request_open(SSH_SESSION *session){
|
||||
enter_function();
|
||||
SSH_MESSAGE *msg=message_new(session);
|
||||
SSH_MESSAGE *msg;
|
||||
STRING *type;
|
||||
char *type_c;
|
||||
u32 sender,window,packet;
|
||||
u32 sender, window, packet;
|
||||
|
||||
enter_function();
|
||||
msg=message_new(session);
|
||||
msg->type=SSH_CHANNEL_REQUEST_OPEN;
|
||||
type=buffer_get_ssh_string(session->in_buffer);
|
||||
type_c=string_to_char(type);
|
||||
@ -198,9 +200,11 @@ static SSH_MESSAGE *handle_channel_request_open(SSH_SESSION *session){
|
||||
}
|
||||
|
||||
CHANNEL *ssh_message_channel_request_open_reply_accept(SSH_MESSAGE *msg){
|
||||
SSH_SESSION *session=msg->session;
|
||||
enter_function();
|
||||
CHANNEL *chan=channel_new(session);
|
||||
SSH_SESSION *session=msg->session;
|
||||
CHANNEL *chan;
|
||||
|
||||
enter_function();
|
||||
chan=channel_new(session);
|
||||
chan->local_channel=ssh_channel_new_id(session);
|
||||
chan->local_maxpacket=35000;
|
||||
chan->local_window=32000;
|
||||
|
@ -36,10 +36,10 @@ MA 02111-1307, USA. */
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#include "libssh/libssh.h"
|
||||
#include "libssh/priv.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
char *ssh_get_user_home_dir(){
|
||||
char *ssh_get_user_home_dir(void) {
|
||||
static char szPath[PATH_MAX] = {0};
|
||||
struct passwd *pwd = NULL;
|
||||
|
||||
@ -55,7 +55,7 @@ char *ssh_get_user_home_dir(){
|
||||
|
||||
#else /* _WIN32 */
|
||||
|
||||
char *ssh_get_user_home_dir(){
|
||||
char *ssh_get_user_home_dir(void) {
|
||||
static char szPath[MAX_PATH];
|
||||
if (SHGetSpecialFolderPathA(NULL, szPath, CSIDL_PROFILE, TRUE))
|
||||
return szPath;
|
||||
@ -72,7 +72,6 @@ int ssh_file_readaccess_ok(char *file){
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
u64 ntohll(u64 a){
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
return a;
|
||||
|
@ -45,7 +45,7 @@ MA 02111-1307, USA. */
|
||||
* \see ssh_options_getopt()
|
||||
*/
|
||||
|
||||
SSH_OPTIONS *ssh_options_new(){
|
||||
SSH_OPTIONS *ssh_options_new(void) {
|
||||
SSH_OPTIONS *option=malloc(sizeof(SSH_OPTIONS));
|
||||
memset(option,0,sizeof(SSH_OPTIONS));
|
||||
option->port=22; /* set the default port */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user