summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/grp.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-02-24 20:52:57 +0000
committerCorinna Vinschen <corinna@vinschen.de>2015-02-24 20:52:57 +0000
commitad8d295e7c02a289d11b7ab3e7c7e36af934adde (patch)
tree3893feff97d034c24f0714f5753fcf599dc445bf /winsup/cygwin/grp.cc
parent59076540bce2380bade31edba78b8dd421a03d3c (diff)
downloadcygnal-ad8d295e7c02a289d11b7ab3e7c7e36af934adde.tar.gz
cygnal-ad8d295e7c02a289d11b7ab3e7c7e36af934adde.tar.bz2
cygnal-ad8d295e7c02a289d11b7ab3e7c7e36af934adde.zip
* ldap.h: Remove index macros.
(class cyg_ldap): Remove members srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Remove private method taking index argument. (cyg_ldap::get_num_attribute): Ditto. Add method taking attribute name. (cyg_ldap::get_primary_gid): Adjust to aforementioned change. (cyg_ldap::get_unix_uid): Ditto. (cyg_ldap::get_unix_gid): Ditto. * ldap.cc: Throughout, use msg and entry in place of srch_msg and srch_entry. (std_user_attr): Add sAMAccountName and objectSid. (group_attr): Ditto. (cyg_ldap::close): Drop handling of srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Move earlier in file. (cyg_ldap::get_num_attribute): Ditto. (cyg_ldap::enumerate_ad_accounts): Add comments for clarity. Use group_attr or user_attr rather than sid_attr to fetch all desired attributes for an account right away. (cyg_ldap::next_account): Store found SID in last_fetched_sid to skip calls to fetch_ad_account from fetch_account_from_windows. (cyg_ldap::get_string_attribute): Remove method taking index argument. (cyg_ldap::get_num_attribute): Ditto. * pwdgrp.h (class pg_ent): Fix formatting. Add member dom. * passwd.cc (pg_ent::enumerate_ad): Store current flat domain name in dom. Construct fetch_acc_t argument from LDAP attributes and call fetch_account_from_windows with that. * userinfo.h (enum fetch_user_arg_type_t): Rename FULL_grp_arg to FULL_acc_arg. Change throughout. (struct fetch_acc_t): Rename from fetch_full_grp_t. Change throughout. (struct fetch_user_arg_t): Rename full_grp to full_acc. Change throughout.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 676dd7672..5e5f1d810 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -145,35 +145,35 @@ internal_getgrsid_cachedonly (cygpsid &sid)
for each group. This is quite a bit faster, especially in slower
environments. */
static struct group * __attribute__((used))
-internal_getgrfull (fetch_full_grp_t &full_grp, cyg_ldap *pldap)
+internal_getgrfull (fetch_acc_t &full_acc, cyg_ldap *pldap)
{
struct group *ret;
cygheap->pg.nss_init ();
/* Check caches first. */
if (cygheap->pg.nss_cygserver_caching ()
- && (ret = cygheap->pg.grp_cache.cygserver.find_group (full_grp.sid)))
+ && (ret = cygheap->pg.grp_cache.cygserver.find_group (full_acc.sid)))
return ret;
if (cygheap->pg.nss_grp_files ()
- && (ret = cygheap->pg.grp_cache.file.find_group (full_grp.sid)))
+ && (ret = cygheap->pg.grp_cache.file.find_group (full_acc.sid)))
return ret;
if (cygheap->pg.nss_grp_db ()
- && (ret = cygheap->pg.grp_cache.win.find_group (full_grp.sid)))
+ && (ret = cygheap->pg.grp_cache.win.find_group (full_acc.sid)))
return ret;
/* Ask sources afterwards. */
if (cygheap->pg.nss_cygserver_caching ()
&& (ret = cygheap->pg.grp_cache.cygserver.add_group_from_cygserver
- (full_grp.sid)))
+ (full_acc.sid)))
return ret;
if (cygheap->pg.nss_grp_files ())
{
cygheap->pg.grp_cache.file.check_file ();
if ((ret = cygheap->pg.grp_cache.file.add_group_from_file
- (full_grp.sid)))
+ (full_acc.sid)))
return ret;
}
if (cygheap->pg.nss_grp_db ())
- return cygheap->pg.grp_cache.win.add_group_from_windows (full_grp, pldap);
+ return cygheap->pg.grp_cache.win.add_group_from_windows (full_acc, pldap);
return NULL;
}
@@ -647,14 +647,14 @@ internal_getgroups (int gidsetsize, gid_t *grouplist, cyg_ldap *pldap,
{
for (ULONG ncnt = 0; ncnt < scnt; ++ncnt)
{
- fetch_full_grp_t full_grp =
+ fetch_acc_t full_acc =
{
.sid = sidp_buf[ncnt],
.name = &nlst[ncnt].Name,
.dom = &dlst->Domains[nlst[ncnt].DomainIndex].Name,
.acc_type = nlst[ncnt].Use
};
- if ((grp = internal_getgrfull (full_grp, pldap)))
+ if ((grp = internal_getgrfull (full_acc, pldap)))
{
if (cnt < gidsetsize)
grouplist[cnt] = grp->gr_gid;