diff options
Diffstat (limited to 'mux.c')
-rw-r--r-- | mux.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mux.c,v 1.70 2018/06/06 18:22:41 djm Exp $ */ | 1 | /* $OpenBSD: mux.c,v 1.71 2018/06/09 03:01:12 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -1852,9 +1852,9 @@ mux_client_request_session(int fd) | |||
1852 | { | 1852 | { |
1853 | Buffer m; | 1853 | Buffer m; |
1854 | char *e, *term; | 1854 | char *e, *term; |
1855 | u_int i, rid, sid, esid, exitval, type, exitval_seen; | 1855 | u_int rid, sid, esid, exitval, type, exitval_seen; |
1856 | extern char **environ; | 1856 | extern char **environ; |
1857 | int devnull, rawmode; | 1857 | int i, devnull, rawmode; |
1858 | 1858 | ||
1859 | debug3("%s: entering", __func__); | 1859 | debug3("%s: entering", __func__); |
1860 | 1860 | ||
@@ -1889,14 +1889,16 @@ mux_client_request_session(int fd) | |||
1889 | buffer_put_cstring(&m, term == NULL ? "" : term); | 1889 | buffer_put_cstring(&m, term == NULL ? "" : term); |
1890 | buffer_put_string(&m, buffer_ptr(&command), buffer_len(&command)); | 1890 | buffer_put_string(&m, buffer_ptr(&command), buffer_len(&command)); |
1891 | 1891 | ||
1892 | /* Pass environment */ | ||
1892 | if (options.num_send_env > 0 && environ != NULL) { | 1893 | if (options.num_send_env > 0 && environ != NULL) { |
1893 | /* Pass environment */ | ||
1894 | for (i = 0; environ[i] != NULL; i++) { | 1894 | for (i = 0; environ[i] != NULL; i++) { |
1895 | if (env_permitted(environ[i])) { | 1895 | if (env_permitted(environ[i])) { |
1896 | buffer_put_cstring(&m, environ[i]); | 1896 | buffer_put_cstring(&m, environ[i]); |
1897 | } | 1897 | } |
1898 | } | 1898 | } |
1899 | } | 1899 | } |
1900 | for (i = 0; i < options.num_setenv; i++) | ||
1901 | buffer_put_cstring(&m, options.setenv[i]); | ||
1900 | 1902 | ||
1901 | if (mux_client_write_packet(fd, &m) != 0) | 1903 | if (mux_client_write_packet(fd, &m) != 0) |
1902 | fatal("%s: write packet: %s", __func__, strerror(errno)); | 1904 | fatal("%s: write packet: %s", __func__, strerror(errno)); |