@@ -9,7 +9,7 @@
#include "handle.h"
/* BOOL RECORD: method table */
-extern record_table_t SEMANAGE_BOOL_RTABLE;
+extern const record_table_t SEMANAGE_BOOL_RTABLE;
extern int bool_file_dbase_init(semanage_handle_t * handle,
const char *path_ro,
@@ -181,7 +181,7 @@ void semanage_bool_free(semanage_bool_t * boolean)
/* Record base functions */
-record_table_t SEMANAGE_BOOL_RTABLE = {
+const record_table_t SEMANAGE_BOOL_RTABLE = {
.create = semanage_bool_create,
.key_extract = semanage_bool_key_extract,
.key_free = semanage_bool_key_free,
@@ -141,7 +141,7 @@ static int bool_commit_list(semanage_handle_t * handle,
}
/* BOOL RECORD: ACTIVEDB extension: method table */
-static record_activedb_table_t SEMANAGE_BOOL_ACTIVEDB_RTABLE = {
+static const record_activedb_table_t SEMANAGE_BOOL_ACTIVEDB_RTABLE = {
.read_list = bool_read_list,
.commit_list = bool_commit_list,
};
@@ -101,7 +101,7 @@ static int bool_parse(semanage_handle_t * handle,
}
/* BOOL RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_BOOL_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_BOOL_FILE_RTABLE = {
.parse = bool_parse,
.print = bool_print,
};
@@ -36,7 +36,7 @@ typedef struct dbase_policydb dbase_t;
#include "semanage_store.h"
/* BOOLEAN RECRORD (SEPOL): POLICYDB extension: method table */
-static record_policydb_table_t SEMANAGE_BOOL_POLICYDB_RTABLE = {
+static const record_policydb_table_t SEMANAGE_BOOL_POLICYDB_RTABLE = {
.add = NULL,
.modify = NULL,
/* FIXME: these casts depend on structs in libsepol matching structs
@@ -166,7 +166,7 @@ typedef struct dbase_table {
/* Retrieves the record table for this database,
* which specifies how to perform basic operations
* on each record. */
- record_table_t *(*get_rtable) (dbase_t * dbase);
+ const record_table_t *(*get_rtable) (dbase_t * dbase);
} dbase_table_t;
@@ -176,7 +176,7 @@ typedef struct dbase_config {
dbase_t *dbase;
/* Database methods */
- dbase_table_t *dtable;
+ const dbase_table_t *dtable;
} dbase_config_t;
@@ -26,15 +26,15 @@ struct dbase_activedb {
dbase_llist_t llist;
/* ACTIVEDB extension */
- record_activedb_table_t *ratable;
+ const record_activedb_table_t *ratable;
};
static int dbase_activedb_cache(semanage_handle_t * handle,
dbase_activedb_t * dbase)
{
- record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
- record_activedb_table_t *ratable = dbase->ratable;
+ const record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
+ const record_activedb_table_t *ratable = dbase->ratable;
record_t **records = NULL;
unsigned int rcount = 0;
@@ -77,8 +77,8 @@ static int dbase_activedb_flush(semanage_handle_t * handle,
dbase_activedb_t * dbase)
{
- record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
- record_activedb_table_t *ratable = dbase->ratable;
+ const record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
+ const record_activedb_table_t *ratable = dbase->ratable;
record_t **records = NULL;
unsigned int rcount = 0;
@@ -111,8 +111,8 @@ static int dbase_activedb_flush(semanage_handle_t * handle,
}
int dbase_activedb_init(semanage_handle_t * handle,
- record_table_t * rtable,
- record_activedb_table_t * ratable,
+ const record_table_t * rtable,
+ const record_activedb_table_t * ratable,
dbase_activedb_t ** dbase)
{
@@ -147,7 +147,7 @@ void dbase_activedb_release(dbase_activedb_t * dbase)
}
/* ACTIVEDB dbase - method table implementation */
-dbase_table_t SEMANAGE_ACTIVEDB_DTABLE = {
+const dbase_table_t SEMANAGE_ACTIVEDB_DTABLE = {
/* Cache/Transactions */
.cache = dbase_activedb_cache,
@@ -24,14 +24,14 @@ typedef struct record_activedb_table {
/* ACTIVEDB - initialization */
extern int dbase_activedb_init(semanage_handle_t * handle,
- record_table_t * rtable,
- record_activedb_table_t * ratable,
+ const record_table_t * rtable,
+ const record_activedb_table_t * ratable,
dbase_activedb_t ** dbase);
/* ACTIVEDB - release */
extern void dbase_activedb_release(dbase_activedb_t * dbase);
/* ACTIVEDB - method table implementation */
-extern dbase_table_t SEMANAGE_ACTIVEDB_DTABLE;
+extern const dbase_table_t SEMANAGE_ACTIVEDB_DTABLE;
#endif
@@ -34,14 +34,14 @@ struct dbase_file {
const char *path[2];
/* FILE extension */
- record_file_table_t *rftable;
+ const record_file_table_t *rftable;
};
static int dbase_file_cache(semanage_handle_t * handle, dbase_file_t * dbase)
{
- record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
- record_file_table_t *rftable = dbase->rftable;
+ const record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
+ const record_file_table_t *rftable = dbase->rftable;
record_t *process_record = NULL;
int pstatus = STATUS_SUCCESS;
@@ -114,7 +114,7 @@ static int dbase_file_cache(semanage_handle_t * handle, dbase_file_t * dbase)
static int dbase_file_flush(semanage_handle_t * handle, dbase_file_t * dbase)
{
- record_file_table_t *rftable = dbase->rftable;
+ const record_file_table_t *rftable = dbase->rftable;
cache_entry_t *ptr;
const char *fname = NULL;
@@ -163,8 +163,8 @@ static int dbase_file_flush(semanage_handle_t * handle, dbase_file_t * dbase)
int dbase_file_init(semanage_handle_t * handle,
const char *path_ro,
const char *path_rw,
- record_table_t * rtable,
- record_file_table_t * rftable, dbase_file_t ** dbase)
+ const record_table_t * rtable,
+ const record_file_table_t * rftable, dbase_file_t ** dbase)
{
dbase_file_t *tmp_dbase = (dbase_file_t *) malloc(sizeof(dbase_file_t));
@@ -199,7 +199,7 @@ void dbase_file_release(dbase_file_t * dbase)
}
/* FILE dbase - method table implementation */
-dbase_table_t SEMANAGE_FILE_DTABLE = {
+dbase_table_t const SEMANAGE_FILE_DTABLE = {
/* Cache/Transactions */
.cache = dbase_file_cache,
@@ -30,14 +30,14 @@ typedef struct record_file_table {
extern int dbase_file_init(semanage_handle_t * handle,
const char *path_ro,
const char *path_rw,
- record_table_t * rtable,
- record_file_table_t * rftable,
+ const record_table_t * rtable,
+ const record_file_table_t * rftable,
dbase_file_t ** dbase);
/* FILE - release */
extern void dbase_file_release(dbase_file_t * dbase);
/* FILE - method table implementation */
-extern dbase_table_t SEMANAGE_FILE_DTABLE;
+extern const dbase_table_t SEMANAGE_FILE_DTABLE;
#endif
@@ -31,7 +31,7 @@ struct dbase_join {
dbase_config_t *join2;
/* JOIN extension */
- record_join_table_t *rjtable;
+ const record_join_table_t *rjtable;
};
static int dbase_join_cache(semanage_handle_t * handle, dbase_join_t * dbase)
@@ -40,12 +40,12 @@ static int dbase_join_cache(semanage_handle_t * handle, dbase_join_t * dbase)
/* Extract all the object tables information */
dbase_t *dbase1 = dbase->join1->dbase;
dbase_t *dbase2 = dbase->join2->dbase;
- dbase_table_t *dtable1 = dbase->join1->dtable;
- dbase_table_t *dtable2 = dbase->join2->dtable;
- record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
- record_join_table_t *rjtable = dbase->rjtable;
- record_table_t *rtable1 = dtable1->get_rtable(dbase1);
- record_table_t *rtable2 = dtable2->get_rtable(dbase2);
+ const dbase_table_t *dtable1 = dbase->join1->dtable;
+ const dbase_table_t *dtable2 = dbase->join2->dtable;
+ const record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
+ const record_join_table_t *rjtable = dbase->rjtable;
+ const record_table_t *rtable1 = dtable1->get_rtable(dbase1);
+ const record_table_t *rtable2 = dtable2->get_rtable(dbase2);
record_key_t *rkey = NULL;
record_t *record = NULL;
@@ -176,12 +176,12 @@ static int dbase_join_flush(semanage_handle_t * handle, dbase_join_t * dbase)
/* Extract all the object tables information */
dbase_t *dbase1 = dbase->join1->dbase;
dbase_t *dbase2 = dbase->join2->dbase;
- dbase_table_t *dtable1 = dbase->join1->dtable;
- dbase_table_t *dtable2 = dbase->join2->dtable;
- record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
- record_join_table_t *rjtable = dbase->rjtable;
- record_table_t *rtable1 = dtable1->get_rtable(dbase1);
- record_table_t *rtable2 = dtable2->get_rtable(dbase2);
+ const dbase_table_t *dtable1 = dbase->join1->dtable;
+ const dbase_table_t *dtable2 = dbase->join2->dtable;
+ const record_table_t *rtable = dbase_llist_get_rtable(&dbase->llist);
+ const record_join_table_t *rjtable = dbase->rjtable;
+ const record_table_t *rtable1 = dtable1->get_rtable(dbase1);
+ const record_table_t *rtable2 = dtable2->get_rtable(dbase2);
cache_entry_t *ptr;
record_key_t *rkey = NULL;
@@ -240,8 +240,8 @@ static int dbase_join_flush(semanage_handle_t * handle, dbase_join_t * dbase)
}
int dbase_join_init(semanage_handle_t * handle,
- record_table_t * rtable,
- record_join_table_t * rjtable,
+ const record_table_t * rtable,
+ const record_join_table_t * rjtable,
dbase_config_t * join1,
dbase_config_t * join2, dbase_t ** dbase)
{
@@ -279,7 +279,7 @@ void dbase_join_release(dbase_join_t * dbase)
}
/* JOIN dbase - method table implementation */
-dbase_table_t SEMANAGE_JOIN_DTABLE = {
+const dbase_table_t SEMANAGE_JOIN_DTABLE = {
/* Cache/Transactions */
.cache = dbase_join_cache,
@@ -33,8 +33,8 @@ typedef struct record_join_table {
/* JOIN - initialization */
extern int dbase_join_init(semanage_handle_t * handle,
- record_table_t * rtable,
- record_join_table_t * rjtable,
+ const record_table_t * rtable,
+ const record_join_table_t * rjtable,
dbase_config_t * join1,
dbase_config_t * join2, dbase_join_t ** dbase);
@@ -42,6 +42,6 @@ extern int dbase_join_init(semanage_handle_t * handle,
extern void dbase_join_release(dbase_join_t * dbase);
/* JOIN - method table implementation */
-extern dbase_table_t SEMANAGE_JOIN_DTABLE;
+extern const dbase_table_t SEMANAGE_JOIN_DTABLE;
#endif
@@ -17,8 +17,8 @@ typedef struct cache_entry {
typedef struct dbase_llist {
/* Method tables */
- record_table_t *rtable;
- dbase_table_t *dtable;
+ const record_table_t *rtable;
+ const dbase_table_t *dtable;
/* In-memory representation (cache) */
cache_entry_t *cache;
@@ -42,8 +42,8 @@ static inline void dbase_llist_cache_init(dbase_llist_t * dbase)
}
static inline void dbase_llist_init(dbase_llist_t * dbase,
- record_table_t * rtable,
- dbase_table_t * dtable)
+ const record_table_t * rtable,
+ const dbase_table_t * dtable)
{
dbase->rtable = rtable;
@@ -76,7 +76,7 @@ static inline int dbase_llist_is_modified(dbase_llist_t * dbase)
}
/* LLIST - polymorphism */
-static inline record_table_t *dbase_llist_get_rtable(dbase_llist_t * dbase)
+static inline const record_table_t *dbase_llist_get_rtable(dbase_llist_t * dbase)
{
return dbase->rtable;
}
@@ -29,10 +29,10 @@ struct dbase_policydb {
const char *path[2];
/* Base record table */
- record_table_t *rtable;
+ const record_table_t *rtable;
/* Policy extensions */
- record_policydb_table_t *rptable;
+ const record_policydb_table_t *rptable;
sepol_policydb_t *policydb;
@@ -178,8 +178,8 @@ static int dbase_policydb_is_modified(dbase_policydb_t * dbase)
int dbase_policydb_init(semanage_handle_t * handle,
const char *path_ro,
const char *path_rw,
- record_table_t * rtable,
- record_policydb_table_t * rptable,
+ const record_table_t * rtable,
+ const record_policydb_table_t * rptable,
dbase_policydb_t ** dbase)
{
@@ -377,7 +377,7 @@ static int dbase_policydb_iterate(semanage_handle_t * handle,
struct list_handler_arg {
semanage_handle_t *handle;
- record_table_t *rtable;
+ const record_table_t *rtable;
record_t **records;
int pos;
};
@@ -444,14 +444,14 @@ static int dbase_policydb_list(semanage_handle_t * handle,
return STATUS_ERR;
}
-static record_table_t *dbase_policydb_get_rtable(dbase_policydb_t * dbase)
+static const record_table_t *dbase_policydb_get_rtable(dbase_policydb_t * dbase)
{
return dbase->rtable;
}
/* POLICYDB dbase - method table implementation */
-dbase_table_t SEMANAGE_POLICYDB_DTABLE = {
+const dbase_table_t SEMANAGE_POLICYDB_DTABLE = {
/* Cache/Transactions */
.cache = dbase_policydb_cache,
@@ -88,8 +88,8 @@ typedef struct record_policydb_table {
extern int dbase_policydb_init(semanage_handle_t * handle,
const char *path_ro,
const char *path_rw,
- record_table_t * rtable,
- record_policydb_table_t * rptable,
+ const record_table_t * rtable,
+ const record_policydb_table_t * rptable,
dbase_policydb_t ** dbase);
/* Attach to a shared policydb.
@@ -107,6 +107,6 @@ extern void dbase_policydb_detach(dbase_policydb_t * dbase);
extern void dbase_policydb_release(dbase_policydb_t * dbase);
/* POLICYDB database - method table implementation */
-extern dbase_table_t SEMANAGE_POLICYDB_DTABLE;
+extern const dbase_table_t SEMANAGE_POLICYDB_DTABLE;
#endif
@@ -104,7 +104,7 @@ static int semanage_direct_install_info(semanage_handle_t *sh,
static int semanage_direct_remove_key(semanage_handle_t *sh,
const semanage_module_key_t *modkey);
-static struct semanage_policy_table direct_funcs = {
+static const struct semanage_policy_table direct_funcs = {
.get_serial = semanage_direct_get_serial,
.destroy = semanage_direct_destroy,
.disconnect = semanage_direct_disconnect,
@@ -9,7 +9,7 @@
#include "handle.h"
/* FCONTEXT RECORD: method table */
-extern record_table_t SEMANAGE_FCONTEXT_RTABLE;
+extern const record_table_t SEMANAGE_FCONTEXT_RTABLE;
extern int fcontext_file_dbase_init(semanage_handle_t * handle,
const char *path_ro,
@@ -289,7 +289,7 @@ void semanage_fcontext_free(semanage_fcontext_t * fcontext)
/* Record base functions */
-record_table_t SEMANAGE_FCONTEXT_RTABLE = {
+const record_table_t SEMANAGE_FCONTEXT_RTABLE = {
.create = semanage_fcontext_create,
.key_extract = semanage_fcontext_key_extract,
.key_free = semanage_fcontext_key_free,
@@ -158,7 +158,7 @@ static int fcontext_parse(semanage_handle_t * handle,
}
/* FCONTEXT RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_FCONTEXT_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_FCONTEXT_FILE_RTABLE = {
.parse = fcontext_parse,
.print = fcontext_print,
};
@@ -80,7 +80,7 @@ struct semanage_handle {
/* these function pointers will point to the appropriate
* routine given the connection type. think of these as
* simulating polymorphism for non-OO languages. */
- struct semanage_policy_table *funcs;
+ const struct semanage_policy_table *funcs;
/* Object databases */
#define DBASE_COUNT 24
@@ -8,7 +8,7 @@
#include "handle.h"
/* IBENDPORT RECORD: method table */
-extern record_table_t SEMANAGE_IBENDPORT_RTABLE;
+extern const record_table_t SEMANAGE_IBENDPORT_RTABLE;
extern int ibendport_file_dbase_init(semanage_handle_t *handle,
const char *path_ro,
@@ -129,7 +129,7 @@ void semanage_ibendport_free(semanage_ibendport_t *ibendport)
/*key base functions */
-record_table_t SEMANAGE_IBENDPORT_RTABLE = {
+const record_table_t SEMANAGE_IBENDPORT_RTABLE = {
.create = semanage_ibendport_create,
.key_extract = semanage_ibendport_key_extract,
.key_free = semanage_ibendport_key_free,
@@ -129,7 +129,7 @@ err:
}
/* IBENDPORT RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_IBENDPORT_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_IBENDPORT_FILE_RTABLE = {
.parse = ibendport_parse,
.print = ibendport_print,
};
@@ -30,7 +30,7 @@ typedef struct dbase_policydb dbase_t;
#include "semanage_store.h"
/* IBENDPORT RECORD (SEPOL): POLICYDB extension : method table */
-static record_policydb_table_t SEMANAGE_IBENDPORT_POLICYDB_RTABLE = {
+static const record_policydb_table_t SEMANAGE_IBENDPORT_POLICYDB_RTABLE = {
.add = NULL,
.modify = (record_policydb_table_modify_t)sepol_ibendport_modify,
.set = NULL,
@@ -8,7 +8,7 @@
#include "handle.h"
/* PKEY RECORD: method table */
-extern record_table_t SEMANAGE_IBPKEY_RTABLE;
+extern const record_table_t SEMANAGE_IBPKEY_RTABLE;
extern int ibpkey_file_dbase_init(semanage_handle_t *handle,
const char *path_ro,
@@ -153,7 +153,7 @@ void semanage_ibpkey_free(semanage_ibpkey_t *ibpkey)
/* key base functions */
-record_table_t SEMANAGE_IBPKEY_RTABLE = {
+const record_table_t SEMANAGE_IBPKEY_RTABLE = {
.create = semanage_ibpkey_create,
.key_extract = semanage_ibpkey_key_extract,
.key_free = semanage_ibpkey_key_free,
@@ -153,7 +153,7 @@ err:
}
/* IBPKEY RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_IBPKEY_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_IBPKEY_FILE_RTABLE = {
.parse = ibpkey_parse,
.print = ibpkey_print,
};
@@ -30,7 +30,7 @@ typedef struct dbase_policydb dbase_t;
#include "semanage_store.h"
/* PKEY RECORD (SEPOL): POLICYDB extension : method table */
-static record_policydb_table_t SEMANAGE_IBPKEY_POLICYDB_RTABLE = {
+static const record_policydb_table_t SEMANAGE_IBPKEY_POLICYDB_RTABLE = {
.add = NULL,
.modify = (record_policydb_table_modify_t)sepol_ibpkey_modify,
.set = NULL,
@@ -8,7 +8,7 @@
#include "handle.h"
/* IFACE RECORD: method table */
-extern record_table_t SEMANAGE_IFACE_RTABLE;
+extern const record_table_t SEMANAGE_IFACE_RTABLE;
extern int iface_policydb_dbase_init(semanage_handle_t * handle,
dbase_config_t * dconfig);
@@ -144,7 +144,7 @@ void semanage_iface_free(semanage_iface_t * iface)
/* Record base functions */
-record_table_t SEMANAGE_IFACE_RTABLE = {
+const record_table_t SEMANAGE_IFACE_RTABLE = {
.create = semanage_iface_create,
.key_extract = semanage_iface_key_extract,
.key_free = semanage_iface_key_free,
@@ -145,7 +145,7 @@ static int iface_parse(semanage_handle_t * handle,
}
/* IFACE RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_IFACE_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_IFACE_FILE_RTABLE = {
.parse = iface_parse,
.print = iface_print,
};
@@ -36,7 +36,7 @@ typedef struct dbase_policydb dbase_t;
#include "semanage_store.h"
/* INTERFACE RECRORD (SEPOL): POLICYDB extension: method table */
-static record_policydb_table_t SEMANAGE_IFACE_POLICYDB_RTABLE = {
+static const record_policydb_table_t SEMANAGE_IFACE_POLICYDB_RTABLE = {
.add = NULL,
.modify = (record_policydb_table_modify_t) sepol_iface_modify,
.set = NULL,
@@ -8,7 +8,7 @@
#include "handle.h"
/* NODE RECORD: method table */
-extern record_table_t SEMANAGE_NODE_RTABLE;
+extern const record_table_t SEMANAGE_NODE_RTABLE;
extern int node_file_dbase_init(semanage_handle_t * handle,
const char *path_ro,
@@ -208,7 +208,7 @@ void semanage_node_free(semanage_node_t * node)
/* Port base functions */
-record_table_t SEMANAGE_NODE_RTABLE = {
+const record_table_t SEMANAGE_NODE_RTABLE = {
.create = semanage_node_create,
.key_extract = semanage_node_key_extract,
.key_free = semanage_node_key_free,
@@ -154,7 +154,7 @@ static int node_parse(semanage_handle_t * handle,
}
/* NODE RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_NODE_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_NODE_FILE_RTABLE = {
.parse = node_parse,
.print = node_print,
};
@@ -35,7 +35,7 @@ typedef struct dbase_policydb dbase_t;
#include "semanage_store.h"
/* NODE RECORD (SEPOL): POLICYDB extension : method table */
-static record_policydb_table_t SEMANAGE_NODE_POLICYDB_RTABLE = {
+static const record_policydb_table_t SEMANAGE_NODE_POLICYDB_RTABLE = {
.add = NULL,
.modify = (record_policydb_table_modify_t) sepol_node_modify,
.set = NULL,
@@ -21,9 +21,9 @@ static int clear_obsolete(semanage_handle_t * handle,
record_key_t *key = NULL;
unsigned int i;
- dbase_table_t *src_dtable = src->dtable;
- dbase_table_t *dst_dtable = dst->dtable;
- record_table_t *rtable = src_dtable->get_rtable(src->dbase);
+ const dbase_table_t *src_dtable = src->dtable;
+ const dbase_table_t *dst_dtable = dst->dtable;
+ const record_table_t *rtable = src_dtable->get_rtable(src->dbase);
for (i = 0; i < nrecords; i++) {
int exists;
@@ -65,8 +65,8 @@ static int load_records(semanage_handle_t * handle,
record_key_t *rkey = NULL;
dbase_t *dbase = dst->dbase;
- dbase_table_t *dtable = dst->dtable;
- record_table_t *rtable = dtable->get_rtable(dbase);
+ const dbase_table_t *dtable = dst->dtable;
+ const record_table_t *rtable = dtable->get_rtable(dbase);
for (i = 0; i < nrecords; i++) {
@@ -154,7 +154,7 @@ int semanage_base_merge_components(semanage_handle_t * handle)
dbase_config_t *src = components[i].src;
dbase_config_t *dst = components[i].dst;
int mode = components[i].mode;
- record_table_t *rtable = src->dtable->get_rtable(src->dbase);
+ const record_table_t *rtable = src->dtable->get_rtable(src->dbase);
/* Must invoke cache function first */
if (src->dtable->cache(handle, src->dbase) < 0)
@@ -8,7 +8,7 @@
#include "handle.h"
/* PORT RECORD: method table */
-extern record_table_t SEMANAGE_PORT_RTABLE;
+extern const record_table_t SEMANAGE_PORT_RTABLE;
extern int port_file_dbase_init(semanage_handle_t * handle,
const char *path_ro,
@@ -164,7 +164,7 @@ void semanage_port_free(semanage_port_t * port)
/* Port base functions */
-record_table_t SEMANAGE_PORT_RTABLE = {
+const record_table_t SEMANAGE_PORT_RTABLE = {
.create = semanage_port_create,
.key_extract = semanage_port_key_extract,
.key_free = semanage_port_key_free,
@@ -161,7 +161,7 @@ static int port_parse(semanage_handle_t * handle,
}
/* PORT RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_PORT_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_PORT_FILE_RTABLE = {
.parse = port_parse,
.print = port_print,
};
@@ -35,7 +35,7 @@ typedef struct dbase_policydb dbase_t;
#include "semanage_store.h"
/* PORT RECORD (SEPOL): POLICYDB extension : method table */
-static record_policydb_table_t SEMANAGE_PORT_POLICYDB_RTABLE = {
+static const record_policydb_table_t SEMANAGE_PORT_POLICYDB_RTABLE = {
.add = NULL,
.modify = (record_policydb_table_modify_t) sepol_port_modify,
.set = NULL,
@@ -9,7 +9,7 @@
#include "handle.h"
/* SEUSER RECORD: method table */
-extern record_table_t SEMANAGE_SEUSER_RTABLE;
+extern const record_table_t SEMANAGE_SEUSER_RTABLE;
extern int seuser_file_dbase_init(semanage_handle_t * handle,
const char *path_ro,
@@ -246,7 +246,7 @@ void semanage_seuser_free(semanage_seuser_t * seuser)
/* Record base functions */
-record_table_t SEMANAGE_SEUSER_RTABLE = {
+const record_table_t SEMANAGE_SEUSER_RTABLE = {
.create = semanage_seuser_create,
.key_extract = semanage_seuser_key_extract,
.key_free = semanage_seuser_key_free,
@@ -109,7 +109,7 @@ static int seuser_parse(semanage_handle_t * handle,
}
/* SEUSER RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_SEUSER_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_SEUSER_FILE_RTABLE = {
.parse = seuser_parse,
.print = seuser_print,
};
@@ -172,7 +172,7 @@ static int semanage_user_base_compare2_qsort(const semanage_user_base_t ** user,
}
/* Record base functions */
-record_table_t SEMANAGE_USER_BASE_RTABLE = {
+const record_table_t SEMANAGE_USER_BASE_RTABLE = {
.create = semanage_user_base_create,
.key_extract = semanage_user_base_key_extract,
.key_free = semanage_user_key_free,
@@ -185,7 +185,7 @@ static int semanage_user_extra_compare2_qsort(const semanage_user_extra_t **
}
/* Record base functions */
-record_table_t SEMANAGE_USER_EXTRA_RTABLE = {
+const record_table_t SEMANAGE_USER_EXTRA_RTABLE = {
.create = semanage_user_extra_create,
.key_extract = semanage_user_extra_key_extract,
.key_free = semanage_user_key_free,
@@ -9,13 +9,13 @@
#include "handle.h"
/* USER record: method table */
-extern record_table_t SEMANAGE_USER_RTABLE;
+extern const record_table_t SEMANAGE_USER_RTABLE;
/* USER BASE record: method table */
-extern record_table_t SEMANAGE_USER_BASE_RTABLE;
+extern const record_table_t SEMANAGE_USER_BASE_RTABLE;
/* USER EXTRA record: method table */
-extern record_table_t SEMANAGE_USER_EXTRA_RTABLE;
+extern const record_table_t SEMANAGE_USER_EXTRA_RTABLE;
/* ============ Init/Release functions ========== */
@@ -382,7 +382,7 @@ void semanage_user_free(semanage_user_t * user)
}
/* Record base functions */
-record_table_t SEMANAGE_USER_RTABLE = {
+const record_table_t SEMANAGE_USER_RTABLE = {
.create = semanage_user_create,
.key_extract = semanage_user_key_extract,
.key_free = semanage_user_key_free,
@@ -195,7 +195,7 @@ static int user_base_parse(semanage_handle_t * handle,
}
/* USER BASE record: FILE extension: method table */
-static record_file_table_t SEMANAGE_USER_BASE_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_USER_BASE_FILE_RTABLE = {
.parse = user_base_parse,
.print = user_base_print,
};
@@ -35,7 +35,7 @@ typedef struct dbase_policydb dbase_t;
#include "semanage_store.h"
/* USER BASE record: POLICYDB extension: method table */
-static record_policydb_table_t SEMANAGE_USER_BASE_POLICYDB_RTABLE = {
+static const record_policydb_table_t SEMANAGE_USER_BASE_POLICYDB_RTABLE = {
.add = NULL,
.modify = (record_policydb_table_modify_t) sepol_user_modify,
.set = NULL,
@@ -100,7 +100,7 @@ static int user_extra_parse(semanage_handle_t * handle,
}
/* USER EXTRA RECORD: FILE extension: method table */
-static record_file_table_t SEMANAGE_USER_EXTRA_FILE_RTABLE = {
+static const record_file_table_t SEMANAGE_USER_EXTRA_FILE_RTABLE = {
.parse = user_extra_parse,
.print = user_extra_print,
};
@@ -22,7 +22,7 @@ typedef struct dbase_join dbase_t;
#include "debug.h"
/* USER record: JOIN extension: method table */
-static record_join_table_t SEMANAGE_USER_JOIN_RTABLE = {
+static const record_join_table_t SEMANAGE_USER_JOIN_RTABLE = {
.join = semanage_user_join,
.split = semanage_user_split,
};