On Mon, Jul 20, 2009 at 4:25 AM, Sharyathi Nagesh<[email protected]> wrote:
> Hi
>  I was able to understand the problem...
> This is what I learnt
>
> Supplementary group IDs of a process is inherited from its parent process,
> so
> who ever spawns the process transfer its supplementary group ids also to its
> child process.
>
> in our test case scenario checking the supplementary group IDs of root which
> is
> spawning the test cases fchmod5 and chmod5 shows this
>
> ---------------------------------------------------------
> cat test.c
> ---------------------------------------------------------
> int main()
> {
>        int size = 10;
>        int i, index;
>        gid_t list[10];
>        index = getgroups(size, list);
>        for ( i =0 ;i < index; i++)
>                printf("\n list[%d]:%d", i, list[i]);
>        printf("\n");
> }
> ---------------------------------------------------------
>
> [r...@mx3350a sharyathi]# ./a.out
>
>  list[0]:0
>  list[1]:1
>  list[2]:2
>  list[3]:3
>  list[4]:4
>  list[5]:6
>  list[6]:10
> ---------------------------------------------------------
> This shows that bin->GID (1) is one of the supplementary group IDs of the
> process
> while nobody->GID (99) is not.
> So in the kernel code
> --------------------------------------------------------
>  if (ia_valid & ATTR_MODE) {
>                umode_t mode = attr->ia_mode;
>
>                if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
>                        mode &= ~S_ISGID;
>                inode->i_mode = mode;
>        }
> --------------------------------------------------------
> S_ISGID is cleared in case file attribute is nobody and not in case of GID
> being bin
>
> I was thinking of what could be the best solution as earlier solution
> proposed
> are not fool proof
> Attaching a fix I though is the best way to handle the issue

Hi Yeehaw,
    1. You didn't provide sign-off, as noted in the DCO:
http://ltp.sourceforge.net/DCO.txt
    2. This appears to be a legitimate documentation bug (at least as
far as the manpages for 2.6.29-r5 are concerned), because I can't find
a single reference to nobody in the manpage, as far as special
importance is concerned. Furthermore, looking at the OpenGroup's
documentation, I don't see anything there either:
http://www.opengroup.org/onlinepubs/000095399/functions/getgroups.html
. So, I'm a bit stumped as to whether or not we'd be doing the right
thing by `fixing' this test.
Thanks,
-Garrett

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

Reply via email to