summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2017-02-24 03:16:34 +0000
committerdjm <djm@openbsd.org>2017-02-24 03:16:34 +0000
commita0f46c420503f533f67e35a3645c63c2e02241b2 (patch)
tree32fe6b5480f37ab50fdf61fc670c48dcc20d8178
parentThe assembly for sigpending(2) wasn't correctly implemented either. I (diff)
downloadwireguard-openbsd-a0f46c420503f533f67e35a3645c63c2e02241b2.tar.xz
wireguard-openbsd-a0f46c420503f533f67e35a3645c63c2e02241b2.zip
might as well set the listener socket CLOEXEC
-rw-r--r--usr.bin/ssh/sshd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 0481766570a..c6be5c41b91 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/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 <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -994,6 +994,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.