Remove --default and --audit from sesearch

- Make -D == --dontaudit in sesearch
This commit is contained in:
Dan Walsh 2013-06-17 13:42:45 -04:00
parent 3caf5ed4b7
commit af4b0ecbe6

View File

@ -1,6 +1,6 @@
diff -up setools-3.3.7/man/sesearch.1~ setools-3.3.7/man/sesearch.1
--- setools-3.3.7/man/sesearch.1~ 2008-02-22 14:06:28.000000000 -0500
+++ setools-3.3.7/man/sesearch.1 2013-05-16 10:28:09.150480353 -0400
diff -up setools-3.3.7/man/sesearch.1.cmdline setools-3.3.7/man/sesearch.1
--- setools-3.3.7/man/sesearch.1.cmdline 2008-02-22 14:06:28.000000000 -0500
+++ setools-3.3.7/man/sesearch.1 2013-06-15 08:47:02.099728083 -0400
@@ -43,7 +43,7 @@ Search for allow rules.
Search for neverallow rules.
.IP "--auditallow"
@ -10,31 +10,56 @@ diff -up setools-3.3.7/man/sesearch.1~ setools-3.3.7/man/sesearch.1
Search for dontaudit rules.
.IP "-T, --type"
Search for type_transition, type_member, and type_change rules.
diff -up setools-3.3.7/secmds/sesearch.c~ setools-3.3.7/secmds/sesearch.c
--- setools-3.3.7/secmds/sesearch.c~ 2013-05-16 10:18:49.214383581 -0400
+++ setools-3.3.7/secmds/sesearch.c 2013-05-16 10:27:21.423222162 -0400
@@ -61,9 +61,9 @@ enum opt_values
diff -up setools-3.3.7/secmds/sesearch.c.cmdline setools-3.3.7/secmds/sesearch.c
--- setools-3.3.7/secmds/sesearch.c.cmdline 2013-06-15 08:47:02.096728078 -0400
+++ setools-3.3.7/secmds/sesearch.c 2013-06-17 13:41:01.623234084 -0400
@@ -24,6 +24,7 @@
*/
#include <config.h>
+#include <selinux/selinux.h>
/* libapol */
#include <apol/policy.h>
@@ -61,9 +62,8 @@ enum opt_values
static struct option const longopts[] = {
{"allow", no_argument, NULL, 'A'},
{"neverallow", no_argument, NULL, RULE_NEVERALLOW},
- {"audit", no_argument, NULL, RULE_AUDIT},
+# {"audit", no_argument, NULL, RULE_AUDIT},
{"auditallow", no_argument, NULL, RULE_AUDITALLOW},
- {"dontaudit", no_argument, NULL, RULE_DONTAUDIT},
+ {"dontaudit", no_argument, NULL, "D"},
+ {"dontaudit", no_argument, NULL, 'D'},
{"type", no_argument, NULL, 'T'},
{"role_allow", no_argument, NULL, RULE_ROLE_ALLOW},
{"role_trans", no_argument, NULL, RULE_ROLE_TRANS},
@@ -72,7 +72,7 @@ static struct option const longopts[] =
@@ -72,7 +72,6 @@ static struct option const longopts[] =
{"source", required_argument, NULL, 's'},
{"target", required_argument, NULL, 't'},
- {"default", required_argument, NULL, 'D'},
+# {"default", required_argument, NULL, 'D'},
{"role_source", required_argument, NULL, EXPR_ROLE_SOURCE},
{"role_target", required_argument, NULL, EXPR_ROLE_TARGET},
{"class", required_argument, NULL, 'c'},
@@ -962,7 +962,7 @@ int main(int argc, char **argv)
@@ -666,10 +665,6 @@ static void print_ft_results(const apol_
size_t i, num_filename_trans = 0;
const qpol_filename_trans_t *filename_trans = NULL;
char *tmp = NULL, *filename_trans_str = NULL, *expr = NULL;
- char enable_char = ' ', branch_char = ' ';
- qpol_iterator_t *iter = NULL;
- const qpol_cond_t *cond = NULL;
- uint32_t enabled = 0, list = 0;
if (!(num_filename_trans = apol_vector_get_size(v)))
goto cleanup;
@@ -677,7 +672,6 @@ static void print_ft_results(const apol_
fprintf(stdout, "Found %zd named file transition filename_trans:\n", num_filename_trans);
for (i = 0; i < num_filename_trans; i++) {
- enable_char = branch_char = ' ';
if (!(filename_trans = apol_vector_get_element(v, i)))
goto cleanup;
@@ -962,7 +956,7 @@ int main(int argc, char **argv)
memset(&cmd_opts, 0, sizeof(cmd_opts));
cmd_opts.indirect = true;
@ -43,7 +68,7 @@ diff -up setools-3.3.7/secmds/sesearch.c~ setools-3.3.7/secmds/sesearch.c
switch (optc) {
case 0:
break;
@@ -978,18 +978,6 @@ int main(int argc, char **argv)
@@ -978,18 +972,6 @@ int main(int argc, char **argv)
exit(1);
}
break;
@ -62,7 +87,7 @@ diff -up setools-3.3.7/secmds/sesearch.c~ setools-3.3.7/secmds/sesearch.c
case 't': /* target */
if (optarg == 0) {
usage(argv[0], 1);
@@ -1082,7 +1070,7 @@ int main(int argc, char **argv)
@@ -1082,7 +1064,7 @@ int main(int argc, char **argv)
case RULE_AUDITALLOW:
cmd_opts.auditallow = true;
break;