* ldap.h (class cyg_ldap): Rename rootdse to def_context. Change

throughout.
	* ldap.cc (cyg_ldap::open): Fix debug output.
	(cyg_ldap::fetch_ad_account): Rename rdse to base.  Restrict LDAP
	query to users and groups only.
	(cyg_ldap::enumerate_ad_accounts): Rearrange filter expression for
	user accounts.
	(SYSTEM_CONTAINER): New macro.
	(cyg_ldap::fetch_posix_offset_for_domain): Set base in LDAP search
	to the "System" container in the default naming context to restrict
	the search scope.
	(cyg_ldap::fetch_unix_sid_from_ad): Add objectCategory=Person to
	search filter for users.
This commit is contained in:
Corinna Vinschen
2015-02-17 21:08:01 +00:00
parent 8d98f956cc
commit c6d22dd3b0
3 changed files with 59 additions and 32 deletions

View File

@@ -25,7 +25,7 @@ details. */
class cyg_ldap {
PLDAP lh;
PWCHAR rootdse;
PWCHAR def_context;
PLDAPMessage msg, entry;
PWCHAR *val;
PWCHAR *attr;
@@ -45,8 +45,8 @@ class cyg_ldap {
uint32_t get_num_attribute (int idx);
public:
cyg_ldap () : lh (NULL), rootdse (NULL), msg (NULL), entry (NULL), val (NULL),
isAD (false), srch_id (NULL), srch_msg (NULL),
cyg_ldap () : lh (NULL), def_context (NULL), msg (NULL), entry (NULL),
val (NULL), isAD (false), srch_id (NULL), srch_msg (NULL),
srch_entry (NULL), last_fetched_sid (NO_SID)
{}
~cyg_ldap () { close (); }