upstream: support ProxyJump=none to disable ProxyJump
functionality; bz#2869 ok dtucker@ OpenBSD-Commit-ID: 1c06ee08eb78451b5837fcfd8cbebc5ff3a67a01
This commit is contained in:
parent
f41bcd70f5
commit
4b22fd8ece
15
readconf.c
15
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>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
|
@ -2072,6 +2072,12 @@ fill_default_options(Options * options)
|
||||||
CLEAR_ON_NONE(options->proxy_command);
|
CLEAR_ON_NONE(options->proxy_command);
|
||||||
CLEAR_ON_NONE(options->control_path);
|
CLEAR_ON_NONE(options->control_path);
|
||||||
CLEAR_ON_NONE(options->revoked_host_keys);
|
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->identity_agent distinguishes NULL from 'none' */
|
||||||
/* options->user will be set in the main program if appropriate */
|
/* options->user will be set in the main program if appropriate */
|
||||||
/* options->hostname will be set in the main program if appropriate */
|
/* options->hostname will be set in the main program if appropriate */
|
||||||
|
@ -2300,6 +2306,8 @@ parse_jump(const char *s, Options *o, int active)
|
||||||
orig = sdup = xstrdup(s);
|
orig = sdup = xstrdup(s);
|
||||||
first = active;
|
first = active;
|
||||||
do {
|
do {
|
||||||
|
if (strcasecmp(s, "none") == 0)
|
||||||
|
break;
|
||||||
if ((cp = strrchr(sdup, ',')) == NULL)
|
if ((cp = strrchr(sdup, ',')) == NULL)
|
||||||
cp = sdup; /* last */
|
cp = sdup; /* last */
|
||||||
else
|
else
|
||||||
|
@ -2320,6 +2328,10 @@ parse_jump(const char *s, Options *o, int active)
|
||||||
} while (cp != sdup);
|
} while (cp != sdup);
|
||||||
/* success */
|
/* success */
|
||||||
if (active) {
|
if (active) {
|
||||||
|
if (strcasecmp(s, "none") == 0) {
|
||||||
|
o->jump_host = xstrdup("none");
|
||||||
|
o->jump_port = 0;
|
||||||
|
} else {
|
||||||
o->jump_user = user;
|
o->jump_user = user;
|
||||||
o->jump_host = host;
|
o->jump_host = host;
|
||||||
o->jump_port = port;
|
o->jump_port = port;
|
||||||
|
@ -2330,6 +2342,7 @@ parse_jump(const char *s, Options *o, int active)
|
||||||
o->jump_extra[cp - s] = '\0';
|
o->jump_extra[cp - s] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out:
|
out:
|
||||||
free(orig);
|
free(orig);
|
||||||
|
|
Loading…
Reference in New Issue