* ldap.cc (struct cyg_ldap_search): Add scope member.

(cyg_ldap::search_s): Add parameter scope.  Use as LDAP search scope
	instead of fixed LDAP_SCOPE_SUBTREE scope.
	(ldap_search_thr): Call cyg_ldap::search_s with scope from argument.
	(cyg_ldap::search): Add parameter scope and fill in to cyg_ldap_search.
	(cyg_ldap::fetch_ad_account): Call search with LDAP_SCOPE_SUBTREE scope.
	(cyg_ldap::fetch_posix_offset_for_domain): Call search with
	LDAP_SCOPE_ONELEVEL scope.
	(cyg_ldap::fetch_unix_sid_from_ad): Call search with LDAP_SCOPE_SUBTREE
	scope.
	(cyg_ldap::fetch_unix_name_from_rfc2307): Ditto.
	* ldap.h (cyg_ldap::search): Align prototype to above change.
	(cyg_ldap::search_s): Ditto.
This commit is contained in:
Corinna Vinschen
2015-02-18 10:25:14 +00:00
parent 8e25eb2c85
commit c3470988cf
3 changed files with 29 additions and 12 deletions

View File

@ -37,7 +37,7 @@ class cyg_ldap {
inline int map_ldaperr_to_errno (ULONG lerr);
inline int wait (cygthread *thr);
inline int connect (PCWSTR domain);
inline int search (PWCHAR base, PWCHAR filter, PWCHAR *attrs);
inline int search (PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR *attrs);
inline int next_page ();
bool fetch_unix_sid_from_ad (uint32_t id, cygsid &sid, bool group);
PWCHAR fetch_unix_name_from_rfc2307 (uint32_t id, bool group);
@ -53,7 +53,7 @@ public:
ULONG connect_ssl (PCWSTR domain);
ULONG connect_non_ssl (PCWSTR domain);
ULONG search_s (PWCHAR base, PWCHAR filter, PWCHAR *attrs);
ULONG search_s (PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR *attrs);
ULONG next_page_s ();
bool is_open () const { return !!lh; }