aboutsummaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-05-16 13:20:27 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-06-12 10:17:54 +0200
commit79f0c38fbd767f578d7b87fae15fb64faad32aab (patch)
treebf55ea6ee92189543bd23fa2b2d0b1bbb049bc56 /src/options.c
parent07faf95a105721422212c1a3216aba218cb94cd9 (diff)
downloadlibssh-79f0c38fbd767f578d7b87fae15fb64faad32aab.tar.gz
libssh-79f0c38fbd767f578d7b87fae15fb64faad32aab.tar.xz
libssh-79f0c38fbd767f578d7b87fae15fb64faad32aab.zip
options: Allow avoiding system-wide configuration
The added option SSH_BIND_OPTIONS_PROCESS_CONFIG allows to skip processing the system-wide configuration file. The global configuration file is processed automatically if this option is not set as false. This option will only be effective if set before any call to ssh_bind_options_parse_config(). Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 3b58fe2c..9af7b22b 100644
--- a/src/options.c
+++ b/src/options.c
@@ -1608,6 +1608,13 @@ static int ssh_bind_set_algo(ssh_bind sshbind,
* paths of configuration files to
* ssh_bind_options_parse_config().
*
+ * - SSH_BIND_OPTIONS_PROCESS_CONFIG
+ * Set it to false to disable automatic processing of
+ * system-wide configuration files. LibSSH automatically
+ * uses these configuration files otherwise. This
+ * option will only have effect if set before any call
+ * to ssh_bind_options_parse_config() (bool).
+ *
* - SSH_BIND_OPTIONS_PUBKEY_ACCEPTED_KEY_TYPES:
* Set the public key algorithm accepted by the server
* (const char *, comma-separated list).
@@ -1955,6 +1962,15 @@ int ssh_bind_options_set(ssh_bind sshbind, enum ssh_bind_options_e type,
}
}
break;
+ case SSH_BIND_OPTIONS_PROCESS_CONFIG:
+ if (value == NULL) {
+ ssh_set_error_invalid(sshbind);
+ return -1;
+ } else {
+ bool *x = (bool *)value;
+ sshbind->config_processed = !(*x);
+ }
+ break;
default:
ssh_set_error(sshbind, SSH_REQUEST_DENIED, "Unknown ssh option %d", type);
return -1;