Signed-off-by: Yuan Sun <sunyu...@huawei.com>
---
 testcases/kernel/containers/userns/userns01.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/containers/userns/userns01.c 
b/testcases/kernel/containers/userns/userns01.c
index 8c45774..15cde43 100644
--- a/testcases/kernel/containers/userns/userns01.c
+++ b/testcases/kernel/containers/userns/userns01.c
@@ -14,7 +14,8 @@
 /*
  * Verify that:
  *  If a user ID has no mapping inside the namespace, user ID and group
- * ID will be the value defined in the file /proc/sys/kernel/overflowuid, 
65534.
+ * ID will be the value defined in the file /proc/sys/kernel/overflowuid(65534)
+ * and /proc/sys/kernel/overflowgid(65534).
  */
 
 #define _GNU_SOURCE
@@ -29,12 +30,14 @@
 #include "libclone.h"
 #include "userns_helper.h"
 #define OVERFLOWUIDPATH "/proc/sys/kernel/overflowuid"
+#define OVERFLOWGIDPATH "/proc/sys/kernel/overflowgid"
 
 char *TCID = "user_namespace1";
 int TST_TOTAL = 1;
 
 char fullpath[BUFSIZ];
 long overflowuid;
+long overflowgid;
 
 /*
  * child_fn1() - Inside a new user namespace
@@ -48,7 +51,7 @@ static int child_fn1(void *arg)
        gid = getegid();
 
        tst_resm(TINFO, "USERNS test is running in a new user namespace.");
-       if (uid == overflowuid && gid == overflowuid) {
+       if (uid == overflowuid && gid == overflowgid) {
                printf("Got expected uid and gid\n");
                exit_val = 0;
        } else {
@@ -63,6 +66,7 @@ static void setup(void)
 {
        check_newuser();
        SAFE_FILE_SCANF(NULL, OVERFLOWUIDPATH, "%ld", &overflowuid);
+       SAFE_FILE_SCANF(NULL, OVERFLOWGIDPATH, "%ld", &overflowgid);
 }
 
 int main(int argc, char *argv[])
-- 
1.9.1


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to