Improve ssh_options_allow_ssh1().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@366 7dcaeef0-15fb-0310-b436-a5af3365683c
Этот коммит содержится в:
родитель
94e91b73f7
Коммит
396db49a41
@ -321,7 +321,7 @@ int ssh_options_set_banner(SSH_OPTIONS *opt, const char *banner);
|
|||||||
int ssh_options_set_status_callback(SSH_OPTIONS *opt, void (*callback)
|
int ssh_options_set_status_callback(SSH_OPTIONS *opt, void (*callback)
|
||||||
(void *arg, float status), void *arg);
|
(void *arg, float status), void *arg);
|
||||||
int ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds, long usec);
|
int ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds, long usec);
|
||||||
void ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow);
|
int ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow);
|
||||||
void ssh_options_allow_ssh2(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_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_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey);
|
||||||
|
@ -666,16 +666,29 @@ int ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds, long usec) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Default value is 0 (no connection to SSH1 servers)
|
/**
|
||||||
* \brief allow or deny the connection to SSH1 servers
|
* @brief Allow or deny the connection to SSH1 servers.
|
||||||
* \param opt options structure
|
*
|
||||||
* \param allow nonzero values allow ssh1
|
* Default value is 0 (no connection to SSH1 servers).
|
||||||
|
*
|
||||||
|
* @param opt The options structure to use.
|
||||||
|
*
|
||||||
|
* @param allow Non zero value allow ssh1.
|
||||||
|
*
|
||||||
|
* @return 0 on success, < 0 on error.
|
||||||
*/
|
*/
|
||||||
void ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow){
|
int ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow) {
|
||||||
if(allow)
|
if (opt == NULL) {
|
||||||
opt->ssh1allowed=1;
|
return -1;
|
||||||
else
|
}
|
||||||
opt->ssh1allowed=0;
|
|
||||||
|
if (allow) {
|
||||||
|
opt->ssh1allowed = 1;
|
||||||
|
} else {
|
||||||
|
opt->ssh1allowed = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Default value is 1 (allow connection to SSH2 servers)
|
/** Default value is 1 (allow connection to SSH2 servers)
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user