[Mauischeduler-cvs_notes] CVS: mauisched/src sss.c,1.13,1.13.8.1
Brought to you by:
mauisched,
mitchmurphy
|
From: Aaron S. <mau...@us...> - 2004-07-02 21:42:33
|
Update of /cvsroot/mauischeduler/mauisched/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6542 Modified Files: Tag: Maui_1_8 sss.c Log Message: initgroups() Index: sss.c =================================================================== RCS file: /cvsroot/mauischeduler/mauisched/src/sss.c,v retrieving revision 1.13 retrieving revision 1.13.8.1 diff -C2 -d -r1.13 -r1.13.8.1 *** sss.c 25 Nov 2002 02:11:31 -0000 1.13 --- sss.c 2 Jul 2004 21:42:12 -0000 1.13.8.1 *************** *** 53,56 **** --- 53,57 ---- #include <errno.h> #include <string.h> + #include <grp.h> #include <sys/types.h> #include <sys/stat.h> *************** *** 143,146 **** --- 144,156 ---- get_stdin(buf, BUFLEN); gid = (int)strtol(buf, (char **)NULL, 10); + + pwd = (struct passwd*)getpwuid(uid); + ptr = pwd->pw_name; + if (ptr != NULL) { + if (initgroups(ptr, gid)) { + perror("initgroups"); + } + } + if (gid >= 0) { setgid(gid); |