#include <stdlib.h>
#include <string.h>
-#include "../src/guestfs_protocol.h"
+#include "guestfs_protocol.h"
#include "daemon.h"
#include "actions.h"
int dev_ok, dev_pts_ok, proc_ok, selinux_ok, sys_ok;
/* We need a root filesystem mounted to do this. */
- NEED_ROOT (return NULL);
+ NEED_ROOT (, return NULL);
/* Conveniently, argv is already a NULL-terminated argv-style array
* of parameters, so we can pass it straight in to our internal
* commandv. We just have to check the list is non-empty.
*/
if (argv[0] == NULL) {
- reply_with_error ("command: passed an empty list");
+ reply_with_error ("passed an empty list");
return NULL;
}
sys_ok = r != -1;
CHROOT_IN;
- r = commandv (&out, &err, argv);
+ r = commandv (&out, &err, (const char * const *) argv);
CHROOT_OUT;
if (sys_ok) command (NULL, NULL, "umount", sysroot_sys, NULL);
}
char *
-do_sh (const char *command)
+do_sh (const char *cmd)
{
- const char *argv[] = { "/bin/sh", "-c", command, NULL };
+ const char *argv[] = { "/bin/sh", "-c", cmd, NULL };
return do_command ((char **) argv);
}
char **
-do_sh_lines (const char *command)
+do_sh_lines (const char *cmd)
{
- const char *argv[] = { "/bin/sh", "-c", command, NULL };
+ const char *argv[] = { "/bin/sh", "-c", cmd, NULL };
return do_command_lines ((char **) argv);
}