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>
This commit is contained in:
John Johansen
2017-01-16 00:43:01 -08:00
parent 55a26ebf63
commit 47f6e5cc73
10 changed files with 76 additions and 126 deletions

View File

@@ -303,6 +303,7 @@ static inline int AUDIT_MODE(struct aa_profile *profile)
bool policy_view_capable(struct aa_ns *ns);
bool policy_admin_capable(struct aa_ns *ns);
int aa_may_manage_policy(struct aa_profile *profile, struct aa_ns *ns, int op);
int aa_may_manage_policy(struct aa_profile *profile, struct aa_ns *ns,
const char *op);
#endif /* __AA_POLICY_H */