summaryrefslogtreecommitdiff
path: root/src/ssh.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-04-12 23:08:22 +0900
committerRyo Nakamura <upa@haeena.net>2024-04-12 23:08:22 +0900
commita1b9afefe50fbbdf6391e94ab21e6e7645eabe4d (patch)
tree8f0fa87ac9c014395a60781c9a3af55060d6b70a /src/ssh.c
parentbf7e2c3ae340464d4de7b4ba105decdbd7c40450 (diff)
add -o SSH_OPTION option
Diffstat (limited to 'src/ssh.c')
-rw-r--r--src/ssh.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ssh.c b/src/ssh.c
index 16e2b0c..2ea81a9 100644
--- a/src/ssh.c
+++ b/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;
}