diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-08-13 20:45:06 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-08-13 20:45:06 +0100 |
commit | 8249460acfc0ab7298d125b4ea29c72729a4582b (patch) | |
tree | b005f9d7ea46f20e7f524a7cbaf31c65d365c49f /fish | |
parent | 299bd94e2ace3daa39add2ae9dc7799596b91fcd (diff) | |
download | libguestfs-8249460acfc0ab7298d125b4ea29c72729a4582b.tar.gz libguestfs-8249460acfc0ab7298d125b4ea29c72729a4582b.tar.xz libguestfs-8249460acfc0ab7298d125b4ea29c72729a4582b.zip |
guestfish: Add --selinux option.
Diffstat (limited to 'fish')
-rw-r--r-- | fish/fish.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fish/fish.c b/fish/fish.c index f245de17..f31f4ad3 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -117,6 +117,7 @@ usage (void) " -n|--no-sync Don't autosync\n" " --remote[=pid] Send commands to remote guestfish\n" " -r|--ro Mount read-only\n" + " --selinux Enable SELinux support\n" " -v|--verbose Verbose messages\n" " -x Echo each command before executing it\n" " -V|--version Display version and exit\n" @@ -139,6 +140,7 @@ main (int argc, char *argv[]) { "no-sync", 0, 0, 'n' }, { "remote", 2, 0, 0 }, { "ro", 0, 0, 'r' }, + { "selinux", 0, 0, 0 }, { "verbose", 0, 0, 'v' }, { "version", 0, 0, 'V' }, { 0, 0, 0, 0 } @@ -205,6 +207,8 @@ main (int argc, char *argv[]) exit (1); } } + } else if (strcmp (long_options[option_index].name, "selinux") == 0) { + guestfs_set_selinux (g, 1); } else { fprintf (stderr, _("guestfish: unknown long option: %s (%d)\n"), long_options[option_index].name, option_index); @@ -306,8 +310,9 @@ main (int argc, char *argv[]) char cmd[1024]; int r; - if (drvs || mps || remote_control_listen || remote_control) { - fprintf (stderr, _("guestfish: cannot use -i option with -a, -m, --listen or --remote\n")); + if (drvs || mps || remote_control_listen || remote_control || + guestfs_get_selinux (g)) { + fprintf (stderr, _("guestfish: cannot use -i option with -a, -m, --listen, --remote or --selinux\n")); exit (1); } if (optind >= argc) { |