summaryrefslogtreecommitdiff
path: root/source4/winbind
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-10-31 20:28:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:36 -0500
commit4bb85c2939c879db566e117f6c1daa22377c0e4e (patch)
treed4c6934a83b637d568120066248183f697b676dc /source4/winbind
parent5ca7979b2ca0cb9de1787023b2bf07e1048ba7cf (diff)
downloadsamba-4bb85c2939c879db566e117f6c1daa22377c0e4e.tar.gz
samba-4bb85c2939c879db566e117f6c1daa22377c0e4e.tar.bz2
samba-4bb85c2939c879db566e117f6c1daa22377c0e4e.zip
r11423: Add some TALLOC_CTX
(This used to be commit a043ef33dca19d5ac1cdead60a4faa8b3a950bf4)
Diffstat (limited to 'source4/winbind')
-rw-r--r--source4/winbind/wb_cmd_lookupname.c12
-rw-r--r--source4/winbind/wb_cmd_lookupsid.c11
-rw-r--r--source4/winbind/wb_samba3_cmd.c4
-rw-r--r--source4/winbind/wb_sid2domain.c2
4 files changed, 16 insertions, 13 deletions
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;