[SCM] Samba Shared Repository - branch master updated - 1807b0870bd1b50229f29b9f78f660a454682006

Jelmer Vernooij jelmer at samba.org
Mon Dec 22 04:01:00 GMT 2008


The branch, master has been updated
       via  1807b0870bd1b50229f29b9f78f660a454682006 (commit)
       via  d58270c5373416997cc70fe392b307a4522e43d9 (commit)
       via  24b62772ab78a84d4a35f5eb15e327b6b76782b0 (commit)
       via  4eabc417a04240ffd813514c5e6ea38cbe5ffc91 (commit)
       via  2396d8d613eed8ab76358056da5fcaf68c71fbf4 (commit)
      from  a6bd295229cf1a245e2ced83ac4e10941207c526 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1807b0870bd1b50229f29b9f78f660a454682006
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Dec 22 04:56:41 2008 +0100

    pidl/python: Factor out connect code rather than duplicating it in each
    Python module.

commit d58270c5373416997cc70fe392b307a4522e43d9
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Dec 22 04:38:57 2008 +0100

    Add header for pyparam.

commit 24b62772ab78a84d4a35f5eb15e327b6b76782b0
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Dec 22 04:21:20 2008 +0100

    Remove includes of py_*.h, which are no longer generated.

commit 4eabc417a04240ffd813514c5e6ea38cbe5ffc91
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Dec 22 04:13:16 2008 +0100

    Remove unnecessary dependencies between Python modules.

commit 2396d8d613eed8ab76358056da5fcaf68c71fbf4
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Dec 22 04:03:55 2008 +0100

    Use consistent names for dcerpc python modules; fixes messaging test.

-----------------------------------------------------------------------

Summary of changes:
 pidl/lib/Parse/Pidl/Samba4/Python.pm               |   84 +-------------------
 source4/auth/credentials/pycredentials.c           |    4 +-
 source4/auth/pyauth.c                              |    5 +-
 source4/lib/messaging/pymessaging.c                |   12 ++-
 source4/lib/registry/pyregistry.c                  |    2 +-
 source4/librpc/config.mk                           |   32 ++++----
 source4/librpc/rpc/pyrpc.c                         |   72 ++++++++++++++++-
 source4/librpc/rpc/pyrpc.h                         |    1 +
 source4/param/provision.c                          |    2 +-
 .../ctdb/ctdb_cluster.h => param/pyparam.h}        |   14 ++--
 source4/scripting/python/pyglue.c                  |    4 +-
 11 files changed, 109 insertions(+), 123 deletions(-)
 copy source4/{cluster/ctdb/ctdb_cluster.h => param/pyparam.h} (76%)


Changeset truncated at 500 lines:

diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 378c40c..68e9c95 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -673,89 +673,10 @@ sub Interface($$$)
 		$self->pidl("static PyObject *interface_$interface->{NAME}_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)");
 		$self->pidl("{");
 		$self->indent;
