summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/readconf.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2018-05-22 00:13:26 +0000
committerdjm <djm@openbsd.org>2018-05-22 00:13:26 +0000
commitd3673cd75562a00babe92aee0ee29f86b8575221 (patch)
tree11a29f2f52cce9d9ef1c30af2f6e7761e82156a6 /usr.bin/ssh/readconf.c
parentAdd RCS Id. (diff)
downloadwireguard-openbsd-d3673cd75562a00babe92aee0ee29f86b8575221.tar.xz
wireguard-openbsd-d3673cd75562a00babe92aee0ee29f86b8575221.zip
support ProxyJump=none to disable ProxyJump functionality; bz#2869
ok dtucker@
Diffstat (limited to 'usr.bin/ssh/readconf.c')
-rw-r--r--usr.bin/ssh/readconf.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c
index 51fb141a973..9cb40e1f432 100644
--- a/usr.bin/ssh/readconf.c
+++ b/usr.bin/ssh/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.286 2018/04/06 13:02:39 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.287 2018/05/22 00:13:26 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2055,6 +2055,12 @@ fill_default_options(Options * options)
CLEAR_ON_NONE(options->proxy_command);
CLEAR_ON_NONE(options->control_path);
CLEAR_ON_NONE(options->revoked_host_keys);
+ if (options->jump_host != NULL &&
+ strcmp(options->jump_host, "none") == 0 &&
+ options->jump_port == 0 && options->jump_user == NULL) {
+ free(options->jump_host);
+ options->jump_host = NULL;
+ }
/* options->identity_agent distinguishes NULL from 'none' */
/* options->user will be set in the main program if appropriate */
/* options->hostname will be set in the main program if appropriate */
@@ -2283,6 +2289,8 @@ parse_jump(const char *s, Options *o, int active)
orig = sdup = xstrdup(s);
first = active;
do {
+ if (strcasecmp(s, "none") == 0)
+ break;
if ((cp = strrchr(sdup, ',')) == NULL)
cp = sdup; /* last */
else
@@ -2303,14 +2311,19 @@ parse_jump(const char *s, Options *o, int active)
} while (cp != sdup);
/* success */
if (active) {
- o->jump_user = user;
- o->jump_host = host;
- o->jump_port = port;
- o->proxy_command = xstrdup("none");
- user = host = NULL;
- if ((cp = strrchr(s, ',')) != NULL && cp != s) {
- o->jump_extra = xstrdup(s);
- o->jump_extra[cp - s] = '\0';
+ if (strcasecmp(s, "none") == 0) {
+ o->jump_host = xstrdup("none");
+ o->jump_port = 0;
+ } else {
+ o->jump_user = user;
+ o->jump_host = host;
+ o->jump_port = port;
+ o->proxy_command = xstrdup("none");
+ user = host = NULL;
+ if ((cp = strrchr(s, ',')) != NULL && cp != s) {
+ o->jump_extra = xstrdup(s);
+ o->jump_extra[cp - s] = '\0';
+ }
}
}
ret = 0;