URL:
https://github.com/SSSD/sssd/pull/5300
Title: #5300: ad: use parallel cldap ping for site discovery
sumit-bose commented:
"""
Hi @pbrezina,
I came across an issue with `current_forest` and `current_site`. After some calls to
`ad_cldap_ping_send()` with `renew_site == False` the value was just garbage. I guess
something like
```
diff --git a/src/providers/ad/ad_cldap_ping.c b/src/providers/ad/ad_cldap_ping.c
index cd23065..ac6f72d 100644
--- a/src/providers/ad/ad_cldap_ping.c
+++ b/src/providers/ad/ad_cldap_ping.c
@@ -597,8 +597,8 @@ struct tevent_req *ad_cldap_ping_send(TALLOC_CTX *mem_ctx,
}
if (!srv_ctx->renew_site) {
- state->site = srv_ctx->current_site;
- state->forest = srv_ctx->current_forest;
+ state->site = talloc_strdup(state, srv_ctx->current_site);
+ state->forest = talloc_strdup(state, srv_ctx->current_forest);
DEBUG(SSSDBG_TRACE_FUNC,
"CLDAP ping is not necessary, using site '%s' and forest
'%s'\n",
state->site != NULL ? state->site : "unknown",
```
is needed to make sure that due to the `talloc_steal()` in the *_recv() function the
values from `src_ctx` do not loose their parent.
bye,
Sumit
"""
See the full comment at
https://github.com/SSSD/sssd/pull/5300#issuecomment-702837048