Displaying 17 results from an estimated 17 matches for "guestfs_int_lazy_make_sockdir".
2016 Jan 29
0
[PATCH 6/6] launch: avoid too long paths for sockets
...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 +789,7 @@ extern void guestfs_int_launch_send_progress (guest...
2016 Feb 02
0
[PATCH 3/3] New API: get-sockdir
...l_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_set_env_runtimedir (guestfs_h *g, const char *runtimedir);
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 */
diff --git a/src/handle.c b/src/handle.c
index 947818c..25d3c99 100644...
2016 Feb 03
0
[PATCH v2 2/2] New API: get-sockdir
...l_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_set_env_runtimedir (guestfs_h *g, const char *runtimedir);
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 */
diff --git a/src/guestfs.pod b/src/guestfs.pod
index a82d060..2a199c0 1...
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 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 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 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 Jan 29
1
Re: [PATCH 6/6] launch: avoid too long paths for sockets
...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 +789,7 @@ extern void guestfs_i...
2016 May 12
0
[PATCH 3/4] appliance: Move code for creating supermin appliance directory to tmpdirs.c.
...a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -758,6 +758,7 @@ extern int guestfs_int_set_env_tmpdir (guestfs_h *g, const char *tmpdir);
extern int guestfs_int_set_env_runtimedir (guestfs_h *g, const char *runtimedir);
extern int guestfs_int_lazy_make_tmpdir (guestfs_h *g);
extern int guestfs_int_lazy_make_sockdir (guestfs_h *g);
+extern char *guestfs_int_lazy_make_supermin_appliance_dir (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);
diff --git a/src/t...
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
2018 Feb 07
1
[PATCH] tmpdirs: Make the ‘su broken’ error message actionable.
...13 +223,13 @@ lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest)
int
guestfs_int_lazy_make_tmpdir (guestfs_h *g)
{
- return lazy_make_tmpdir (g, guestfs_get_tmpdir, &g->tmpdir);
+ return lazy_make_tmpdir (g, guestfs_get_tmpdir, 0, &g->tmpdir);
}
int
guestfs_int_lazy_make_sockdir (guestfs_h *g)
{
- return lazy_make_tmpdir (g, guestfs_get_sockdir, &g->sockdir);
+ return lazy_make_tmpdir (g, guestfs_get_sockdir, 1, &g->sockdir);
}
/**
--
2.13.2
2016 May 12
0
[PATCH 2/4] src/tmpdirs.c: Add internal documentation.
...during launch.
+/**
+ * The C<g-E<gt>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.
*/
int
guestfs_int_lazy_make_tmpdir (guestfs_h *g)
@@ -192,10 +212,13 @@ guestfs_int_lazy_make_sockdir (guestfs_h *g)
return lazy_make_tmpdir (g, guestfs_get_sockdir, &g->sockdir);
}
-/* Recursively remove a temporary directory. If removal fails, just
+/**
+ * Recursively remove a temporary directory. If removal fails, just
* return (it's a temporary directory so it'll event...
2016 Feb 09
2
[PATCH 1/2] tmpdirs: centralize permissions handling
...e same user.
+ */
+ if (geteuid () == 0 && chmod (tmppath, 0755) == -1) {
+ perrorf (g, "chmod: %s", tmppath);
+ free (tmppath);
+ return -1;
+ }
*dest = tmppath;
}
return 0;
@@ -178,24 +189,7 @@ guestfs_int_lazy_make_tmpdir (guestfs_h *g)
int
guestfs_int_lazy_make_sockdir (guestfs_h *g)
{
- int ret;
- uid_t euid = geteuid ();
-
- ret = lazy_make_tmpdir (g, guestfs_get_sockdir, &g->sockdir);
- if (ret == -1)
- return ret;
-
- if (euid == 0) {
- /* Allow qemu (which may be running as qemu.qemu) to read the socket
- * temporary directory. (RHBZ#...
2016 Oct 31
1
[PATCH] handle: Improve error messaging if XDG_RUNTIME_DIR path does not exist.
...h *g, const char *runtimedir);
+extern int guestfs_int_set_env_tmpdir (guestfs_h *g, const char *envname, const char *tmpdir);
+extern int guestfs_int_set_env_runtimedir (guestfs_h *g, const char *envname, const char *runtimedir);
extern int guestfs_int_lazy_make_tmpdir (guestfs_h *g);
extern int guestfs_int_lazy_make_sockdir (guestfs_h *g);
extern char *guestfs_int_lazy_make_supermin_appliance_dir (guestfs_h *g);
diff --git a/src/handle.c b/src/handle.c
index b28a1e0..0796015 100644
--- a/src/handle.c
+++ b/src/handle.c
@@ -218,7 +218,7 @@ parse_environment (guestfs_h *g,
}
str = do_getenv (data, "TMPDIR&...
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.
2017 Sep 19
7
[PATCH 0/6] Various clean ups in lib/
Miscellaneous small cleanups in lib/ directory.
Rich.
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