diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: session.c,v 1.316 2019/06/28 13:35:04 deraadt Exp $ */ | 1 | /* $OpenBSD: session.c,v 1.318 2020/01/23 07:10:22 dtucker 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 |
@@ -56,10 +56,10 @@ | |||
56 | #endif | 56 | #endif |
57 | #include <pwd.h> | 57 | #include <pwd.h> |
58 | #include <signal.h> | 58 | #include <signal.h> |
59 | #include <stdarg.h> | ||
60 | #include <stdio.h> | 59 | #include <stdio.h> |
61 | #include <stdlib.h> | 60 | #include <stdlib.h> |
62 | #include <string.h> | 61 | #include <string.h> |
62 | #include <stdarg.h> | ||
63 | #include <unistd.h> | 63 | #include <unistd.h> |
64 | #include <limits.h> | 64 | #include <limits.h> |
65 | 65 | ||
@@ -946,6 +946,7 @@ read_etc_default_login(char ***env, u_int *envsize, uid_t uid) | |||
946 | } | 946 | } |
947 | #endif /* HAVE_ETC_DEFAULT_LOGIN */ | 947 | #endif /* HAVE_ETC_DEFAULT_LOGIN */ |
948 | 948 | ||
949 | #if defined(USE_PAM) || defined(HAVE_CYGWIN) | ||
949 | static void | 950 | static void |
950 | copy_environment_blacklist(char **source, char ***env, u_int *envsize, | 951 | copy_environment_blacklist(char **source, char ***env, u_int *envsize, |
951 | const char *blacklist) | 952 | const char *blacklist) |
@@ -973,12 +974,15 @@ copy_environment_blacklist(char **source, char ***env, u_int *envsize, | |||
973 | free(var_name); | 974 | free(var_name); |
974 | } | 975 | } |
975 | } | 976 | } |
977 | #endif /* defined(USE_PAM) || defined(HAVE_CYGWIN) */ | ||
976 | 978 | ||
977 | void | 979 | #ifdef HAVE_CYGWIN |
980 | static void | ||
978 | copy_environment(char **source, char ***env, u_int *envsize) | 981 | copy_environment(char **source, char ***env, u_int *envsize) |
979 | { | 982 | { |
980 | copy_environment_blacklist(source, env, envsize, NULL); | 983 | copy_environment_blacklist(source, env, envsize, NULL); |
981 | } | 984 | } |
985 | #endif | ||
982 | 986 | ||
983 | static char ** | 987 | static char ** |
984 | do_setup_env(struct ssh *ssh, Session *s, const char *shell) | 988 | do_setup_env(struct ssh *ssh, Session *s, const char *shell) |
@@ -1638,7 +1642,7 @@ do_child(struct ssh *ssh, Session *s, const char *command) | |||
1638 | do_rc_files(ssh, s, shell); | 1642 | do_rc_files(ssh, s, shell); |
1639 | 1643 | ||
1640 | /* restore SIGPIPE for child */ | 1644 | /* restore SIGPIPE for child */ |
1641 | signal(SIGPIPE, SIG_DFL); | 1645 | ssh_signal(SIGPIPE, SIG_DFL); |
1642 | 1646 | ||
1643 | if (s->is_subsystem == SUBSYSTEM_INT_SFTP_ERROR) { | 1647 | if (s->is_subsystem == SUBSYSTEM_INT_SFTP_ERROR) { |
1644 | error("Connection from %s: refusing non-sftp session", | 1648 | error("Connection from %s: refusing non-sftp session", |