diff options
author | James Morris <james.l.morris@oracle.com> | 2012-03-15 14:43:02 +1100 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2012-03-15 14:43:02 +1100 |
commit | b01d3fb921df9baef1ecd13704f4b1e269b58b6b (patch) | |
tree | 1ca714b40774cd56c0194abee5c6577b2ba6aad2 /security/apparmor/file.c | |
parent | 6041e8346f2165679c2184cab60db768d6a26a1d (diff) | |
parent | 2d4cee7e3a2b9f9c3237672cc136e20dbad0e2ce (diff) | |
download | op-kernel-dev-b01d3fb921df9baef1ecd13704f4b1e269b58b6b.zip op-kernel-dev-b01d3fb921df9baef1ecd13704f4b1e269b58b6b.tar.gz |
Merge branch 'for-security' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor into next
Diffstat (limited to 'security/apparmor/file.c')
-rw-r--r-- | security/apparmor/file.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/security/apparmor/file.c b/security/apparmor/file.c index bba875c..3022c0f 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c @@ -278,22 +278,16 @@ int aa_path_perm(int op, struct aa_profile *profile, struct path *path, int error; flags |= profile->path_flags | (S_ISDIR(cond->mode) ? PATH_IS_DIR : 0); - error = aa_get_name(path, flags, &buffer, &name); + error = aa_path_name(path, flags, &buffer, &name, &info); if (error) { if (error == -ENOENT && is_deleted(path->dentry)) { /* Access to open files that are deleted are * give a pass (implicit delegation) */ error = 0; + info = NULL; perms.allow = request; - } else if (error == -ENOENT) - info = "Failed name lookup - deleted entry"; - else if (error == -ESTALE) - info = "Failed name lookup - disconnected path"; - else if (error == -ENAMETOOLONG) - info = "Failed name lookup - name too long"; - else - info = "Failed name lookup"; + } } else { aa_str_perms(profile->file.dfa, profile->file.start, name, cond, &perms); @@ -364,12 +358,14 @@ int aa_path_link(struct aa_profile *profile, struct dentry *old_dentry, lperms = nullperms; /* buffer freed below, lname is pointer in buffer */ - error = aa_get_name(&link, profile->path_flags, &buffer, &lname); + error = aa_path_name(&link, profile->path_flags, &buffer, &lname, + &info); if (error) goto audit; /* buffer2 freed below, tname is pointer in buffer2 */ - error = aa_get_name(&target, profile->path_flags, &buffer2, &tname); + error = aa_path_name(&target, profile->path_flags, &buffer2, &tname, + &info); if (error) goto audit; |