search for: guestfs_int_lazy_make_tmpdir

Displaying 20 results from an estimated 63 matches for "guestfs_int_lazy_make_tmpdir".

2016 Dec 11
3
[PATCH 0/2] generic function for temporary path generation
Cosmetic change as suggested in this previous patch: https://www.redhat.com/archives/libguestfs/2016-November/msg00111.html Matteo Cafasso (2): lib: generic function for temporary path generation lib: use guestfs_int_make_temp_path to generate temporary files src/drives.c | 5 ++--- src/file.c | 22 +++++++++------------- src/guestfs-internal.h | 1 + src/journal.c
2016 Dec 11
0
[PATCH 2/2] lib: use guestfs_int_make_temp_path to generate temporary files
...| 17 ++--------------- 4 files changed, 15 insertions(+), 33 deletions(-) diff --git a/src/drives.c b/src/drives.c index 1e3b0af..1e04f81 100644 --- a/src/drives.c +++ b/src/drives.c @@ -421,7 +421,8 @@ create_drive_dev_null (guestfs_h *g, data->format = "raw"; } - if (guestfs_int_lazy_make_tmpdir (g) == -1) + tmpfile = guestfs_int_make_temp_path (g, "devnull"); + if (tmpfile == NULL) return NULL; /* Because we create a special file, there is no point forcing qemu @@ -429,8 +430,6 @@ create_drive_dev_null (guestfs_h *g, */ data->readonly = false; - tmpfile =...
2017 Sep 20
1
Re: [PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...y, 19 September 2017 13:38:27 CEST Richard W.M. Jones wrote: > diff --git a/lib/command.c b/lib/command.c > index bc469de59..7018c3ac0 100644 > --- a/lib/command.c > +++ b/lib/command.c > @@ -815,8 +815,9 @@ guestfs_int_cmd_pipe_run (struct command *cmd, const char *mode) > if (guestfs_int_lazy_make_tmpdir (cmd->g) == -1) > goto error; > > - cmd->error_file = > - safe_asprintf (cmd->g, "%s/cmderr.%d", cmd->g->tmpdir, ++cmd->g->unique); > + cmd->error_file = guestfs_int_make_temp_path (cmd->g, "cmderr", "txt"); > +...
2017 Sep 19
0
[PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...stfs_int_cmd_add_arg (copycmd, varsfile); guestfs_int_cmd_add_arg (copycmd, varst); diff --git a/lib/command.c b/lib/command.c index bc469de59..7018c3ac0 100644 --- a/lib/command.c +++ b/lib/command.c @@ -815,8 +815,9 @@ guestfs_int_cmd_pipe_run (struct command *cmd, const char *mode) if (guestfs_int_lazy_make_tmpdir (cmd->g) == -1) goto error; - cmd->error_file = - safe_asprintf (cmd->g, "%s/cmderr.%d", cmd->g->tmpdir, ++cmd->g->unique); + cmd->error_file = guestfs_int_make_temp_path (cmd->g, "cmderr", "txt"); + if (!cmd->error_file) +...
2016 Sep 17
0
[PATCH 4/4] TSK: small refactoring
...t guestfs_tsk_dirent_list *); +static char *make_temp_file (guestfs_h *, const char *); struct guestfs_tsk_dirent_list * guestfs_impl_filesystem_walk (guestfs_h *g, const char *mountable) { int ret = 0; - CLEANUP_FCLOSE FILE *fp = NULL; CLEANUP_UNLINK_FREE char *tmpfile = NULL; - ret = guestfs_int_lazy_make_tmpdir (g); - if (ret < 0) - return NULL; - - tmpfile = safe_asprintf (g, "%s/filesystem_walk%d", g->tmpdir, ++g->unique); + tmpfile = make_temp_file (g, "filesystem_walk"); ret = guestfs_internal_filesystem_walk (g, mountable, tmpfile); if (ret < 0) retur...
2016 Sep 17
7
[PATCH 0/4] New API - find_block
This series is ready for review but requires the previous one to be merged first: https://www.redhat.com/archives/libguestfs/2016-September/msg00101.html The find_block API allows the User to search all the filesystem entries referring to a given data block and returns a tsk_dirent structure for each of them. Use case examples: - Check whether a block containing a deleted file has been re-used
2017 Sep 19
7
[PATCH 0/6] Various clean ups in lib/
Miscellaneous small cleanups in lib/ directory. Rich.
2016 Feb 02
6
[PATCH 1/3] launch: add internal helper for socket paths creation
Introduce an internal helper to create paths for sockets; will be useful for changing later the logic for placing sockets. --- src/guestfs-internal.h | 1 + src/launch-direct.c | 4 +++- src/launch-libvirt.c | 10 ++++++---- src/launch.c | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index
2017 Sep 20
7
[PATCH v2] 0/6] Various clean ups in lib/
v1 -> v2: - Remove the unnecessary calls to guestfs_int_lazy_make_tmpdir in the final patch. Rich.
2016 Feb 02
0
[PATCH 3/3] New API: get-sockdir
...t." }; + ] (* daemon_functions are any functions which cause some action diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index bff9f64..6e441e4 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -434,8 +434,10 @@ struct guestfs_h * handle, you have to call guestfs_int_lazy_make_tmpdir. */ char *tmpdir; - /* Environment variables that affect tmpdir/cachedir locations. */ + char *sockdir; + /* Environment variables that affect tmpdir/cachedir/sockdir locations. */ char *env_tmpdir; /* $TMPDIR (NULL if not set) */ + char *env_runtimedir; /* $XDG_RU...
2016 May 18
1
[PATCH] drives: force format=raw for /dev/null dummy drives
...) { + error (g, _("for device '/dev/null', format must be 'raw'")); + return NULL; + } + } else { + /* Manual set format=raw for /dev/null drives, if that was not + * already manually specified. */ + data->format = "raw"; } if (guestfs_int_lazy_make_tmpdir (g) == -1) -- 2.5.5
2016 May 18
1
[PATCH v2] drives: force format=raw for /dev/null dummy drives
...) { + error (g, _("for device '/dev/null', format must be 'raw'")); + return NULL; + } + } else { + /* Manual set format=raw for /dev/null drives, if that was not + * already manually specified. */ + data->format = "raw"; } if (guestfs_int_lazy_make_tmpdir (g) == -1) -- 2.5.5
2016 Feb 03
0
[PATCH v2 2/2] New API: get-sockdir
...t." }; + ] (* daemon_functions are any functions which cause some action diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index bff9f64..6e441e4 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -434,8 +434,10 @@ struct guestfs_h * handle, you have to call guestfs_int_lazy_make_tmpdir. */ char *tmpdir; - /* Environment variables that affect tmpdir/cachedir locations. */ + char *sockdir; + /* Environment variables that affect tmpdir/cachedir/sockdir locations. */ char *env_tmpdir; /* $TMPDIR (NULL if not set) */ + char *env_runtimedir; /* $XDG_RU...
2016 Feb 09
2
[PATCH 1/2] tmpdirs: centralize permissions handling
...rc/launch.c | 7 ------- src/tmpdirs.c | 30 ++++++++++++------------------ 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/src/launch.c b/src/launch.c index 9273c58..958d4b3 100644 --- a/src/launch.c +++ b/src/launch.c @@ -60,13 +60,6 @@ guestfs_impl_launch (guestfs_h *g) if (guestfs_int_lazy_make_tmpdir (g) == -1) return -1; - /* Allow anyone to read the temporary directory. The socket in this - * directory won't be readable but anyone can see it exists if they - * want. (RHBZ#610880). - */ - if (chmod (g->tmpdir, 0755) == -1) - warning (g, "chmod: %s: %m (ignored)&q...
2016 Feb 03
4
[PATCH v2 1/2] launch: add internal helper for socket paths creation
Introduce an internal helper to create paths for sockets -- will be useful for changing later the logic for placing sockets. Futhermore, check that the length of sockets won't overflow the buffer for their filenames. --- src/guestfs-internal.h | 1 + src/launch-direct.c | 4 +++- src/launch-libvirt.c | 10 ++++++---- src/launch.c | 17 +++++++++++++++++ 4 files changed, 27
2016 Jan 29
0
[PATCH 6/6] launch: avoid too long paths for sockets
.../* Error handler, plus stack of old error handlers. */ guestfs_error_handler_cb error_cb; @@ -758,7 +763,9 @@ extern void guestfs_int_call_callbacks_array (guestfs_h *g, uint64_t event, cons /* tmpdirs.c */ extern int guestfs_int_set_env_tmpdir (guestfs_h *g, const char *tmpdir); extern int guestfs_int_lazy_make_tmpdir (guestfs_h *g); +extern int guestfs_int_lazy_make_sockdir (guestfs_h *g); extern void guestfs_int_remove_tmpdir (guestfs_h *g); +extern void guestfs_int_remove_sockdir (guestfs_h *g); extern void guestfs_int_recursive_remove_dir (guestfs_h *g, const char *dir); /* whole-file.c */ @@ -782,6 +78...
2016 Jan 29
7
[PATCH 1/6] launch: unix: check for length of sockets
Error out early if the path to the socket will not fit into sockaddr_un::sun_path, as we will not be able to connect to it. --- src/launch-unix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/launch-unix.c b/src/launch-unix.c index 740c554..973e14b 100644 --- a/src/launch-unix.c +++ b/src/launch-unix.c @@ -47,6 +47,12 @@ launch_unix (guestfs_h *g, void *datav, const char
2016 Feb 08
2
Re: [PATCH v2 2/2] New API: get-sockdir
On Wed, Feb 03, 2016 at 01:17:42PM +0100, Pino Toscano wrote: > Introduce a new read-only API to get a path where to store temporary > sockets: this is different from tmpdir, as we need short paths for > sockets (due to sockaddr_un::sun_path), and it is either > XDG_RUNTIME_DIR if set, or /tmp; adapt guestfs_int_create_socketname > to create sockets in that location. > >
2016 Sep 19
5
[PATCH v7 0/4] New API - find_inode
v7: - Merge src/tsk.c refactoring patch with #4 of find_block series Matteo Cafasso (4): lib: logic refactoring New API: internal_find_inode New API: find_inode find_inode: added API tests daemon/tsk.c | 52 ++++++++++++++++++++++++++++++++++ generator/actions.ml | 21 ++++++++++++++ src/MAX_PROC_NR | 2 +- src/tsk.c | 52
2016 Apr 04
2
Re: [PATCH v2 4/5] appliance: Added filesystem_walk command
...dirent *dirent); > + > +struct guestfs_tsk_dirent_list * > +guestfs_impl_filesystem_walk (guestfs_h *g, const char *mountable) > +{ > + int ret = 0; > + size_t size = 0; > + CLEANUP_FREE char *buf = NULL; > + CLEANUP_UNLINK_FREE char *tmpfile = NULL; > + > + ret = guestfs_int_lazy_make_tmpdir (g); > + if (ret < 0) > + return NULL; > + > + tmpfile = safe_asprintf (g, "%s/filesystem_walk%d", g->tmpdir, ++g->unique); > + > + ret = guestfs_internal_filesystem_walk (g, mountable, tmpfile); > + if (ret < 0) > + return NULL; > + > +...