* security.h (cygsidlist::addfromgr): Avoid duplicate entries.

* grp.cc (initgrousp): Add syscall_printf.
	(setgroups): Add syscall_printf and make sure sids are added only once.
This commit is contained in:
Corinna Vinschen
2005-04-06 12:35:52 +00:00
parent dafef5e249
commit b62b8d7c80
3 changed files with 15 additions and 11 deletions

View File

@ -148,7 +148,8 @@ public:
BOOL add (const char *sidstr)
{ cygsid nsi (sidstr); return add (nsi); }
BOOL addfromgr (struct __group32 *gr) /* Only with alloc */
{ return sids[count++].getfromgr (gr); }
{ return sids[count].getfromgr (gr)
&& (contains (sids[count]) || ++count); }
BOOL operator+= (cygsid &si) { return add (si); }
BOOL operator+= (const char *sidstr) { return add (sidstr); }