summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-10-23 05:08:00 +0000
committerDamien Miller <djm@mindrot.org>2017-10-23 16:14:30 +1100
commitb7548b12a6b2b4abf4d057192c353147e0abba08 (patch)
treedc76477cd371b6197ba840c3a178bfbcf6d7baba /session.c
parent887669ef032d63cf07f53cada216fa8a0c9a7d72 (diff)
upstream commit
Expose devices allocated for tun/tap forwarding. At the client, the device may be obtained from a new %T expansion for LocalCommand. At the server, the allocated devices will be listed in a SSH_TUNNEL variable exposed to the environment of any user sessions started after the tunnel forwarding was established. ok markus Upstream-ID: e61e53f8ae80566e9ddc0d67a5df5bdf2f3c9f9e
Diffstat (limited to 'session.c')
-rw-r--r--session.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/session.c b/session.c
index 4bccb62d1..a701fa0cd 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.292 2017/09/12 06:32:07 djm Exp $ */ 1/* $OpenBSD: session.c,v 1.293 2017/10/23 05:08:00 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -140,6 +140,7 @@ extern u_int utmp_len;
140extern int startup_pipe; 140extern int startup_pipe;
141extern void destroy_sensitive_data(void); 141extern void destroy_sensitive_data(void);
142extern Buffer loginmsg; 142extern Buffer loginmsg;
143char *tun_fwd_ifnames; /* serverloop.c */
143 144
144/* original command from peer. */ 145/* original command from peer. */
145const char *original_command = NULL; 146const char *original_command = NULL;
@@ -1066,6 +1067,8 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
1066 free(laddr); 1067 free(laddr);
1067 child_set_env(&env, &envsize, "SSH_CONNECTION", buf); 1068 child_set_env(&env, &envsize, "SSH_CONNECTION", buf);
1068 1069
1070 if (tun_fwd_ifnames != NULL)
1071 child_set_env(&env, &envsize, "SSH_TUNNEL", tun_fwd_ifnames);
1069 if (auth_info_file != NULL) 1072 if (auth_info_file != NULL)
1070 child_set_env(&env, &envsize, "SSH_USER_AUTH", auth_info_file); 1073 child_set_env(&env, &envsize, "SSH_USER_AUTH", auth_info_file);
1071 if (s->ttyfd != -1) 1074 if (s->ttyfd != -1)