Displaying 11 results from an estimated 11 matches for "lazy_make_tmpdir".
2018 Feb 07
1
[PATCH] tmpdirs: Make the ‘su broken’ error message actionable.
...rror message.
---
lib/tmpdirs.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/tmpdirs.c b/lib/tmpdirs.c
index bda3ee694..804c58be0 100644
--- a/lib/tmpdirs.c
+++ b/lib/tmpdirs.c
@@ -180,18 +180,22 @@ guestfs_impl_get_sockdir (guestfs_h *g)
}
static int
-lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest)
+lazy_make_tmpdir (guestfs_h *g,
+ char *(*getdir) (guestfs_h *g), int is_runtime_dir,
+ char **dest)
{
if (!*dest) {
CLEANUP_FREE char *tmpdir = getdir (g);
char *tmppath = safe_asprintf (g,...
2016 Feb 09
2
[PATCH 1/2] tmpdirs: centralize permissions handling
Move to lazy_make_tmpdir the logic for making world-readable (but only
for root) newly-created temporary directories, removing the non-fatal
code doing that in guestfs_impl_launch.
Followup of commit 772f649e595d202bdb67f05aeb62157c1104be89.
---
src/launch.c | 7 -------
src/tmpdirs.c | 30 ++++++++++++-----------------...
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
2016 Feb 02
0
[PATCH 3/3] New API: get-sockdir
...+
]
(* 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 02
0
[PATCH 2/3] lib: extract lazy tmpdir creation helper
...+++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/tmpdirs.c b/src/tmpdirs.c
index 9154d8b..2ae9c74 100644
--- a/src/tmpdirs.c
+++ b/src/tmpdirs.c
@@ -119,6 +119,22 @@ guestfs_impl_get_cachedir (guestfs_h *g)
return safe_strdup (g, str);
}
+static int
+lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest)
+{
+ if (!*dest) {
+ CLEANUP_FREE char *tmpdir = getdir (g);
+ char *tmppath = safe_asprintf (g, "%s/libguestfsXXXXXX", tmpdir);
+ if (mkdtemp (tmppath) == NULL) {
+ perrorf (g, _("%s: cannot create temporary...
2016 May 12
0
[PATCH 2/4] src/tmpdirs.c: Add internal documentation.
...* Note this actually calculates the sockdir, so it never returns NULL. */
+/**
+ * Implements the C<guestfs_get_sockdir> API.
+ *
+ * Note this actually calculates the sockdir, so it never returns
+ * C<NULL>.
+ */
char *
guestfs_impl_get_sockdir (guestfs_h *g)
{
@@ -176,9 +195,10 @@ lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest)
return 0;
}
-/* The g->tmpdir (per-handle temporary directory) is not created when
- * the handle is created. Instead we create it lazily before the
- * first time it is used, or during launch.
+/**
+ * The C<g-E<gt>tmpd...
2016 Feb 03
0
[PATCH v2 2/2] New API: get-sockdir
...+
]
(* 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 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 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.
>
>
2017 Dec 18
0
[PATCH] tmpdirs: Blame systemd because su is broken.
....c b/lib/tmpdirs.c
index 605bf90fb..bda3ee694 100644
--- a/lib/tmpdirs.c
+++ b/lib/tmpdirs.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <libintl.h>
@@ -185,7 +186,12 @@ lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest)
CLEANUP_FREE char *tmpdir = getdir (g);
char *tmppath = safe_asprintf (g, "%s/libguestfsXXXXXX", tmpdir);
if (mkdtemp (tmppath) == NULL) {
- perrorf (g, _("%s: cannot create temporary directory"), tm...
2016 May 12
7
[PATCH 0/4] lib: qemu: Memoize qemu feature detection.
Doing qemu feature detection in the direct backend takes ~100ms
because we need to run `qemu -help' and `qemu -devices ?', and each of
those interacts with glibc's very slow link loader.
Fixing the link loader is really hard. Instead memoize the
output of those two commands.
This patch series first separates all the code dealing with qemu into
a separate module (src/qemu.c) and