summaryrefslogtreecommitdiff
path: root/source4/libnet/py_net.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-04-15 09:54:41 +0200
committerAndrew Tridgell <tridge@samba.org>2008-04-15 09:54:41 +0200
commitb967afca648eea481e586f367f99464418cf8468 (patch)
tree3fbe9cc92a21013cbd1eb2b6fa1b73ccddfbb151 /source4/libnet/py_net.c
parent9cd04363f56ba5ee4f8b1ffaf662fe81cc995e99 (diff)
parentafaba23131dc079be3cd92e87495ec8b2ebdc4ae (diff)
downloadsamba-b967afca648eea481e586f367f99464418cf8468.tar.gz
samba-b967afca648eea481e586f367f99464418cf8468.tar.bz2
samba-b967afca648eea481e586f367f99464418cf8468.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit e891157b4ec7b2f845fb20c4106d80bf169f2072)
Diffstat (limited to 'source4/libnet/py_net.c')
-rw-r--r--source4/libnet/py_net.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index 2fcbc5d156..cf81d8070d 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -22,11 +22,12 @@
#include "libnet.h"
#include "param/param.h"
#include "libcli/security/security.h"
+#include "lib/events/events.h"
-struct libnet_context *py_net_ctx(PyObject *obj)
+struct libnet_context *py_net_ctx(PyObject *obj, struct event_context *ev)
{
/* FIXME: Use obj */
- return libnet_context_init(NULL, global_loadparm);
+ return libnet_context_init(ev, global_loadparm);
}
static PyObject *py_net_join(PyObject *cls, PyObject *args, PyObject *kwargs)
@@ -35,6 +36,7 @@ static PyObject *py_net_join(PyObject *cls, PyObject *args, PyObject *kwargs)
NTSTATUS status;
PyObject *result;
TALLOC_CTX *mem_ctx;
+ struct event_context *ev;
struct libnet_context *libnet_ctx;
const char *kwnames[] = { "domain_name", "netbios_name", "join_type", "level", NULL };
@@ -43,9 +45,12 @@ static PyObject *py_net_join(PyObject *cls, PyObject *args, PyObject *kwargs)
&r.in.join_type, &r.in.level))
return NULL;
- mem_ctx = talloc_new(NULL);
+ /* FIXME: we really need to get a context from the caller or we may end
+ * up with 2 event contexts */
+ ev = event_context_init(NULL);
+ mem_ctx = talloc_new(ev);
- libnet_ctx = py_net_ctx(cls);
+ libnet_ctx = py_net_ctx(cls, ev);
status = libnet_Join(libnet_ctx, mem_ctx, &r);
if (NT_STATUS_IS_ERR(status)) {