All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sharyathi Nagesh <sharyath@in.ibm.com>
To: Munipradeep Beerakam <mpradeep@linux.vnet.ibm.com>
Cc: ltp-list@lists.sourceforge.net, sharyath@linux.vnet.ibm.com
Subject: Re: [LTP] Issue observed with chmod05, fchmod05 test cases
Date: Tue, 21 Jul 2009 17:01:07 +0530	[thread overview]
Message-ID: <4A65A6FB.2020901@in.ibm.com> (raw)
In-Reply-To: <1248168950.13756.7.camel@munipradeep-laptop>

Muni
  What I am trying to say is, this fix assumes that
Bin->GID is part of supplementary group IDs of root and nobody->GID is not.
There is no basis for this assumption. If nobody->GID is part of supplementary group ID than 
it will fail again.
  So instead specifically set the supplementary group ID of the process to avoid confusion
Thanks
Yeehaw
> 
> diff --git a/testcases/kernel/syscalls/chmod/chmod05.c b/testcases/kernel/syscalls/chmod/chmod05.c
> index 4504aaa..c6f1225 100644
> --- a/testcases/kernel/syscalls/chmod/chmod05.c
> +++ b/testcases/kernel/syscalls/chmod/chmod05.c
> @@ -177,7 +177,7 @@ int main(int ac, char **av)
>  			if ((PERMS & ~S_ISGID) != dir_mode) {
>  				tst_resm(TFAIL, "%s: Incorrect modes 0%03o, "
>  					 "Expected 0%03o", TESTDIR, dir_mode,
> -					 PERMS);
> +					 PERMS & ~S_ISGID);
>  			} else {
>  				tst_resm(TPASS,
>  					 "Functionality of chmod(%s, %#o) successful",
> @@ -241,12 +241,12 @@ void setup()
>  				strerror(errno));
>  	}

> 
> -	if (chown(TESTDIR, nobody_u->pw_uid, bin_group->gr_gid) == -1)
> +	if (chown(TESTDIR, nobody_u->pw_uid, nobody_u->pw_gid) == -1)
>  		tst_brkm(TBROK, cleanup, "Couldn't change owner of testdir: %s",
>  				strerror(errno));
> 
> -	/* change to nobody:nobody */
> -	if (setegid(nobody_u->pw_gid) == -1 ||
> +	/* change to nobody:bin */
> +	if (setegid(bin_group->gr_gid) == -1 ||
>  		 seteuid(nobody_u->pw_uid) == -1)
>  		tst_brkm(TBROK, cleanup, "Couldn't switch to nobody:nobody: %s",
>  				strerror(errno));


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2009-07-21 11:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21  9:35 [LTP] Issue observed with chmod05, fchmod05 test cases Munipradeep Beerakam
2009-07-21 11:31 ` Sharyathi Nagesh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-06-29  7:00 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

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=4A65A6FB.2020901@in.ibm.com \
    --to=sharyath@in.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=mpradeep@linux.vnet.ibm.com \
    --cc=sharyath@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.