Displaying 17 results from an estimated 17 matches for "have_mkostemp".
2019 Aug 02
1
[nbdkit PATCH] server: Restrict thread model when no atomic CLOEXEC
...diff --git a/common/utils/utils.c b/common/utils/utils.c
index 9ac3443b..029b6685 100644
--- a/common/utils/utils.c
+++ b/common/utils/utils.c
@@ -140,13 +140,15 @@ exit_status_to_nbd_error (int status, const char *cmd)
*/
int
set_cloexec (int fd) {
-#if defined SOCK_CLOEXEC && defined HAVE_MKOSTEMP && defined HAVE_PIPE2
+#if (defined SOCK_CLOEXEC && defined HAVE_MKOSTEMP && defined HAVE_PIPE2 && \
+ defined HAVE_ACCEPT4)
nbdkit_error ("prefer creating fds with CLOEXEC atomically set");
close (fd);
errno = EBADF;
return -1;
#else
-# if...
2019 Aug 02
0
[nbdkit PATCH v2 07/17] build: Audit for use of pipe2
...diff --git a/common/utils/utils.c b/common/utils/utils.c
index 7b63b4d4..9ac3443b 100644
--- a/common/utils/utils.c
+++ b/common/utils/utils.c
@@ -140,13 +140,13 @@ exit_status_to_nbd_error (int status, const char *cmd)
*/
int
set_cloexec (int fd) {
-#if defined SOCK_CLOEXEC && defined HAVE_MKOSTEMP
+#if defined SOCK_CLOEXEC && defined HAVE_MKOSTEMP && defined HAVE_PIPE2
nbdkit_error ("prefer creating fds with CLOEXEC atomically set");
close (fd);
errno = EBADF;
return -1;
#else
-# if defined SOCK_CLOEXEC || defined HAVE_MKOSTEMP
+# if defined SOCK_CLOEXE...
2019 Aug 02
2
Re: [nbdkit PATCH v2 10/17] plugins: Add .fork_safe field
On Fri, Aug 02, 2019 at 02:26:11PM -0500, Eric Blake wrote:
> Allow a plugin field to declare whether a parallel plugin can tolerate
> windows where fds are not CLOEXEC, or must take precautions to avoid
> leaking fds if the plugin may fork. For safety reasons, the flag
> defaults to off, but many in-tree plugins can set it to on (most
> commonly because they don't fork after
2019 Aug 02
23
[nbdkit PATCH v2 00/17] fd leak safety
This is a major rewrite compared to my v1 series, where I've tried
a lot harder to ensure that we still accommodate building on Haiku
(although I have not actually yet fired up a Haiku VM to try it
for myself). I also managed to make the sh plugin fully parallel,
on capable platforms.
See also my question on patch 10 on whether I've picked the best
naming convention.
Eric Blake (17):
2019 Nov 02
2
[PATCH nbdkit] server: Use GCC hints to move debug and error handling code out of hot paths.
...\
+ } while (0)
/* log-*.c */
#if !HAVE_VFPRINTF_PERCENT_M
diff --git a/server/plugins.c b/server/plugins.c
index 87daaf2..65f6817 100644
--- a/server/plugins.c
+++ b/server/plugins.c
@@ -71,7 +71,7 @@ plugin_thread_model (struct backend *b)
#if !(defined SOCK_CLOEXEC && defined HAVE_MKOSTEMP && defined HAVE_PIPE2 && \
defined HAVE_ACCEPT4)
if (thread_model > NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS) {
- nbdkit_debug ("system lacks atomic CLOEXEC, serializing to avoid fd leaks");
+ debug ("system lacks atomic CLOEXEC, serializing to av...
2020 Apr 07
2
[PATCH nbdkit v2] tmpdisk: Generalize the tmpdisk plugin
An evolution of v1 here:
https://www.redhat.com/archives/libguestfs/2020-April/msg00035.html
I want to generalize the tmpdisk plugin, particularly so you can use
commands like ‘qemu-img create’ or even ‘virt-builder’.
(Actually virt-builder really works - I tested it - but of course it
causes a 30+ second delay when connecting to the server.)
You can now use commands such as:
nbdkit tmpdisk
2010 Jul 21
0
Samba install on AIX
...ONICALIZE_FILE_NAME''@|1|g' -e
's|@''HAVE_DECL_GETLOADAVG''@|1|g' -e 's|@''HAVE_GETSUBOPT''@|1|g' -e
's|@''HAVE_MALLOC_POSIX''@|1|g' -e 's|@''HAVE_MKDTEMP''@|1|g' -e
's|@''HAVE_MKOSTEMP''@|1|g' -e 's|@''HAVE_MKOSTEMPS''@|1|g' -e
's|@''HAVE_MKSTEMPS''@|1|g' -e 's|@''HAVE_RANDOM_H''@|0|g' -e
's|@''HAVE_RANDOM_R''@|1|g' -e 's|@''HAVE_REALLOC_POSIX''@|...
2020 Apr 07
0
[PATCH nbdkit v2] tmpdisk: Pass any parameters as shell variables to the command.
...nother user might be able
+ * to see the temporary file being created and interfere with it
+ * before we reopen it in the plugin below.
+ */
+ if (asprintf (&dir, "%s/tmpdiskXXXXXX", tmpdir) == -1) {
nbdkit_error ("asprintf: %m");
goto error;
}
-
-#ifdef HAVE_MKOSTEMP
- h->fd = mkostemp (disk, O_CLOEXEC);
-#else
- /* Racy, fix your libc. */
- h->fd = mkstemp (disk);
- if (h->fd >= 0) {
- h->fd = set_cloexec (h->fd);
- if (h->fd == -1) {
- int e = errno;
- unlink (disk);
- errno = e;
- }
- }
-#endif
- if (h->f...
2019 Jul 31
13
[nbdkit PATCH 0/8] fd leak safety
There's enough here to need a review; some of it probably needs
backporting to stable-1.12.
This probably breaks tests on Haiku or other platforms that have not
been as on-the-ball about atomic CLOEXEC; feel free to report issues
that arise, and I'll help come up with workarounds (even if we end up
leaving a rare fd leak on less-capable systems).
Meanwhile, I'm still working on my
2020 Apr 08
0
[PATCH nbdkit v3] tmpdisk: Pass any parameters as shell variables to the command.
...nother user might be able
+ * to see the temporary file being created and interfere with it
+ * before we reopen it in the plugin below.
+ */
+ if (asprintf (&dir, "%s/tmpdiskXXXXXX", tmpdir) == -1) {
nbdkit_error ("asprintf: %m");
goto error;
}
-
-#ifdef HAVE_MKOSTEMP
- h->fd = mkostemp (disk, O_CLOEXEC);
-#else
- /* Racy, fix your libc. */
- h->fd = mkstemp (disk);
- if (h->fd >= 0) {
- h->fd = set_cloexec (h->fd);
- if (h->fd == -1) {
- int e = errno;
- unlink (disk);
- errno = e;
- }
- }
-#endif
- if (h->f...
2020 Apr 08
2
[PATCH nbdkit v3] tmpdisk: Generalize the tmpdisk plugin.
v2 was here:
https://www.redhat.com/archives/libguestfs/2020-April/msg00075.html
In v3:
- Add [VAR=VALUE ...] to manual.
- Various minor improvements to the manual.
- Work (at least, in theory - not tested) with block devices or
symlinks. I didn't document this because it's hard to ensure these
files or block devices would be cleaned up, so here be dragons.
- Remove O_NOCTTY.
-
2020 Jul 10
2
[PATCH nbdkit] New filter: gzip
...+ if (compressed_size == -1)
+ return -1;
+
+ /* Create the temporary file. */
+ tmpdir = getenv ("TMPDIR");
+ if (!tmpdir)
+ tmpdir = LARGE_TMPDIR;
+
+ len = strlen (tmpdir) + 8;
+ template = alloca (len);
+ snprintf (template, len, "%s/XXXXXX", tmpdir);
+
+#ifdef HAVE_MKOSTEMP
+ fd = mkostemp (template, O_CLOEXEC);
+#else
+ /* This is only invoked serially with the lock held, so this is safe. */
+ fd = mkstemp (template);
+ if (fd >= 0) {
+ fd = set_cloexec (fd);
+ if (fd < 0) {
+ int e = errno;
+ unlink (template);
+ errno = e;
+ }
+ }...
2020 Mar 17
2
[PATCH nbdkit v3] New tmpdisk plugin.
v2 was here:
https://www.redhat.com/archives/libguestfs/2020-March/msg00154.html
v3:
- Micro-optimize tmpdir.
- Quote $disk in default command shell fragment.
- Don't redirect mkfs output to /dev/null. Instead use
exec </dev/null >/dev/null before the shell fragment.
We may want to do this in other places where we run
external shell scripts, or more generally for all
2020 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh
plugin itself was calling .can_flush twice in some situations (in
order to default .can_fua). Then right after, I regressed it to call
.can_zero twice (in order to default .can_fast_zero). I also missed
that .thread_model could use better caching, because at the time, I
did not add testsuite coverage. Fix that now.
Eric Blake
2020 Aug 15
3
[PATCH EXPERIMENTAL nbdkit 0/2] Port to Windows using mingw.
The patches following do indeed allow you to compile nbdkit.exe, but
it does not actually work yet. I'm posting this experimental series
more as a work in progress and to get feedback.
Note this does not require Windows itself to build or test. You can
cross-compile it using mingw64-* packages on Fedora or Debian, and
test it [spoiler alert: it fails] using Wine.
Rich.
2018 Dec 28
12
[PATCH nbdkit 0/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
This patch series enhances the cache filter in a few ways, primarily
adding a "cache-on-read" feature (similar to qemu's copyonread); and
adding the ability to limit the cache size and the antecedent of that
which is having a method to reclaim cache blocks.
As the cache is stored as a sparse temporary file, reclaiming cache
blocks simply means punching holes in the temporary file.
2011 Jun 07
3
builder-debian febootstrap success d6d144eab55388d4117880f2d3a7e8c2571c9d9a
This is an automatic message generated by the builder on
builder-debian for febootstrap. Log files from the build
follow below.
Linux builder-debian.home.annexia.org 2.6.36-trunk-amd64 #1 SMP Wed Oct 27 14:28:29 UTC 2010 x86_64 GNU/Linux
Tue Jun 7 20:00:01 BST 2011
-----
+ git pull --rebase git://git.annexia.org/git/febootstrap.git master
>From git://git.annexia.org/git/febootstrap
*