public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Yuan Sun <sunyuan3@huawei.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] Use the value of /proc/sys/kernel/overflowgid as overflowgid.
Date: Tue, 2 Jun 2015 03:41:53 -0400 (EDT)	[thread overview]
Message-ID: <1730844907.8987752.1433230913614.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1433239413-6032-1-git-send-email-sunyuan3@huawei.com>



----- Original Message -----
> From: "Yuan Sun" <sunyuan3@huawei.com>
> To: jstancek@redhat.com
> Cc: ltp-list@lists.sourceforge.net
> 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 <sunyuan3@huawei.com>

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
> 
> 

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

      reply	other threads:[~2015-06-02  7:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 10:03 [LTP] [PATCH] Use the value of /proc/sys/kernel/overflowgid as overflowgid Yuan Sun
2015-06-02  7:41 ` Jan Stancek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1730844907.8987752.1433230913614.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=sunyuan3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox