upstream commit

might as well set the listener socket CLOEXEC

Upstream-ID: 9c538433d6a0ca79f5f21decc5620e46fb68ab57
This commit is contained in:
djm@openbsd.org 2017-02-24 03:16:34 +00:00 committed by Damien Miller
parent d549919055
commit 8071a6924c
1 changed files with 6 additions and 1 deletions

7
sshd.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: sshd.c,v 1.482 2017/02/06 09:22:51 djm Exp $ */
/* $OpenBSD: sshd.c,v 1.483 2017/02/24 03:16:34 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -1046,6 +1046,11 @@ server_listen(void)
close(listen_sock);
continue;
}
if (fcntl(listen_sock, F_SETFD, FD_CLOEXEC) == -1) {
verbose("socket: CLOEXEC: %s", strerror(errno));
close(listen_sock);
continue;
}
/*
* Set socket options.
* Allow local port reuse in TIME_WAIT.