search for: tmpdiskxxxxxx

Displaying 10 results from an estimated 10 matches for "tmpdiskxxxxxx".

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
2020 Apr 07
0
[PATCH nbdkit v2] tmpdisk: Pass any parameters as shell variables to the command.
...stat statbuf; h = malloc (sizeof *h); if (h == NULL) { @@ -228,36 +264,25 @@ tmpdisk_open (int readonly) goto error; } h->fd = -1; + h->size = -1; h->can_punch_hole = true; - /* Create the new disk image for this connection. */ - if (asprintf (&disk, "%s/tmpdiskXXXXXX", tmpdir) == -1) { + /* For security reasons we have to create a temporary directory + * under tmpdir that only the current user can access. If we + * created it in a shared directory then another user might be able + * to see the temporary file being created and interfere with it +...
2020 Apr 08
0
[PATCH nbdkit v3] tmpdisk: Pass any parameters as shell variables to the command.
...stat statbuf; h = malloc (sizeof *h); if (h == NULL) { @@ -228,36 +292,25 @@ tmpdisk_open (int readonly) goto error; } h->fd = -1; + h->size = -1; h->can_punch_hole = true; - /* Create the new disk image for this connection. */ - if (asprintf (&disk, "%s/tmpdiskXXXXXX", tmpdir) == -1) { + /* For security reasons we have to create a temporary directory + * under tmpdir that only the current user can access. If we + * created it in a shared directory then another user might be able + * to see the temporary file being created and interfere with it +...
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 Apr 09
0
[PATCH nbdkit v2 3/3] tmpdisk: Implement this plugin using fileops.
...} - h->fd = -1; - h->size = -1; - h->can_punch_hole = true; /* For security reasons we have to create a temporary directory * under tmpdir that only the current user can access. If we @@ -303,20 +251,20 @@ tmpdisk_open (int readonly) */ if (asprintf (&dir, "%s/tmpdiskXXXXXX", tmpdir) == -1) { nbdkit_error ("asprintf: %m"); - goto error; + goto error0; } if (mkdtemp (dir) == NULL) { nbdkit_error ("%s: %m", dir); - goto error; + goto error0; } if (asprintf (&disk, "%s/disk", dir) == -1) { nbdk...
2020 Mar 17
0
Re: [PATCH nbdkit v2] New tmpdisk plugin.
...h = malloc (sizeof *h); > + if (h == NULL) { > + nbdkit_error ("malloc: %m"); > + goto error; > + } > + h->fd = -1; > + h->can_punch_hole = true; > + > + /* Create the new disk image for this connection. */ > + if (asprintf (&disk, "%s/tmpdiskXXXXXX", tmpdir) == -1) { [2]...here, a user-supplied TMPDIR may require shell-quoting at the points above. > + nbdkit_error ("asprintf: %m"); > + goto error; > + } > + > + h->fd = mkstemp (disk); [3]...ouch - we are not using mkostemp() to atomically set FD_CL...
2020 Mar 17
2
[PATCH nbdkit v2] New tmpdisk plugin.
...ir) + tmpdir = "/var/tmp"; + + h = malloc (sizeof *h); + if (h == NULL) { + nbdkit_error ("malloc: %m"); + goto error; + } + h->fd = -1; + h->can_punch_hole = true; + + /* Create the new disk image for this connection. */ + if (asprintf (&disk, "%s/tmpdiskXXXXXX", tmpdir) == -1) { + nbdkit_error ("asprintf: %m"); + goto error; + } + + h->fd = mkstemp (disk); + if (h->fd == -1) { + nbdkit_error ("mkstemp: %m"); + goto error; + } + + /* Truncate the disk to a sparse file of the right size. */ + if (ftruncate (...
2020 Mar 16
1
[PATCH nbdkit] New tmpdisk plugin.
Unfinished (needs tests). This is my attempt to make a "remote tmpfs" plugin as outlined in this prior email: https://www.redhat.com/archives/libguestfs/2020-March/msg00134.html Although it would be possible to construct something a bit like this using existing plugins and filters (perhaps with some new features in those filters) I think it may be nicer to have a dedicated plugin for
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 Apr 09
6
[PATCH nbdkit v2 0/3] Implement fileops.
Needs some work still, see in particular the commit message for patch 3. Rich.