diff options
author | Eric Paris <eparis@redhat.com> | 2012-08-24 15:58:53 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2013-07-25 13:02:53 -0400 |
commit | d355987f47bbe24e7450b509a3f8aac0db88b65a (patch) | |
tree | 60bd8865c311f6319f9ab3f26be57b95b55e5685 /security | |
parent | 40d3d0b85fa22084fc3b7eeb943aca365097cea3 (diff) |
SELinux: make it harder to get the number of mnt opts wrong
Instead of just hard coding a value, use the enum to out benefit.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/hooks.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 42b538ceb8b4..863f20590186 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -94,8 +94,6 @@ | |||
94 | #include "audit.h" | 94 | #include "audit.h" |
95 | #include "avc_ss.h" | 95 | #include "avc_ss.h" |
96 | 96 | ||
97 | #define NUM_SEL_MNT_OPTS 5 | ||
98 | |||
99 | extern struct security_operations *security_ops; | 97 | extern struct security_operations *security_ops; |
100 | 98 | ||
101 | /* SECMARK reference count */ | 99 | /* SECMARK reference count */ |
@@ -307,8 +305,11 @@ enum { | |||
307 | Opt_defcontext = 3, | 305 | Opt_defcontext = 3, |
308 | Opt_rootcontext = 4, | 306 | Opt_rootcontext = 4, |
309 | Opt_labelsupport = 5, | 307 | Opt_labelsupport = 5, |
308 | Opt_nextmntopt = 6, | ||
310 | }; | 309 | }; |
311 | 310 | ||
311 | #define NUM_SEL_MNT_OPTS (Opt_nextmntopt - 1) | ||
312 | |||
312 | static const match_table_t tokens = { | 313 | static const match_table_t tokens = { |
313 | {Opt_context, CONTEXT_STR "%s"}, | 314 | {Opt_context, CONTEXT_STR "%s"}, |
314 | {Opt_fscontext, FSCONTEXT_STR "%s"}, | 315 | {Opt_fscontext, FSCONTEXT_STR "%s"}, |