From bb78a286dbc90d248bd7a9d29344de87051920f2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 18 Dec 2009 10:23:41 -0500 Subject: Fix ldap child memory hierarchy and other issues The timeout handler was not a child of the request so it could fire even though the request was already freed. The code wouldn't use async writes to the children so it could incur in a short write with no way to detect or recover from it. Also fixed style of some helper functions to pass explicit paramters instead of a general structure. Add common code to do async writes to pipes. Fixed async write issue for the krb5_child as well. Fix also sdap_kinit_done(), a return statement was missing and we were mixing SDAP_AUTH and errno return codes in state->result Remove usless helper function that just replicates talloc_strndup() --- server/providers/child_common.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'server/providers/child_common.h') diff --git a/server/providers/child_common.h b/server/providers/child_common.h index 894255b57..a441df3c5 100644 --- a/server/providers/child_common.h +++ b/server/providers/child_common.h @@ -46,15 +46,14 @@ struct io_buffer { size_t size; }; -uint8_t *copy_buffer_and_add_zero(TALLOC_CTX *mem_ctx, - const uint8_t *src, size_t len); - /* Async communication with the child process via a pipe */ -struct read_pipe_state; +struct tevent_req *write_pipe_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + uint8_t *buf, size_t len, int fd); +int write_pipe_recv(struct tevent_req *req); struct tevent_req *read_pipe_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, int fd); - int read_pipe_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, uint8_t **buf, ssize_t *len); -- cgit