dismod: add --actions option for non-interactive use
Example session:
$ ./dismod --help
Usage:
./dismod [OPTIONS] binary_pol_file
Options:
-h, --help print this help message
-a, --actions ACTIONS run non-interactively
Actions:
1 display unconditional AVTAB
2 display conditional AVTAB
3 display users
4 display bools
5 display roles
6 display types, attributes, and aliases
7 display role transitions
8 display role allows
9 Display policycon
0 Display initial SIDs
a Display avrule requirements
b Display avrule declarations
c Display policy capabilities
u Display the unknown handling setting
F Display filename_trans rules
$ ./dismod --actions 16 input.mod
Reading policy...
libsepol.policydb_index_others: security: 0 users, 1 roles, 2 types, 0 bools
libsepol.policydb_index_others: security: 0 sens, 0 cats
libsepol.policydb_index_others: security: 1 classes, 0 rules, 0 cond rules
libsepol.policydb_index_others: security: 0 users, 1 roles, 2 types, 0 bools
libsepol.policydb_index_others: security: 0 sens, 0 cats
libsepol.policydb_index_others: security: 1 classes, 0 rules, 0 cond rules
Binary policy module file loaded.
Module name: input
Module version: 1.0.0
Policy version: 21
unconditional avtab:
--- begin avrule block ---
decl 1:
allow [httpd_t] [http_port_t] : [tcp_socket] { name_bind };
[http_port_t] [2]: type flags:0
[httpd_t] [1]: type flags:0
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Acked-by: James Carter <jwcart2@gmail.com>