Lines Matching refs:datum
154 static int create_symbol(uint32_t symbol_type, hashtab_key_t key, hashtab_datum_t datum, in create_symbol() argument
164 ret = symtab_insert(policydbp, symbol_type, key, datum, scope, in create_symbol()
197 hashtab_key_t key, hashtab_datum_t datum, in declare_symbol() argument
201 int ret = create_symbol(symbol_type, key, datum, dest_value, SCOPE_DECL); in declare_symbol()
255 role_datum_t *datum = NULL; in create_role() local
268 datum = malloc(sizeof(*datum)); in create_role()
269 if (datum == NULL) { in create_role()
275 role_datum_init(datum); in create_role()
276 datum->flavor = isattr; in create_role()
279 ret = declare_symbol(SYM_ROLES, id, datum, &value, &value); in create_role()
281 ret = require_symbol(SYM_ROLES, id, datum, &value, &value); in create_role()
284 datum->s.value = value; in create_role()
287 *role = datum; in create_role()
299 role_datum_destroy(datum); in create_role()
300 free(datum); in create_role()
303 *role = datum; in create_role()
308 role_datum_destroy(datum); in create_role()
309 free(datum); in create_role()
390 type_datum_t *datum; in create_type() local
408 datum = malloc(sizeof(*datum)); in create_type()
409 if (!datum) { in create_type()
414 type_datum_init(datum); in create_type()
415 datum->primary = 1; in create_type()
416 datum->flavor = isattr; in create_type()
419 ret = declare_symbol(SYM_TYPES, id, datum, &value, &value); in create_type()
421 ret = require_symbol(SYM_TYPES, id, datum, &value, &value); in create_type()
425 datum->s.value = value; in create_type()
426 *type = datum; in create_type()
428 type_datum_destroy(datum); in create_type()
429 free(datum); in create_type()
441 type_datum_destroy(datum); in create_type()
442 free(datum); in create_type()
500 user_datum_t *datum = NULL; in create_user() local
512 datum = malloc(sizeof(*datum)); in create_user()
513 if (datum == NULL) { in create_user()
519 user_datum_init(datum); in create_user()
522 ret = declare_symbol(SYM_USERS, id, datum, &value, &value); in create_user()
524 ret = require_symbol(SYM_USERS, id, datum, &value, &value); in create_user()
527 datum->s.value = value; in create_user()
530 *user = datum; in create_user()
537 *user = datum; in create_user()
542 user_datum_destroy(datum); in create_user()
543 free(datum); in create_user()
716 hashtab_key_t key, hashtab_datum_t datum, in require_symbol() argument
720 int ret = create_symbol(symbol_type, key, datum, dest_value, SCOPE_REQ); in require_symbol()
763 static int perm_destroy(hashtab_key_t key, hashtab_datum_t datum, void *p in perm_destroy() argument
768 free(datum); in perm_destroy()
785 class_datum_t *datum = NULL; in require_class() local
802 if ((datum = calloc(1, sizeof(*datum))) == NULL || in require_class()
803 symtab_init(&datum->permissions, PERM_SYMTAB_SIZE)) { in require_class()
805 class_datum_destroy(datum); in require_class()
809 require_symbol(SYM_CLASSES, class_id, datum, &datum->s.value, in require_class()
810 &datum->s.value); in require_class()
814 class_datum_destroy(datum); in require_class()
825 class_datum_destroy(datum); in require_class()
826 datum = hashtab_search(policydbp->p_classes.table, class_id); in require_class()
827 assert(datum); /* the class datum should have existed */ in require_class()
836 perm = hashtab_search(datum->permissions.table, perm_id); in require_class()
837 if (!perm && datum->comdatum) in require_class()
839 hashtab_search(datum->comdatum->permissions.table, in require_class()
861 hashtab_insert(datum->permissions.table, perm_id, in require_class()
869 perm->s.value = datum->permissions.nprim + 1; in require_class()
872 if (add_perm_to_class(perm->s.value, datum->s.value) == -1) { in require_class()
879 datum->permissions.nprim++; in require_class()