iinniittggrroouuppss() -- General Function (libc)

Initialize the supplementary group-access list
#iinncclluuddee <ssyyss/ttyyppeess.hh>
#iinncclluuddee <ggrrpp.hh>
iinntt iinniittggrroouuppss(_u_s_e_r, _b_a_s_e_g_i_d)
ccoonnsstt cchhaarr *_u_s_e_r; ggiidd_tt _b_a_s_e_g_i_d;

The  ``supplemental group-access  list'' is the  list of  group identifiers
that  are  used  in   addition  to  the  effective  group  identifier  when
determining the level of access that a process has to a file.  The function
iinniittggrroouuppss() initializes  the supplemental group-access list  to the groups
to which _u_s_e_r belongs.

_u_s_e_r is  the login identifier of the user  in question.  _b_a_s_e_g_i_d identifies
that user's base group, as  set in the file /eettcc/ppaasssswwdd. iinniittggrroouuppss() calls
the library  function ggeettggrreenntt() to read from /eettcc/ggrroouupp  all of the groups
to  which _u_s_e_r  belongs (in  addition to  her base  group).  It  then calls
sseettggrroouuppss()  to initialize  the supplementary  group-access list  to _u_s_e_r's
base group and the additional groups returned by ggeettggrreenntt().

If all goes well, iinniittggrroouuppss() modifies the supplementary group-access list
returns zero.  Otherwise, it does not modify the list, returns -1, and sets
eerrrrnnoo to an appropriate value.

_S_e_e _A_l_s_o
ggeettggrreenntt(), lliibbcc, sseettggrroouuppss()

_N_o_t_e_s
If _u_s_e_r  belongs to more  than NNGGRROOUUPPSS_MMAAXX groups,  iinniittggrroouuppss() reads only
the first NNGGRROOUUPPSS_MMAAXX groups from /eettcc/ggrroouupp and ignores all of the others.
Note that NNGGRROOUUPPSS_MMAAXX  is a limit set by the  POSIX Standard.  For a fuller
discussion  of these  limits,  see the  Lexicon entries  for ssyyssccoonnff()  and
lliimmiittss.hh.

Only the superuser rroooott can use iinniittggrroouuppss().
