Hi guys.
I have wrote a simple program to test getgroups functionality:
Here is my group configuration:
Code:
group1:501:test_user
group2:502:test_user
group3:503:test_user
group4:504:test_user
group5:505:test_user
test_user is member of all groups. and here is the program:
int main(void)
{
//I get number of supplementary groups
int number_of_groups = getgroups(0, NULL);
printf("%d\n", number_of_groups);
return EXIT_SUCCESS;
}
This program is running with user id of test_user. But the problem is this:
'number_of_groups' is always '1'