mirror of git://anongit.mindrot.org/openssh.git
upstream: fix a race condition in the SIGCHILD handler that could turn
in to a kill(-1); bz3084, reported by Gao Rui, ok dtucker@ OpenBSD-Commit-ID: ac2742e04a69d4c34223505b6a32f6d686e18896
This commit is contained in:
parent
03f9205f0f
commit
4332b4fe49
11
sftp.c
11
sftp.c
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: sftp.c,v 1.195 2019/10/02 00:42:30 djm Exp $ */
|
/* $OpenBSD: sftp.c,v 1.196 2019/11/01 03:54:33 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
|
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
|
||||||
*
|
*
|
||||||
|
@ -220,9 +220,12 @@ static const struct CMD cmds[] = {
|
||||||
static void
|
static void
|
||||||
killchild(int signo)
|
killchild(int signo)
|
||||||
{
|
{
|
||||||
if (sshpid > 1) {
|
pid_t pid;
|
||||||
kill(sshpid, SIGTERM);
|
|
||||||
waitpid(sshpid, NULL, 0);
|
pid = sshpid;
|
||||||
|
if (pid > 1) {
|
||||||
|
kill(pid, SIGTERM);
|
||||||
|
waitpid(pid, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_exit(1);
|
_exit(1);
|
||||||
|
|
Loading…
Reference in New Issue