summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/ldap.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-07-29 08:53:13 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-07-29 08:53:13 +0000
commit898e26c82f9f8b105f867516f7866c3479986628 (patch)
treee3108f27e163c7fd916ce89c07c98725657a5834 /winsup/cygwin/ldap.cc
parentca6a65aa641625c8948d731c6a3b10a8ee9cd684 (diff)
downloadcygnal-898e26c82f9f8b105f867516f7866c3479986628.tar.gz
cygnal-898e26c82f9f8b105f867516f7866c3479986628.tar.bz2
cygnal-898e26c82f9f8b105f867516f7866c3479986628.zip
* 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.
Diffstat (limited to 'winsup/cygwin/ldap.cc')
-rw-r--r--winsup/cygwin/ldap.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/ldap.cc b/winsup/cygwin/ldap.cc
index fa19c307e..df7756809 100644
--- a/winsup/cygwin/ldap.cc
+++ b/winsup/cygwin/ldap.cc
@@ -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);
}