summaryrefslogtreecommitdiff
path: root/src/providers
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-06-24 14:53:27 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-07-17 15:01:51 +0200
commit711bba7e2f72a816774effa389ad13bcc46e7843 (patch)
treea101e81f75892c794b3613be0fff0c4bd481f5a2 /src/providers
parenta7401bf72db3a6eb62b1628f9dd141f7118e3510 (diff)
downloadsssd-711bba7e2f72a816774effa389ad13bcc46e7843.tar.gz
sssd-711bba7e2f72a816774effa389ad13bcc46e7843.tar.bz2
sssd-711bba7e2f72a816774effa389ad13bcc46e7843.zip
SIGCHLD handler: do not call callback when pvt data where freed
https://fedorahosted.org/sssd/ticket/1992
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/dp_dyndns.c6
-rw-r--r--src/providers/krb5/krb5_child_handler.c2
-rw-r--r--src/providers/ldap/sdap_child_helpers.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/providers/dp_dyndns.c b/src/providers/dp_dyndns.c
index 3467683a..488c2a61 100644
--- a/src/providers/dp_dyndns.c
+++ b/src/providers/dp_dyndns.c
@@ -764,6 +764,7 @@ nsupdate_get_addrs_recv(struct tevent_req *req,
struct nsupdate_child_state {
int pipefd_to_child;
struct tevent_timer *timeout_handler;
+ struct sss_child_ctx_old *child_ctx;
int child_status;
};
@@ -799,7 +800,8 @@ nsupdate_child_send(TALLOC_CTX *mem_ctx,
state->pipefd_to_child = pipefd_to_child;
/* Set up SIGCHLD handler */
- ret = child_handler_setup(ev, child_pid, nsupdate_child_handler, req);
+ ret = child_handler_setup(ev, child_pid, nsupdate_child_handler, req,
+ &state->child_ctx);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, ("Could not set up child handlers [%d]: %s\n",
ret, sss_strerror(ret)));
@@ -847,6 +849,8 @@ nsupdate_child_timeout(struct tevent_context *ev,
tevent_req_data(req, struct nsupdate_child_state);
DEBUG(SSSDBG_CRIT_FAILURE, ("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, ERR_DYNDNS_TIMEOUT);
}
diff --git a/src/providers/krb5/krb5_child_handler.c b/src/providers/krb5/krb5_child_handler.c
index 1da7e4f4..dda53ab1 100644
--- a/src/providers/krb5/krb5_child_handler.c
+++ b/src/providers/krb5/krb5_child_handler.c
@@ -329,7 +329,7 @@ static errno_t fork_child(struct tevent_req *req)
fd_nonblocking(state->io->read_from_child_fd);
fd_nonblocking(state->io->write_to_child_fd);
- ret = child_handler_setup(state->ev, pid, NULL, NULL);
+ ret = child_handler_setup(state->ev, pid, NULL, NULL, NULL);
if (ret != EOK) {
DEBUG(1, ("Could not set up child signal handler\n"));
return ret;
diff --git a/src/providers/ldap/sdap_child_helpers.c b/src/providers/ldap/sdap_child_helpers.c
index fd4d10f4..e5731344 100644
--- a/src/providers/ldap/sdap_child_helpers.c
+++ b/src/providers/ldap/sdap_child_helpers.c
@@ -119,7 +119,7 @@ static errno_t sdap_fork_child(struct tevent_context *ev,
fd_nonblocking(child->read_from_child_fd);
fd_nonblocking(child->write_to_child_fd);
- ret = child_handler_setup(ev, pid, NULL, NULL);
+ ret = child_handler_setup(ev, pid, NULL, NULL, NULL);
if (ret != EOK) {
return ret;
}