diff options
author | James Morris <jmorris@namei.org> | 2011-10-22 22:23:58 +0200 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-10-22 22:23:58 +0200 |
commit | c45ed235abf1b0b6666417e3c394f18717976acd (patch) | |
tree | e41dd99f2c217a8ce160b24d81a4aec1cccbfe02 /security/smack/smack_access.c | |
parent | e0b057b406a33501a656dc8d67ea945d7bcdad61 (diff) | |
parent | 0e94ae17c857b3835a2b8ea46ce44b5da4e2cc5d (diff) | |
download | op-kernel-dev-c45ed235abf1b0b6666417e3c394f18717976acd.zip op-kernel-dev-c45ed235abf1b0b6666417e3c394f18717976acd.tar.gz |
Merge branch 'master' of git://gitorious.org/smack-next/kernel into next
Diffstat (limited to 'security/smack/smack_access.c')
-rw-r--r-- | security/smack/smack_access.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index a885f62..cc7cb6e 100644 --- a/security/smack/smack_access.c +++ b/security/smack/smack_access.c @@ -353,17 +353,13 @@ struct smack_known *smk_find_entry(const char *string) } /** - * smk_import_entry - import a label, return the list entry - * @string: a text string that might be a Smack label + * smk_parse_smack - parse smack label from a text string + * @string: a text string that might contain a Smack label * @len: the maximum size, or zero if it is NULL terminated. - * - * Returns a pointer to the entry in the label list that - * matches the passed string, adding it if necessary. + * @smack: parsed smack label, or NULL if parse error */ -struct smack_known *smk_import_entry(const char *string, int len) +void smk_parse_smack(const char *string, int len, char *smack) { - struct smack_known *skp; - char smack[SMK_LABELLEN]; int found; int i; @@ -381,7 +377,22 @@ struct smack_known *smk_import_entry(const char *string, int len) } else smack[i] = string[i]; } +} + +/** + * smk_import_entry - import a label, return the list entry + * @string: a text string that might be a Smack label + * @len: the maximum size, or zero if it is NULL terminated. + * + * Returns a pointer to the entry in the label list that + * matches the passed string, adding it if necessary. + */ +struct smack_known *smk_import_entry(const char *string, int len) +{ + struct smack_known *skp; + char smack[SMK_LABELLEN]; + smk_parse_smack(string, len, smack); if (smack[0] == '\0') return NULL; |