aboutsummaryrefslogtreecommitdiff
path: root/tests/ssh_ping.c
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-08-19 14:10:22 +0200
committerAndreas Schneider <asn@cryptomilk.org>2020-03-29 10:00:57 +0200
commit3aea2ad53fe9c53160ca28a037cb4257ad2060d8 (patch)
tree9bd401714b86488f24b8a39c1c22605d44bb8e47 /tests/ssh_ping.c
parent6bd2b93f43dacceaf060d1aeb89749eba7df2cbb (diff)
downloadlibssh-3aea2ad53fe9c53160ca28a037cb4257ad2060d8.tar.gz
libssh-3aea2ad53fe9c53160ca28a037cb4257ad2060d8.tar.xz
libssh-3aea2ad53fe9c53160ca28a037cb4257ad2060d8.zip
ssh_ping: Ignore system-wide configuration
Ignore the system-wide configuration when simply trying to reach the host. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/ssh_ping.c')
-rw-r--r--tests/ssh_ping.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ssh_ping.c b/tests/ssh_ping.c
index dc966779..c3fc1f9a 100644
--- a/tests/ssh_ping.c
+++ b/tests/ssh_ping.c
@@ -16,6 +16,7 @@ clients must be made or how a client should react.
#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <libssh/libssh.h>
int main(int argc, char **argv)
@@ -24,6 +25,8 @@ int main(int argc, char **argv)
ssh_session session = NULL;
int rc = 1;
+ bool process_config = false;
+
if (argc < 1 || argv[1] == NULL) {
fprintf(stderr, "Error: Need an argument (hostname)\n");
goto out;
@@ -45,6 +48,12 @@ int main(int argc, char **argv)
goto out;
}
+ /* Ignore system-wide configurations when simply trying to reach host */
+ rc = ssh_options_set(session, SSH_OPTIONS_PROCESS_CONFIG, &process_config);
+ if (rc < 0) {
+ goto out;
+ }
+
rc = ssh_connect(session);
if (rc != SSH_OK) {
fprintf(stderr, "Connection failed : %s\n", ssh_get_error(session));