1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
samba-mirror/source4/lib/messaging
Andrew Tridgell f1c523939b pytalloc: ensure talloc_ctx is directly after PyObject_HEAD
the talloc python interface for tp_alloc and tp_dealloc relies on a
cast to a py_talloc_Object to find the talloc_ctx (see
py_talloc_dealloc). This means we rely on the talloc_ctx for the
object being directly after the PyObject_HEAD

This fixes the talloc free with references bug in samba_dnsupdate

The actual problem was the tp_alloc() call in
PyCredentialCacheContainer_from_ccache_container() which used a cast
from a py_talloc_Object to a PyCredentialCacheContainerObject. That
case effectively changed the parent/child relationship between the
talloc_ctx and the ccc ptr.

This patch changes all the structures that follow this pattern to put
the TALLOC_CTX directly after the PyObject_HEAD, to ensure that if
anyone else decides to do a dangerous cast like this that it won't
cause the same sort of subtle breakage.

Pair-Programmed-With: Rusty Russell <rusty@samba.org>
2010-04-20 15:50:27 +10:00
..
tests python: use '#!/usr/bin/env python' to cope with varying install locations 2010-03-25 14:37:19 +11:00
config.mk Fix unresolved symbol in python messaging module. 2009-06-02 18:05:42 +02:00
irpc.h s4-server: kill main daemon if a task fails to initialise 2009-09-18 18:05:55 -07:00
messaging.c s4-messaging: use auto-close on the socket 2010-03-05 11:54:36 +11:00
messaging.h s4-messaging: added a new msg type MSG_DREPL_ALLOCATE_RID 2010-01-08 13:03:01 +11:00
pymessaging.c pytalloc: ensure talloc_ctx is directly after PyObject_HEAD 2010-04-20 15:50:27 +10:00
wscript_build s4-waf: removed the AUTOGENERATED markers 2010-04-06 20:27:16 +10:00