aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c16
-rw-r--r--security/selinux/include/security.h5
2 files changed, 13 insertions, 8 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9d002f8484a3..93c809a6e4fa 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -321,10 +321,10 @@ enum {
321}; 321};
322 322
323static match_table_t tokens = { 323static match_table_t tokens = {
324 {Opt_context, "context=%s"}, 324 {Opt_context, CONTEXT_STR "%s"},
325 {Opt_fscontext, "fscontext=%s"}, 325 {Opt_fscontext, FSCONTEXT_STR "%s"},
326 {Opt_defcontext, "defcontext=%s"}, 326 {Opt_defcontext, DEFCONTEXT_STR "%s"},
327 {Opt_rootcontext, "rootcontext=%s"}, 327 {Opt_rootcontext, ROOTCONTEXT_STR "%s"},
328 {Opt_error, NULL}, 328 {Opt_error, NULL},
329}; 329};
330 330
@@ -2287,10 +2287,10 @@ static inline int match_prefix(char *prefix, int plen, char *option, int olen)
2287 2287
2288static inline int selinux_option(char *option, int len) 2288static inline int selinux_option(char *option, int len)
2289{ 2289{
2290 return (match_prefix("context=", sizeof("context=")-1, option, len) || 2290 return (match_prefix(CONTEXT_STR, sizeof(CONTEXT_STR)-1, option, len) ||
2291 match_prefix("fscontext=", sizeof("fscontext=")-1, option, len) || 2291 match_prefix(FSCONTEXT_STR, sizeof(FSCONTEXT_STR)-1, option, len) ||
2292 match_prefix("defcontext=", sizeof("defcontext=")-1, option, len) || 2292 match_prefix(DEFCONTEXT_STR, sizeof(DEFCONTEXT_STR)-1, option, len) ||
2293 match_prefix("rootcontext=", sizeof("rootcontext=")-1, option, len)); 2293 match_prefix(ROOTCONTEXT_STR, sizeof(ROOTCONTEXT_STR)-1, option, len));
2294} 2294}
2295 2295
2296static inline void take_option(char **to, char *from, int *first, int len) 2296static inline void take_option(char **to, char *from, int *first, int len)
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index dd70aa084637..bc823ef70a12 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -41,6 +41,11 @@
41#define ROOTCONTEXT_MNT 0x04 41#define ROOTCONTEXT_MNT 0x04
42#define DEFCONTEXT_MNT 0x08 42#define DEFCONTEXT_MNT 0x08
43 43
44#define CONTEXT_STR "context="
45#define FSCONTEXT_STR "fscontext="
46#define ROOTCONTEXT_STR "rootcontext="
47#define DEFCONTEXT_STR "defcontext="
48
44struct netlbl_lsm_secattr; 49struct netlbl_lsm_secattr;
45 50
46extern int selinux_enabled; 51extern int selinux_enabled;