diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-02-06 16:04:08 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-02-06 16:04:08 +1100 |
commit | ecc9d46dc53cddb5a220f89e6160b3ca6178bb9c (patch) | |
tree | 6cf2aaf1867ef2be4531b34b13e542e234f93884 /sshd.c | |
parent | f58fb7e727895b8f66ed9914ca0a04913f2b56c1 (diff) |
- (dtucker) [sshd.c] Bug #757: Clear child's environment to prevent
accidentally inheriting from root's environment. ok djm@
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -101,6 +101,7 @@ extern char *__progname; | |||
101 | #else | 101 | #else |
102 | char *__progname; | 102 | char *__progname; |
103 | #endif | 103 | #endif |
104 | extern char **environ; | ||
104 | 105 | ||
105 | /* Server configuration options. */ | 106 | /* Server configuration options. */ |
106 | ServerOptions options; | 107 | ServerOptions options; |
@@ -1101,6 +1102,11 @@ main(int ac, char **av) | |||
1101 | unmounted if desired. */ | 1102 | unmounted if desired. */ |
1102 | chdir("/"); | 1103 | chdir("/"); |
1103 | 1104 | ||
1105 | #ifndef HAVE_CYGWIN | ||
1106 | /* Clear environment */ | ||
1107 | environ[0] = NULL; | ||
1108 | #endif | ||
1109 | |||
1104 | /* ignore SIGPIPE */ | 1110 | /* ignore SIGPIPE */ |
1105 | signal(SIGPIPE, SIG_IGN); | 1111 | signal(SIGPIPE, SIG_IGN); |
1106 | 1112 | ||