From 5e096d9ceb637a785d4537555799602a3de2b3dc Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Thu, 7 Jul 2011 15:41:31 +0200 Subject: [PATCH] policycoreutils: semodule: support for alternative root paths Add a -p option to semodule which will allow it to operate on the specified semanaged root instead of the default. Signed-off-by: Eric Paris Acked-by: Dan Walsh --- policycoreutils/semodule/semodule.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/policycoreutils/semodule/semodule.c b/policycoreutils/semodule/semodule.c index 059f6299..81d6a3c9 100644 --- a/policycoreutils/semodule/semodule.c +++ b/policycoreutils/semodule/semodule.c @@ -162,6 +162,7 @@ static void parse_command_line(int argc, char **argv) {"noreload", 0, NULL, 'n'}, {"build", 0, NULL, 'B'}, {"disable_dontaudit", 0, NULL, 'D'}, + {"path", required_argument, NULL, 'p'}, {NULL, 0, NULL, 0} }; int i; @@ -170,7 +171,7 @@ static void parse_command_line(int argc, char **argv) no_reload = 0; create_store = 0; while ((i = - getopt_long(argc, argv, "s:b:hi:lvqe:d:r:u:RnBD", opts, + getopt_long(argc, argv, "p:s:b:hi:lvqe:d:r:u:RnBD", opts, NULL)) != -1) { switch (i) { case 'b': @@ -198,6 +199,9 @@ static void parse_command_line(int argc, char **argv) case 'r': set_mode(REMOVE_M, optarg); break; + case 'p': + semanage_set_root(optarg); + break; case 'u': set_mode(UPGRADE_M, optarg); break;