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 <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Eric Paris 2011-07-07 15:41:31 +02:00
parent 4b00b5c6a4
commit 5e096d9ceb

View file

@ -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;