From: Jan S. <jst...@re...> - 2015-06-02 07:42:12
|
----- Original Message ----- > From: "Yuan Sun" <sun...@hu...> > To: jst...@re... > Cc: ltp...@li... > Sent: Tuesday, 2 June, 2015 12:03:33 PM > Subject: [PATCH] Use the value of /proc/sys/kernel/overflowgid as overflowgid. > > Signed-off-by: Yuan Sun <sun...@hu...> Hi, pushed, I have also remove unused global variable and made the 2 remaining static. Regards, Jan > --- > 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 > > |