summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/security.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-04-18 21:10:15 +0000
committerChristopher Faylor <me@cgf.cx>2001-04-18 21:10:15 +0000
commit0381fec68f46471d29d3b87c5361e05fcdeb2cd5 (patch)
tree718cfaf2d3d8734c48f8957892329c0e8fc2fbfc /winsup/cygwin/security.cc
parenta2d47fe9d983ec85075172211172af9e5ab4054f (diff)
downloadcygnal-0381fec68f46471d29d3b87c5361e05fcdeb2cd5.tar.gz
cygnal-0381fec68f46471d29d3b87c5361e05fcdeb2cd5.tar.bz2
cygnal-0381fec68f46471d29d3b87c5361e05fcdeb2cd5.zip
Throughout, change fdtab references to cygheap->fdtab.
* child_info.h (cygheap_exec_info): Eliminate special fdtab stuff. * spawn.cc (spawn_guts): Ditto. * cygheap.cc (cygheap_init): Initialize fdtab, if appropriate. * cygheap.h (CYGHEAPSIZE): Include size of init_cygheap. (_cmalloc_entry): Include fdtab here. * dtable.h (dtable): Declare/define new methods. * dtable.cc (dtable::vfork_child_fixup): New method. (dtable::fixup_after_exec): Remove unneeded extra arguments. * dcrt0.cc (dll_crt0_1): Ditto. * environ.cc (getwinenv): Use case sensitive comparison. (winenv): Make a copy of environment cache to avoid realloc problems when duplicate environment variables exist in the environment. (From Egor Duda) * net.cc (cygwin_socket): Revert Apr 14 change. * include/sys/file.h: Protect against previous X_OK definition. * passwd.cc: Eliminate passwd_sem throughout. * security.cc: Ditto. * cygwin.din: Export New functions. * passwd.cc (read_etc_passwd): Make race safe. (getpwuid_r): New function. (getpwnam_r): New function.
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r--winsup/cygwin/security.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index def5685f6..d780103f8 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -185,7 +185,6 @@ get_world_sid ()
return world_sid;
}
-int passwd_sem = 0;
int group_sem = 0;
static int
@@ -207,10 +206,6 @@ get_id_from_sid (PSID psid, BOOL search_grp, int *type)
if (!search_grp)
{
- if (passwd_sem > 0)
- return 0;
- ++passwd_sem;
-
struct passwd *pw;
while ((pw = getpwent ()) != NULL)
{
@@ -221,7 +216,6 @@ get_id_from_sid (PSID psid, BOOL search_grp, int *type)
}
}
endpwent ();
- --passwd_sem;
if (id >= 0)
{
if (type)
@@ -330,7 +324,7 @@ is_grp_member (uid_t uid, gid_t gid)
extern int getgroups (int, gid_t *, gid_t, const char *);
BOOL grp_member = TRUE;
- if (!group_sem && !passwd_sem)
+ if (!group_sem)
{
struct passwd *pw = getpwuid (uid);
gid_t grps[NGROUPS_MAX];
@@ -1745,13 +1739,13 @@ extern "C"
int
facl (int fd, int cmd, int nentries, aclent_t *aclbufp)
{
- if (fdtab.not_open (fd))
+ if (cygheap->fdtab.not_open (fd))
{
syscall_printf ("-1 = facl (%d)", fd);
set_errno (EBADF);
return -1;
}
- const char *path = fdtab[fd]->get_name ();
+ const char *path = cygheap->fdtab[fd]->get_name ();
if (path == NULL)
{
syscall_printf ("-1 = facl (%d) (no name)", fd);