[ale] Unexpected behavior

Denny Chambers dchambers at bugfixer.net
Thu Dec 11 11:28:48 EST 2003


Thanks Danny for the info, I will check that out. buser however is not 
part of the root group. Are you saying that when I set the effective 
user to 100, that gets concatenated to root existing group list, and 
that the entire group list is then used to decide my rights to the file?

Denny

Danny Cox wrote:

>Denny,
>
>On Wed, 2003-12-10 at 17:41, Denny Chambers wrote:
>  
>
>>So let me set up the scenario:
>>
>>First here is a simple test program I use:
>>
>>--start copy
>>#include <sys/types.h>
>>#include <unistd.h>
>>#include <stdio.h>
>>
>>main(int argc, char *argv) {
>>    FILE *fd = NULL;
>>
>>    setegid(100);
>>    seteuid(501);
>>    if((fd = fopen("./foo", "r")) != NULL){
>>        printf("User (%d/%d) has rights to file\n", geteuid(), getegid());
>>    }
>>    else{
>>        printf("User (%d/%d) does not have rights file\n", geteuid(), 
>>getegid());
>>    }
>>}
>>--stop copy
>>    
>>
>
>	This is the group list problem.  All users have a list of groups they
>belong to.  You must wipe this out IN ADDITION TO setting the egid.  See
>groups(1) to list the groups you belong to, and getgroups(2) and
>setgroups(2) for an API to [gs]et the group list.
>
>  
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3435 bytes
Desc: S/MIME Cryptographic Signature




More information about the Ale mailing list