[LTP] [PATCH v5 1/1] syscalls/mq_unlink: convert to use new test library API

Cyril Hrubis chrubis@suse.cz
Mon Dec 5 17:13:51 CET 2016


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


More information about the ltp mailing list