summaryrefslogtreecommitdiff
path: root/source4/dsdb/pydsdb.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-06-19 17:15:26 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-19 22:46:43 +0200
commit74309eb29cba6a9a3c22bcb808b5c2e59a9f9880 (patch)
tree80b877f38dd8b502e28ccca54bd9399c2dbe730c /source4/dsdb/pydsdb.c
parenta4f60ffe4bb4e0e32d7cd62dc872b1f23435edca (diff)
downloadsamba-74309eb29cba6a9a3c22bcb808b5c2e59a9f9880.tar.gz
samba-74309eb29cba6a9a3c22bcb808b5c2e59a9f9880.tar.bz2
samba-74309eb29cba6a9a3c22bcb808b5c2e59a9f9880.zip
pydsdb: Move write_prefixes_from_schema_to_ldb to pydsdb from pyglue.
Diffstat (limited to 'source4/dsdb/pydsdb.c')
-rw-r--r--source4/dsdb/pydsdb.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index 8f9ed9fa77..a911afc8e6 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -435,6 +435,30 @@ static PyObject *py_dsdb_set_schema_from_ldb(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
+static PyObject *py_dsdb_write_prefixes_from_schema_to_ldb(PyObject *self, PyObject *args)
+{
+ PyObject *py_ldb;
+ struct ldb_context *ldb;
+ WERROR result;
+ struct dsdb_schema *schema;
+
+ if (!PyArg_ParseTuple(args, "O", &py_ldb))
+ return NULL;
+
+ PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
+ schema = dsdb_get_schema(ldb, NULL);
+ if (!schema) {
+ PyErr_SetString(PyExc_RuntimeError, "Failed to set find a schema on ldb!\n");
+ return NULL;
+ }
+
+ result = dsdb_write_prefixes_from_schema_to_ldb(NULL, ldb, schema);
+ PyErr_WERROR_IS_ERR_RAISE(result);
+
+ Py_RETURN_NONE;
+}
+
static PyMethodDef py_dsdb_methods[] = {
@@ -477,6 +501,8 @@ static PyMethodDef py_dsdb_methods[] = {
NULL },
{ "dsdb_set_schema_from_ldb", (PyCFunction)py_dsdb_set_schema_from_ldb, METH_VARARGS,
NULL },
+ { "dsdb_write_prefixes_from_schema_to_ldb", (PyCFunction)py_dsdb_write_prefixes_from_schema_to_ldb, METH_VARARGS,
+ NULL },
{ NULL }
};