aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-10-30 16:19:19 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-02 11:16:35 +0100
commitb7fefb05007cfbcded5b413cb4f77475aebf074c (patch)
treece1e0acbdbe9e38b75cae55914b2e502bd1947f4 /src
parent89a8a6fcf07368c56a98ff8168db77b6814fbe7b (diff)
downloadlibssh-b7fefb05007cfbcded5b413cb4f77475aebf074c.tar.gz
libssh-b7fefb05007cfbcded5b413cb4f77475aebf074c.tar.xz
libssh-b7fefb05007cfbcded5b413cb4f77475aebf074c.zip
options: Provide a way of disabling automatic config parsing
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/options.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index a7bd4538..4ffa99bb 100644
--- a/src/options.c
+++ b/src/options.c
@@ -421,6 +421,12 @@ int ssh_options_set_algo(ssh_session session,
* Set it to disable Nagle's Algorithm (TCP_NODELAY) on the
* session socket. (int, 0=false)
*
+ * - SSH_OPTIONS_PROCESS_CONFIG
+ * Set it to false to disable automatic processing of per-user
+ * and system-wide OpenSSH configuration files. LibSSH
+ * automatically uses these configuration files unless
+ * you provide it with this option or with different file (bool).
+ *
* @param value The value to set. This is a generic pointer and the
* datatype which is used should be set according to the
* type set.
@@ -954,6 +960,15 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
session->opts.nodelay = (*x & 0xff) > 0 ? 1 : 0;
}
break;
+ case SSH_OPTIONS_PROCESS_CONFIG:
+ if (value == NULL) {
+ ssh_set_error_invalid(session);
+ return -1;
+ } else {
+ bool *x = (bool *)value;
+ session->opts.config_processed = !(*x);
+ }
+ break;
default:
ssh_set_error(session, SSH_REQUEST_DENIED, "Unknown ssh option %d", type);
return -1;