-		$self->pidl("dcerpc_InterfaceObject *ret;");
-		$self->pidl("const char *binding_string;");
-		$self->pidl("struct cli_credentials *credentials;");
-		$self->pidl("struct loadparm_context *lp_ctx = NULL;");
-		$self->pidl("PyObject *py_lp_ctx = Py_None, *py_credentials = Py_None, *py_basis = Py_None;");
-		$self->pidl("TALLOC_CTX *mem_ctx = NULL;");
-		$self->pidl("struct event_context *event_ctx;");
-		$self->pidl("NTSTATUS status;");
-		$self->pidl("");
-		$self->pidl("const char *kwnames[] = {");
-		$self->indent;
-		$self->pidl("\"binding\", \"lp_ctx\", \"credentials\", \"basis_connection\", NULL");
-		$self->deindent;
-		$self->pidl("};");
-		$self->pidl("extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);");
-		$self->pidl("extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);");
-		$self->pidl("");
-		$self->pidl("if (!PyArg_ParseTupleAndKeywords(args, kwargs, \"s|OOO:$interface->{NAME}\", discard_const_p(char *, kwnames), &binding_string, &py_lp_ctx, &py_credentials, &py_basis)) {");
-		$self->indent;
-		$self->pidl("return NULL;");
-		$self->deindent;
-		$self->pidl("}");
-		$self->pidl("");
-		$self->pidl("lp_ctx = lp_from_py_object(py_lp_ctx);");
-		$self->pidl("if (lp_ctx == NULL) {");
-		$self->indent;
-		$self->pidl("PyErr_SetString(PyExc_TypeError, \"Expected loadparm context\");");
-		$self->pidl("return NULL;");
-		$self->deindent;
-		$self->pidl("}");
-		$self->pidl("");
-
-		$self->pidl("status = dcerpc_init(lp_ctx);");
-		$self->pidl("if (!NT_STATUS_IS_OK(status)) {");
-		$self->indent;
-		$self->pidl("PyErr_SetNTSTATUS(status);");
-		$self->pidl("return NULL;");
-		$self->deindent;
-		$self->pidl("}");
-
-		$self->pidl("credentials = cli_credentials_from_py_object(py_credentials);");
-		$self->pidl("if (credentials == NULL) {");
-		$self->indent;
-		$self->pidl("PyErr_SetString(PyExc_TypeError, \"Expected credentials\");");
-		$self->pidl("return NULL;");
+		$self->pidl("return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_$interface->{NAME});");
 		$self->deindent;
 		$self->pidl("}");
-
-		$self->pidl("ret = PyObject_New(dcerpc_InterfaceObject, type);");
-		$self->pidl("");
-		$self->pidl("event_ctx = event_context_init(mem_ctx);");
-		$self->pidl("");
-
-		$self->pidl("if (py_basis != Py_None) {");
-		$self->indent;
-		$self->pidl("struct dcerpc_pipe *base_pipe;");
-		$self->pidl("");
-		$self->pidl("if (!PyObject_TypeCheck(py_basis, &dcerpc_InterfaceType)) {");
-		$self->indent;
-		$self->pidl("PyErr_SetString(PyExc_ValueError, \"basis_connection must be a DCE/RPC connection\");");
-		$self->pidl("talloc_free(mem_ctx);");
-		$self->pidl("return NULL;");
-		$self->deindent;
-		$self->pidl("}");
-		$self->pidl("");
-		$self->pidl("base_pipe = ((dcerpc_InterfaceObject *)py_basis)->pipe;");
-		$self->pidl("");
-		$self->pidl("status = dcerpc_secondary_context(base_pipe, &ret->pipe, &ndr_table_$interface->{NAME});");
-		$self->deindent;
-		$self->pidl("} else {");
-		$self->indent;
-		$self->pidl("status = dcerpc_pipe_connect(NULL, &ret->pipe, binding_string, ");
-		$self->pidl("             &ndr_table_$interface->{NAME}, credentials, event_ctx, lp_ctx);");
-		$self->deindent;
-		$self->pidl("}");
-		$self->handle_ntstatus("status", "NULL", "mem_ctx");
-
-		$self->pidl("ret->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;");
-
-		$self->pidl("return (PyObject *)ret;");
-		$self->deindent;
-		$self->pidl("}");
-		
+	
 		$self->pidl("");
 
 		my $signature = 
@@ -1202,7 +1123,6 @@ sub Parse($$$$$)
 #include \"librpc/rpc/dcerpc.h\"
 #include \"lib/talloc/pytalloc.h\"
 #include \"librpc/rpc/pyrpc.h\"
-#include \"lib/events/events.h\"
 #include \"$hdr\"
 #include \"$ndr_hdr\"
 
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c
index 5f3801c..4fa9fe5 100644
--- a/source4/auth/credentials/pycredentials.c
+++ b/source4/auth/credentials/pycredentials.c
@@ -22,9 +22,7 @@
 #include "lib/cmdline/credentials.h"
 #include "librpc/gen_ndr/samr.h" /* for struct samr_Password */
 #include "libcli/util/pyerrors.h"
