summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-11-02 16:50:11 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-11-02 16:50:11 +0100
commitcb77fca1cd4cb340ca619410195aa6895f848b92 (patch)
tree10624686f67917db2ecb597f41041de0c706e776 /source4
parente11a7b3a0b7039af705ccb3a1c0bc7e21faa2bc6 (diff)
downloadsamba-cb77fca1cd4cb340ca619410195aa6895f848b92.tar.gz
samba-cb77fca1cd4cb340ca619410195aa6895f848b92.tar.bz2
samba-cb77fca1cd4cb340ca619410195aa6895f848b92.zip
Remove use of global loadparm in python modules.
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/messaging/pymessaging.c9
-rw-r--r--source4/libnet/py_net.c5
2 files changed, 11 insertions, 3 deletions
diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c
index c2c23b679e..ad8f955466 100644
--- a/source4/lib/messaging/pymessaging.c
+++ b/source4/lib/messaging/pymessaging.c
@@ -34,6 +34,9 @@
PyAPI_DATA(PyTypeObject) messaging_Type;
PyAPI_DATA(PyTypeObject) irpc_ClientConnectionType;
+/* FIXME: This prototype should be in param/pyparam.h */
+struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx);
+
static bool server_id_from_py(PyObject *object, struct server_id *server_id)
{
if (!PyTuple_Check(object)) {
@@ -80,7 +83,8 @@ PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwa
ev = s4_event_context_init(ret->mem_ctx);
if (messaging_path == NULL) {
- messaging_path = lp_messaging_path(ret->mem_ctx, global_loadparm);
+ messaging_path = lp_messaging_path(ret->mem_ctx,
+ py_default_loadparm_context(ret->mem_ctx));
} else {
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
}
@@ -334,7 +338,8 @@ PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
ev = s4_event_context_init(ret->mem_ctx);
if (messaging_path == NULL) {
- messaging_path = lp_messaging_path(ret->mem_ctx, global_loadparm);
+ messaging_path = lp_messaging_path(ret->mem_ctx,
+ py_default_loadparm_context(ret->mem_ctx));
} else {
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
}
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index 37d51d7840..887c3f466c 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -24,10 +24,13 @@
#include "lib/events/events.h"
#include "param/param.h"
+/* FIXME: This prototype should be in param/pyparam.h */
+struct loadparm_context *py_default_loadparm_context(TALLOC_CTX *mem_ctx);
+
static struct libnet_context *py_net_ctx(PyObject *obj, struct event_context *ev)
{
/* FIXME: Use obj */
- return libnet_context_init(ev, global_loadparm);
+ return libnet_context_init(ev, py_default_loadparm_context(NULL));
}
static PyObject *py_net_join(PyObject *cls, PyObject *args, PyObject *kwargs)