aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWilliam Roberts2016-01-29 13:03:40 -0600
committerWilliam Roberts2016-01-29 13:05:57 -0600
commitc92dae9807e890e7b8bdc8f293ef35143ad51ca5 (patch)
tree658e0faf5c9ac969f30f84a6ed93787a88fdcc5a /tools
parent696a66ba202780d757bd8a2d47db72473b7d558b (diff)
downloadsystem-sepolicy-c92dae9807e890e7b8bdc8f293ef35143ad51ca5.tar.gz
system-sepolicy-c92dae9807e890e7b8bdc8f293ef35143ad51ca5.tar.xz
system-sepolicy-c92dae9807e890e7b8bdc8f293ef35143ad51ca5.zip
checkseapp: remove data types form static map
Data type tracking is no longer needed now that per key validation routines are supported. Change-Id: I2f1d0d5b1713e0477996479b0f279a58f43f15c7 Signed-off-by: William Roberts <william.c.roberts@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/check_seapp.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/tools/check_seapp.c b/tools/check_seapp.c
index 50f18374..aca294fb 100644
--- a/tools/check_seapp.c
+++ b/tools/check_seapp.c
@@ -80,14 +80,6 @@ enum key_dir {
80 dir_in, dir_out 80 dir_in, dir_out
81}; 81};
82 82
83/**
84 * The expected "type" of data the value in the key
85 * value pair should be.
86 */
87enum data_type {
88 dt_bool, dt_string
89};
90
91struct list_element { 83struct list_element {
92 list_element *next; 84 list_element *next;
93}; 85};
@@ -110,7 +102,6 @@ struct key_map_regex {
110struct key_map { 102struct key_map {
111 char *name; 103 char *name;
112 key_dir dir; 104 key_dir dir;
113 data_type type;
114 char *data; 105 char *data;
115 key_map_regex regex; 106 key_map_regex regex;
116 bool (*fn_validate)(char *value, char **errmsg); 107 bool (*fn_validate)(char *value, char **errmsg);
@@ -210,19 +201,19 @@ static bool validate_selinux_level(char *value, char **errmsg);
210 */ 201 */
211key_map rules[] = { 202key_map rules[] = {
212 /*Inputs*/ 203 /*Inputs*/
213 { .name = "isSystemServer", .type = dt_bool, .dir = dir_in, .data = NULL, .fn_validate = validate_bool }, 204 { .name = "isSystemServer", .dir = dir_in, .data = NULL, .fn_validate = validate_bool },
214 { .name = "isOwner", .type = dt_bool, .dir = dir_in, .data = NULL, .fn_validate = validate_bool }, 205 { .name = "isOwner", .dir = dir_in, .data = NULL, .fn_validate = validate_bool },
215 { .name = "user", .type = dt_string, .dir = dir_in, .data = NULL }, 206 { .name = "user", .dir = dir_in, .data = NULL },
216 { .name = "seinfo", .type = dt_string, .dir = dir_in, .data = NULL }, 207 { .name = "seinfo", .dir = dir_in, .data = NULL },
217 { .name = "name", .type = dt_string, .dir = dir_in, .data = NULL }, 208 { .name = "name", .dir = dir_in, .data = NULL },
218 { .name = "path", .type = dt_string, .dir = dir_in, .data = NULL }, 209 { .name = "path", .dir = dir_in, .data = NULL },
219 { .name = "isPrivApp", .type = dt_bool, .dir = dir_in, .data = NULL, .fn_validate = validate_bool }, 210 { .name = "isPrivApp", .dir = dir_in, .data = NULL, .fn_validate = validate_bool },
220 /*Outputs*/ 211 /*Outputs*/
221 { .name = "domain", .type = dt_string, .dir = dir_out, .data = NULL, .fn_validate = validate_selinux_type }, 212 { .name = "domain", .dir = dir_out, .data = NULL, .fn_validate = validate_selinux_type },
222 { .name = "type", .type = dt_string, .dir = dir_out, .data = NULL, .fn_validate = validate_selinux_type }, 213 { .name = "type", .dir = dir_out, .data = NULL, .fn_validate = validate_selinux_type },
223 { .name = "levelFromUid", .type = dt_bool, .dir = dir_out, .data = NULL, .fn_validate = validate_bool }, 214 { .name = "levelFromUid", .dir = dir_out, .data = NULL, .fn_validate = validate_bool },
224 { .name = "levelFrom", .type = dt_string, .dir = dir_out, .data = NULL, .fn_validate = validate_levelFrom }, 215 { .name = "levelFrom", .dir = dir_out, .data = NULL, .fn_validate = validate_levelFrom },
225 { .name = "level", .type = dt_string, .dir = dir_out, .data = NULL, .fn_validate = validate_selinux_level }, 216 { .name = "level", .dir = dir_out, .data = NULL, .fn_validate = validate_selinux_level },
226}; 217};
227 218
228/** 219/**
@@ -518,9 +509,6 @@ static map_match rule_map_cmp(rule_map *rmA, rule_map *rmB) {
518 mB = &(rmB->m[j]); 509 mB = &(rmB->m[j]);
519 input_mode = 0; 510 input_mode = 0;
520 511
521 if (mA->type != mB->type)
522 continue;
523
524 if (strcmp(mA->name, mB->name)) 512 if (strcmp(mA->name, mB->name))
525 continue; 513 continue;
526 514