Mercurial > dropbear
comparison svr-session.c @ 1342:8747c2b19152
merge 2017.75
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 18 May 2017 22:59:38 +0800 |
parents | 2c9dac2d6707 |
children | 3fdd8c5a0195 e8f67918fdc9 |
comparison
equal
deleted
inserted
replaced
1341:ab35a9ccc2eb | 1342:8747c2b19152 |
---|---|
60 {SSH_MSG_CHANNEL_CLOSE, recv_msg_channel_close}, | 60 {SSH_MSG_CHANNEL_CLOSE, recv_msg_channel_close}, |
61 {SSH_MSG_CHANNEL_SUCCESS, ignore_recv_response}, | 61 {SSH_MSG_CHANNEL_SUCCESS, ignore_recv_response}, |
62 {SSH_MSG_CHANNEL_FAILURE, ignore_recv_response}, | 62 {SSH_MSG_CHANNEL_FAILURE, ignore_recv_response}, |
63 {SSH_MSG_REQUEST_FAILURE, ignore_recv_response}, /* for keepalive */ | 63 {SSH_MSG_REQUEST_FAILURE, ignore_recv_response}, /* for keepalive */ |
64 {SSH_MSG_REQUEST_SUCCESS, ignore_recv_response}, /* client */ | 64 {SSH_MSG_REQUEST_SUCCESS, ignore_recv_response}, /* client */ |
65 #ifdef USING_LISTENERS | 65 #if DROPBEAR_LISTENERS |
66 {SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation}, | 66 {SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation}, |
67 {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure}, | 67 {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure}, |
68 #endif | 68 #endif |
69 {0, 0} /* End */ | 69 {0, 0} /* End */ |
70 }; | 70 }; |
71 | 71 |
72 static const struct ChanType *svr_chantypes[] = { | 72 static const struct ChanType *svr_chantypes[] = { |
73 &svrchansess, | 73 &svrchansess, |
74 #ifdef ENABLE_SVR_LOCALTCPFWD | 74 #if DROPBEAR_SVR_LOCALTCPFWD |
75 &svr_chan_tcpdirect, | 75 &svr_chan_tcpdirect, |
76 #endif | 76 #endif |
77 NULL /* Null termination is mandatory. */ | 77 NULL /* Null termination is mandatory. */ |
78 }; | 78 }; |
79 | 79 |
94 | 94 |
95 common_session_init(sock, sock); | 95 common_session_init(sock, sock); |
96 | 96 |
97 /* Initialise server specific parts of the session */ | 97 /* Initialise server specific parts of the session */ |
98 svr_ses.childpipe = childpipe; | 98 svr_ses.childpipe = childpipe; |
99 #ifdef USE_VFORK | 99 #if DROPBEAR_VFORK |
100 svr_ses.server_pid = getpid(); | 100 svr_ses.server_pid = getpid(); |
101 #endif | 101 #endif |
102 svr_authinitialise(); | 102 svr_authinitialise(); |
103 chaninitialise(svr_chantypes); | 103 chaninitialise(svr_chantypes); |
104 svr_chansessinitialise(); | 104 svr_chansessinitialise(); |
170 snprintf(fullmsg, sizeof(fullmsg), "Exit before auth: %s", exitmsg); | 170 snprintf(fullmsg, sizeof(fullmsg), "Exit before auth: %s", exitmsg); |
171 } | 171 } |
172 | 172 |
173 dropbear_log(LOG_INFO, "%s", fullmsg); | 173 dropbear_log(LOG_INFO, "%s", fullmsg); |
174 | 174 |
175 #ifdef USE_VFORK | 175 #if DROPBEAR_VFORK |
176 /* For uclinux only the main server process should cleanup - we don't want | 176 /* For uclinux only the main server process should cleanup - we don't want |
177 * forked children doing that */ | 177 * forked children doing that */ |
178 if (svr_ses.server_pid == getpid()) | 178 if (svr_ses.server_pid == getpid()) |
179 #endif | 179 #endif |
180 { | 180 { |
211 } | 211 } |
212 #endif | 212 #endif |
213 | 213 |
214 /* if we are using DEBUG_TRACE, we want to print to stderr even if | 214 /* if we are using DEBUG_TRACE, we want to print to stderr even if |
215 * syslog is used, so it is included in error reports */ | 215 * syslog is used, so it is included in error reports */ |
216 #ifdef DEBUG_TRACE | 216 #if DEBUG_TRACE |
217 havetrace = debug_trace; | 217 havetrace = debug_trace; |
218 #endif | 218 #endif |
219 | 219 |
220 if (!opts.usingsyslog || havetrace) { | 220 if (!opts.usingsyslog || havetrace) { |
221 struct tm * local_tm = NULL; | 221 struct tm * local_tm = NULL; |