@@ -145,6 +145,7 @@ static void usage(char *progname)
145
145
printf (" -v,--verbose be verbose\n" );
146
146
printf (" -P,--preserve_tunables Preserve tunables in policy\n" );
147
147
printf (" -C,--ignore-module-cache Rebuild CIL modules compiled from HLL files\n" );
148
+ printf (" -o,--config=PATH use an alternate path for the semanage config\n" );
148
149
printf (" -p,--path use an alternate path for the policy root\n" );
149
150
printf (" -S,--store-path use an alternate path for the policy store root\n" );
150
151
printf (" -c, --cil extract module as cil. This only affects module extraction.\n" );
@@ -210,6 +211,7 @@ static void parse_command_line(int argc, char **argv)
210
211
{"enable" , required_argument , NULL , 'e' },
211
212
{"disable" , required_argument , NULL , 'd' },
212
213
{"path" , required_argument , NULL , 'p' },
214
+ {"config" , required_argument , NULL , 'o' },
213
215
{"store-path" , required_argument , NULL , 'S' },
214
216
{"checksum" , 0 , NULL , 'm' },
215
217
{NULL , 0 , NULL , 0 }
@@ -223,7 +225,7 @@ static void parse_command_line(int argc, char **argv)
223
225
check_ext_changes = 0 ;
224
226
priority = 400 ;
225
227
while ((i =
226
- getopt_long (argc , argv , "s:b:hi:l::vr:u:RnNBDCPX:e:d:p:S:E:cHm" ,
228
+ getopt_long (argc , argv , "s:b:hi:l::vr:u:RnNBDCPX:e:d:p:o: S:E:cHm" ,
227
229
opts , & longind )) != -1 ) {
228
230
switch (i ) {
229
231
case '\0' :
@@ -304,6 +306,14 @@ static void parse_command_line(int argc, char **argv)
304
306
case 'C' :
305
307
ignore_module_cache = 1 ;
306
308
break ;
309
+ case 'o' :
310
+ sh = semanage_handle_create_with_path (optarg );
311
+ if (!sh ) {
312
+ fprintf (stderr , "%s: Could not create semanage handle\n" ,
313
+ argv [0 ]);
314
+ exit (1 );
315
+ }
316
+ break ;
307
317
case 'X' :
308
318
set_mode (PRIORITY_M , optarg );
309
319
break ;
@@ -421,11 +431,13 @@ int main(int argc, char *argv[])
421
431
if (build || check_ext_changes )
422
432
commit = 1 ;
423
433
424
- sh = semanage_handle_create ();
425
434
if (!sh ) {
426
- fprintf (stderr , "%s: Could not create semanage handle\n" ,
427
- argv [0 ]);
428
- goto cleanup_nohandle ;
435
+ sh = semanage_handle_create ();
436
+ if (!sh ) {
437
+ fprintf (stderr , "%s: Could not create semanage handle\n" ,
438
+ argv [0 ]);
439
+ goto cleanup_nohandle ;
440
+ }
429
441
}
430
442
431
443
if (store ) {
0 commit comments