Skip to content

Commit

Permalink
apparmor: use task path helpers
Browse files Browse the repository at this point in the history
apparmor: use task path helpers

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Nick Piggin authored and Al Viro committed Aug 18, 2010
1 parent baa0389 commit 44672e4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions security/apparmor/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,14 @@ static int d_namespace_path(struct path *path, char *buf, int buflen,
int deleted, connected;
int error = 0;

/* Get the root we want to resolve too */
/* Get the root we want to resolve too, released below */
if (flags & PATH_CHROOT_REL) {
/* resolve paths relative to chroot */
read_lock(&current->fs->lock);
root = current->fs->root;
/* released below */
path_get(&root);
read_unlock(&current->fs->lock);
get_fs_root(current->fs, &root);
} else {
/* resolve paths relative to namespace */
root.mnt = current->nsproxy->mnt_ns->root;
root.dentry = root.mnt->mnt_root;
/* released below */
path_get(&root);
}

Expand Down

0 comments on commit 44672e4

Please sign in to comment.