summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-05-20 19:02:47 +1000
committerDamien Miller <djm@mindrot.org>2011-05-20 19:02:47 +1000
commit814ace08751a80c3b965c06fdfc1c9ac3d7698ca (patch)
tree5cc0a8c1ecc49fc882a950d9b647f7c1d060d7b6
parentec2eaa3daf7f5543d8619cec30c1d73268323d01 (diff)
- OpenBSD CVS Sync
- djm@cvs.openbsd.org 2011/05/15 08:09:01 [authfd.c monitor.c serverloop.c] use FD_CLOEXEC consistently; patch from zion AT x96.org
-rw-r--r--ChangeLog4
-rw-r--r--authfd.c4
-rw-r--r--monitor.c4
-rw-r--r--serverloop.c6
4 files changed, 11 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index b729c6f6f..481e9c310 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
7 fragment uses (bad main() return type). 7 fragment uses (bad main() return type).
8 bz#1900 and bz#1901 reported by g.esp AT free.fr; ok dtucker@ 8 bz#1900 and bz#1901 reported by g.esp AT free.fr; ok dtucker@
9 - (djm) [servconf.c] remove leftover droppings of AuthorizedKeysFile2 9 - (djm) [servconf.c] remove leftover droppings of AuthorizedKeysFile2
10 - OpenBSD CVS Sync
11 - djm@cvs.openbsd.org 2011/05/15 08:09:01
12 [authfd.c monitor.c serverloop.c]
13 use FD_CLOEXEC consistently; patch from zion AT x96.org
10 14
1120110515 1520110515
12 - (djm) OpenBSD CVS Sync 16 - (djm) OpenBSD CVS Sync
diff --git a/authfd.c b/authfd.c
index c11c3f5a8..c942a9110 100644
--- a/authfd.c
+++ b/authfd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfd.c,v 1.84 2010/08/31 11:54:45 djm Exp $ */ 1/* $OpenBSD: authfd.c,v 1.85 2011/05/15 08:09:01 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -110,7 +110,7 @@ ssh_get_authentication_socket(void)
110 return -1; 110 return -1;
111 111
112 /* close on exec */ 112 /* close on exec */
113 if (fcntl(sock, F_SETFD, 1) == -1) { 113 if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1) {
114 close(sock); 114 close(sock);
115 return -1; 115 return -1;
116 } 116 }
diff --git a/monitor.c b/monitor.c
index 29d987c70..732cb365d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.110 2010/09/09 10:45:45 djm Exp $ */ 1/* $OpenBSD: monitor.c,v 1.111 2011/05/15 08:09:01 djm Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -1834,7 +1834,7 @@ mm_init_compression(struct mm_master *mm)
1834/* XXX */ 1834/* XXX */
1835 1835
1836#define FD_CLOSEONEXEC(x) do { \ 1836#define FD_CLOSEONEXEC(x) do { \
1837 if (fcntl(x, F_SETFD, 1) == -1) \ 1837 if (fcntl(x, F_SETFD, FD_CLOEXEC) == -1) \
1838 fatal("fcntl(%d, F_SETFD)", x); \ 1838 fatal("fcntl(%d, F_SETFD)", x); \
1839} while (0) 1839} while (0)
1840 1840
diff --git a/serverloop.c b/serverloop.c
index 8be01c5c3..19b84ff27 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.159 2009/05/28 16:50:16 andreas Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.160 2011/05/15 08:09:01 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -131,8 +131,8 @@ notify_setup(void)
131{ 131{
132 if (pipe(notify_pipe) < 0) { 132 if (pipe(notify_pipe) < 0) {
133 error("pipe(notify_pipe) failed %s", strerror(errno)); 133 error("pipe(notify_pipe) failed %s", strerror(errno));
134 } else if ((fcntl(notify_pipe[0], F_SETFD, 1) == -1) || 134 } else if ((fcntl(notify_pipe[0], F_SETFD, FD_CLOEXEC) == -1) ||
135 (fcntl(notify_pipe[1], F_SETFD, 1) == -1)) { 135 (fcntl(notify_pipe[1], F_SETFD, FD_CLOEXEC) == -1)) {
136 error("fcntl(notify_pipe, F_SETFD) failed %s", strerror(errno)); 136 error("fcntl(notify_pipe, F_SETFD) failed %s", strerror(errno));
137 close(notify_pipe[0]); 137 close(notify_pipe[0]);
138 close(notify_pipe[1]); 138 close(notify_pipe[1]);