diff options
author | djm@openbsd.org <djm@openbsd.org> | 2018-06-09 03:01:12 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-06-09 13:11:00 +1000 |
commit | 7082bb58a2eb878d23ec674587c742e5e9673c36 (patch) | |
tree | ca7c8ddb616358d96279fdbfd5986328f48a1821 /mux.c | |
parent | 3b9798bda15bd3f598f5ef07595d64e23504da91 (diff) | |
download | openssh-git-7082bb58a2eb878d23ec674587c742e5e9673c36.tar.gz |
upstream: add a SetEnv directive to ssh_config that allows setting
environment variables for the remote session (subject to the server accepting
them)
refactor SendEnv to remove the arbitrary limit of variable names.
ok markus@
OpenBSD-Commit-ID: cfbb00d9b0e10c1ffff1d83424351fd961d1f2be
Diffstat (limited to 'mux.c')
-rw-r--r-- | mux.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: mux.c,v 1.70 2018/06/06 18:22:41 djm Exp $ */ +/* $OpenBSD: mux.c,v 1.71 2018/06/09 03:01:12 djm Exp $ */ /* * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> * @@ -1852,9 +1852,9 @@ mux_client_request_session(int fd) { Buffer m; char *e, *term; - u_int i, rid, sid, esid, exitval, type, exitval_seen; + u_int rid, sid, esid, exitval, type, exitval_seen; extern char **environ; - int devnull, rawmode; + int i, devnull, rawmode; debug3("%s: entering", __func__); @@ -1889,14 +1889,16 @@ mux_client_request_session(int fd) buffer_put_cstring(&m, term == NULL ? "" : term); buffer_put_string(&m, buffer_ptr(&command), buffer_len(&command)); + /* Pass environment */ if (options.num_send_env > 0 && environ != NULL) { - /* Pass environment */ for (i = 0; environ[i] != NULL; i++) { if (env_permitted(environ[i])) { buffer_put_cstring(&m, environ[i]); } } } + for (i = 0; i < options.num_setenv; i++) + buffer_put_cstring(&m, options.setenv[i]); if (mux_client_write_packet(fd, &m) != 0) fatal("%s: write packet: %s", __func__, strerror(errno)); |