1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

idmap_rfc2307: Fix a crash after connection problem to DC

When the connection to the DC has a problem, the code behind
ads_do_search_retry closes the current connection and opens a new one.
The new connection has a new struct LDAP to represent the connection. In
this case, the LDAP pointer in the idmap_rfc2307_context becomes
invalid.

Fix this problem by updating the local pointer after calling
ads_do_search_retry.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Christof Schmitt 2014-09-17 13:23:11 -07:00
parent fa9630e368
commit 304e3904f0

View File

@ -103,6 +103,7 @@ static NTSTATUS idmap_rfc2307_ads_search(struct idmap_rfc2307_context *ctx,
status = ads_do_search_retry(ctx->ads, bind_path,
LDAP_SCOPE_SUBTREE, expr, attrs, result);
ctx->ldap = ctx->ads->ldap.ld;
return ads_ntstatus(status);
}