mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-09-25 10:58:56 +02:00
upstream: reap the [net] child if it hangs up while writing privsep
message payloads, not just the message header OpenBSD-Commit-ID: 24dbd400aa381ac96be7ed2dd49018487dfef6ce
This commit is contained in:
parent
6211aa085f
commit
41987efd35
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: monitor_wrap.c,v 1.132 2024/06/11 00:40:21 djm Exp $ */
|
/* $OpenBSD: monitor_wrap.c,v 1.133 2024/06/11 00:44:52 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
|
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
|
||||||
* Copyright 2002 Markus Friedl <markus@openbsd.org>
|
* Copyright 2002 Markus Friedl <markus@openbsd.org>
|
||||||
@ -175,7 +175,7 @@ mm_request_receive(int sock, struct sshbuf *m)
|
|||||||
{
|
{
|
||||||
u_char buf[4], *p = NULL;
|
u_char buf[4], *p = NULL;
|
||||||
u_int msg_len;
|
u_int msg_len;
|
||||||
int r;
|
int oerrno, r;
|
||||||
|
|
||||||
debug3_f("entering");
|
debug3_f("entering");
|
||||||
|
|
||||||
@ -193,8 +193,13 @@ mm_request_receive(int sock, struct sshbuf *m)
|
|||||||
sshbuf_reset(m);
|
sshbuf_reset(m);
|
||||||
if ((r = sshbuf_reserve(m, msg_len, &p)) != 0)
|
if ((r = sshbuf_reserve(m, msg_len, &p)) != 0)
|
||||||
fatal_fr(r, "reserve");
|
fatal_fr(r, "reserve");
|
||||||
if (atomicio(read, sock, p, msg_len) != msg_len)
|
if (atomicio(read, sock, p, msg_len) != msg_len) {
|
||||||
fatal_f("read: %s", strerror(errno));
|
oerrno = errno;
|
||||||
|
error_f("read: %s", strerror(errno));
|
||||||
|
if (oerrno == EPIPE)
|
||||||
|
mm_reap();
|
||||||
|
cleanup_exit(255);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user