瀏覽代碼

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>
Eric W. Biederman 12 年之前
父節點
當前提交
702e490211
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/staging/dgrp/dgrp_common.c

+ 2 - 2
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)
 int dgrp_chk_perm(int mode, int op)
 {
 {
-	if (!current_euid())
+	if (!uid_eq(GLOBAL_ROOT_UID, current_euid()))
 		mode >>= 6;
 		mode >>= 6;
-	else if (in_egroup_p(0))
+	else if (in_egroup_p(GLOBAL_ROOT_GID))
 		mode >>= 3;
 		mode >>= 3;
 
 
 	if ((mode & op & 0007) == op)
 	if ((mode & op & 0007) == op)