* 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.
This commit is contained in:
parent
22f8000733
commit
5a8746b732
@ -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>
|
2002-09-08 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* fhandler_tty.cc (fhandler_tty_slave::open): Don't protect
|
* fhandler_tty.cc (fhandler_tty_slave::open): Don't protect
|
||||||
|
@ -449,14 +449,16 @@ extern "C"
|
|||||||
int
|
int
|
||||||
initgroups32 (const char *, __gid32_t)
|
initgroups32 (const char *, __gid32_t)
|
||||||
{
|
{
|
||||||
|
if (wincap.has_security ())
|
||||||
|
cygheap->user.groups.clear_supp ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
int
|
int
|
||||||
initgroups (const char *, __gid16_t)
|
initgroups (const char * name, __gid16_t gid)
|
||||||
{
|
{
|
||||||
return 0;
|
return initgroups32 (name, gid16togid32(gid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setgroups32: standards? */
|
/* setgroups32: standards? */
|
||||||
|
@ -61,6 +61,9 @@ cygsidlist::free_sids ()
|
|||||||
{
|
{
|
||||||
if (sids)
|
if (sids)
|
||||||
cfree (sids);
|
cfree (sids);
|
||||||
|
sids = NULL;
|
||||||
|
count = maxcount = 0;
|
||||||
|
type = cygsidlist_empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
|
@ -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 {
|
class cygsidlist {
|
||||||
int maxcount;
|
int maxcount;
|
||||||
public:
|
public:
|
||||||
@ -167,6 +167,11 @@ public:
|
|||||||
sgsids = newsids;
|
sgsids = newsids;
|
||||||
ischanged = TRUE;
|
ischanged = TRUE;
|
||||||
}
|
}
|
||||||
|
void clear_supp ()
|
||||||
|
{
|
||||||
|
sgsids.free_sids ();
|
||||||
|
ischanged = TRUE;
|
||||||
|
}
|
||||||
void update_pgrp (const PSID sid)
|
void update_pgrp (const PSID sid)
|
||||||
{
|
{
|
||||||
pgsid = sid;
|
pgsid = sid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user