Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

userns: Fix build of drivers/staging/dgrp

Explicitly test for GLOBAL_ROOT_UID and GLOBAL_ROOT_GID
instead of using 0, allowing dgrp to compile and work
properly when user namespace support is enabled.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>

+2 -2
+2 -2
drivers/staging/dgrp/dgrp_common.c
··· 179 179 */ 180 180 int dgrp_chk_perm(int mode, int op) 181 181 { 182 - if (!current_euid()) 182 + if (!uid_eq(GLOBAL_ROOT_UID, current_euid())) 183 183 mode >>= 6; 184 - else if (in_egroup_p(0)) 184 + else if (in_egroup_p(GLOBAL_ROOT_GID)) 185 185 mode >>= 3; 186 186 187 187 if ((mode & op & 0007) == op)