All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] Implement tst_setup_netns() helper function
Date: Fri, 25 Nov 2022 18:17:32 +0100	[thread overview]
Message-ID: <Y4D4rKNYjyEdDNEL@pevik> (raw)
In-Reply-To: <8fb62925-43ff-92d2-d310-b78d24b06d21@suse.cz>

> On 25. 11. 22 18:01, Petr Vorel wrote:
> > Hi Martin,

> > > +void tst_setup_netns(void)
> > > +{
> > > +	int real_uid = getuid();
> > > +	int real_gid = getgid();
> > > +	int nscount = 1;
> > > +
> > > +	if (!access("/proc/sys/user/max_user_namespaces", F_OK)) {
> > Out of curiosity, this can happen only on old kernel, which does not support
> > user namespaces (kernel < 3.8) ? I guess there must be other case,
> > I suppose you would not bother about 3.8, right?

> > Also asking that if not readable we don't TCONF (int nscount = 1).

> This is very much still happening on kernel 4.4.180 even though user
> namespaces are supported and enabled by default. That's why
> tst_setup_netns() fails with TCONF only when max_user_namespaces sysfile
> exists, is read-only AND the value inside is zero.

Makes sense.

And missing file: if I'm correct sysctl files were added in v4.9-rc1 in
25f9c0817c53 ("userns: Generalize the user namespace count into ucount")

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-11-25 17:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 15:34 [LTP] [PATCH 1/2] Implement tst_setup_netns() helper function Martin Doucha
2022-11-25 15:34 ` [LTP] [PATCH 2/2] syscalls: Replace namespace setup boilerplate with tst_setup_netns() Martin Doucha
2022-11-25 16:43 ` [LTP] [PATCH 1/2] Implement tst_setup_netns() helper function Petr Vorel
2022-11-25 17:01 ` Petr Vorel
2022-11-25 17:09   ` Martin Doucha
2022-11-25 17:17     ` Petr Vorel [this message]
2022-11-25 17:20     ` Petr Vorel

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=Y4D4rKNYjyEdDNEL@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.