From 4bb85c2939c879db566e117f6c1daa22377c0e4e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 31 Oct 2005 20:28:08 +0000 Subject: r11423: Add some TALLOC_CTX (This used to be commit a043ef33dca19d5ac1cdead60a4faa8b3a950bf4) --- source4/winbind/wb_cmd_lookupname.c | 12 +++++++----- source4/winbind/wb_cmd_lookupsid.c | 11 ++++++----- source4/winbind/wb_samba3_cmd.c | 4 ++-- source4/winbind/wb_sid2domain.c | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) (limited to 'source4') diff --git a/source4/winbind/wb_cmd_lookupname.c b/source4/winbind/wb_cmd_lookupname.c index 619c268c29..bf77b445b5 100644 --- a/source4/winbind/wb_cmd_lookupname.c +++ b/source4/winbind/wb_cmd_lookupname.c @@ -35,13 +35,14 @@ struct cmd_lookupname_state { static struct composite_context *lookupname_send_req(struct wbsrv_domain *domain, void *p); static NTSTATUS lookupname_recv_req(struct composite_context *ctx, void *p); -struct composite_context *wb_cmd_lookupname_send(struct wbsrv_service *service, +struct composite_context *wb_cmd_lookupname_send(TALLOC_CTX *mem_ctx, + struct wbsrv_service *service, const char *dom_name, const char *name) { struct cmd_lookupname_state *state; - state = talloc(NULL, struct cmd_lookupname_state); + state = talloc(mem_ctx, struct cmd_lookupname_state); state->name = talloc_asprintf(state, "%s\\%s", dom_name, name); if (state->name == NULL) goto failed; state->ctx = wb_domain_request_send(state, service, @@ -97,12 +98,13 @@ NTSTATUS wb_cmd_lookupname_recv(struct composite_context *c, return status; } -NTSTATUS wb_cmd_lookupname(struct wbsrv_service *service, +NTSTATUS wb_cmd_lookupname(TALLOC_CTX *mem_ctx, + struct wbsrv_service *service, const char *dom_name, const char *name, - TALLOC_CTX *mem_ctx, struct wb_sid_object **sid) + struct wb_sid_object **sid) { struct composite_context *c = - wb_cmd_lookupname_send(service, dom_name, name); + wb_cmd_lookupname_send(mem_ctx, service, dom_name, name); return wb_cmd_lookupname_recv(c, mem_ctx, sid); } diff --git a/source4/winbind/wb_cmd_lookupsid.c b/source4/winbind/wb_cmd_lookupsid.c index 1279cfe877..a92b2ea183 100644 --- a/source4/winbind/wb_cmd_lookupsid.c +++ b/source4/winbind/wb_cmd_lookupsid.c @@ -35,12 +35,13 @@ struct cmd_lookupsid_state { static struct composite_context *lookupsid_send_req(struct wbsrv_domain *domain, void *p); static NTSTATUS lookupsid_recv_req(struct composite_context *ctx, void *p); -struct composite_context *wb_cmd_lookupsid_send(struct wbsrv_service *service, +struct composite_context *wb_cmd_lookupsid_send(TALLOC_CTX *mem_ctx, + struct wbsrv_service *service, const struct dom_sid *sid) { struct cmd_lookupsid_state *state; - state = talloc(NULL, struct cmd_lookupsid_state); + state = talloc(mem_ctx, struct cmd_lookupsid_state); state->sid = dom_sid_dup(state, sid); if (state->sid == NULL) goto failed; state->ctx = wb_domain_request_send(state, service, @@ -95,11 +96,11 @@ NTSTATUS wb_cmd_lookupsid_recv(struct composite_context *c, return status; } -NTSTATUS wb_cmd_lookupsid(struct wbsrv_service *service, +NTSTATUS wb_cmd_lookupsid(TALLOC_CTX *mem_ctx, struct wbsrv_service *service, const struct dom_sid *sid, - TALLOC_CTX *mem_ctx, struct wb_sid_object **name) + struct wb_sid_object **name) { struct composite_context *c = - wb_cmd_lookupsid_send(service, sid); + wb_cmd_lookupsid_send(mem_ctx, service, sid); return wb_cmd_lookupsid_recv(c, mem_ctx, name); } diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index 6c68398f48..25c80cb099 100644 --- a/source4/winbind/wb_samba3_cmd.c +++ b/source4/winbind/wb_samba3_cmd.c @@ -371,7 +371,7 @@ NTSTATUS wbsrv_samba3_lookupname(struct wbsrv_samba3_call *s3call) DEBUG(5, ("wbsrv_samba3_lookupname called\n")); - ctx = wb_cmd_lookupname_send(service, + ctx = wb_cmd_lookupname_send(s3call, service, s3call->request.data.name.dom_name, s3call->request.data.name.name); NT_STATUS_HAVE_NO_MEMORY(ctx); @@ -425,7 +425,7 @@ NTSTATUS wbsrv_samba3_lookupsid(struct wbsrv_samba3_call *s3call) return NT_STATUS_NO_MEMORY; } - ctx = wb_cmd_lookupsid_send(service, sid); + ctx = wb_cmd_lookupsid_send(s3call, service, sid); NT_STATUS_HAVE_NO_MEMORY(ctx); /* setup the callbacks */ diff --git a/source4/winbind/wb_sid2domain.c b/source4/winbind/wb_sid2domain.c index 83e81e1cd0..13cc318f76 100644 --- a/source4/winbind/wb_sid2domain.c +++ b/source4/winbind/wb_sid2domain.c @@ -127,7 +127,7 @@ struct composite_context *wb_sid2domain_send(struct wbsrv_service *service, return result; } - ctx = wb_cmd_lookupsid_send(service, state->my_domain, state->sid); + ctx = wb_cmd_lookupsid_send(state, service, state->sid); if (ctx == NULL) goto failed; ctx->async.fn = sid2domain_recv_name; ctx->async.private_data = state; -- cgit