summaryrefslogtreecommitdiffstats
path: root/security/apparmor/file.c
diff options
context:
space:
mode:
authorJohn Johansen2017-01-16 09:43:01 +0100
committerJohn Johansen2017-01-16 10:18:46 +0100
commit47f6e5cc7355e4ff2fd7ace919aa9e291077c26b (patch)
tree28afc953505fa769dafd1532b141a779b80672b9 /security/apparmor/file.c
parentapparmor: rename context abreviation cxt to the more standard ctx (diff)
downloadkernel-qcow2-linux-47f6e5cc7355e4ff2fd7ace919aa9e291077c26b.tar.gz
kernel-qcow2-linux-47f6e5cc7355e4ff2fd7ace919aa9e291077c26b.tar.xz
kernel-qcow2-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/file.c')
-rw-r--r--security/apparmor/file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/security/apparmor/file.c b/security/apparmor/file.c
index 608971ac6781..e04f044340ba 100644
--- a/security/apparmor/file.c
+++ b/security/apparmor/file.c
@@ -104,7 +104,7 @@ static void file_audit_cb(struct audit_buffer *ab, void *va)
* Returns: %0 or error on failure
*/
int aa_audit_file(struct aa_profile *profile, struct file_perms *perms,
- gfp_t gfp, int op, u32 request, const char *name,
+ gfp_t gfp, const char *op, u32 request, const char *name,
const char *target, kuid_t ouid, const char *info, int error)
{
int type = AUDIT_APPARMOR_AUTO;
@@ -276,8 +276,9 @@ static inline bool is_deleted(struct dentry *dentry)
*
* Returns: %0 else error if access denied or other error
*/
-int aa_path_perm(int op, struct aa_profile *profile, const struct path *path,
- int flags, u32 request, struct path_cond *cond)
+int aa_path_perm(const char *op, struct aa_profile *profile,
+ const struct path *path, int flags, u32 request,
+ struct path_cond *cond)
{
char *buffer = NULL;
struct file_perms perms = {};
@@ -446,7 +447,7 @@ audit:
*
* Returns: %0 if access allowed else error
*/
-int aa_file_perm(int op, struct aa_profile *profile, struct file *file,
+int aa_file_perm(const char *op, struct aa_profile *profile, struct file *file,
u32 request)
{
struct path_cond cond = {