add -o SSH_OPTION option

This commit is contained in:
Ryo Nakamura
2024-04-12 23:08:22 +09:00
parent bf7e2c3ae3
commit a1b9afefe5
6 changed files with 89 additions and 15 deletions

View File

@@ -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;
}