summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-12-07 09:56:31 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-12-07 03:09:08 +0100
commitd8f98933fd35bb10f064edaa1a4ac8d89c6e83bc (patch)
tree2bdabcb7b2d7e9c167abc33642ab60063c84687c /source4/dsdb
parentdbbb626dc0ad7b0100aec3ee3a787e1ac18f528a (diff)
downloadsamba-d8f98933fd35bb10f064edaa1a4ac8d89c6e83bc.tar.gz
samba-d8f98933fd35bb10f064edaa1a4ac8d89c6e83bc.tar.bz2
samba-d8f98933fd35bb10f064edaa1a4ac8d89c6e83bc.zip
pydsdb: provide a am_pdc hook like am_rodc to python scripts
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/pydsdb.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index 3c7c8bfaa1..738ea6d641 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -945,6 +945,25 @@ static PyObject *py_dsdb_am_rodc(PyObject *self, PyObject *args)
return PyBool_FromLong(am_rodc);
}
+/*
+ call into samdb_is_pdc()
+ */
+static PyObject *py_dsdb_am_pdc(PyObject *self, PyObject *args)
+{
+ PyObject *py_ldb;
+ struct ldb_context *ldb;
+ int ret;
+ bool am_pdc;
+
+ if (!PyArg_ParseTuple(args, "O", &py_ldb))
+ return NULL;
+
+ PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
+ am_pdc = samdb_is_pdc(ldb);
+ return PyBool_FromLong(am_pdc);
+}
+
static PyMethodDef py_dsdb_methods[] = {
{ "_samdb_server_site_name", (PyCFunction)py_samdb_server_site_name,
@@ -997,6 +1016,9 @@ static PyMethodDef py_dsdb_methods[] = {
{ "_am_rodc",
(PyCFunction)py_dsdb_am_rodc, METH_VARARGS,
NULL },
+ { "_am_pdc",
+ (PyCFunction)py_dsdb_am_pdc, METH_VARARGS,
+ NULL },
{ "_dsdb_set_schema_from_ldif", (PyCFunction)py_dsdb_set_schema_from_ldif, METH_VARARGS,
NULL },
{ "_dsdb_set_schema_from_ldb", (PyCFunction)py_dsdb_set_schema_from_ldb, METH_VARARGS,