0

When I create a child process, it inherits the supplementary gids of the parent. If the parent is a root, then the child has (0) as supplementary gid. This behavior is not desired.

Is it possible to force supplementary group IDs to have no group id? If yes, how?

  • Why was the question tagged with "C"? Are you writing a program to do something? How would you have a group with no group ID? What would the purpose be? – Jeff Schaller Feb 21 at 12:08
  • 1
    Are you asking about dropping group privileges in a C program? – Kusalananda Feb 21 at 12:11
  • @JeffSchaller Because I am using the c language. When I create a child process, it inherits the supplementary gids of the parent. If the parent is a root, then the child has (0) as supplementary gid. This behavior is not desired – I. Hamad Feb 21 at 12:11
  • @Kusalananda yes! – I. Hamad Feb 21 at 12:12
  • 1
    Interestingly, there are no instances in the purported duplicate of having an empty set of supplementary group IDs, which is what the question here asks. initgroups() does not create an empty set, notice. – JdeBP Feb 21 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.