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 <[email protected]>
---
 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to