search for: commandvf

Displaying 20 results from an estimated 24 matches for "commandvf".

Did you mean: commandv
2015 Feb 18
1
[PATCH] Fix a bug in e2fsck execution code
Use commandrvf() instead of commandvf() to execute e2fsck. A non-zero exit status does not always indicate a failure. Signed-off-by: Nikos Skalkotos <skalkoto@grnet.gr> --- daemon/ext2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/ext2.c b/daemon/ext2.c index 65ddae6..8ef6d5f 100644 --- a/da...
2015 Dec 01
2
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
On Tue, Dec 01, 2015 at 03:59:56PM +0100, Mateusz Guzik wrote: > CHROOT_IN/OUT around commandvf are definitely problematic. chroot should be > done in the child, which also removes the need to chroot out in the > parent. The CHROOT_IN/OUT business does need to be rewritten. Every instance where we currently do something like: CHROOT_IN; r = stat (fd, &statbuf); CHROOT_OUT...
2015 Nov 19
5
[PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
..._mount (&bind_state) == -1) return NULL; if (enable_network) { @@ -266,8 +279,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 01
0
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
On Tue, Dec 01, 2015 at 04:58:11PM +0000, Richard W.M. Jones wrote: > On Tue, Dec 01, 2015 at 03:59:56PM +0100, Mateusz Guzik wrote: > > CHROOT_IN/OUT around commandvf are definitely problematic. chroot should be > > done in the child, which also removes the need to chroot out in the > > parent. > > The CHROOT_IN/OUT business does need to be rewritten. Every > instance where we currently do something like: > > CHROOT_IN; > r =...
2015 Dec 01
1
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...nable_network) { > @@ -266,8 +279,10 @@ do_command (char *const *argv) > return NULL; > } > 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...
2016 Jan 21
0
[PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
...(s = va_arg (args, char *)) != NULL) { + const char **p = realloc (argv, sizeof (char *) * (++i)); + if (p == NULL) { + perror ("realloc"); + va_end (args); + return -1; + } + argv = p; + argv[i-2] = s; + argv[i-1] = NULL; + } + + va_end (args); + + r = commandvf (stdoutput, stderror, flags, (const char * const*) argv); + + return r; +} + +/* Same as 'command', but we allow the status code from the + * subcommand to be non-zero, and return that status code. + * We still return -1 if there was some other error. + */ +int +commandrf (char **stdoutput...
2016 Jan 26
2
[PATCH] daemon: fold xfs_admin stdout to stderr
...insertion(+), 1 deletion(-) diff --git a/daemon/xfs.c b/daemon/xfs.c index abc2736..7f72e6a 100644 --- a/daemon/xfs.c +++ b/daemon/xfs.c @@ -537,7 +537,7 @@ do_xfs_admin (const char *device, ADD_ARG (argv, i, device); ADD_ARG (argv, i, NULL); - r = commandv (NULL, &err, argv); + r = commandvf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, argv); if (r == -1) { reply_with_error ("%s: %s", device, err); return -1; -- 2.5.0
2012 Dec 14
1
[PATCH] daemon: Add sentinel attribute to commandf and commandrf
...const char *name, ...); + const char *name, ...) __attribute__((sentinel)); extern int commandrf (char **stdoutput, char **stderror, int flags, - const char *name, ...); + const char *name, ...) __attribute__((sentinel)); extern int commandvf (char **stdoutput, char **stderror, int flags, char const *const *argv); extern int commandrvf (char **stdoutput, char **stderror, int flags, -- 1.7.11.7
2014 Nov 24
1
[PATCH] ntfsresize: Capture errors sent to stdout (RHBZ#1166618).
...diff --git a/daemon/ntfs.c b/daemon/ntfs.c index aef45a2..762ca88 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -94,7 +94,7 @@ do_ntfsresize (const char *device, int64_t size, int force) ADD_ARG (argv, i, device); ADD_ARG (argv, i, NULL); - r = commandv (NULL, &err, argv); + r = commandvf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, argv); if (r == -1) { reply_with_error ("%s: %s", device, err); return -1; -- 2.1.0
2015 Dec 01
0
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...} > > > > nit: same. Both these leaks need to be fixed, thanks for reporting them. > > + 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 exec...
2015 Dec 02
3
[PATCH] daemon: improve internal commandrvf
...ULL; - } - if (bind_mount (&bind_state) == -1) return NULL; if (enable_network) { @@ -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 @@...
2015 Dec 01
2
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...er, do_command sets up /etc/resolv.conf for the "guest". My argument is that executing linux binaries in an environment without properly populated /dev is a recipe for trouble and will one day come back with weird failures or improperly constructed images. > > CHROOT_IN/OUT around commandvf are definitely problematic. chroot should be > > done in the child, which also removes the need to chroot out in the > > parent. > > That could be another way to make the command* functions in the daemon > safer, which wouldn't solve the issue of this email thread: even if...
2009 Nov 09
1
[PATCH libguestfs] indent with spaces, not TABs
...int commandf (char **stdoutput, char **stderror, int flags, - const char *name, ...); + const char *name, ...); extern int commandrf (char **stdoutput, char **stderror, int flags, - const char *name, ...); + const char *name, ...); extern int commandvf (char **stdoutput, char **stderror, int flags, char const *const *argv); extern int commandrvf (char **stdoutput, char **stderror, int flags, - char const* const *argv); + char const* const *argv); extern char **split_lines (char *str); diff...
2015 Nov 20
0
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...> if (enable_network) { > @@ -266,8 +279,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); 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. --...
2015 Dec 01
0
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...zilla.redhat.com/1195881). > Filesystems in the container would not be fully populated (see: /dev/mem > & friends), but only have 'container-friendly' files. > > That's definitely a lot of work and I'm not up to the task. Right - patches welcome! > Regardless, commandvf vs chroot usage can be improved without said > significant work. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a...
2015 Dec 02
0
Re: [PATCH] daemon: improve internal commandrvf
...> return NULL; > if (enable_network) { > @@ -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 > +...
2016 Jan 21
0
[PATCH v3 1/6] daemon: Rename daemon/command.c -> daemon/sh.c.
...reply_with_error ("passed an empty list"); - return NULL; - } - - if (bind_mount (&bind_state) == -1) - return NULL; - if (enable_network) { - if (set_up_etc_resolv_conf (&resolver_state) == -1) - return NULL; - } - - flags = COMMAND_FLAG_DO_CHROOT; - - r = commandvf (&out, &err, flags, (const char * const *) argv); - - free_bind_state (&bind_state); - free_resolver_state (&resolver_state); - - if (r == -1) { - reply_with_error ("%s", err); - free (out); - return NULL; - } - - return out; /* Caller frees. */ -} - -char...
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
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.