On 09/26/2013 07:09 PM, [email protected] wrote: > Hi! >> The cleanup() may be called twice by both the parent and child process >> in this testcase leading to a failure. >> >> This patch makes sure cleanup() is called only once by parent process. >> >> Signed-off-by: Zeng Linggang <[email protected]> >> Signed-off-by: Ma Shimiao <[email protected]> >> --- >> testcases/kernel/syscalls/setuid/setuid04.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/testcases/kernel/syscalls/setuid/setuid04.c >> b/testcases/kernel/syscalls/setuid/setuid04.c >> index d8e991e..365859b 100644 >> --- a/testcases/kernel/syscalls/setuid/setuid04.c >> +++ b/testcases/kernel/syscalls/setuid/setuid04.c >> @@ -88,7 +88,7 @@ static void do_master_child(void) >> int pid; >> int status; >> >> - if (SETUID(cleanup, ltpuser->pw_uid) == -1) { >> + if (SETUID(NULL, ltpuser->pw_uid) == -1) { >> tst_brkm(TBROK, NULL, >> "setuid failed to set the effective uid to %d", >> ltpuser->pw_uid); > This one is much better. Applied, thanks. > > (The patch failed to apply and needed to be redone by hand.) Thanks Cyril. I will be more careful next time. > > BTW: It would be better to remove all the tst_* interface from the > function that runs in the child and use printf() + exit() instead. > (In order to avoid bugs like this one) It's a good idea. I will have a try.
Regards, Ma Shimiao > ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
