Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 1/1] syscalls/mq_unlink: convert to use new test library API
Date: Mon, 5 Dec 2016 17:13:51 +0100	[thread overview]
Message-ID: <20161205161351.GL22344@rei.lan> (raw)
In-Reply-To: <20161205144943.GI22344@rei.lan>

Hi!
> > > We may also run the test for nobody in a child process so
> > > that we don't have to take care restoring the euid at the end of the
> > > function.
> > It's require to restore euid for other tests (to be running as root again). Or
> > have I overlooked something?
> 
> If you fork() then call setuid() in the child, do the test and exit then
> parent will still run under the same uid it has been started. No need to
> resetore anything.

Looks like I've been to fast to respond here, I should have read the
question twice before answering...

The test will fail to unlink the queue at the end of the do_test() in
this case. That is the reason the euid is reset to root back again as
the first thing after we jump to EXIT: label.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2016-12-05 16:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 14:32 [LTP] [PATCH v5 1/1] syscalls/mq_unlink: convert to use new test library API Petr Vorel
2016-12-05 14:49 ` Cyril Hrubis
2016-12-05 16:13   ` Cyril Hrubis [this message]
2016-12-05 18:17     ` 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=20161205161351.GL22344@rei.lan \
    --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