From: Eric W. Biederman Date: Tue, 2 Oct 2012 22:37:37 +0000 (-0700) Subject: userns: Fix build of drivers/staging/dgrp X-Git-Tag: v3.7-rc1~119^2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=702e490211b2b7e448ebe1b3a07d97ad2fc07e03;p=linux.git 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 Cc: Greg Kroah-Hartman Signed-off-by: "Eric W. Biederman" --- diff --git a/drivers/staging/dgrp/dgrp_common.c b/drivers/staging/dgrp/dgrp_common.c index fce74e7fb834..3553998b72bc 100644 --- a/drivers/staging/dgrp/dgrp_common.c +++ b/drivers/staging/dgrp/dgrp_common.c @@ -179,9 +179,9 @@ void dgrp_carrier(struct ch_struct *ch) */ int dgrp_chk_perm(int mode, int op) { - if (!current_euid()) + if (!uid_eq(GLOBAL_ROOT_UID, current_euid())) mode >>= 6; - else if (in_egroup_p(0)) + else if (in_egroup_p(GLOBAL_ROOT_GID)) mode >>= 3; if ((mode & op & 0007) == op)