public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Subrata Modak <subrata@linux.vnet.ibm.com>,
	ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH 2/2] chmod05: fix the effective user when do cleanup
Date: Mon, 08 Jun 2009 14:16:37 +0800	[thread overview]
Message-ID: <4A2CACC5.6080601@cn.fujitsu.com> (raw)
In-Reply-To: <4A2CABFB.3010207@cn.fujitsu.com>

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.

  chmod05     0  WARN  :  tst_rmdir(): rmobj(/tmp/chmOpEdLA) failed: \
  remove(/tmp/chmOpEdLA) 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/chmod/chmod05.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/testcases/kernel/syscalls/chmod/chmod05.c b/testcases/kernel/syscalls/chmod/chmod05.c
index c6f1225..252f14e 100644
--- a/testcases/kernel/syscalls/chmod/chmod05.c
+++ b/testcases/kernel/syscalls/chmod/chmod05.c
@@ -266,6 +266,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





------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2009-06-08  6:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08  6:13 [LTP] [PATCH 1/2] chmod05: fix to modify the group ownership before do dir chmod Wei Yongjun
2009-06-08  6:16 ` Wei Yongjun [this message]
2009-06-09 18:24   ` [LTP] [PATCH 2/2] chmod05: fix the effective user when do cleanup Subrata Modak
2009-06-09 18:24 ` [LTP] [PATCH 1/2] chmod05: fix to modify the group ownership before do dir chmod Subrata Modak

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=4A2CACC5.6080601@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=subrata@linux.vnet.ibm.com \
    /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