* cygheap.h (class cygheap_domain_info): Remove lowest_tdo_posix_offset.
* ldap.cc (cyg_ldap::fetch_posix_offset_for_domain): Return UINT32_MAX in case of error. * security.h (PRIMARY_POSIX_OFFSET): Define. (NOACCESS_POSIX_OFFSET): Define. (UNUSABLE_POSIX_OFFSET): Define. * uinfo.cc (cygheap_domain_info::init): Drop initializing lowest_tdo_posix_offset. (pwdgrp::fetch_account_from_file): Set PosixOffset to either UNUSABLE_POSIX_OFFSET or NOACCESS_POSIX_OFFSET in case we don't get a sensible offset from AD. Explain why. Drop setting ch lowest_tdo_posix_offset. (pwdgrp::fetch_account_from_windows): Replace constant 0x100000 with PRIMARY_POSIX_OFFSET throughout.
This commit is contained in:
@@ -471,6 +471,8 @@ cyg_ldap::next_account (cygsid &sid)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Return UINT32_MAX on error to allow differing between not being able
|
||||
to fetch a value and a real 0 offset. */
|
||||
uint32_t
|
||||
cyg_ldap::fetch_posix_offset_for_domain (PCWSTR domain)
|
||||
{
|
||||
@@ -491,11 +493,11 @@ cyg_ldap::fetch_posix_offset_for_domain (PCWSTR domain)
|
||||
__small_swprintf (filter, L"(&(objectClass=trustedDomain)(%W=%W))",
|
||||
wcschr (domain, L'.') ? L"name" : L"flatName", domain);
|
||||
if (search (rootdse, filter, attr = tdom_attr) != 0)
|
||||
return 0;
|
||||
return UINT32_MAX;
|
||||
if (!(entry = ldap_first_entry (lh, msg)))
|
||||
{
|
||||
debug_printf ("No entry for %W in rootdse %W", filter, rootdse);
|
||||
return 0;
|
||||
return UINT32_MAX;
|
||||
}
|
||||
return get_num_attribute (0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user