-
-/* Here until param/param.i gets rewritten in "manual" C */
-extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);
+#include "param/pyparam.h"
 
 struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj)
 {
diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c
index cc717bf..e97174f 100644
--- a/source4/auth/pyauth.c
+++ b/source4/auth/pyauth.c
@@ -20,10 +20,7 @@
 #include "param/param.h"
 #include "pyauth.h"
 #include "auth/system_session_proto.h"
-
-/* FIXME: These should be in a header file somewhere, once we finish moving
- * away from SWIG .. */
-extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);
+#include "param/pyparam.h"
 
 PyTypeObject PyAuthSession = {
 	.tp_name = "AuthSession",
diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c
index ad8f955..9f04bf0 100644
--- a/source4/lib/messaging/pymessaging.c
+++ b/source4/lib/messaging/pymessaging.c
@@ -29,7 +29,6 @@
 #include "lib/events/events.h"
 #include "cluster/cluster.h"
 #include "param/param.h"
-#include "librpc/gen_ndr/py_irpc.h"
 
 PyAPI_DATA(PyTypeObject) messaging_Type;
 PyAPI_DATA(PyTypeObject) irpc_ClientConnectionType;
@@ -37,6 +36,9 @@ 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);
 
+/* FIXME: This prototype should be in py_irpc.h, or shared otherwise */
+extern const struct PyNdrRpcMethodDef py_ndr_irpc_methods[];
+
 static bool server_id_from_py(PyObject *object, struct server_id *server_id)
 {
 	if (!PyTuple_Check(object)) {
@@ -541,8 +543,12 @@ static bool irpc_AddNdrRpcMethods(PyTypeObject *ifacetype, const struct PyNdrRpc
 
 void initmessaging(void)
 {
-	extern void initirpc(void);
 	PyObject *mod;
+	PyObject *dep_irpc;
+
+	dep_irpc = PyImport_ImportModule("samba.dcerpc.irpc");
+	if (dep_irpc == NULL)
+		return;
 
 	if (PyType_Ready(&irpc_ClientConnectionType) < 0)
 		return;
@@ -560,8 +566,6 @@ void initmessaging(void)
 	if (mod == NULL)
 		return;
 
-	initirpc();
-
 	Py_INCREF((PyObject *)&irpc_ClientConnectionType);
 	PyModule_AddObject(mod, "ClientConnection", (PyObject *)&irpc_ClientConnectionType);
 
diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c
index b93071f..2d2f2fb 100644
--- a/source4/lib/registry/pyregistry.c
+++ b/source4/lib/registry/pyregistry.c
@@ -24,8 +24,8 @@
 #include "scripting/python/modules.h" /* for py_iconv_convenience() */
 #include <pytalloc.h>
 #include <tevent.h>
+#include "param/pyparam.h"
 
-extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);
 extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);
 
 PyAPI_DATA(PyTypeObject) PyRegistryKey;
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 8fe4bb5..a034344 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -648,7 +648,7 @@ python_echo_OBJ_FILES = ../librpc/gen_ndr/py_echo.o
 
 [PYTHON::python_winreg]
 LIBRARY_REALNAME = samba/dcerpc/winreg.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_WINREG PYTALLOC param swig_credentials python_dcerpc_misc python_lsa python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_WINREG PYTALLOC param swig_credentials python_dcerpc
 
 python_winreg_OBJ_FILES = ../librpc/gen_ndr/py_winreg.o
 
@@ -660,79 +660,79 @@ python_dcerpc_misc_OBJ_FILES = ../librpc/gen_ndr/py_misc.o
 
 [PYTHON::python_initshutdown]
 LIBRARY_REALNAME = samba/dcerpc/initshutdown.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN PYTALLOC param swig_credentials python_lsa python_dcerpc_security python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN PYTALLOC param swig_credentials python_dcerpc
 
 python_initshutdown_OBJ_FILES = ../librpc/gen_ndr/py_initshutdown.o
 
 [PYTHON::python_epmapper]
 LIBRARY_REALNAME = samba/dcerpc/epmapper.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES =  dcerpc PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc
+PRIVATE_DEPENDENCIES =  dcerpc PYTALLOC param swig_credentials python_dcerpc
 
 python_epmapper_OBJ_FILES = ../librpc/gen_ndr/py_epmapper.o
 
 [PYTHON::python_mgmt]
 LIBRARY_REALNAME = samba/dcerpc/mgmt.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = PYTALLOC param swig_credentials dcerpc python_dcerpc_misc python_dcerpc
+PRIVATE_DEPENDENCIES = PYTALLOC param swig_credentials dcerpc python_dcerpc
 
 python_mgmt_OBJ_FILES = ../librpc/gen_ndr/py_mgmt.o
 
 [PYTHON::python_atsvc]
 LIBRARY_REALNAME = samba/dcerpc/atsvc.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = dcerpc_atsvc PYTALLOC param swig_credentials  python_dcerpc
+PRIVATE_DEPENDENCIES = dcerpc_atsvc PYTALLOC param swig_credentials python_dcerpc
 
 python_atsvc_OBJ_FILES = ../librpc/gen_ndr/py_atsvc.o
 
 [PYTHON::python_dcerpc_nbt]
-LIBRARY_REALNAME = samba/nbt.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = NDR_NBT PYTALLOC param swig_credentials python_dcerpc python_dcerpc_misc python_dcerpc_security
+LIBRARY_REALNAME = samba/dcerpc/nbt.$(SHLIBEXT)
+PRIVATE_DEPENDENCIES = NDR_NBT PYTALLOC param swig_credentials python_dcerpc 
 
 python_dcerpc_nbt_OBJ_FILES = ../librpc/gen_ndr/py_nbt.o
 
 [PYTHON::python_samr]
 LIBRARY_REALNAME = samba/dcerpc/samr.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = dcerpc_samr PYTALLOC python_dcerpc_security python_lsa python_dcerpc_misc swig_credentials param python_dcerpc
+PRIVATE_DEPENDENCIES = dcerpc_samr PYTALLOC swig_credentials param python_dcerpc
 
 python_samr_OBJ_FILES = ../librpc/gen_ndr/py_samr.o
 
 [PYTHON::python_svcctl]
 LIBRARY_REALNAME = samba/dcerpc/svcctl.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL PYTALLOC param swig_credentials python_dcerpc
 
 python_svcctl_OBJ_FILES = ../librpc/gen_ndr/py_svcctl.o
 
 [PYTHON::python_lsa]
 LIBRARY_REALNAME = samba/dcerpc/lsa.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_LSA PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_LSA PYTALLOC param swig_credentials python_dcerpc
 
 python_lsa_OBJ_FILES = ../librpc/gen_ndr/py_lsa.o
 
 [PYTHON::python_wkssvc]
 LIBRARY_REALNAME = samba/dcerpc/wkssvc.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC PYTALLOC param swig_credentials python_lsa python_dcerpc_security python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC PYTALLOC param swig_credentials python_dcerpc
 
 python_wkssvc_OBJ_FILES = ../librpc/gen_ndr/py_wkssvc.o
 
 [PYTHON::python_dfs]
 LIBRARY_REALNAME = samba/dcerpc/dfs.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_DFS PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_DFS PYTALLOC param swig_credentials python_dcerpc
 
 python_dfs_OBJ_FILES = ../librpc/gen_ndr/py_dfs.o
 
 [PYTHON::python_unixinfo]
 LIBRARY_REALNAME = samba/dcerpc/unixinfo.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_UNIXINFO PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc_misc python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_UNIXINFO PYTALLOC param swig_credentials python_dcerpc
 
 python_unixinfo_OBJ_FILES = ../librpc/gen_ndr/py_unixinfo.o
 
 [PYTHON::python_irpc]
-LIBRARY_REALNAME = samba/irpc.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_IRPC PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc_misc python_dcerpc python_dcerpc_nbt
+LIBRARY_REALNAME = samba/dcerpc/irpc.$(SHLIBEXT)
+PRIVATE_DEPENDENCIES = RPC_NDR_IRPC PYTALLOC param swig_credentials python_dcerpc 
 
 python_irpc_OBJ_FILES = $(gen_ndrsrcdir)/py_irpc.o
 
 [PYTHON::python_drsuapi]
 LIBRARY_REALNAME = samba/dcerpc/drsuapi.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = RPC_NDR_DRSUAPI PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc_security python_dcerpc
+PRIVATE_DEPENDENCIES = RPC_NDR_DRSUAPI PYTALLOC param swig_credentials python_dcerpc
 
 python_drsuapi_OBJ_FILES = ../librpc/gen_ndr/py_drsuapi.o
 
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c
index a59f355..53a083e 100644
--- a/source4/librpc/rpc/pyrpc.c
+++ b/source4/librpc/rpc/pyrpc.c
@@ -23,6 +23,7 @@
 #include "librpc/rpc/pyrpc.h"
 #include "librpc/rpc/dcerpc.h"
 #include "lib/events/events.h"
+#include "param/pyparam.h"
 
 static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface, struct PyNdrRpcMethodDef *md, PyObject *args, PyObject *kwargs)
 {
@@ -250,7 +251,7 @@ static PyObject *py_iface_request(PyObject *self, PyObject *args, PyObject *kwar
 	return ret;
 }
 
-static PyObject *py_iface_later_context(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *py_iface_alter_context(PyObject *self, PyObject *args, PyObject *kwargs)
 {
 	dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)self;
 	NTSTATUS status;
@@ -286,9 +287,75 @@ static PyObject *py_iface_later_context(PyObject *self, PyObject *args, PyObject
 	return Py_None;
 }
 
+PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs, const struct ndr_interface_table *table)
+{
+	dcerpc_InterfaceObject *ret;
+	const char *binding_string;
+	struct cli_credentials *credentials;
+	struct loadparm_context *lp_ctx = NULL;
+	PyObject *py_lp_ctx = Py_None, *py_credentials = Py_None, *py_basis = Py_None;
+	TALLOC_CTX *mem_ctx = NULL;
+	struct event_context *event_ctx;
+	NTSTATUS status;
+
+	const char *kwnames[] = {
+		"binding", "lp_ctx", "credentials", "basis_connection", NULL
+	};
+	extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);
+
+	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|OOO:samr", discard_const_p(char *, kwnames), &binding_string, &py_lp_ctx, &py_credentials, &py_basis)) {
+		return NULL;
+	}
+
+	lp_ctx = lp_from_py_object(py_lp_ctx);
+	if (lp_ctx == NULL) {
+		PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
+		return NULL;
+	}
+
+	status = dcerpc_init(lp_ctx);
+	if (!NT_STATUS_IS_OK(status)) {
+		PyErr_SetNTSTATUS(status);
+		return NULL;
+	}
+	credentials = cli_credentials_from_py_object(py_credentials);
+	if (credentials == NULL) {
+		PyErr_SetString(PyExc_TypeError, "Expected credentials");
+		return NULL;
+	}
+	ret = PyObject_New(dcerpc_InterfaceObject, type);
+
+	event_ctx = event_context_init(mem_ctx);
+
+	if (py_basis != Py_None) {
+		struct dcerpc_pipe *base_pipe;
+
+		if (!PyObject_TypeCheck(py_basis, &dcerpc_InterfaceType)) {
+			PyErr_SetString(PyExc_ValueError, "basis_connection must be a DCE/RPC connection");
+			talloc_free(mem_ctx);
+			return NULL;
+		}
+
+		base_pipe = ((dcerpc_InterfaceObject *)py_basis)->pipe;
+
+		status = dcerpc_secondary_context(base_pipe, &ret->pipe, table);
+	} else {
+		status = dcerpc_pipe_connect(NULL, &ret->pipe, binding_string, 
+		             table, credentials, event_ctx, lp_ctx);
+	}
+	if (NT_STATUS_IS_ERR(status)) {
+		PyErr_SetNTSTATUS(status);
+		talloc_free(mem_ctx);
+		return NULL;
+	}
+
+	ret->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
+	return (PyObject *)ret;
+}
+
 static PyMethodDef dcerpc_interface_methods[] = {
 	{ "request", (PyCFunction)py_iface_request, METH_VARARGS|METH_KEYWORDS, "S.request(opnum, data, object=None) -> data\nMake a raw request" },
-	{ "alter_context", (PyCFunction)py_iface_later_context, METH_VARARGS|METH_KEYWORDS, "S.alter_context(syntax)\nChange to a different interface" },
+	{ "alter_context", (PyCFunction)py_iface_alter_context, METH_VARARGS|METH_KEYWORDS, "S.alter_context(syntax)\nChange to a different interface" },
 	{ NULL, NULL, 0, NULL },
 };
 
