Lines Matching refs:sid
19 #define SIDTAB_HASH(sid) \ argument
20 (sid & SIDTAB_HASH_MASK)
42 int sepol_sidtab_insert(sidtab_t * s, sepol_security_id_t sid, in sepol_sidtab_insert() argument
51 hvalue = SIDTAB_HASH(sid); in sepol_sidtab_insert()
54 while (cur != NULL && sid > cur->sid) { in sepol_sidtab_insert()
59 if (cur && sid == cur->sid) { in sepol_sidtab_insert()
67 newnode->sid = sid; in sepol_sidtab_insert()
82 if (sid >= s->next_sid) in sepol_sidtab_insert()
83 s->next_sid = sid + 1; in sepol_sidtab_insert()
87 int sepol_sidtab_remove(sidtab_t * s, sepol_security_id_t sid) in sepol_sidtab_remove() argument
95 hvalue = SIDTAB_HASH(sid); in sepol_sidtab_remove()
98 while (cur != NULL && sid > cur->sid) { in sepol_sidtab_remove()
103 if (cur == NULL || sid != cur->sid) in sepol_sidtab_remove()
118 context_struct_t *sepol_sidtab_search(sidtab_t * s, sepol_security_id_t sid) in sepol_sidtab_search() argument
126 hvalue = SIDTAB_HASH(sid); in sepol_sidtab_search()
128 while (cur != NULL && sid > cur->sid) in sepol_sidtab_search()
131 if (cur == NULL || sid != cur->sid) { in sepol_sidtab_search()
133 sid = SECINITSID_UNLABELED; in sepol_sidtab_search()
134 hvalue = SIDTAB_HASH(sid); in sepol_sidtab_search()
136 while (cur != NULL && sid > cur->sid) in sepol_sidtab_search()
138 if (!cur || sid != cur->sid) in sepol_sidtab_search()
146 int (*apply) (sepol_security_id_t sid, in sepol_sidtab_map()
159 ret = apply(cur->sid, &cur->context, args); in sepol_sidtab_map()
169 int (*apply) (sepol_security_id_t sid, in sepol_sidtab_map_remove_on_error()
183 ret = apply(cur->sid, &cur->context, args); in sepol_sidtab_map_remove_on_error()
217 return cur->sid; in sepol_sidtab_search_context()
228 sepol_security_id_t sid; in sepol_sidtab_context_to_sid() local
233 sid = sepol_sidtab_search_context(s, context); in sepol_sidtab_context_to_sid()
234 if (!sid) { in sepol_sidtab_context_to_sid()
237 sid = sepol_sidtab_search_context(s, context); in sepol_sidtab_context_to_sid()
238 if (sid) in sepol_sidtab_context_to_sid()
245 sid = s->next_sid++; in sepol_sidtab_context_to_sid()
246 ret = sepol_sidtab_insert(s, sid, context); in sepol_sidtab_context_to_sid()
256 *out_sid = sid; in sepol_sidtab_context_to_sid()