From f767a508a68e7308e0fba638626b67615a3ce2e9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 17 Dec 2006 13:33:43 +0000 Subject: r20225: we can't use composite_error() in a _recv() function, as that would trigger the caller to call the _recv() function again and will be an endless loop. this is just a fix the to prevent this, and use a more usefull error code than NT_STATUS_UNSUCCESSFUL I think we should move the checks about valid responses into the function which receives the the response (here continue_name_found()), so that the _recv() function only needs to transfer the output vars to the caller without any logic to analyse the network response. metze (This used to be commit c02048f4800fe14e975f1cf0b5bd45f14261ac18) --- source4/libnet/libnet_lookup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/libnet/libnet_lookup.c') diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index e8bceb9218..d194c1a73c 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -419,7 +419,9 @@ NTSTATUS libnet_LookupName_recv(struct composite_context *c, TALLOC_CTX *mem_ctx struct lsa_TransSidArray *sids = s->lookup.out.sids; if (domains == NULL || sids == NULL) { - composite_error(c, NT_STATUS_UNSUCCESSFUL); + status = NT_STATUS_UNSUCCESSFUL; + io->out.error_string = talloc_asprintf(mem_ctx, "Error: %s", nt_errstr(status)); + goto done; } if (sids->count > 0) { @@ -440,6 +442,7 @@ NTSTATUS libnet_LookupName_recv(struct composite_context *c, TALLOC_CTX *mem_ctx io->out.error_string = talloc_asprintf(mem_ctx, "Error: %s", nt_errstr(status)); } +done: talloc_free(c); return status; } -- cgit