@@ -315,7 +382,6 @@ static PyObject *dcerpc_interface_new(PyTypeObject *self, PyObject *args, PyObje
 	const char *kwnames[] = {
 		"binding", "syntax", "lp_ctx", "credentials", "basis_connection", NULL
 	};
-	extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);
 	extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);
 	struct ndr_interface_table *table;
 
diff --git a/source4/librpc/rpc/pyrpc.h b/source4/librpc/rpc/pyrpc.h
index 3b2162c..6d5193f 100644
--- a/source4/librpc/rpc/pyrpc.h
+++ b/source4/librpc/rpc/pyrpc.h
@@ -69,5 +69,6 @@ struct PyNdrRpcMethodDef {
 };
 
 bool PyInterface_AddNdrRpcMethods(PyTypeObject *object, const struct PyNdrRpcMethodDef *mds);
+PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs, const struct ndr_interface_table *table);
 
 #endif /* _PYRPC_H_ */
diff --git a/source4/param/provision.c b/source4/param/provision.c
index b207cf6..7a06f77 100644
--- a/source4/param/provision.c
+++ b/source4/param/provision.c
@@ -28,12 +28,12 @@
 #include <Python.h>
 #include "scripting/python/modules.h"
 #include "lib/ldb/pyldb.h"
