Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Scott <conrad.scott@dsl.pipex.com>2002-09-12 14:07:50 +0400
committerConrad Scott <conrad.scott@dsl.pipex.com>2002-09-12 14:07:50 +0400
commitc7b43795cf79f09bfc810074471dab508f01ecbf (patch)
treefa4e3e7293137bda934300b079fd3a9c8c919400
parent450d73c6bf478df7dcb4501ccb3de303883b5b0f (diff)
Merged changes from HEAD
-rw-r--r--winsup/cygwin/ChangeLog14
-rw-r--r--winsup/cygwin/fhandler_tty.cc2
-rw-r--r--winsup/cygwin/grp.cc6
-rw-r--r--winsup/cygwin/security.cc3
-rw-r--r--winsup/cygwin/security.h7
-rw-r--r--winsup/cygwin/tty.cc4
6 files changed, 29 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 42d551909..f5b42ef9c 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,17 @@
+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
+ input/output handles since they are not properly manipulated later.
+ * tty.cc (tty::make_pipes): Ditto.
+
2002-09-06 Christopher Faylor <cgf@redhat.com>
* winsup.h (_WIN32_WINNT): Protect.
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 68a09a2a7..68a2c4718 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -531,9 +531,7 @@ fhandler_tty_slave::open (path_conv *, int flags, mode_t)
get_ttyp ()->to_master, to_master_local);
set_io_handle (from_master_local);
- ProtectHandle1INH (from_master_local, from_pty);
set_output_handle (to_master_local);
- ProtectHandle1INH (to_master_local, to_pty);
set_open_status ();
termios_printf ("tty%d opened", ttynum);
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;
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index 3f55a6c23..982bfab57 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -366,14 +366,14 @@ tty::make_pipes (fhandler_pty_master *ptym)
return FALSE;
}
- ProtectHandle1INH (to_slave, to_pty);
+ // ProtectHandle1INH (to_slave, to_pty);
if (CreatePipe (&from_slave, &to_master, &sec_all, 0) == FALSE)
{
termios_printf ("can't create output pipe");
set_errno (ENOENT);
return FALSE;
}
- ProtectHandle1INH (from_slave, from_pty);
+ // ProtectHandle1INH (from_slave, from_pty);
termios_printf ("tty%d from_slave %p, to_slave %p", ntty, from_slave,
to_slave);