From 87dcfc872c11fdb13ebf0448abe91150aaa86859 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 11 Oct 2011 14:32:04 -0400 Subject: [PATCH] ukernel: set close-on-exec on our socket if the process we are in execs a child, it doesn't get our socket Change-Id: Iaf1831866e0dcda0449e75d89c576557c61090dd Reviewed-on: http://gerrit.openafs.org/5598 Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/rx/UKERNEL/rx_knet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rx/UKERNEL/rx_knet.c b/src/rx/UKERNEL/rx_knet.c index 6692b5444a..082ff68603 100644 --- a/src/rx/UKERNEL/rx_knet.c +++ b/src/rx/UKERNEL/rx_knet.c @@ -257,6 +257,10 @@ rxk_InitializeSocket(void) usr_assert(rc == 0); #endif /* AFS_USR_AIX_ENV */ +#ifdef FD_CLOEXEC + fcntl(sock, F_SETFD, FD_CLOEXEC); +#endif + usockp->sock = sock; usockp->port = lcladdr.sin_port;