Call setgid() before setuid(), because that when setuid()
set this process' uid to an unprivileged one, then it can't
do the setgid() operation.

Signed-off-by: Wanlong Gao <[email protected]>
---
 .../interfaces/clock_getcpuclockid/5-1.c           |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
 
b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
index 07218f6..933f669 100644
--- 
a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
+++ 
b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
@@ -37,8 +37,8 @@ int main(int argc, char *argv[])
 
                pwd = getpwnam("nobody");
                if (pwd != NULL) {
-                       setuid(pwd->pw_uid);
                        setgid(pwd->pw_gid);
+                       setuid(pwd->pw_uid);
                }
 
        }
@@ -62,4 +62,4 @@ int main(int argc, char *argv[])
        printf("Test PASSED\n");
        return PTS_PASS;
 #endif
-}
\ No newline at end of file
+}
-- 
1.7.6


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to