diff options
author | Pavel Březina <pbrezina@redhat.com> | 2013-08-27 11:11:05 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-28 13:46:38 +0200 |
commit | b525aa57f138f67624038c4a1bdeca9042bcf2f0 (patch) | |
tree | 4f44c25233a4f4e4420b6d33b62fa595cb662681 /src/providers/ipa | |
parent | e526ea590b031e3257511b02a887a0379602578c (diff) | |
download | sssd-b525aa57f138f67624038c4a1bdeca9042bcf2f0.tar.gz sssd-b525aa57f138f67624038c4a1bdeca9042bcf2f0.tar.xz sssd-b525aa57f138f67624038c4a1bdeca9042bcf2f0.zip |
SIGCHLD handler: do not call callback when pvt data where freed
https://fedorahosted.org/sssd/ticket/1992
Diffstat (limited to 'src/providers/ipa')
-rw-r--r-- | src/providers/ipa/ipa_dyndns.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c index 561ee5280..a43901b6c 100644 --- a/src/providers/ipa/ipa_dyndns.c +++ b/src/providers/ipa/ipa_dyndns.c @@ -356,6 +356,7 @@ failed: struct nsupdate_send_ctx { struct ipa_nsupdate_ctx *nsupdate_ctx; + struct sss_child_ctx_old *child_ctx; int child_status; }; @@ -588,7 +589,8 @@ fork_nsupdate_send(struct ipa_nsupdate_ctx *ctx) /* Set up SIGCHLD handler */ ret = child_handler_setup(ctx->dyndns_ctx->ipa_ctx->id_ctx->be->ev, - pid, ipa_dyndns_child_handler, req); + pid, ipa_dyndns_child_handler, req, + &state->child_ctx); if (ret != EOK) { return NULL; } @@ -618,9 +620,16 @@ static void ipa_dyndns_timeout(struct tevent_context *ev, { struct tevent_req *req = talloc_get_type(pvt, struct tevent_req); + struct nsupdate_send_ctx *state = + tevent_req_data(req, struct nsupdate_send_ctx); + DEBUG(1, ("Timeout reached for dynamic DNS update\n")); + child_handler_destroy(state->child_ctx); + state->child_ctx = NULL; + state->child_status = ETIMEDOUT; + tevent_req_error(req, ETIMEDOUT); } |