diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: monitor.c,v 1.49 2003/08/28 12:54:34 markus Exp $"); | 28 | RCSID("$OpenBSD: monitor.c,v 1.50 2003/09/23 20:17:11 markus Exp $"); |
29 | 29 | ||
30 | #include <openssl/dh.h> | 30 | #include <openssl/dh.h> |
31 | 31 | ||
@@ -272,14 +272,17 @@ monitor_permit_authentications(int permit) | |||
272 | } | 272 | } |
273 | } | 273 | } |
274 | 274 | ||
275 | Authctxt * | 275 | void |
276 | monitor_child_preauth(struct monitor *pmonitor) | 276 | monitor_child_preauth(Authctxt *_authctxt, struct monitor *pmonitor) |
277 | { | 277 | { |
278 | struct mon_table *ent; | 278 | struct mon_table *ent; |
279 | int authenticated = 0; | 279 | int authenticated = 0; |
280 | 280 | ||
281 | debug3("preauth child monitor started"); | 281 | debug3("preauth child monitor started"); |
282 | 282 | ||
283 | authctxt = _authctxt; | ||
284 | memset(authctxt, 0, sizeof(*authctxt)); | ||
285 | |||
283 | if (compat20) { | 286 | if (compat20) { |
284 | mon_dispatch = mon_dispatch_proto20; | 287 | mon_dispatch = mon_dispatch_proto20; |
285 | 288 | ||
@@ -292,8 +295,6 @@ monitor_child_preauth(struct monitor *pmonitor) | |||
292 | monitor_permit(mon_dispatch, MONITOR_REQ_SESSKEY, 1); | 295 | monitor_permit(mon_dispatch, MONITOR_REQ_SESSKEY, 1); |
293 | } | 296 | } |
294 | 297 | ||
295 | authctxt = authctxt_new(); | ||
296 | |||
297 | /* The first few requests do not require asynchronous access */ | 298 | /* The first few requests do not require asynchronous access */ |
298 | while (!authenticated) { | 299 | while (!authenticated) { |
299 | authenticated = monitor_read(pmonitor, mon_dispatch, &ent); | 300 | authenticated = monitor_read(pmonitor, mon_dispatch, &ent); |
@@ -333,8 +334,6 @@ monitor_child_preauth(struct monitor *pmonitor) | |||
333 | __func__, authctxt->user); | 334 | __func__, authctxt->user); |
334 | 335 | ||
335 | mm_get_keystate(pmonitor); | 336 | mm_get_keystate(pmonitor); |
336 | |||
337 | return (authctxt); | ||
338 | } | 337 | } |
339 | 338 | ||
340 | static void | 339 | static void |
@@ -1185,7 +1184,7 @@ mm_record_login(Session *s, struct passwd *pw) | |||
1185 | if (getpeername(packet_get_connection_in(), | 1184 | if (getpeername(packet_get_connection_in(), |
1186 | (struct sockaddr *) & from, &fromlen) < 0) { | 1185 | (struct sockaddr *) & from, &fromlen) < 0) { |
1187 | debug("getpeername: %.100s", strerror(errno)); | 1186 | debug("getpeername: %.100s", strerror(errno)); |
1188 | fatal_cleanup(); | 1187 | cleanup_exit(255); |
1189 | } | 1188 | } |
1190 | } | 1189 | } |
1191 | /* Record that there was a login on that tty from the remote host. */ | 1190 | /* Record that there was a login on that tty from the remote host. */ |
@@ -1200,7 +1199,6 @@ mm_session_close(Session *s) | |||
1200 | debug3("%s: session %d pid %ld", __func__, s->self, (long)s->pid); | 1199 | debug3("%s: session %d pid %ld", __func__, s->self, (long)s->pid); |
1201 | if (s->ttyfd != -1) { | 1200 | if (s->ttyfd != -1) { |
1202 | debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ptyfd); | 1201 | debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ptyfd); |
1203 | fatal_remove_cleanup(session_pty_cleanup2, (void *)s); | ||
1204 | session_pty_cleanup2(s); | 1202 | session_pty_cleanup2(s); |
1205 | } | 1203 | } |
1206 | s->used = 0; | 1204 | s->used = 0; |
@@ -1225,7 +1223,6 @@ mm_answer_pty(int socket, Buffer *m) | |||
1225 | res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); | 1223 | res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); |
1226 | if (res == 0) | 1224 | if (res == 0) |
1227 | goto error; | 1225 | goto error; |
1228 | fatal_add_cleanup(session_pty_cleanup2, (void *)s); | ||
1229 | pty_setowner(authctxt->pw, s->tty); | 1226 | pty_setowner(authctxt->pw, s->tty); |
1230 | 1227 | ||
1231 | buffer_put_int(m, 1); | 1228 | buffer_put_int(m, 1); |