summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2015-08-12 11:56:02 -0700
committerCasey Schaufler <casey@schaufler-ca.com>2015-08-12 18:10:01 -0700
commit3d04c92403d377918c9a3bddab6ee103f0db25dd (patch)
tree8aae34ab646ba8d41fa1d9d245deed9376574218 /security
parent41a2d5751616e38d1e293e3cb35a6e2bc7a03473 (diff)
downloadlinux-stable-3d04c92403d377918c9a3bddab6ee103f0db25dd.tar.gz
linux-stable-3d04c92403d377918c9a3bddab6ee103f0db25dd.tar.bz2
linux-stable-3d04c92403d377918c9a3bddab6ee103f0db25dd.zip
Smack - Fix build error with bringup unconfigured
The changes for mounting binary filesystems was allied improperly, with the list of tokens being in an ifdef that it shouldn't have been. Fix that, and a couple style issues that were bothering me. Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security')
-rw-r--r--security/smack/smack_lsm.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 54fb3a1d8953..996c88956438 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -57,15 +57,7 @@ LIST_HEAD(smk_ipv6_port_list);
static struct kmem_cache *smack_inode_cache;
int smack_enabled;
-#ifdef CONFIG_SECURITY_SMACK_BRINGUP
-static char *smk_bu_mess[] = {
- "Bringup Error", /* Unused */
- "Bringup", /* SMACK_BRINGUP_ALLOW */
- "Unconfined Subject", /* SMACK_UNCONFINED_SUBJECT */
- "Unconfined Object", /* SMACK_UNCONFINED_OBJECT */
-};
-
-static const match_table_t tokens = {
+static const match_table_t smk_mount_tokens = {
{Opt_fsdefault, SMK_FSDEFAULT "%s"},
{Opt_fsfloor, SMK_FSFLOOR "%s"},
{Opt_fshat, SMK_FSHAT "%s"},
@@ -74,6 +66,14 @@ static const match_table_t tokens = {
{Opt_error, NULL},
};
+#ifdef CONFIG_SECURITY_SMACK_BRINGUP
+static char *smk_bu_mess[] = {
+ "Bringup Error", /* Unused */
+ "Bringup", /* SMACK_BRINGUP_ALLOW */
+ "Unconfined Subject", /* SMACK_UNCONFINED_SUBJECT */
+ "Unconfined Object", /* SMACK_UNCONFINED_OBJECT */
+};
+
static void smk_bu_mode(int mode, char *s)
{
int i = 0;
@@ -599,9 +599,14 @@ static int smack_parse_opts_str(char *options,
struct security_mnt_opts *opts)
{
char *p;
- char *fsdefault = NULL, *fsfloor = NULL;
- char *fshat = NULL, *fsroot = NULL, *fstransmute = NULL;
- int rc = -ENOMEM, num_mnt_opts = 0;
+ char *fsdefault = NULL;
+ char *fsfloor = NULL;
+ char *fshat = NULL;
+ char *fsroot = NULL;
+ char *fstransmute = NULL;
+ int rc = -ENOMEM;
+ int num_mnt_opts = 0;
+ int token;
opts->num_mnt_opts = 0;
@@ -609,13 +614,12 @@ static int smack_parse_opts_str(char *options,
return 0;
while ((p = strsep(&options, ",")) != NULL) {
- int token;
substring_t args[MAX_OPT_ARGS];
if (!*p)
continue;
- token = match_token(p, tokens, args);
+ token = match_token(p, smk_mount_tokens, args);
switch (token) {
case Opt_fsdefault: