diff options
author | John Johansen <john.johansen@canonical.com> | 2017-01-16 09:43:01 +0100 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2017-01-16 10:18:46 +0100 |
commit | 47f6e5cc7355e4ff2fd7ace919aa9e291077c26b (patch) | |
tree | 28afc953505fa769dafd1532b141a779b80672b9 /security/apparmor/procattr.c | |
parent | apparmor: rename context abreviation cxt to the more standard ctx (diff) | |
download | linux-47f6e5cc7355e4ff2fd7ace919aa9e291077c26b.tar.xz linux-47f6e5cc7355e4ff2fd7ace919aa9e291077c26b.zip |
apparmor: change op from int to const char *
Having ops be an integer that is an index into an op name table is
awkward and brittle. Every op change requires an edit for both the
op constant and a string in the table. Instead switch to using const
strings directly, eliminating the need for the table that needs to
be kept in sync.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/procattr.c')
-rw-r--r-- | security/apparmor/procattr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/apparmor/procattr.c b/security/apparmor/procattr.c index 1babd3655520..4cb5f3dc906d 100644 --- a/security/apparmor/procattr.c +++ b/security/apparmor/procattr.c @@ -88,13 +88,13 @@ int aa_getprocattr(struct aa_profile *profile, char **string) * * Returns: start position of name after token else NULL on failure */ -static char *split_token_from_name(int op, char *args, u64 * token) +static char *split_token_from_name(const char *op, char *args, u64 *token) { char *name; *token = simple_strtoull(args, &name, 16); if ((name == args) || *name != '^') { - AA_ERROR("%s: Invalid input '%s'", op_table[op], args); + AA_ERROR("%s: Invalid input '%s'", op, args); return ERR_PTR(-EINVAL); } |