Displaying 15 results from an estimated 15 matches for "free_bind_st".
2016 Jan 21
0
[PATCH v3 1/6] daemon: Rename daemon/command.c -> daemon/sh.c.
...uot;
-#include "daemon.h"
-#include "actions.h"
-
-#include "ignore-value.h"
-
-GUESTFSD_EXT_CMD(str_cp, cp);
-GUESTFSD_EXT_CMD(str_mount, mount);
-GUESTFSD_EXT_CMD(str_umount, umount);
-
-#ifdef HAVE_ATTRIBUTE_CLEANUP
-#define CLEANUP_BIND_STATE __attribute__((cleanup(free_bind_state)))
-#define CLEANUP_RESOLVER_STATE __attribute__((cleanup(free_resolver_state)))
-#else
-#define CLEANUP_BIND_STATE
-#define CLEANUP_RESOLVER_STATE
-#endif
-
-struct bind_state {
- bool mounted;
- char *sysroot_dev;
- char *sysroot_dev_pts;
- char *sysroot_proc;
- char *sysroot_selinux;
-...
2015 Nov 19
5
[PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...9,10 @@ do_command (char *const *argv)
return NULL;
}
+ flags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | fd;
+
CHROOT_IN;
- r = commandv (&out, &err, (const char * const *) argv);
+ r = commandvf (&out, &err, flags, (const char * const *) argv);
CHROOT_OUT;
free_bind_state (&bind_state);
--
2.1.0
2015 Dec 02
3
[PATCH] daemon: improve internal commandrvf
...etwork) {
@@ -279,11 +268,9 @@ do_command (char *const *argv)
return NULL;
}
- flags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | dev_null_fd;
+ flags = COMMAND_FLAG_DO_CHROOT;
- CHROOT_IN;
r = commandvf (&out, &err, flags, (const char * const *) argv);
- CHROOT_OUT;
free_bind_state (&bind_state);
free_resolver_state (&resolver_state);
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 7fbb2a2..af6f68c 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -128,6 +128,7 @@ extern char **empty_list (void);
#define COMMAND_FLAG_FD_MASK (1024-1)...
2015 Nov 20
0
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...rn NULL;
> }
>
> + flags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | fd;
> +
> CHROOT_IN;
> - r = commandv (&out, &err, (const char * const *) argv);
> + r = commandvf (&out, &err, flags, (const char * const *) argv);
> CHROOT_OUT;
>
> free_bind_state (&bind_state);
Looks good. How about naming the variable 'dev_null_fd' or something,
so we know it's not just a temporary file descriptor variable?
Anyway, ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and vi...
2015 Dec 02
0
Re: [PATCH] daemon: improve internal commandrvf
...*argv)
> return NULL;
> }
>
> - flags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | dev_null_fd;
> + flags = COMMAND_FLAG_DO_CHROOT;
>
> - CHROOT_IN;
> r = commandvf (&out, &err, flags, (const char * const *) argv);
> - CHROOT_OUT;
>
> free_bind_state (&bind_state);
> free_resolver_state (&resolver_state);
> diff --git a/daemon/daemon.h b/daemon/daemon.h
> index 7fbb2a2..af6f68c 100644
> --- a/daemon/daemon.h
> +++ b/daemon/daemon.h
> @@ -128,6 +128,7 @@ extern char **empty_list (void);
> #define COMMAND_FLAG_...
2015 Dec 01
0
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...lags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | fd;
> > +
> > CHROOT_IN;
> > - r = commandv (&out, &err, (const char * const *) argv);
> > + r = commandvf (&out, &err, flags, (const char * const *) argv);
> > CHROOT_OUT;
> >
> > free_bind_state (&bind_state);
>
> According to the analysis in
> https://bugzilla.redhat.com/show_bug.cgi?id=1280029 the problem was that
> the target program was being executed in a chroot which did not have
> /dev/null populated, hence the open in commandrvf failed and the process
> wa...
2014 Jan 28
3
[PATCH 1/2] daemon: If /selinux exists in the guest, bind-mount /sys/fs/selinux to there.
...selinux_ok = r != -1;
r = command (NULL, NULL, str_mount, "--bind", "/sys", bs->sysroot_sys, NULL);
bs->sys_ok = r != -1;
r = command (NULL, NULL, str_mount, "--bind", "/sys/fs/selinux", bs->sysroot_sys_fs_selinux, NULL);
@@ -121,6 +129,8 @@ free_bind_state (struct bind_state *bs)
free (bs->sysroot_sys_fs_selinux);
if (bs->sys_ok) umount_ignore_fail (bs->sysroot_sys);
free (bs->sysroot_sys);
+ if (bs->selinux_ok) umount_ignore_fail (bs->sysroot_selinux);
+ free (bs->sysroot_selinux);
if (bs->proc_ok...
2015 Dec 01
1
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...}
>
nit: same.
> + flags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | fd;
> +
> CHROOT_IN;
> - r = commandv (&out, &err, (const char * const *) argv);
> + r = commandvf (&out, &err, flags, (const char * const *) argv);
> CHROOT_OUT;
>
> free_bind_state (&bind_state);
According to the analysis in
https://bugzilla.redhat.com/show_bug.cgi?id=1280029 the problem was that
the target program was being executed in a chroot which did not have
/dev/null populated, hence the open in commandrvf failed and the process
was left without fd 0.
commandr...
2014 Jan 24
2
[PATCH 0/2] Implement virt-builder --selinux-relabel option.
Do SELinux relabelling properly.
2015 Dec 05
6
[PATCH 0/6 v2] [FOR COMMENTS ONLY] Rework inspection.
This is a more working version. Inspection (partially) succeeds on a
real guest this time :-)
You can test it out on a real guest (in this case, a CentOS disk image
located at /tmp/centos-6.img) by doing:
$ ./run guestfish -v -x -a /tmp/centos-6.img
><fs> run
><fs> debug sh "guestfs-inspection --verbose"
which will print lots of debugging, and at the end the
2016 Jan 21
8
[PATCH v3 0/6] [FOR COMMENTS ONLY] Rework inspection.
For background on this change, see:
https://rwmj.wordpress.com/2015/12/06/inspection-now-with-added-prolog/
v2 was previously posted here:
https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html
To test this patch series on a real guest, you can do:
$ ./run guestfish -v -x -a /var/tmp/centos-6.img
><fs> run
><fs> debug sh "guestfs-inspection
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...08be0 100644
--- a/daemon/sh.c
+++ b/daemon/sh.c
@@ -32,10 +32,6 @@
#include "ignore-value.h"
-GUESTFSD_EXT_CMD(str_cp, cp);
-GUESTFSD_EXT_CMD(str_mount, mount);
-GUESTFSD_EXT_CMD(str_umount, umount);
-
#ifdef HAVE_ATTRIBUTE_CLEANUP
#define CLEANUP_BIND_STATE __attribute__((cleanup(free_bind_state)))
#define CLEANUP_RESOLVER_STATE __attribute__((cleanup(free_resolver_state)))
@@ -100,20 +96,20 @@ bind_mount (struct bind_state *bs)
* However I have not found a reliable way to unmount the same set
* of directories (umount -R does NOT work).
*/
- r = command (NULL, NULL, str_mo...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...ot;ignore-value.h"
-GUESTFSD_EXT_CMD(str_cp, cp);
-GUESTFSD_EXT_CMD(str_mount, mount);
-GUESTFSD_EXT_CMD(str_umount, umount);
+DECLARE_EXTERNAL_COMMANDS ("cp", "mount", "umount")
#ifdef HAVE_ATTRIBUTE_CLEANUP
#define CLEANUP_BIND_STATE __attribute__((cleanup(free_bind_state)))
@@ -100,20 +98,20 @@ bind_mount (struct bind_state *bs)
* However I have not found a reliable way to unmount the same set
* of directories (umount -R does NOT work).
*/
- r = command (NULL, NULL, str_mount, "--bind", "/dev", bs->sysroot_dev, NULL);
+ r = c...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option
‘./guestfsd --print-external-commands’