search for: guestfs_int_create_socketname

Displaying 16 results from an estimated 16 matches for "guestfs_int_create_socketname".

2016 Feb 02
0
Re: [PATCH 1/3] launch: add internal helper for socket paths creation
...,7 @@ extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen); > extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); > #define APPLIANCE_COMMAND_LINE_IS_TCG 1 > const char *guestfs_int_get_cpu_model (int kvm); > +int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]); I'm sure I read a rant from Linus about how this doesn't actually enforce the array length. However I have tested it, and gcc warns if I pass the wrong array length, so this looks OK. > extern void guestfs_int_reg...
2016 Feb 03
4
[PATCH v2 1/2] launch: add internal helper for socket paths creation
...nal.h @@ -782,6 +782,7 @@ extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen); extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); #define APPLIANCE_COMMAND_LINE_IS_TCG 1 const char *guestfs_int_get_cpu_model (int kvm); +int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]); extern void guestfs_int_register_backend (const char *name, const struct backend_ops *); extern int guestfs_int_set_backend (guestfs_h *g, const char *method); diff --git a/src/launch-direct.c b/src/launch-direct.c index b8e...
2016 Feb 02
6
[PATCH 1/3] launch: add internal helper for socket paths creation
...nal.h @@ -782,6 +782,7 @@ extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen); extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); #define APPLIANCE_COMMAND_LINE_IS_TCG 1 const char *guestfs_int_get_cpu_model (int kvm); +int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]); extern void guestfs_int_register_backend (const char *name, const struct backend_ops *); extern int guestfs_int_set_backend (guestfs_h *g, const char *method); diff --git a/src/launch-direct.c b/src/launch-direct.c index b8e...
2016 Jan 29
0
[PATCH 6/6] launch: avoid too long paths for sockets
....c */ @@ -782,6 +789,7 @@ extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen); extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); #define APPLIANCE_COMMAND_LINE_IS_TCG 1 const char *guestfs_int_get_cpu_model (int kvm); +int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]); extern void guestfs_int_register_backend (const char *name, const struct backend_ops *); extern int guestfs_int_set_backend (guestfs_h *g, const char *method); diff --git a/src/handle.c b/src/handle.c index 947818c..076e3fd...
2016 Feb 03
3
Re: [PATCH 1/3] launch: add internal helper for socket paths creation
...; --- a/src/launch.c > > +++ b/src/launch.c > > @@ -418,6 +418,21 @@ guestfs_int_get_cpu_model (int kvm) > > #endif > > } > > > > +/* Create the path for a socket with the selected filename in the > > + * tmpdir. > > + */ > > +int > > +guestfs_int_create_socketname (guestfs_h *g, const char *filename, > > + char (*sockpath)[UNIX_PATH_MAX]) > > +{ > > + char *path = g->tmpdir; > > + > > + snprintf (*sockpath, UNIX_PATH_MAX-1, "%s/%s", path, filename); > > + (*sockpath)[UNIX_PATH_...
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 Jan 29
1
Re: [PATCH 6/6] launch: avoid too long paths for sockets
...,7 @@ extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen); > extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); > #define APPLIANCE_COMMAND_LINE_IS_TCG 1 > const char *guestfs_int_get_cpu_model (int kvm); > +int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]); > extern void guestfs_int_register_backend (const char *name, const struct backend_ops *); > extern int guestfs_int_set_backend (guestfs_h *g, const char *method); > > diff --git a/src/handle.c b/src/handle.c &gt...
2016 Feb 08
2
Re: [PATCH v2 2/2] New API: get-sockdir
..., 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. > > Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for > debugging. As you saw, there were a few problems with this patch. However I also found something more fundamental. On machines where XDG_RUNTIME_DIR is set to /run/user/$UID,...
2016 Feb 02
0
[PATCH 3/3] New API: get-sockdir
Introduce a new read-only API to get a path where to store temporary sockets: this is different than tmpdir, as we need short paths for sockets (due to sockaddr_un::sun_path), and is either XDG_RUNTIME_DIR if set, or /tmp. Adapt guestfs_int_create_socketname to create sockets in that location, checking whether the resulting path still fits in the limited buffer. Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for debugging. --- fish/guestfish.pod | 11 +++++++++++ generator/actions.ml | 16 ++++++++++++++++ src/guestfs-internal.h |...
2016 Feb 03
0
[PATCH v2 2/2] New API: get-sockdir
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. Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for debugging. --- fish/guestfish.pod | 11 +++++++++++ generator/actions.ml | 16 ++++++++++++++++ src/guestfs-internal.h | 7 ++++++- src/guestfs.pod | 11 +++++++++++ src/handle.c...
2016 Feb 03
0
Re: [PATCH 1/3] launch: add internal helper for socket paths creation
...ch.c > > > @@ -418,6 +418,21 @@ guestfs_int_get_cpu_model (int kvm) > > > #endif > > > } > > > > > > +/* Create the path for a socket with the selected filename in the > > > + * tmpdir. > > > + */ > > > +int > > > +guestfs_int_create_socketname (guestfs_h *g, const char *filename, > > > + char (*sockpath)[UNIX_PATH_MAX]) > > > +{ > > > + char *path = g->tmpdir; > > > + > > > + snprintf (*sockpath, UNIX_PATH_MAX-1, "%s/%s", path, filename); > >...
2016 Feb 09
0
Re: [PATCH v2 2/2] New API: get-sockdir
...+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. > > > > Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for > > debugging. > > As you saw, there were a few problems with this patch. However I also > found something more fundamental. > > On machines whe...
2016 May 16
0
[PATCH] launch: direct: Add DAX root filesystem support.
...fs_int_launch_send_progress (guestfs_h *g, int perdozen); extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); #define APPLIANCE_COMMAND_LINE_IS_TCG 1 +#define APPLIANCE_COMMAND_LINE_USE_ACPI 2 const char *guestfs_int_get_cpu_model (int kvm); int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*sockname)[UNIX_PATH_MAX]); extern void guestfs_int_register_backend (const char *name, const struct backend_ops *); diff --git a/src/launch-direct.c b/src/launch-direct.c index 01b7e07..a005bda 100644 --- a/src/launch-direct.c +++ b/src/launch-direct.c @...
2016 Apr 13
1
[PATCH v2 libguestfs] launch: Implement a safer getumask.
...tmpdir); - debug (g, "launch: umask=0%03o", get_umask (g)); + mask = guestfs_int_getumask (g); + if (mask >= 0) + debug (g, "launch: umask=0%03o", (unsigned) mask); debug (g, "launch: euid=%ju", (uintmax_t) geteuid ()); } @@ -475,40 +476,6 @@ guestfs_int_create_socketname (guestfs_h *g, const char *filename, } /** - * glibc documents, but does not actually implement, a L<getumask(3)> - * call. - * - * This function implements a thread-safe way to get the umask. Note - * this is only called when C<g-E<gt>verbose> is true and after - * C<g-E&...
2016 Apr 14
2
[PATCH v3 libguestfs] launch: Implement a safer getumask.
...tmpdir); - debug (g, "launch: umask=0%03o", get_umask (g)); + mask = guestfs_int_getumask (g); + if (mask >= 0) + debug (g, "launch: umask=0%03o", (unsigned) mask); debug (g, "launch: euid=%ju", (uintmax_t) geteuid ()); } @@ -475,40 +476,6 @@ guestfs_int_create_socketname (guestfs_h *g, const char *filename, } /** - * glibc documents, but does not actually implement, a L<getumask(3)> - * call. - * - * This function implements a thread-safe way to get the umask. Note - * this is only called when C<g-E<gt>verbose> is true and after - * C<g-E&...
2016 Apr 13
3
[PATCH libguestfs] launch: Implement a safer getumask.
...tmpdir); - debug (g, "launch: umask=0%03o", get_umask (g)); + mask = guestfs_int_getumask (g); + if (mask >= 0) + debug (g, "launch: umask=0%03o", (unsigned) mask); debug (g, "launch: euid=%ju", (uintmax_t) geteuid ()); } @@ -475,40 +476,6 @@ guestfs_int_create_socketname (guestfs_h *g, const char *filename, } /** - * glibc documents, but does not actually implement, a L<getumask(3)> - * call. - * - * This function implements a thread-safe way to get the umask. Note - * this is only called when C<g-E<gt>verbose> is true and after - * C<g-E&...