| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
struct semanage_bool; |
| 22 |
struct semanage_bool_key; |
| 23 |
typedef struct semanage_bool record_t; |
| 24 |
typedef struct semanage_bool_key record_key_t; |
| 25 |
#define DBASE_RECORD_DEFINED |
| 26 |
|
| 27 |
struct dbase_policydb; |
| 28 |
typedef struct dbase_policydb dbase_t; |
| 29 |
#define DBASE_DEFINED |
| 30 |
|
| 31 |
#include <sepol/booleans.h> |
| 32 |
#include <semanage/handle.h> |
| 33 |
#include "boolean_internal.h" |
| 34 |
#include "debug.h" |
| 35 |
#include "database_policydb.h" |
| 36 |
#include "semanage_store.h" |
| 37 |
|
| 38 |
|
| 39 |
record_policydb_table_t SEMANAGE_BOOL_POLICYDB_RTABLE = { |
| 40 |
.add = NULL, |
| 41 |
.modify = NULL, |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
.set = (record_policydb_table_set_t) sepol_bool_set, |
| 47 |
.query = (record_policydb_table_query_t) sepol_bool_query, |
| 48 |
.count = (record_policydb_table_count_t) sepol_bool_count, |
| 49 |
.exists = (record_policydb_table_exists_t) sepol_bool_exists, |
| 50 |
.iterate = (record_policydb_table_iterate_t) sepol_bool_iterate, |
| 51 |
}; |
| 52 |
|
| 53 |
int bool_policydb_dbase_init(semanage_handle_t * handle, |
| 54 |
dbase_config_t * dconfig) |
| 55 |
{ |
| 56 |
|
| 57 |
if (dbase_policydb_init(handle, |
| 58 |
semanage_path(SEMANAGE_ACTIVE, SEMANAGE_STORE_KERNEL), |
| 59 |
semanage_path(SEMANAGE_TMP, SEMANAGE_STORE_KERNEL), |
| 60 |
&SEMANAGE_BOOL_RTABLE, |
| 61 |
&SEMANAGE_BOOL_POLICYDB_RTABLE, |
| 62 |
&dconfig->dbase) < 0) |
| 63 |
return STATUS_ERR; |
| 64 |
|
| 65 |
dconfig->dtable = &SEMANAGE_POLICYDB_DTABLE; |
| 66 |
return STATUS_SUCCESS; |
| 67 |
} |
| 68 |
|
| 69 |
void bool_policydb_dbase_release(dbase_config_t * dconfig) |
| 70 |
{ |
| 71 |
|
| 72 |
dbase_policydb_release(dconfig->dbase); |
| 73 |
} |