summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/readconf.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2018-10-03 06:38:35 +0000
committerdjm <djm@openbsd.org>2018-10-03 06:38:35 +0000
commit07e34c21604a7f3315365a3741992de37ed6de0e (patch)
tree6b82f6cb8944f9765464ab4d7d09ef286ad50102 /usr.bin/ssh/readconf.c
parentFix a race condition that affects pfsync interface deletion. (diff)
downloadwireguard-openbsd-07e34c21604a7f3315365a3741992de37ed6de0e.tar.xz
wireguard-openbsd-07e34c21604a7f3315365a3741992de37ed6de0e.zip
Allow ssh_config IdentityAgent directive to accept environment variable
names as well as explicit paths. ok dtucker@
Diffstat (limited to 'usr.bin/ssh/readconf.c')
-rw-r--r--usr.bin/ssh/readconf.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c
index c4f8e19486b..5fe0ccc7d3f 100644
--- a/usr.bin/ssh/readconf.c
+++ b/usr.bin/ssh/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.298 2018/09/20 03:30:44 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.299 2018/10/03 06:38:35 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1685,7 +1685,18 @@ parse_keytypes:
case oIdentityAgent:
charptr = &options->identity_agent;
- goto parse_string;
+ arg = strdelim(&s);
+ if (!arg || *arg == '\0')
+ fatal("%.200s line %d: Missing argument.",
+ filename, linenum);
+ /* Extra validation if the string represents an env var. */
+ if (arg[0] == '$' && !valid_env_name(arg + 1)) {
+ fatal("%.200s line %d: Invalid environment name %s.",
+ filename, linenum, arg);
+ }
+ if (*activep && *charptr == NULL)
+ *charptr = xstrdup(arg);
+ break;
case oDeprecated:
debug("%s line %d: Deprecated option \"%s\"",