summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2018-10-03 06:38:35 +0000
committerDamien Miller <djm@mindrot.org>2018-10-03 16:39:58 +1000
commit5eff5b858e717e901e6af6596306a114de9f79f2 (patch)
tree1e89894968478a2c5b44cabd9747fd90d51725e1 /readconf.c
parenta46ac4d86b25414d78b632e8173578b37e5f8a83 (diff)
upstream: Allow ssh_config IdentityAgent directive to accept
environment variable names as well as explicit paths. ok dtucker@ OpenBSD-Commit-ID: 2f0996e103876c53d8c9dd51dcce9889d700767b
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index 057726d0e..d39cfa3c5 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.298 2018/09/20 03:30:44 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.299 2018/10/03 06:38:35 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
@@ -1700,7 +1700,18 @@ parse_keytypes:
1700 1700
1701 case oIdentityAgent: 1701 case oIdentityAgent:
1702 charptr = &options->identity_agent; 1702 charptr = &options->identity_agent;
1703 goto parse_string; 1703 arg = strdelim(&s);
1704 if (!arg || *arg == '\0')
1705 fatal("%.200s line %d: Missing argument.",
1706 filename, linenum);
1707 /* Extra validation if the string represents an env var. */
1708 if (arg[0] == '$' && !valid_env_name(arg + 1)) {
1709 fatal("%.200s line %d: Invalid environment name %s.",
1710 filename, linenum, arg);
1711 }
1712 if (*activep && *charptr == NULL)
1713 *charptr = xstrdup(arg);
1714 break;
1704 1715
1705 case oDeprecated: 1716 case oDeprecated:
1706 debug("%s line %d: Deprecated option \"%s\"", 1717 debug("%s line %d: Deprecated option \"%s\"",