* [LTP] [PATCH] kill05.c: fix fail due to the same pw_uid of ltpuser1 and ltpuser2
@ 2011-03-08 5:42 Peng Haitao
2011-04-26 16:25 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Peng Haitao @ 2011-03-08 5:42 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list
Hi Garrett,
When the macro "SAFE_GETPWNAM" is called twice, the return values are the same.
This may cause the case failure.
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
testcases/kernel/syscalls/kill/kill05.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/testcases/kernel/syscalls/kill/kill05.c b/testcases/kernel/syscalls/kill/kill05.c
index 0193100..6a80597 100644
--- a/testcases/kernel/syscalls/kill/kill05.c
+++ b/testcases/kernel/syscalls/kill/kill05.c
@@ -143,9 +143,6 @@ void do_master_child(char **av)
struct passwd *ltpuser1, *ltpuser2;
- ltpuser1 = SAFE_GETPWNAM(NULL, user1name);
- ltpuser2 = SAFE_GETPWNAM(NULL, user2name);
-
TEST_EXP_ENOS(exp_enos);
Tst_count = 0;
@@ -158,7 +155,7 @@ void do_master_child(char **av)
tst_brkm(TBROK|TERRNO, cleanup, "Fork failed");
if (pid1 == 0) {
-
+ ltpuser1 = SAFE_GETPWNAM(NULL, user1name);
if (setreuid(ltpuser1->pw_uid, ltpuser1->pw_uid) == -1) {
perror("setreuid failed (in child)");
exit(1);
@@ -172,6 +169,7 @@ void do_master_child(char **av)
do_child();
#endif
}
+ ltpuser2 = SAFE_GETPWNAM(NULL, user2name);
if (setreuid(ltpuser2->pw_uid, ltpuser2->pw_uid) == -1) {
perror("seteuid failed");
exit(1);
--
1.7.1
--
Best Regards,
Peng Haitao
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
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
end of thread, other threads:[~2011-04-26 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 5:42 [LTP] [PATCH] kill05.c: fix fail due to the same pw_uid of ltpuser1 and ltpuser2 Peng Haitao
2011-04-26 16:25 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox