[Libguestfs] [nbdkit PATCH 4/8] Revert "RHEL 5: Define O_CLOEXEC and SOCK_CLOEXEC."
Richard W.M. Jones
rjones at redhat.com
Thu Aug 1 09:06:01 UTC 2019
On Wed, Jul 31, 2019 at 04:31:32PM -0500, Eric Blake wrote:
> This reverts commit 25206df20275aeff346d9b86adf5e9be99cc9e43.
>
> An upcoming patch wants to ensure no leaked fds from the server to a
> child process. POSIX has required O_CLOEXEC since 2008, and although
> current POSIX doesn't yet specify full atomic interfaces everywhere
> such as SOCK_CLOEXEC, it does have an open bug since 2014 [1]
> recommending the full set of interfaces that will be mandatory in the
> next revision of POSIX. Most modern OS have caught up to that (RHEL 6
> and FreeBSD 10 support SOCK_CLOEXEC, for example), and we're doing
> ourselves a disservice by using silent fallback instead of actively
> detecting with compile failure on systems that are still behind.
>
> [1] http://austingroupbugs.net/view.php?id=411
>
> Conflicts:
> filters/xz/xzfile.c - The fallback moved from plugins/xz/xzfile.c (and
> in fact has been dead code since commit c879d310 made it a filter)
> plugins/file/file.c - context changes in the meantime
> src/internal.h - Moved to server/internal.h
> ---
> server/internal.h | 8 --------
> filters/xz/xzfile.c | 4 ----
> plugins/example2/example2.c | 4 ----
> plugins/file/file.c | 4 ----
> plugins/streaming/streaming.c | 4 ----
> 5 files changed, 24 deletions(-)
>
> diff --git a/server/internal.h b/server/internal.h
> index 80ab879c..6207f0cf 100644
> --- a/server/internal.h
> +++ b/server/internal.h
> @@ -50,14 +50,6 @@
> #define UNIX_PATH_MAX 108
> #endif
>
> -#ifndef O_CLOEXEC
> -#define O_CLOEXEC 0
> -#endif
> -
> -#ifndef SOCK_CLOEXEC
> -#define SOCK_CLOEXEC 0
> -#endif
As far as I can see Haiku (hrev52698) has O_CLOEXEC but NOT
SOCK_CLOEXEC. As this version is a little old I'll do an update and
see if newer versions support it.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
More information about the Libguestfs
mailing list