@@ -145,6 +145,7 @@ static void usage(char *progname)
printf(" -v,--verbose be verbose\n");
printf(" -P,--preserve_tunables Preserve tunables in policy\n");
printf(" -C,--ignore-module-cache Rebuild CIL modules compiled from HLL files\n");
+ printf(" -o,--config=PATH use an alternate path for the semanage config\n");
printf(" -p,--path use an alternate path for the policy root\n");
printf(" -S,--store-path use an alternate path for the policy store root\n");
printf(" -c, --cil extract module as cil. This only affects module extraction.\n");
@@ -223,7 +224,7 @@ static void parse_command_line(int argc, char **argv)
check_ext_changes = 0;
priority = 400;
while ((i =
- getopt_long(argc, argv, "s:b:hi:l::vr:u:RnNBDCPX:e:d:p:S:E:cHm",
+ getopt_long(argc, argv, "s:b:hi:l::vr:u:RnNBDCPX:e:d:p:o:S:E:cHm",
opts, &longind)) != -1) {
switch (i) {
case '\0':
@@ -304,6 +305,14 @@ static void parse_command_line(int argc, char **argv)
case 'C':
ignore_module_cache = 1;
break;
+ case 'o':
+ sh = semanage_handle_create_with_path(optarg);
+ if (!sh) {
+ fprintf(stderr, "%s: Could not create semanage handle\n",
+ argv[0]);
+ exit(1);
+ }
+ break;
case 'X':
set_mode(PRIORITY_M, optarg);
break;
@@ -421,11 +430,13 @@ int main(int argc, char *argv[])
if (build || check_ext_changes)
commit = 1;
- sh = semanage_handle_create();
if (!sh) {
- fprintf(stderr, "%s: Could not create semanage handle\n",
- argv[0]);
- goto cleanup_nohandle;
+ sh = semanage_handle_create();
+ if (!sh) {
+ fprintf(stderr, "%s: Could not create semanage handle\n",
+ argv[0]);
+ goto cleanup_nohandle;
+ }
}
if (store) {