aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-06-21 20:38:05 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-06-21 20:38:05 +0000
commit2a770b2a6f38678409b7f5cc1d56f786ba1e7bf3 (patch)
treee281abb163f511f94de8ac09d6369c19e6dae3a8
parent4adc3db74eeb77b67bea90dfe48d1555b99dfa45 (diff)
downloadnewlib-2a770b2a6f38678409b7f5cc1d56f786ba1e7bf3.zip
newlib-2a770b2a6f38678409b7f5cc1d56f786ba1e7bf3.tar.gz
newlib-2a770b2a6f38678409b7f5cc1d56f786ba1e7bf3.tar.bz2
* security.cc (get_initgroups_sidlist): Drop special_pgrp parameter.
(get_setgroups_sidlist): Avoid duplicate groups in group list. (create_token): Remove special_pgrp local variable. Accomodate change to get_initgroups_sidlist call.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/security.cc16
2 files changed, 14 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a3fe9a3..fef6169 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2005-06-21 Corinna Vinschen <corinna@vinschen.de>
+ * security.cc (get_initgroups_sidlist): Drop special_pgrp parameter.
+ (get_setgroups_sidlist): Avoid duplicate groups in group list.
+ (create_token): Remove special_pgrp local variable. Accomodate
+ change to get_initgroups_sidlist call.
+
+2005-06-21 Corinna Vinschen <corinna@vinschen.de>
+
* uinfo.cc (uinfo_init): Call reimpersonate to set the main thread's
impersonation token.
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index c589513..fce6eb0 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -582,20 +582,19 @@ get_server_groups (cygsidlist &grp_list, PSID usersid, struct passwd *pw)
static bool
get_initgroups_sidlist (cygsidlist &grp_list,
PSID usersid, PSID pgrpsid, struct passwd *pw,
- PTOKEN_GROUPS my_grps, LUID auth_luid, int &auth_pos,
- bool &special_pgrp)
+ PTOKEN_GROUPS my_grps, LUID auth_luid, int &auth_pos)
{
grp_list += well_known_world_sid;
grp_list += well_known_authenticated_users_sid;
if (well_known_system_sid == usersid)
auth_pos = -1;
- else
- get_token_group_sidlist (grp_list, my_grps, auth_luid, auth_pos);
+ else
+ get_token_group_sidlist (grp_list, my_grps, auth_luid, auth_pos);
if (!get_server_groups (grp_list, usersid, pw))
return false;
/* special_pgrp true if pgrpsid is not in normal groups */
- if ((special_pgrp = !grp_list.contains (pgrpsid)))
+ if (!grp_list.contains (pgrpsid))
grp_list += pgrpsid;
return true;
}
@@ -609,7 +608,8 @@ get_setgroups_sidlist (cygsidlist &tmp_list, PTOKEN_GROUPS my_grps,
tmp_list += well_known_authenticated_users_sid;
get_token_group_sidlist (tmp_list, my_grps, auth_luid, auth_pos);
for (int gidx = 0; gidx < groups.sgsids.count; gidx++)
- tmp_list += groups.sgsids.sids[gidx];
+ if (!tmp_list.contains (groups.sgsids.sids[gidx]))
+ tmp_list += groups.sgsids.sids[gidx];
if (!groups.sgsids.contains (pgpsid))
tmp_list += pgpsid;
}
@@ -851,7 +851,6 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
SECURITY_QUALITY_OF_SERVICE sqos =
{ sizeof sqos, SecurityImpersonation, SECURITY_STATIC_TRACKING, FALSE };
OBJECT_ATTRIBUTES oa = { sizeof oa, 0, 0, 0, 0, &sqos };
- bool special_pgrp = false;
LUID auth_luid = SYSTEM_LUID;
LARGE_INTEGER exp = { QuadPart:INT64_MAX };
@@ -920,8 +919,7 @@ create_token (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
get_setgroups_sidlist (tmp_gsids, my_tok_gsids, new_groups, auth_luid,
auth_pos);
else if (!get_initgroups_sidlist (tmp_gsids, usersid, new_groups.pgsid, pw,
- my_tok_gsids, auth_luid, auth_pos,
- special_pgrp))
+ my_tok_gsids, auth_luid, auth_pos))
goto out;
/* Primary group. */