Skip to content
Commit 929aa5b2 authored by Josh Triplett's avatar Josh Triplett Committed by Linus Torvalds
Browse files

uidgid: make uid_valid and gid_valid work with !CONFIG_MULTIUSER



{u,g}id_valid call {u,g}id_eq, which calls __k{u,g}id_val on both
arguments and compares.  With !CONFIG_MULTIUSER, __k{u,g}id_val return a
constant 0, which makes {u,g}id_valid always return false.  Change
{u,g}id_valid to compare their argument against -1 instead.  That produces
identical results in the normal CONFIG_MULTIUSER=y case, but with
!CONFIG_MULTIUSER will make {u,g}id_valid constant-fold into "return
true;" rather than "return false;".

This fixes uses of devpts without CONFIG_MULTIUSER.

Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com&gt;,>
Cc: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 499611ed
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment