public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH ltp] syscalls/bind02.c: Fix create socker failed for nobody user and nogroup for "Permission denied"
Date: Thu, 16 Aug 2018 16:25:24 +0200	[thread overview]
Message-ID: <20180816142524.GC30369@rei> (raw)
In-Reply-To: <20180810025656.8825-1-zhanghuix.yuan@intel.com>

Hi!
>  testcases/kernel/syscalls/bind/bind02.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/bind/bind02.c b/testcases/kernel/syscalls/bind/bind02.c
> index 90b0e9d8e..84ce588ce 100644
> --- a/testcases/kernel/syscalls/bind/bind02.c
> +++ b/testcases/kernel/syscalls/bind/bind02.c
> @@ -86,7 +86,12 @@ void try_bind(void)
>  	}
>  
>  	if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
> -		tst_brkm(TBROK | TERRNO, 0, "socket() failed");
> +		if (errno == EACCES) {
> +			tst_resm(TPASS, "correct error");
> +			return;
> +		}else {
> +			tst_brkm(TBROK | TERRNO, 0, "socket() failed");
> +		}
>  	}

There is no good reason why shouldn't the nobody user be able to create
AF_INET socket. Fist of all you should figure out why this is happening,
then, if it turns out to be the test fault, we can do something about
it.

-- 
Cyril Hrubis
chrubis@suse.cz

      reply	other threads:[~2018-08-16 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10  2:56 [LTP] [PATCH ltp] syscalls/bind02.c: Fix create socker failed for nobody user and nogroup for "Permission denied" Zhanghui Yuan
2018-08-16 14:25 ` Cyril Hrubis [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=20180816142524.GC30369@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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