public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sharyathi Nagesh <sharyath@in.ibm.com>
To: subrata@linux.vnet.ibm.com
Cc: ltp-list@lists.sourceforge.net, mbeeraka@in.ibm.com
Subject: [LTP] [PATCH][RESEND] Issue observed with chmod05, fchmod05 test cases
Date: Thu, 06 Aug 2009 17:09:40 +0530	[thread overview]
Message-ID: <4A7AC0FC.1080405@in.ibm.com> (raw)
In-Reply-To: <1249005278.5788.79.camel@subratamodak.linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

Subrata
	Resending the patch, after the modification. Let me know if this is acceptable
Thanks
Yeehaw





[-- Attachment #2: fix_supplementary_group_id_issue.patch --]
[-- Type: text/x-patch, Size: 2124 bytes --]

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 <sharyath@in.ibm.com>

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));

[-- Attachment #3: Type: text/plain, Size: 355 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2009-08-06 11:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29  7:00 [LTP] Issue observed with chmod05, fchmod05 test cases Sharyathi Nagesh
2009-06-29  7:33 ` Wei Yongjun
2009-06-29 10:30   ` Sharyathi Nagesh
2009-07-02  4:34   ` Sharyathi Nagesh
2009-07-20 11:25   ` Sharyathi Nagesh
2009-07-20 15:56     ` Garrett Cooper
2009-07-21  8:57       ` Sharyathi Nagesh
2009-07-30 18:28         ` Subrata Modak
2009-07-31  1:38           ` Sharyathi Nagesh
2009-07-31  1:54             ` Subrata Modak
2009-08-06 11:39               ` Sharyathi Nagesh [this message]
2009-08-07 12:41                 ` [LTP] [PATCH][RESEND] " Subrata Modak
2009-09-15 10:27                   ` Sharyathi Nagesh
2009-09-16 15:16                     ` 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=4A7AC0FC.1080405@in.ibm.com \
    --to=sharyath@in.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=mbeeraka@in.ibm.com \
    --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