[Libguestfs] [nbdkit PATCH 4/8] Revert "RHEL 5: Define O_CLOEXEC and SOCK_CLOEXEC."
Eric Blake
eblake at redhat.com
Wed Jul 31 21:42:23 UTC 2019
On 7/31/19 4:31 PM, 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
> ---
I plan to also squash in this: (not in the original 25206df2 in 1.1.13,
but instead added by copy-and-paste in 1.1.20):
diff --git i/plugins/split/split.c w/plugins/split/split.c
index 1b8e69a2..68682b29 100644
--- i/plugins/split/split.c
+++ w/plugins/split/split.c
@@ -45,10 +45,6 @@
#include <nbdkit-plugin.h>
-#ifndef O_CLOEXEC
-#define O_CLOEXEC 0
-#endif
-
/* The files. */
static char **filenames = NULL;
static size_t nr_files = 0;
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190731/ba2da2c6/attachment.sig>
More information about the Libguestfs
mailing list