mirror of
https://github.com/SELinuxProject/selinux
synced 2025-04-17 04:40:41 +00:00
libselinux: constify global strings
Declare the read-only encode table const. Drop the only once used global variable selinux_rootpath. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
eb963a88b4
commit
d27d6beff3
@ -33,7 +33,7 @@ static int object_name_encode(const char *objname, char *buffer, size_t buflen)
|
||||
return -1;
|
||||
buffer[offset++] = '+';
|
||||
} else {
|
||||
static const char *table = "0123456789ABCDEF";
|
||||
static const char *const table = "0123456789ABCDEF";
|
||||
int l = (code & 0x0f);
|
||||
int h = (code & 0xf0) >> 4;
|
||||
|
||||
|
@ -153,7 +153,6 @@ static int setpolicytype(const char *type)
|
||||
}
|
||||
|
||||
static char *selinux_policyroot = NULL;
|
||||
static const char *selinux_rootpath = SELINUXDIR;
|
||||
|
||||
static void init_selinux_config(void)
|
||||
{
|
||||
@ -312,7 +311,7 @@ int selinux_set_policy_root(const char *path)
|
||||
|
||||
const char *selinux_path(void)
|
||||
{
|
||||
return selinux_rootpath;
|
||||
return SELINUXDIR;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user