diff options
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.507 2019/09/13 04:27:35 djm Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.508 2019/10/31 21:18:28 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1344,6 +1344,22 @@ main(int ac, char **av) | |||
1344 | exit(0); | 1344 | exit(0); |
1345 | } | 1345 | } |
1346 | 1346 | ||
1347 | /* Expand SecurityKeyProvider if it refers to an environment variable */ | ||
1348 | if (options.sk_provider != NULL && *options.sk_provider == '$' && | ||
1349 | strlen(options.sk_provider) > 1) { | ||
1350 | if ((cp = getenv(options.sk_provider + 1)) == NULL) { | ||
1351 | debug("Security key provider %s did not resolve; " | ||
1352 | "disabling", options.sk_provider); | ||
1353 | free(options.sk_provider); | ||
1354 | options.sk_provider = NULL; | ||
1355 | } else { | ||
1356 | debug2("resolved SecurityKeyProvider %s => %s", | ||
1357 | options.sk_provider, cp); | ||
1358 | free(options.sk_provider); | ||
1359 | options.sk_provider = xstrdup(cp); | ||
1360 | } | ||
1361 | } | ||
1362 | |||
1347 | if (muxclient_command != 0 && options.control_path == NULL) | 1363 | if (muxclient_command != 0 && options.control_path == NULL) |
1348 | fatal("No ControlPath specified for \"-O\" command"); | 1364 | fatal("No ControlPath specified for \"-O\" command"); |
1349 | if (options.control_path != NULL) { | 1365 | if (options.control_path != NULL) { |