Samba 4 libnet_join and RPC-JOIN torture test
Brad Henry
j0j0 at riod.ca
Tue Sep 13 14:51:19 GMT 2005
Rafal Szczesniak wrote:
>On Tue, Sep 13, 2005 at 07:51:31AM +0200, Stefan (metze) Metzmacher wrote:
>
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>using the standard macro, we loose the error string here, so I would propose to use a libnet
>>specific macro here,
>>
>>#define LIBNET_NOT_OK_RETURN(status, tmp_mem, error) do {\
>> if (!NT_STATUS_IS_OK(status)) {
>> r->out.error_string = talloc_asprintf error;
>> talloc_free(tmp_mem);
>> return status;
>> }
>>} while(0)
>>
>>
>
>what specifically does this tmp_mem do here ?
>
>
>
>>and use it like this:
>>
>> status = dcerpc_lsa_OpenPolicy2(c.out.dcerpc_pipe, tmp_ctx, &lsa_open_policy);
>> LIBNET_NOT_OK_RETURN(status, tmp_ctx,(mem_ctx,
>> "lsa_OpenPolicy2 failed: %s",
>> nt_errstr(status)));
>>
>>abartlet, mimir: happy with such libnet specific macros?
>>
>>
>
>Looks quite fine at the first glance and I can check it in. The only thing
>I'm not clear about is tmp_ctx. Is it just function's memory context that
>we destroy here, as the function itself fails ?
>
>
>cheers,
>
>
Hi Rafal,
You are correct; tmp_mem is just a temporary talloc()'d memory context,
local to the function that is using the macro.
Brad
More information about the samba-technical
mailing list