libsepol: constify sepol_genbools()'s boolpath parameter

This allows removing an unnecessary cast to (char *) in libselinux.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2017-03-28 23:41:48 +02:00 committed by James Carter
parent 76f8c04c19
commit b6579d262e
4 changed files with 5 additions and 6 deletions

View file

@ -79,7 +79,7 @@ int selinux_mkload_policy(int preservebools)
int (*policydb_to_image)(sepol_handle_t *, sepol_policydb_t *, void **, size_t *) = NULL;
int (*genbools_array)(void *data, size_t len, char **names, int *values, int nel) = NULL;
int (*genusers)(void *data, size_t len, const char *usersdir, void **newdata, size_t * newlen) = NULL;
int (*genbools)(void *data, size_t len, char *boolpath) = NULL;
int (*genbools)(void *data, size_t len, const char *boolpath) = NULL;
#ifdef SHARED
char *errormsg = NULL;
@ -275,8 +275,7 @@ checkbool:
free(names);
}
} else if (setlocaldefs) {
(void)genbools(data, size,
(char *)selinux_booleans_path());
(void)genbools(data, size, selinux_booleans_path());
}
}

View file

@ -17,7 +17,7 @@ extern "C" {
policy for the boolean settings in the boolean configuration file.
The binary policy is rewritten in place in memory.
Returns 0 upon success, or -1 otherwise. */
extern int sepol_genbools(void *data, size_t len, char *boolpath);
extern int sepol_genbools(void *data, size_t len, const char *boolpath);
/* Given an existing binary policy (starting at 'data', with length 'len')
and boolean settings specified by the parallel arrays ('names', 'values')

View file

@ -4,7 +4,7 @@ sepol_genbools \- Rewrite a binary policy with different boolean settings
.SH "SYNOPSIS"
.B #include <sepol/sepol.h>
.sp
.BI "int sepol_genbools(void *" data ", size_t "len ", char *" boolpath );
.BI "int sepol_genbools(void *" data ", size_t "len ", const char *" boolpath );
.br
.BI "int sepol_genbools_array(void *" data ", size_t " len ", char **" names ", int *" values ", int " nel );

View file

@ -157,7 +157,7 @@ static int load_booleans(struct policydb *policydb, const char *path,
return errors ? -1 : 0;
}
int sepol_genbools(void *data, size_t len, char *booleans)
int sepol_genbools(void *data, size_t len, const char *booleans)
{
struct policydb policydb;
struct policy_file pf;