From 099fc00b601fe7775f5fdb18d8473031b8a7ce27 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 4 Apr 2010 01:48:35 +0200 Subject: Add C-based Samba-specific subclass of Ldb. --- source4/scripting/python/pyglue.c | 24 ------------------------ source4/scripting/python/samba/__init__.py | 8 ++------ 2 files changed, 2 insertions(+), 30 deletions(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index b75d7d3782..e4a20f8d19 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -159,27 +159,6 @@ static PyObject *py_ldb_set_credentials(PyObject *self, PyObject *args) Py_RETURN_NONE; } -static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args) -{ - PyObject *py_lp_ctx, *py_ldb; - struct loadparm_context *lp_ctx; - struct ldb_context *ldb; - if (!PyArg_ParseTuple(args, "OO", &py_ldb, &py_lp_ctx)) - return NULL; - - PyErr_LDB_OR_RAISE(py_ldb, ldb); - - lp_ctx = lp_from_py_object(py_lp_ctx); - if (lp_ctx == NULL) { - PyErr_SetString(PyExc_TypeError, "Expected loadparm object"); - return NULL; - } - - ldb_set_opaque(ldb, "loadparm", lp_ctx); - - Py_RETURN_NONE; -} - static PyObject *py_ldb_set_utf8_casefold(PyObject *self, PyObject *args) { PyObject *py_ldb; @@ -542,9 +521,6 @@ static PyMethodDef py_misc_methods[] = { { "ldb_set_credentials", (PyCFunction)py_ldb_set_credentials, METH_VARARGS, "ldb_set_credentials(ldb, credentials)\n" "Set credentials to use when connecting." }, - { "ldb_set_loadparm", (PyCFunction)py_ldb_set_loadparm, METH_VARARGS, - "ldb_set_loadparm(ldb, session_info)\n" - "Set loadparm context to use when connecting." }, { "samdb_set_domain_sid", (PyCFunction)py_samdb_set_domain_sid, METH_VARARGS, "samdb_set_domain_sid(samdb, sid)\n" "Set SID of domain to use." }, diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py index cb2405a3f9..80c6df626a 100644 --- a/source4/scripting/python/samba/__init__.py +++ b/source4/scripting/python/samba/__init__.py @@ -44,10 +44,9 @@ else: import ldb import dsdb import glue +from samba._ldb import Ldb - - -class Ldb(ldb.Ldb): +class Ldb(Ldb): """Simple Samba-specific LDB subclass that takes care of setting up the modules dir, credentials pointers, etc. @@ -117,9 +116,6 @@ class Ldb(ldb.Ldb): def set_credentials(self, credentials): glue.ldb_set_credentials(self, credentials) - def set_loadparm(self, lp_ctx): - glue.ldb_set_loadparm(self, lp_ctx) - def set_create_perms(self, perms=0600): # we usually want Samba databases to be private. If we later find we # need one public, we will have to change this here -- cgit