+#include "param/pyparam.h"
 
 NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
 			struct provision_settings *settings, 
 			struct provision_result *result)
 {
-	extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);
 	PyObject *provision_mod, *provision_dict, *provision_fn, *py_result, *parameters;
 	
 	DEBUG(0,("Provision for Become-DC test using python\n"));
diff --git a/source4/cluster/ctdb/ctdb_cluster.h b/source4/param/pyparam.h
similarity index 76%
copy from source4/cluster/ctdb/ctdb_cluster.h
copy to source4/param/pyparam.h
index bac09bd..4d7e32d 100644
--- a/source4/cluster/ctdb/ctdb_cluster.h
+++ b/source4/param/pyparam.h
@@ -1,9 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
-
-   ctdb clustering hooks - header
-
-   Copyright (C) Andrew Tridgell 2006
+   Samba utility functions
+   Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2008
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -19,5 +17,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-void cluster_ctdb_init(struct loadparm_context *lp_ctx,
-		       struct event_context *ev, const char *model);
+#ifndef _PYPARAM_H_
+#define _PYPARAM_H_
+
+struct loadparm_context *lp_from_py_object(PyObject *py_obj);
+
+#endif /* _PYPARAM_H_ */
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c
index 55eb618..1b59978 100644
--- a/source4/scripting/python/pyglue.c
+++ b/source4/scripting/python/pyglue.c
@@ -27,14 +27,12 @@
 #include <Python.h>
 #include "pyldb.h"
 #include "libcli/util/pyerrors.h"
-#include "librpc/gen_ndr/py_misc.h"
-#include "librpc/gen_ndr/py_security.h"
 #include "libcli/security/security.h"
 #include "auth/pyauth.h"
+#include "param/pyparam.h"
 
 /* FIXME: These should be in a header file somewhere, once we finish moving
  * away from SWIG .. */
-extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);
 extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);
 
 #define PyErr_LDB_OR_RAISE(py_ldb, ldb) \


-- 
Samba Shared Repository


More information about the samba-cvs mailing list