diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-07-01 15:13:49 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-07-01 15:15:37 +1000 |
commit | 27620c85e7d55e6e522b39c7aea8f83c2b5eb9b1 (patch) | |
tree | e1bab49d1adf179c66b8ff575eb8a23003a41fd4 /source4/libnet | |
parent | 0534ae012b3ef962f52fef9968eef30e88668874 (diff) | |
download | samba-27620c85e7d55e6e522b39c7aea8f83c2b5eb9b1.tar.gz samba-27620c85e7d55e6e522b39c7aea8f83c2b5eb9b1.tar.bz2 samba-27620c85e7d55e6e522b39c7aea8f83c2b5eb9b1.zip |
use a talloc_reparent in a very ugly way
this works around some terrible use of talloc in the libnet code
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet_rpc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c index 66e12d0da1..4524448928 100644 --- a/source4/libnet/libnet_rpc.c +++ b/source4/libnet/libnet_rpc.c @@ -400,8 +400,17 @@ static NTSTATUS libnet_RpcConnectDC_recv(struct composite_context *c, status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { - /* move connected rpc pipe between memory contexts */ - r->out.dcerpc_pipe = talloc_steal(mem_ctx, s->r.out.dcerpc_pipe); + /* move connected rpc pipe between memory contexts + + The use of talloc_reparent(talloc_parent(), ...) is + bizarre, but it is needed because of the absolutely + atrocious use of talloc in this code. We need to + force the original parent to change, but finding + the original parent is well nigh impossible at this + point in the code (yes, I tried). + */ + r->out.dcerpc_pipe = talloc_reparent(talloc_parent(s->r.out.dcerpc_pipe), + mem_ctx, s->r.out.dcerpc_pipe); /* reference created pipe structure to long-term libnet_context so that it can be used by other api functions even after short-term |