mirror of
https://github.com/upa/mscp.git
synced 2026-02-13 16:44:43 +08:00
add -o SSH_OPTION option
This commit is contained in:
16
src/ssh.c
16
src/ssh.c
@@ -4,12 +4,13 @@
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libssh/callbacks.h"
|
||||
|
||||
#include <ssh.h>
|
||||
#include <mscp.h>
|
||||
#include <strerrno.h>
|
||||
|
||||
#include "libssh/callbacks.h"
|
||||
#include "libssh/options.h"
|
||||
|
||||
static int ssh_verify_known_hosts(ssh_session session);
|
||||
static int ssh_authenticate_kbdint(ssh_session session);
|
||||
|
||||
@@ -87,6 +88,17 @@ static int ssh_set_opts(ssh_session ssh, struct mscp_ssh_opts *opts)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (opts->options) {
|
||||
int n;
|
||||
for (n = 0; opts->options[n]; n++) {
|
||||
if (ssh_config_parse_string(ssh, opts->options[n]) != SSH_OK) {
|
||||
priv_set_errv("failed to set ssh option %s: %s",
|
||||
opts->options[n]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user