* uinfo.cc (cygheap_domain_info::init): Fix handling of account domain

on donmain controllers.  Explain why.
This commit is contained in:
Corinna Vinschen 2014-02-10 20:16:55 +00:00
parent ebb09f85e1
commit b0244c497b
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2014-02-10 Corinna Vinschen <corinna@vinschen.de>
* uinfo.cc (cygheap_domain_info::init): Fix handling of account domain
on donmain controllers. Explain why.
2014-02-10 Corinna Vinschen <corinna@vinschen.de>
* cygheap.cc (cwcsdup): Change parameter to correct PWCSTR.

View File

@ -745,9 +745,13 @@ cygheap_domain_info::init ()
system_printf ("LsaQueryInformationPolicy(Account) %u", status);
return false;
}
/* Copy account domain info to cygheap. */
adom_name = cwcsdup (adom->DomainName.Buffer);
/* Copy account domain info to cygheap. If we're running on a DC the account
domain is identical to the primary domain. This leads to confusion when
trying to compute the uid/gid values. Therefore we invalidate the account
domain name if we're running on a DC. */
adom_sid = adom->DomainSid;
if (pdom_sid == adom_sid)
adom_name = cwcsdup (pdom_sid == adom_sid ? L"@" : adom->DomainName.Buffer);
LsaFreeMemory (adom);
lsa_close_policy (lsa);
if (cygheap->dom.member_machine ())