Skip to content

Commit

Permalink
userns: Fix build of drivers/staging/dgrp
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: "Eric W. Biederman" <[email protected]>
  • Loading branch information
ebiederm committed Oct 3, 2012
1 parent 8826532 commit 702e490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/dgrp/dgrp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 702e490

Please sign in to comment.