Subrata
Resending the patch, after the modification. Let me know if this is
acceptable
Thanks
Yeehaw
This Patch fixes bug in the test cases chmod05.c and fchmod05.c. The test case uses 2 UserIds nobody and bin.
The issue is observed when one of the UserId is the supplementary group Ids of the root. In that case the
Posix standard mentions that S_IGSID bit should not be cleared by the systemcall causing the test to fail.
This test case fixes the issue by specifically clearing the supplementary group ID of the process.The
main intention of the test case is to test if S_IGSID bit is cleared in case the non privilage user tries to
set file modes and hence clearing the supplementary group Ids.
Signed-off-by: Sharyathi Nagesh <[email protected]>
Index: ltp-full-20090430/testcases/kernel/syscalls/chmod/chmod05.c
===================================================================
--- ltp-full-20090430.orig/testcases/kernel/syscalls/chmod/chmod05.c 2009-04-25 23:22:44.000000000 +0530
+++ ltp-full-20090430/testcases/kernel/syscalls/chmod/chmod05.c 2009-07-20 16:34:07.000000000 +0530
@@ -240,6 +240,10 @@
tst_brkm(TBROK, cleanup, "mkdir(2) of %s failed: %s", TESTDIR,
strerror(errno));
}
+
+ if(setgroups(1, &nobody_u->pw_gid) == -1)
+ tst_brkm(TBROK, cleanup, "Couldn't change supplementary group Id: %s",
+ strerror(errno));
if (chown(TESTDIR, nobody_u->pw_uid, bin_group->gr_gid) == -1)
tst_brkm(TBROK, cleanup, "Couldn't change owner of testdir: %s",
Index: ltp-full-20090430/testcases/kernel/syscalls/fchmod/fchmod05.c
===================================================================
--- ltp-full-20090430.orig/testcases/kernel/syscalls/fchmod/fchmod05.c 2009-07-20 16:22:56.000000000 +0530
+++ ltp-full-20090430/testcases/kernel/syscalls/fchmod/fchmod05.c 2009-07-20 16:32:26.000000000 +0530
@@ -218,6 +218,10 @@
tst_brkm(TBROK, cleanup, "mkdir(2) of %s failed", TESTDIR);
}
+ if(setgroups(1, &nobody_u->pw_gid) == -1)
+ tst_brkm(TBROK, cleanup, "Couldn't change supplementary group Id: %s",
+ strerror(errno));
+
if (chown(TESTDIR, nobody_u->pw_uid, bin_group->gr_gid) == -1)
tst_brkm(TBROK, cleanup, "Couldn't change owner of testdir: %s",
strerror(errno));
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list