Skip to content

Commit

Permalink
SELinux: make it harder to get the number of mnt opts wrong
Browse files Browse the repository at this point in the history
Instead of just hard coding a value, use the enum to out benefit.

Signed-off-by: Eric Paris <[email protected]>
  • Loading branch information
eparis committed Jul 25, 2013
1 parent 40d3d0b commit d355987
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions security/selinux/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@
#include "audit.h"
#include "avc_ss.h"

#define NUM_SEL_MNT_OPTS 5

extern struct security_operations *security_ops;

/* SECMARK reference count */
Expand Down Expand Up @@ -307,8 +305,11 @@ enum {
Opt_defcontext = 3,
Opt_rootcontext = 4,
Opt_labelsupport = 5,
Opt_nextmntopt = 6,
};

#define NUM_SEL_MNT_OPTS (Opt_nextmntopt - 1)

static const match_table_t tokens = {
{Opt_context, CONTEXT_STR "%s"},
{Opt_fscontext, FSCONTEXT_STR "%s"},
Expand Down

0 comments on commit d355987

Please sign in to comment.