Mikael Pettersson <mikpe@csd.uu.se> noted that the current 2.6-git (and 2.4)
patch to disallow KDSKBSENT for unpriviledged users should be less restrictive
allowing reading of current function key string entry, but not writing.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
        if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry)))
                return -EFAULT;
 
+       if (!capable(CAP_SYS_TTY_CONFIG))
+               perm = 0;
+
        switch (cmd) {
        case KDGKBENT:
                key_map = key_maps[s];
        int ret;
 
        if (!capable(CAP_SYS_TTY_CONFIG))
-               return -EPERM;
+               perm = 0;
 
        kbs = kmalloc(sizeof(*kbs), GFP_KERNEL);
        if (!kbs) {