apparmor: fix error code to failure message mapping for name lookup
authorJohn Johansen <john.johansen@canonical.com>
Tue, 19 Feb 2013 00:02:34 +0000 (16:02 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Sun, 28 Apr 2013 07:35:40 +0000 (00:35 -0700)
-ESTALE used to be incorrectly used to indicate a disconnected path, when
name lookup failed.  This was fixed in commit e1b0e444 to correctly return
-EACCESS, but the error to failure message mapping was not correctly updated
to reflect this change.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
security/apparmor/path.c

index e91ffee..35b394a 100644 (file)
@@ -174,7 +174,7 @@ static int get_name_to_buffer(struct path *path, int flags, char *buffer,
        if (info && error) {
                if (error == -ENOENT)
                        *info = "Failed name lookup - deleted entry";
-               else if (error == -ESTALE)
+               else if (error == -EACCES)
                        *info = "Failed name lookup - disconnected path";
                else if (error == -ENAMETOOLONG)
                        *info = "Failed name lookup - name too long";