X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fcommand.c;h=3f21807f3b8df74b1f1796dbbe6647fe111aac81;hp=46a265c984546d1d4bf910e6af72484eb1a67a76;hb=a7b73d4a1e09f12b2002083618056f0c823c1dcf;hpb=ab81d09a710242ab61001ef5e8ffd321725b47a7 diff --git a/daemon/command.c b/daemon/command.c index 46a265c..3f21807 100644 --- a/daemon/command.c +++ b/daemon/command.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ #include "actions.h" char * -do_command (char * const * const argv) +do_command (char **argv) { char *out, *err; int r; @@ -84,7 +84,7 @@ do_command (char * const * const argv) } char ** -do_command_lines (char * const * const argv) +do_command_lines (char **argv) { char *out; char **lines; @@ -101,3 +101,19 @@ do_command_lines (char * const * const argv) return lines; /* Caller frees. */ } + +char * +do_sh (char *command) +{ + char *argv[] = { "/bin/sh", "-c", command, NULL }; + + return do_command (argv); +} + +char ** +do_sh_lines (char *command) +{ + char *argv[] = { "/bin/sh", "-c", command, NULL }; + + return do_command_lines (argv); +}