summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2016-05-04 12:21:53 +0000
committerDarren Tucker <dtucker@zip.com.au>2016-05-05 00:01:49 +1000
commitb02ad1ce9105bfa7394ac7590c0729dd52e26a81 (patch)
treeffd061ffac036e169402e36282e8b8f1dd8566cf /ssh.c
parent910e59bba09ac309d78ce61e356da35292212935 (diff)
upstream commit
IdentityAgent for specifying specific agent sockets; ok djm@ Upstream-ID: 3e6a15eb89ea0fd406f108826b7dc7dec4fbfac1
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/ssh.c b/ssh.c
index a881ba14c..ea52bbf5d 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.438 2016/04/29 08:07:53 djm Exp $ */ 1/* $OpenBSD: ssh.c,v 1.439 2016/05/04 12:21:53 markus 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
@@ -1335,6 +1335,22 @@ main(int ac, char **av)
1335 /* load options.identity_files */ 1335 /* load options.identity_files */
1336 load_public_identity_files(); 1336 load_public_identity_files();
1337 1337
1338 /* optionally set the SSH_AUTHSOCKET_ENV_NAME varibale */
1339 if (options.identity_agent) {
1340 if (strcmp(options.identity_agent, "none") == 0) {
1341 unsetenv(SSH_AUTHSOCKET_ENV_NAME);
1342 } else {
1343 p = tilde_expand_filename(options.identity_agent,
1344 original_real_uid);
1345 cp = percent_expand(p, "d", pw->pw_dir,
1346 "u", pw->pw_name, "l", thishost, "h", host,
1347 "r", options.user, (char *)NULL);
1348 setenv(SSH_AUTHSOCKET_ENV_NAME, cp, 1);
1349 free(cp);
1350 free(p);
1351 }
1352 }
1353
1338 /* Expand ~ in known host file names. */ 1354 /* Expand ~ in known host file names. */
1339 tilde_expand_paths(options.system_hostfiles, 1355 tilde_expand_paths(options.system_hostfiles,
1340 options.num_system_hostfiles); 1356 options.num_system_hostfiles);