diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-09-11 14:37:11 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-09-11 14:37:11 +0400 |
commit | 5a8746b73201f906c0a2d03041130c28f89eb26d (patch) | |
tree | cccaba3bb75d28da890a4174c9d4d854c54aa7ff /winsup | |
parent | 22f8000733076a2acf41e58f8294341c256628b0 (diff) |
* grp.cc (initgroups): Call groups::clear_supp to free the
supplementary group sids that may have been set by setgroups.
* security.cc (cygsidlist::free_sids): Also zero the class members.
* security.h (groups::clear_supp): New.
Rename cygsidlist_unknown to cygsidlist_empty.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/grp.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 3 | ||||
-rw-r--r-- | winsup/cygwin/security.h | 7 |
4 files changed, 21 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ad6555f2f..4f02920a5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2002-09-10 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (initgroups): Call groups::clear_supp to free the + supplementary group sids that may have been set by setgroups. + * security.cc (cygsidlist::free_sids): Also zero the class members. + * security.h (groups::clear_supp): New. + Rename cygsidlist_unknown to cygsidlist_empty. + 2002-09-08 Christopher Faylor <cgf@redhat.com> * fhandler_tty.cc (fhandler_tty_slave::open): Don't protect diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 5bfb50e14..31f577a94 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -449,14 +449,16 @@ extern "C" int initgroups32 (const char *, __gid32_t) { + if (wincap.has_security ()) + cygheap->user.groups.clear_supp (); return 0; } extern "C" int -initgroups (const char *, __gid16_t) +initgroups (const char * name, __gid16_t gid) { - return 0; + return initgroups32 (name, gid16togid32(gid)); } /* setgroups32: standards? */ diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 43841c1f5..508ed82e2 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -61,6 +61,9 @@ cygsidlist::free_sids () { if (sids) cfree (sids); + sids = NULL; + count = maxcount = 0; + type = cygsidlist_empty; } extern "C" void diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 580d7c143..d9bd691f3 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -86,7 +86,7 @@ public: } }; -typedef enum { cygsidlist_unknown, cygsidlist_alloc, cygsidlist_auto } cygsidlist_type; +typedef enum { cygsidlist_empty, cygsidlist_alloc, cygsidlist_auto } cygsidlist_type; class cygsidlist { int maxcount; public: @@ -167,6 +167,11 @@ public: sgsids = newsids; ischanged = TRUE; } + void clear_supp () + { + sgsids.free_sids (); + ischanged = TRUE; + } void update_pgrp (const PSID sid) { pgsid = sid; |