Lines Matching refs:handle
54 static int dbase_policydb_set_serial(semanage_handle_t * handle, in dbase_policydb_set_serial() argument
58 int cache_serial = handle->funcs->get_serial(handle); in dbase_policydb_set_serial()
60 ERR(handle, "could not update cache serial"); in dbase_policydb_set_serial()
68 static int dbase_policydb_needs_resync(semanage_handle_t * handle, in dbase_policydb_needs_resync() argument
77 cache_serial = handle->funcs->get_serial(handle); in dbase_policydb_needs_resync()
89 static int dbase_policydb_cache(semanage_handle_t * handle, in dbase_policydb_cache() argument
102 if (!dbase_policydb_needs_resync(handle, dbase)) in dbase_policydb_cache()
105 fname = dbase->path[handle->is_in_transaction]; in dbase_policydb_cache()
108 ERR(handle, "could not create policydb object"); in dbase_policydb_cache()
116 ERR(handle, "could not open %s for reading: %s", in dbase_policydb_cache()
125 ERR(handle, "could not create policy file object"); in dbase_policydb_cache()
130 sepol_policy_file_set_handle(pf, handle->sepolh); in dbase_policydb_cache()
141 if (dbase_policydb_set_serial(handle, dbase) < 0) in dbase_policydb_cache()
149 ERR(handle, "could not cache policy database"); in dbase_policydb_cache()
157 static int dbase_policydb_flush(semanage_handle_t * handle in dbase_policydb_flush() argument
178 int dbase_policydb_init(semanage_handle_t * handle, in dbase_policydb_init() argument
205 ERR(handle, "out of memory, could not initialize policy database"); in dbase_policydb_init()
241 static int dbase_policydb_add(semanage_handle_t * handle, in dbase_policydb_add() argument
246 if (dbase->rptable->add(handle->sepolh, dbase->policydb, key, data) < 0) in dbase_policydb_add()
253 ERR(handle, "could not add record to the database"); in dbase_policydb_add()
257 static int dbase_policydb_set(semanage_handle_t * handle, in dbase_policydb_set() argument
262 if (dbase->rptable->set(handle->sepolh, dbase->policydb, key, data) < 0) in dbase_policydb_set()
269 ERR(handle, "could not set record value"); in dbase_policydb_set()
273 static int dbase_policydb_modify(semanage_handle_t * handle, in dbase_policydb_modify() argument
279 if (dbase->rptable->modify(handle->sepolh, in dbase_policydb_modify()
287 ERR(handle, "could not modify record value"); in dbase_policydb_modify()
291 static int dbase_policydb_del(semanage_handle_t * handle in dbase_policydb_del() argument
303 static int dbase_policydb_clear(semanage_handle_t * handle in dbase_policydb_clear() argument
313 static int dbase_policydb_query(semanage_handle_t * handle, in dbase_policydb_query() argument
318 if (dbase->rptable->query(handle->sepolh, in dbase_policydb_query()
325 ERR(handle, "could not query record value"); in dbase_policydb_query()
329 static int dbase_policydb_exists(semanage_handle_t * handle, in dbase_policydb_exists() argument
334 if (dbase->rptable->exists(handle->sepolh, in dbase_policydb_exists()
341 ERR(handle, "could not check if record exists"); in dbase_policydb_exists()
345 static int dbase_policydb_count(semanage_handle_t * handle, in dbase_policydb_count() argument
350 if (dbase->rptable->count(handle->sepolh, in dbase_policydb_count()
357 ERR(handle, "could not count the database records"); in dbase_policydb_count()
361 static int dbase_policydb_iterate(semanage_handle_t * handle, in dbase_policydb_iterate() argument
367 if (dbase->rptable->iterate(handle->sepolh, in dbase_policydb_iterate()
374 ERR(handle, "could not iterate over records"); in dbase_policydb_iterate()
379 semanage_handle_t *handle; member
390 if (arg->rtable->clone(arg->handle, record, &arg->records[arg->pos]) < in list_handler()
397 static int dbase_policydb_list(semanage_handle_t * handle, in dbase_policydb_list() argument
407 list_arg.handle = handle; in dbase_policydb_list()
409 if (dbase->rptable->count(handle->sepolh, in dbase_policydb_list()
422 if (dbase->rptable->iterate(handle->sepolh, in dbase_policydb_list()
425 ERR(handle, "list handler could not extract record"); in dbase_policydb_list()
435 ERR(handle, "out of memory"); in dbase_policydb_list()
443 ERR(handle, "could not list records"); in dbase_policydb_list()