Commit 4158cb60 authored by Christian Göttsche's avatar Christian Göttsche Committed by Paul Moore

selinux: declare read-only data arrays const

The array of mount tokens in only used in match_opt_prefix() and never
modified.

The array of symtab names is never modified and only used in the
DEBUG_HASHES configuration as output.

The array of files for the SElinux filesystem sub-directory `ss` is
similar to the other `struct tree_descr` usages only read from to
construct the containing entries.
Signed-off-by: default avatarChristian Göttsche <cgzones@googlemail.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 4595ae8c
...@@ -357,7 +357,7 @@ enum { ...@@ -357,7 +357,7 @@ enum {
}; };
#define A(s, has_arg) {#s, sizeof(#s) - 1, Opt_##s, has_arg} #define A(s, has_arg) {#s, sizeof(#s) - 1, Opt_##s, has_arg}
static struct { static const struct {
const char *name; const char *name;
int len; int len;
int opt; int opt;
......
...@@ -1649,7 +1649,7 @@ static int sel_make_ss_files(struct dentry *dir) ...@@ -1649,7 +1649,7 @@ static int sel_make_ss_files(struct dentry *dir)
struct super_block *sb = dir->d_sb; struct super_block *sb = dir->d_sb;
struct selinux_fs_info *fsi = sb->s_fs_info; struct selinux_fs_info *fsi = sb->s_fs_info;
int i; int i;
static struct tree_descr files[] = { static const struct tree_descr files[] = {
{ "sidtab_hash_stats", &sel_sidtab_hash_stats_ops, S_IRUGO }, { "sidtab_hash_stats", &sel_sidtab_hash_stats_ops, S_IRUGO },
}; };
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "services.h" #include "services.h"
#ifdef DEBUG_HASHES #ifdef DEBUG_HASHES
static const char *symtab_name[SYM_NUM] = { static const char *const symtab_name[SYM_NUM] = {
"common prefixes", "common prefixes",
"classes", "classes",
"roles", "roles",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment