mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r15492: Without this patch, the LDAP client libs will call abort() in
ldap_get_values_len, because they were handed a NULL msgs pointer, for example in ads_pull_sid(). This occurs when the AD server fails at the connect stage. (The toubled AD server is actually Samba4 in my example). Andrew Bartlett
This commit is contained in:
parent
7729799be9
commit
221a6de7d0
@ -48,15 +48,16 @@ ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path, int scope
|
||||
return ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
|
||||
}
|
||||
|
||||
while (count--) {
|
||||
*res = NULL;
|
||||
status = ads_do_search_all(ads, bp, scope, expr, attrs, res);
|
||||
if (ADS_ERR_OK(status)) {
|
||||
DEBUG(5,("Search for %s gave %d replies\n",
|
||||
expr, ads_count_replies(ads, *res)));
|
||||
SAFE_FREE(bp);
|
||||
return status;
|
||||
}
|
||||
*res = NULL;
|
||||
status = ads_do_search_all(ads, bp, scope, expr, attrs, res);
|
||||
if (ADS_ERR_OK(status)) {
|
||||
DEBUG(5,("Search for %s gave %d replies\n",
|
||||
expr, ads_count_replies(ads, *res)));
|
||||
SAFE_FREE(bp);
|
||||
return status;
|
||||
}
|
||||
|
||||
while (--count) {
|
||||
|
||||
if (*res)
|
||||
ads_msgfree(ads, *res);
|
||||
@ -79,6 +80,15 @@ ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path, int scope
|
||||
SAFE_FREE(bp);
|
||||
return status;
|
||||
}
|
||||
|
||||
*res = NULL;
|
||||
status = ads_do_search_all(ads, bp, scope, expr, attrs, res);
|
||||
if (ADS_ERR_OK(status)) {
|
||||
DEBUG(5,("Search for %s gave %d replies\n",
|
||||
expr, ads_count_replies(ads, *res)));
|
||||
SAFE_FREE(bp);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
SAFE_FREE(bp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user