From e9017ba418202b4b191c5a9ad4a96857558ce606 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 14 Apr 2008 17:22:58 +0200 Subject: Use _OBJ_FILES variables in a couple more places. (This used to be commit 92856d5054106894b65cd1a1b5119c0facfc4cff) --- source4/libnet/config.mk | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) (limited to 'source4/libnet') diff --git a/source4/libnet/config.mk b/source4/libnet/config.mk index 231d67cf35..243fc1813a 100644 --- a/source4/libnet/config.mk +++ b/source4/libnet/config.mk @@ -1,38 +1,16 @@ [SUBSYSTEM::LIBSAMBA-NET] PRIVATE_PROTO_HEADER = libnet_proto.h -PRIVATE_DEPENDENCIES = PROVISION -OBJ_FILES = \ - libnet.o \ - libnet_passwd.o \ - libnet_time.o \ - libnet_rpc.o \ - libnet_join.o \ - libnet_site.o \ - libnet_become_dc.o \ - libnet_unbecome_dc.o \ - libnet_vampire.o \ - libnet_samsync.o \ - libnet_samdump.o \ - libnet_samdump_keytab.o \ - libnet_samsync_ldb.o \ - libnet_user.o \ - libnet_group.o \ - libnet_share.o \ - libnet_lookup.o \ - libnet_domain.o \ - userinfo.o \ - groupinfo.o \ - userman.o \ - groupman.o \ - prereq_domain.o -PUBLIC_DEPENDENCIES = CREDENTIALS dcerpc dcerpc_samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI LIBCLI_COMPOSITE LIBCLI_RESOLVE LIBCLI_FINDDCS LIBCLI_CLDAP LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH LIBNDR SMBPASSWD - -#PUBLIC_HEADERS += $(addprefix libnet/, libnet.h libnet_join.h libnet_lookup.h libnet_passwd.h \ -# libnet_rpc.h libnet_share.h libnet_time.h \ -# libnet_user.h libnet_site.h libnet_vampire.h \ -# userinfo.h userman.h) +PUBLIC_DEPENDENCIES = CREDENTIALS dcerpc dcerpc_samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI LIBCLI_COMPOSITE LIBCLI_RESOLVE LIBCLI_FINDDCS LIBCLI_CLDAP LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH LIBNDR SMBPASSWD PROVISION +LIBSAMBA-NET_OBJ_FILES = $(addprefix libnet/, \ + libnet.o libnet_passwd.o libnet_time.o libnet_rpc.o \ + libnet_join.o libnet_site.o libnet_become_dc.o libnet_unbecome_dc.o \ + libnet_vampire.o libnet_samdump.o libnet_samdump_keytab.o \ + libnet_samsync_ldb.o libnet_user.o libnet_group.o libnet_share.o \ + libnet_lookup.o libnet_domain.o userinfo.o groupinfo.o userman.o \ + groupman.o prereq_domain.o libnet_samsync.o) [PYTHON::python_net] -PRIVATE_DEPENDENCIES = LIBSAMBA-NET LIBPYTHON -OBJ_FILES = py_net.o +PRIVATE_DEPENDENCIES = LIBSAMBA-NET + +python_net_OBJ_FILES = libnet/py_net.o -- cgit From b54e6a815514ef1e5a0a5d11ca43f85e0366b8dc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 14 Apr 2008 17:58:09 +0200 Subject: Ensure we initialise s->lp_ctx for the way into the provision. Andrew Bartlett (This used to be commit b191a1953c24545e9dc1869fc33cb29343d4e3f2) --- source4/libnet/libnet_vampire.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/libnet') diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index 9d32088fe6..1cc63a3fb0 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -586,6 +586,8 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } + s->lp_ctx = ctx->lp_ctx; + join = talloc_zero(s, struct libnet_JoinDomain); if (!join) { return NT_STATUS_NO_MEMORY; -- cgit From 4f51b0246db3242ee02ee16905cba13a5dc5633a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 14 Apr 2008 12:43:37 -0400 Subject: Fix problems with event context not being the parent. (This used to be commit 957c4d893acf9e6db06a3fc3a4687ab6bb238635) --- source4/libnet/libnet.c | 13 +++++-------- source4/libnet/py_net.c | 13 +++++++++---- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'source4/libnet') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index d1605bc17d..c966898cee 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -28,20 +28,17 @@ struct libnet_context *libnet_context_init(struct event_context *ev, { struct libnet_context *ctx; + /* We require an event context here */ + if (!ev) { + return NULL; + } + /* create brand new libnet context */ ctx = talloc(ev, struct libnet_context); if (!ctx) { return NULL; } - /* events */ - if (ev == NULL) { - ev = event_context_find(ctx); - if (ev == NULL) { - talloc_free(ctx); - return NULL; - } - } ctx->event_ctx = ev; ctx->lp_ctx = lp_ctx; 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)) { -- cgit