* [LTP] [PATCH] chown03: fix the effective user when do cleanup
@ 2009-06-11 4:20 Wei Yongjun
2009-06-15 19:16 ` Subrata Modak
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2009-06-11 4:20 UTC (permalink / raw)
To: ltp-list
The TESTDIR is created by root user, but when we do cleanup, the effective
user had been changed to nobody, so the cleanup will be failed when the
TESTDIR is removed.
chown03 1 PASS : chown() on testfile succeeds, clears setuid/gid bits
chown03 0 WARN : tst_rmdir(): rmobj(/tmp/choYm1VHD) failed: \
remove(/tmp/choYm1VHD) failed; errno=1: Operation not permitted
This patch fixed the problem by reset the effective user to root.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
testcases/kernel/syscalls/chown/chown03.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/testcases/kernel/syscalls/chown/chown03.c b/testcases/kernel/syscalls/chown/chown03.c
index f27cb6f..d2eecd1 100644
--- a/testcases/kernel/syscalls/chown/chown03.c
+++ b/testcases/kernel/syscalls/chown/chown03.c
@@ -267,6 +267,9 @@ void cleanup()
*/
TEST_CLEANUP;
+ setegid(0);
+ seteuid(0);
+
/* Remove tmp dir and all files in it */
tst_rmdir();
--
1.6.0.2.530.g67faa
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [LTP] [PATCH] chown03: fix the effective user when do cleanup
2009-06-11 4:20 [LTP] [PATCH] chown03: fix the effective user when do cleanup Wei Yongjun
@ 2009-06-15 19:16 ` Subrata Modak
0 siblings, 0 replies; 2+ messages in thread
From: Subrata Modak @ 2009-06-15 19:16 UTC (permalink / raw)
To: Wei Yongjun; +Cc: ltp-list
On Thu, 2009-06-11 at 12:20 +0800, Wei Yongjun wrote:
> The TESTDIR is created by root user, but when we do cleanup, the effective
> user had been changed to nobody, so the cleanup will be failed when the
> TESTDIR is removed.
>
> chown03 1 PASS : chown() on testfile succeeds, clears setuid/gid bits
> chown03 0 WARN : tst_rmdir(): rmobj(/tmp/choYm1VHD) failed: \
> remove(/tmp/choYm1VHD) failed; errno=1: Operation not permitted
>
> This patch fixed the problem by reset the effective user to root.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Thanks.
Regards--
Subrata
> ---
> testcases/kernel/syscalls/chown/chown03.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/chown/chown03.c b/testcases/kernel/syscalls/chown/chown03.c
> index f27cb6f..d2eecd1 100644
> --- a/testcases/kernel/syscalls/chown/chown03.c
> +++ b/testcases/kernel/syscalls/chown/chown03.c
> @@ -267,6 +267,9 @@ void cleanup()
> */
> TEST_CLEANUP;
>
> + setegid(0);
> + seteuid(0);
> +
> /* Remove tmp dir and all files in it */
> tst_rmdir();
>
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-15 19:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-11 4:20 [LTP] [PATCH] chown03: fix the effective user when do cleanup Wei Yongjun
2009-06-15 19:16 ` Subrata Modak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox