diff --git a/sshd.c b/sshd.c index c2c1cc8a6..df694fe3d 100644 --- a/sshd.c +++ b/sshd.c @@ -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 * Copyright (c) 1995 Tatu Ylonen , 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.