libsepol: method to check disable dontaudit flag.

This patch adds the ability to check on the value of the disable_dontaudit flag in the sepol handle. In the past the only way to know the value of this was to directly read the values from the handle. The get function provides a setter-getter symmetry similar to other functions found in libsepol.

Signed-off-by: Christopher Pardy <cpardy@redhat.com>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
Christopher Pardy 2009-07-06 10:42:15 -04:00 committed by Stephen Smalley
parent 1591e42625
commit 86a2f899cb
3 changed files with 13 additions and 0 deletions

View File

@ -7,6 +7,12 @@ typedef struct sepol_handle sepol_handle_t;
/* Create and return a sepol handle. */
sepol_handle_t *sepol_handle_create(void);
/* Get whether or not dontaudits will be disabled, same values as
* specified by set_disable_dontaudit. This value reflects the state
* your system will be set to upon commit, not necessarily its
* current state.*/
int sepol_get_disable_dontaudit(sepol_handle_t * sh);
/* Set whether or not to disable dontaudits, 0 is default and does
* not disable dontaudits, 1 disables them */
void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit);

View File

@ -21,6 +21,12 @@ sepol_handle_t *sepol_handle_create(void)
return sh;
}
int sepol_get_disable_dontaudit(sepol_handle_t *sh)
{
assert(sh !=NULL);
return sh->disable_dontaudit;
}
void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit)
{
assert(sh !=NULL);

View File

@ -12,6 +12,7 @@
sepol_policydb_*; sepol_set_policydb_from_file;
sepol_policy_kern_*;
sepol_policy_file_*;
sepol_get_disable_dontaudit;
sepol_set_disable_dontaudit;
sepol_set_expand_consume_base;
local: *;