summaryrefslogtreecommitdiff
path: root/security/apparmor/policy.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2017-01-16 11:42:47 +0300
committerJohn Johansen <john.johansen@canonical.com>2017-01-16 12:18:37 +0300
commitb79473f2de3eb3320e2a145da8a2ea03c7331784 (patch)
treee02004ebe5b7e02d900c603d988126fb0ece719a /security/apparmor/policy.c
parentee2351e4b07cb7e3609f8661effe0382fb23646b (diff)
downloadlinux-b79473f2de3eb3320e2a145da8a2ea03c7331784.tar.xz
apparmor: Make aa_remove_profile() callable from a different view
This is prep work for fs operations being able to remove namespaces. Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/policy.c')
-rw-r--r--security/apparmor/policy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index 046edecc4c8a..0314faeacccd 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -944,6 +944,7 @@ free:
/**
* aa_remove_profiles - remove profile(s) from the system
+ * @view: namespace the remove is being done from
* @fqname: name of the profile or namespace to remove (NOT NULL)
* @size: size of the name
*
@@ -954,9 +955,9 @@ free:
*
* Returns: size of data consume else error code if fails
*/
-ssize_t aa_remove_profiles(char *fqname, size_t size)
+ssize_t aa_remove_profiles(struct aa_ns *view, char *fqname, size_t size)
{
- struct aa_ns *root, *ns = NULL;
+ struct aa_ns *root = NULL, *ns = NULL;
struct aa_profile *profile = NULL;
const char *name = fqname, *info = NULL;
ssize_t error = 0;
@@ -967,7 +968,7 @@ ssize_t aa_remove_profiles(char *fqname, size_t size)
goto fail;
}
- root = aa_current_profile()->ns;
+ root = view;
if (fqname[0] == ':') {
char *ns_name;