diff options
author | des <des@FreeBSD.org> | 2008-07-23 09:28:49 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2008-07-23 09:28:49 +0000 |
commit | 58ec1452c85f52291a1bd8f7c1e9f3b150a7a880 (patch) | |
tree | 7f4db193e6aaf3390a97bd79900d7d352cafa0e6 /monitor.c | |
parent | 3d5211603f4c722b3f0673c377e762ce44660c7c (diff) | |
download | FreeBSD-src-58ec1452c85f52291a1bd8f7c1e9f3b150a7a880.zip FreeBSD-src-58ec1452c85f52291a1bd8f7c1e9f3b150a7a880.tar.gz |
Vendor import of OpenSSH 4.9p1 for posterity's sake
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.91 2007/05/17 20:52:13 djm Exp $ */ +/* $OpenBSD: monitor.c,v 1.94 2007/10/29 04:08:08 dtucker Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * Copyright 2002 Markus Friedl <markus@openbsd.org> @@ -643,11 +643,11 @@ mm_answer_pwnamallow(int sock, Buffer *m) #endif buffer_put_cstring(m, pwent->pw_dir); buffer_put_cstring(m, pwent->pw_shell); + + out: buffer_put_string(m, &options, sizeof(options)); if (options.banner != NULL) buffer_put_cstring(m, options.banner); - - out: debug3("%s: sending MONITOR_ANS_PWNAM: %d", __func__, allowed); mm_request_send(sock, MONITOR_ANS_PWNAM, m); @@ -1314,8 +1314,9 @@ mm_answer_pty(int sock, Buffer *m) mm_request_send(sock, MONITOR_ANS_PTY, m); - mm_send_fd(sock, s->ptyfd); - mm_send_fd(sock, s->ttyfd); + if (mm_send_fd(sock, s->ptyfd) == -1 || + mm_send_fd(sock, s->ttyfd) == -1) + fatal("%s: send fds failed", __func__); /* make sure nothing uses fd 0 */ if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) < 0) @@ -1546,6 +1547,11 @@ mm_answer_term(int sock, Buffer *req) /* The child is terminating */ session_destroy_all(&mm_session_close); +#ifdef USE_PAM + if (options.use_pam) + sshpam_cleanup(); +#endif + while (waitpid(pmonitor->m_pid, &status, 0) == -1) if (errno != EINTR) exit(1); |