diff options
Diffstat (limited to 'security/selinux/ss/policydb.h')
-rw-r--r-- | security/selinux/ss/policydb.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h index 95d3d7de361e..4e3ab9d0b315 100644 --- a/security/selinux/ss/policydb.h +++ b/security/selinux/ss/policydb.h | |||
@@ -203,21 +203,13 @@ struct policydb { | |||
203 | #define p_cats symtab[SYM_CATS] | 203 | #define p_cats symtab[SYM_CATS] |
204 | 204 | ||
205 | /* symbol names indexed by (value - 1) */ | 205 | /* symbol names indexed by (value - 1) */ |
206 | char **sym_val_to_name[SYM_NUM]; | 206 | struct flex_array *sym_val_to_name[SYM_NUM]; |
207 | #define p_common_val_to_name sym_val_to_name[SYM_COMMONS] | ||
208 | #define p_class_val_to_name sym_val_to_name[SYM_CLASSES] | ||
209 | #define p_role_val_to_name sym_val_to_name[SYM_ROLES] | ||
210 | #define p_type_val_to_name sym_val_to_name[SYM_TYPES] | ||
211 | #define p_user_val_to_name sym_val_to_name[SYM_USERS] | ||
212 | #define p_bool_val_to_name sym_val_to_name[SYM_BOOLS] | ||
213 | #define p_sens_val_to_name sym_val_to_name[SYM_LEVELS] | ||
214 | #define p_cat_val_to_name sym_val_to_name[SYM_CATS] | ||
215 | 207 | ||
216 | /* class, role, and user attributes indexed by (value - 1) */ | 208 | /* class, role, and user attributes indexed by (value - 1) */ |
217 | struct class_datum **class_val_to_struct; | 209 | struct class_datum **class_val_to_struct; |
218 | struct role_datum **role_val_to_struct; | 210 | struct role_datum **role_val_to_struct; |
219 | struct user_datum **user_val_to_struct; | 211 | struct user_datum **user_val_to_struct; |
220 | struct type_datum **type_val_to_struct; | 212 | struct flex_array *type_val_to_struct_array; |
221 | 213 | ||
222 | /* type enforcement access vectors and transitions */ | 214 | /* type enforcement access vectors and transitions */ |
223 | struct avtab te_avtab; | 215 | struct avtab te_avtab; |
@@ -321,6 +313,13 @@ static inline int put_entry(void *buf, size_t bytes, int num, struct policy_file | |||
321 | return 0; | 313 | return 0; |
322 | } | 314 | } |
323 | 315 | ||
316 | static inline char *sym_name(struct policydb *p, unsigned int sym_num, unsigned int element_nr) | ||
317 | { | ||
318 | struct flex_array *fa = p->sym_val_to_name[sym_num]; | ||
319 | |||
320 | return flex_array_get_ptr(fa, element_nr); | ||
321 | } | ||
322 | |||
324 | extern u16 string_to_security_class(struct policydb *p, const char *name); | 323 | extern u16 string_to_security_class(struct policydb *p, const char *name); |
325 | extern u32 string_to_av_perm(struct policydb *p, u16 tclass, const char *name); | 324 | extern u32 string_to_av_perm(struct policydb *p, u16 tclass, const char *name); |
326 | 325 | ||