diff options
author | Ryo Nakamura <upa@haeena.net> | 2023-08-04 13:31:10 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2023-08-04 13:31:10 +0900 |
commit | 518aa42208969566aa26cf82a40d1ecb6358684a (patch) | |
tree | 676bd0795f25966719d1d242ed8c9a18e57597b8 /src/pymscp.c | |
parent | 3b26c7c7191c44ddd8840a803b603cd2f60ac059 (diff) |
add -F ssh_config option
Diffstat (limited to 'src/pymscp.c')
-rw-r--r-- | src/pymscp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pymscp.c b/src/pymscp.c index 1a55a3d..0d92df4 100644 --- a/src/pymscp.c +++ b/src/pymscp.c @@ -103,6 +103,7 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw) /* mscp_ssh_opts */ "login_name", /* const char * */ "port", /* const char * */ + "config", /* const char * */ "identity", /* const char * */ "cipher", /* const char * */ @@ -116,9 +117,9 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw) "enable_nagle", /* bool */ NULL, }; - const char *fmt = "si" "|" "ii" "kkk" "s" "iii" "sss" "sssss" "ipp"; + const char *fmt = "si" "|" "ii" "kkk" "s" "iii" "ssss" "sssss" "ipp"; char *coremask = NULL; - char *login_name = NULL, *port = NULL, *identity = NULL; + char *login_name = NULL, *port = NULL, *config = NULL, *identity = NULL; char *cipher = NULL, *hmac = NULL, *compress = NULL; char *password = NULL, *passphrase = NULL; @@ -148,6 +149,7 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw) &i->mo.msg_fd, &login_name, &port, + &config, &identity, &cipher, &hmac, @@ -167,6 +169,8 @@ static PyObject *wrap_mscp_init(PyObject *self, PyObject *args, PyObject *kw) strncpy(i->so.login_name, login_name, MSCP_SSH_MAX_LOGIN_NAME - 1); if (port) strncpy(i->so.port, port, MSCP_SSH_MAX_PORT_STR - 1); + if (config) + strncpy(i->so.config, config, PATH_MAX - 1); if (identity) strncpy(i->so.identity, identity, MSCP_SSH_MAX_IDENTITY_PATH - 1); if (cipher) |