From: Cyril H. <su...@li...> - 2011-05-20 12:53:09
|
The branch, master, has been updated via de92307bb0681418da0c6d8552e749acc8054467 (commit) from 346aab2e758f0ac3297f9a82b94f9db42838d534 (commit) - Log ----------------------------------------------------------------- commit de92307bb0681418da0c6d8552e749acc8054467 Author: Caspar Zhang <cz...@re...> Date: Wed May 11 17:39:54 2011 +0800 chown03: fix EPERM issue in setup phase of chown03 testcase, it set effective gid/uid before create tmpdir, this might cause EPERM error under some circumstance: chown03 1 TBROK : chown(/tmp/ltp-1FYYTiULQl/chos2UBh3, -1, 0) failed: errno=EPERM(1): Operation not permitted chown03 2 TBROK : Remaining cases broken chown03 0 TWARN : tst_brk: Invalid Type: 4. Using TBROK chown03 3 TBROK : tmpdir_cleanup: no user cleanup function called before exiting This patch creates tmpdir first, then set the effective gid/uid to test. Signed-off-by: Caspar Zhang <cz...@re...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/chown/chown03.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testcases/kernel/syscalls/chown/chown03.c b/testcases/kernel/syscalls/chown/chown03.c index 34b2d59..e26be0d 100644 --- a/testcases/kernel/syscalls/chown/chown03.c +++ b/testcases/kernel/syscalls/chown/chown03.c @@ -167,6 +167,10 @@ void setup() tst_require_root(NULL); + tst_sig(FORK, DEF_HANDLER, cleanup); + + tst_tmpdir(); + ltpuser = getpwnam(nobody_uid); if (ltpuser == NULL) tst_brkm(TBROK|TERRNO, NULL, "getpwnam(\"nobody\") failed"); @@ -177,10 +181,6 @@ void setup() tst_brkm(TBROK|TERRNO, NULL, "seteuid(%d) failed", ltpuser->pw_uid); - tst_sig(FORK, DEF_HANDLER, cleanup); - - tst_tmpdir(); - /* Create a test file under temporary directory */ if ((fd = open(TESTFILE, O_RDWR|O_CREAT, FILE_MODE)) == -1) tst_brkm(TBROK|TERRNO, cleanup, @@ -213,4 +213,4 @@ void cleanup() tst_rmdir(); -} \ No newline at end of file +} hooks/post-receive -- ltp |