};
#endif
+int policydb_loaded_version;
+
static unsigned int symtab_sizes[SYM_NUM] = {
2,
32,
.sym_num = SYM_NUM,
.ocon_num = OCON_NUM,
},
+ {
+ .version = POLICYDB_VERSION_NLCLASS,
+ .sym_num = SYM_NUM,
+ .ocon_num = OCON_NUM,
+ },
};
static struct policydb_compat_info *policydb_lookup_compat(int version)
*/
int roles_init(struct policydb *p)
{
- char *key = 0;
+ char *key = NULL;
int rc;
struct role_datum *role;
kfree(key);
comdatum = datum;
- hashtab_map(comdatum->permissions.table, perm_destroy, 0);
+ hashtab_map(comdatum->permissions.table, perm_destroy, NULL);
hashtab_destroy(comdatum->permissions.table);
kfree(datum);
return 0;
kfree(key);
cladatum = datum;
- hashtab_map(cladatum->permissions.table, perm_destroy, 0);
+ hashtab_map(cladatum->permissions.table, perm_destroy, NULL);
hashtab_destroy(cladatum->permissions.table);
constraint = cladatum->constraints;
while (constraint) {
int i;
for (i = 0; i < SYM_NUM; i++) {
- hashtab_map(p->symtab[i].table, destroy_f[i], 0);
+ hashtab_map(p->symtab[i].table, destroy_f[i], NULL);
hashtab_destroy(p->symtab[i].table);
}
static int perm_read(struct policydb *p, struct hashtab *h, void *fp)
{
- char *key = 0;
+ char *key = NULL;
struct perm_datum *perdatum;
int rc;
u32 *buf, len;
static int common_read(struct policydb *p, struct hashtab *h, void *fp)
{
- char *key = 0;
+ char *key = NULL;
struct common_datum *comdatum;
u32 *buf, len, nel;
int i, rc;
static int class_read(struct policydb *p, struct hashtab *h, void *fp)
{
- char *key = 0;
+ char *key = NULL;
struct class_datum *cladatum;
struct constraint_node *c, *lc;
struct constraint_expr *e, *le;
static int role_read(struct policydb *p, struct hashtab *h, void *fp)
{
- char *key = 0;
+ char *key = NULL;
struct role_datum *role;
int rc;
u32 *buf, len;
static int type_read(struct policydb *p, struct hashtab *h, void *fp)
{
- char *key = 0;
+ char *key = NULL;
struct type_datum *typdatum;
int rc;
u32 *buf, len;
static int user_read(struct policydb *p, struct hashtab *h, void *fp)
{
- char *key = 0;
+ char *key = NULL;
struct user_datum *usrdatum;
int rc;
u32 *buf, len;
struct role_trans *tr, *ltr;
struct ocontext *l, *c, *newc;
struct genfs *genfs_p, *genfs, *newgenfs;
- int i, j, rc, r_policyvers;
+ int i, j, rc, r_policyvers = 0;
u32 *buf, len, len2, config, nprim, nel, nel2;
char *policydb_str;
struct policydb_compat_info *info;
if (rc)
goto bad;
out:
+ policydb_loaded_version = r_policyvers;
return rc;
bad_newc:
ocontext_destroy(newc,OCON_FSUSE);