aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-02-27 17:41:15 +0000
committerCorinna Vinschen <corinna@vinschen.de>2003-02-27 17:41:15 +0000
commit7b2ce66370f5e1a8a18dcc169acc9cfa8c1c7671 (patch)
tree33cedd2da301b07b6820b3bd38d1b187adf0aeb4
parent0e7a60fef95e17d33e46d5ce6d0c9b3be18adc99 (diff)
downloadnewlib-7b2ce66370f5e1a8a18dcc169acc9cfa8c1c7671.zip
newlib-7b2ce66370f5e1a8a18dcc169acc9cfa8c1c7671.tar.gz
newlib-7b2ce66370f5e1a8a18dcc169acc9cfa8c1c7671.tar.bz2
* uinfo.cc (internal_getlogin): Only update user.groups.pgsid
if the call to set the primary group succeeds.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/uinfo.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4065d80..472b838 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-27 Pierre Humblet <pierre.humblet@ieee.org>
+
+ * uinfo.cc (internal_getlogin): Only update user.groups.pgsid
+ if the call to set the primary group succeeds.
+
2003-02-27 Christopher Faylor <cgf@redhat.com>
* cygthread::detach: Improve error message.
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index cb620d8..6b07ea4 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -83,10 +83,11 @@ internal_getlogin (cygheap_user &user)
if (gsid.getfromgr (internal_getgrgid (pw->pw_gid)))
{
/* Set primary group to the group in /etc/passwd. */
- user.groups.pgsid = gsid;
if (!SetTokenInformation (ptok, TokenPrimaryGroup,
&gsid, sizeof gsid))
debug_printf ("SetTokenInformation(TokenPrimaryGroup): %E");
+ else
+ user.groups.pgsid = gsid;
}
else
debug_printf ("gsid not found in augmented /etc/group");