Displaying 20 results from an estimated 24 matches for "stdoutput".
2016 Jan 21
0
[PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
...en;
+
+#ifndef MAX
+# define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+/* For improved readability dealing with pipe arrays */
+#define PIPE_READ 0
+#define PIPE_WRITE 1
+
+/* Easy ways to run external commands. For full documentation, see
+ * 'commandrvf' below.
+ */
+int
+commandf (char **stdoutput, char **stderror, unsigned flags,
+ const char *name, ...)
+{
+ va_list args;
+ /* NB: Mustn't free the strings which are on the stack. */
+ CLEANUP_FREE const char **argv = NULL;
+ char *s;
+ size_t i;
+ int r;
+
+ /* Collect the command line arguments into an array. */
+ i =...
2016 Jan 26
1
[PATCH] daemon: improve debugging for "stdout on stderr" flag
...*(), indicate that as stdout=e in debugging message.
---
daemon/command.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/daemon/command.c b/daemon/command.c
index 73fce56..2423a4e 100644
--- a/daemon/command.c
+++ b/daemon/command.c
@@ -185,6 +185,7 @@ commandrvf (char **stdoutput, char **stderror, unsigned flags,
int so_fd[2], se_fd[2];
unsigned flag_copy_stdin = flags & COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN;
int flag_copy_fd = (int) (flags & COMMAND_FLAG_FD_MASK);
+ unsigned flag_out_on_err = flags & COMMAND_FLAG_FOLD_STDOUT_ON_STDERR;
pid_t pid;...
2012 Dec 13
2
[PATCH 1/2] daemon: NFC Use symbolic names in commandrvf
...arrays */
+#define PIPE_READ 0
+#define PIPE_WRITE 1
+
/* If root device is an ext2 filesystem, this is the major and minor.
* This is so we can ignore this device from the point of view of the
* user, eg. in guestfs_list_devices and many other places.
@@ -834,22 +838,22 @@ commandrvf (char **stdoutput, char **stderror, int flags,
signal (SIGPIPE, SIG_DFL);
close (0);
if (flag_copy_stdin) {
- dup2 (stdin_fd[0], 0);
- close (stdin_fd[0]);
- close (stdin_fd[1]);
+ dup2 (stdin_fd[PIPE_READ], STDIN_FILENO);
+ close (stdin_fd[PIPE_READ]);
+ close (stdin_fd[...
2012 Dec 14
1
[PATCH] daemon: Add sentinel attribute to commandf and commandrf
...d, 2 insertions(+), 2 deletions(-)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 8f932d2..df1ba3a 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -100,9 +100,9 @@ extern char **split_lines (char *str);
#define COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN 2048
extern int commandf (char **stdoutput, char **stderror, int flags,
- const char *name, ...);
+ const char *name, ...) __attribute__((sentinel));
extern int commandrf (char **stdoutput, char **stderror, int flags,
- const char *name, ...);
+ const char *n...
2011 Jun 09
15
[PATCH 00/13] Fix errors found using Coverity static analyzer.
I ran the Coverity static analyzer[1] on libguestfs, and fixed many
errors as a result.
Coverity found some errors in gnulib, but it doesn't seem to be worth
following those up since the version of gnulib we are using is so old.
There are a couple more errors (possibly 1 false-positive) which I'm
going to send in a separate email.
BTW all the errors found by Coverity were in the daemon
2006 May 12
10
why dtrace is not quiet?
i''m running the following script:
#pragma D option quiet
profile:::tick-1sec
/ ++x >= 15 /
{
exit(0);
}
io:::start {
@io_size[execname] = sum(args[0]->b_bcount);
}
on exit, the script prints out the value of @io_size, why?
there''s no printa(), and i also specified "D option quiet" (i also tried -q).
this seems to happen with any kind of probe: on exit(0) all
2009 Nov 09
1
[PATCH libguestfs] indent with spaces, not TABs
...optional, for OCaml bindings).
diff --git a/daemon/daemon.h b/daemon/daemon.h
index dbdec3b..ccda8e3 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -55,13 +55,13 @@ extern void free_stringslen (char **argv, int len);
#define COMMAND_FLAG_FOLD_STDOUT_ON_STDERR 1
extern 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, ch...
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky
for development (too easy to miss new ones) so I spent some
time last week and today working on removing them.
The first patch gets us down to almost no warnings with
the original -Wall setting. That was by far the hardest part.
Once I'd done that, I enabled nearly all of gcc's warnings via
gnulib's warnings and manywarnings modules
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
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
2015 Dec 02
3
[PATCH] daemon: improve internal commandrvf
...@@ -128,6 +128,7 @@ extern char **empty_list (void);
#define COMMAND_FLAG_FD_MASK (1024-1)
#define COMMAND_FLAG_FOLD_STDOUT_ON_STDERR 1024
#define COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN 2048
+#define COMMAND_FLAG_DO_CHROOT 4096
extern int commandf (char **stdoutput, char **stderror, int flags,
const char *name, ...) __attribute__((sentinel));
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 0a29aa6..47245f7 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -932,21 +932,44 @@ commandrvf (char **stdoutput, char **stderror,...
2015 Jun 17
0
[PATCH 4/4] daemon: add split_lines_sb
...+extern struct stringsbuf split_lines_sb (char *str);
extern char **split_lines (char *str);
extern char **empty_list (void);
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 198b2b2..21b3600 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -1115,7 +1115,8 @@ commandrvf (char **stdoutput, char **stderror, int flags,
return -1;
}
-/* Split an output string into a NULL-terminated list of lines.
+/* Split an output string into a NULL-terminated list of lines,
+ * wrapped into a stringsbuf.
* Typically this is used where we have run an external command
* which has printed o...
2015 Dec 02
0
Re: [PATCH] daemon: improve internal commandrvf
...(1024-1)
> #define COMMAND_FLAG_FOLD_STDOUT_ON_STDERR 1024
> #define COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN 2048
> +#define COMMAND_FLAG_DO_CHROOT 4096
>
Any eason for having this decimal? The standard thing is to use hex.
> extern int commandf (char **stdoutput, char **stderror, int flags,
> const char *name, ...) __attribute__((sentinel));
> diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
> index 0a29aa6..47245f7 100644
> --- a/daemon/guestfsd.c
> +++ b/daemon/guestfsd.c
> @@ -932,21 +932,44 @@ commandrvf (char...
2013 Aug 18
3
missing chdir before chroot in guestfsd
...n/pwd"
/
><fs> sh "/bin/pwd"
(unreachable)/
><fs> sh "cd / ; /bin/pwd"
/
This untested change may fix it.
===================
--- libguestfs-1.20.10.orig/daemon/guestfsd.c
+++ libguestfs-1.20.10/daemon/guestfsd.c
@@ -879,7 +879,11 @@ commandrvf (char **stdoutput, char **std
close (stdin_fd[PIPE_READ]);
close (stdin_fd[PIPE_WRITE]);
- if (chroot (sysroot) == -1) {
+ if (chdir (sysroot) == -1) {
+ perror ("chdir");
+ _exit (EXIT_FAILURE);
+ }
+ if (chroot (".") == -1) {
perror (&q...
2015 Jun 17
4
[PATCH 1/4] daemon: introduce free_stringsbuf
Simple shortcut to easily cleanup a stringsbuf.
---
daemon/daemon.h | 1 +
daemon/guestfsd.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 53cb797..bed4dbc 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -92,6 +92,7 @@ extern int add_string (struct stringsbuf *sb, const char *str);
extern int add_sprintf (struct stringsbuf *sb, const
2009 May 01
2
Plugin to generate text logs using cucumber.
Hi,
I was able to run the scenarios using rake features in cucmber,
All the respective results are displayed in colour in std output.
is there any plugin using which i can capture these results(that are
generated at run time).
Please let me know the procedure to capture these logs in to a files.
--
Posted via http://www.ruby-forum.com/.
2013 Aug 19
0
Re: missing chdir before chroot in guestfsd
...gt; (unreachable)/
>
> ><fs> sh "cd / ; /bin/pwd"
> /
>
> This untested change may fix it.
>
> ===================
> --- libguestfs-1.20.10.orig/daemon/guestfsd.c
> +++ libguestfs-1.20.10/daemon/guestfsd.c
> @@ -879,7 +879,11 @@ commandrvf (char **stdoutput, char **std
> close (stdin_fd[PIPE_READ]);
> close (stdin_fd[PIPE_WRITE]);
>
> - if (chroot (sysroot) == -1) {
> + if (chdir (sysroot) == -1) {
> + perror ("chdir");
> + _exit (EXIT_FAILURE);
> + }
> + if (chroot...
2007 Jan 26
0
Problems with assert_select in integration tests
...NG"=>nil,
"HTTP_ACCEPT"=>"text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
"REQUEST_METHOD"=>"GET"},
@output_hidden={"_session_id"=>"d0060c4ee33f3d58c0ef83bbfa107b6f"},
@stdoutput=#<StringIO:0x24771d0>,
@cookies={"_session_id"=>["d0060c4ee33f3d58c0ef83bbfa107b6f"]},
@stdinput=#<StringIO:0x24771e4>, @params={}, @multipart=false>, @body="
[ header of page cut .... ] <div id=\"main-double\">\n\t\t\t\n\n<form
action=\...
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.
2012 Dec 13
1
[PATCH] daemon: fix directory outside current root when executing commands
...i/test.log
/tests/c-api/test-private-data
+/tests/c-api/test-pwd
/tests/c-api/tests
/tests/c-api/tests.c
/tests/c-api/test*.tmp
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 7e83a2a..1cbf82c 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -846,6 +846,8 @@ commandrvf (char **stdoutput, char **stderror, int flags,
close (so_fd[PIPE_WRITE]);
close (se_fd[PIPE_WRITE]);
+ chdir("/");
+
execvp (argv[0], (void *) argv);
perror (argv[0]);
_exit (EXIT_FAILURE);
diff --git a/generator/actions.ml b/generator/actions.ml
index 2e815fc..f78d851 100644...