summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-18 20:22:23 -0700
committerAndrew Tridgell <tridge@samba.org>2010-09-19 11:29:32 -0700
commite72a1e20557f212af03d32152f0cc11acee57814 (patch)
tree09700cae7625ff487534fcb6e625ff8c32e6037f /source4
parent2666cc9c161d4a0f5083f546dbcf470d34b24499 (diff)
downloadsamba-e72a1e20557f212af03d32152f0cc11acee57814.tar.gz
samba-e72a1e20557f212af03d32152f0cc11acee57814.tar.bz2
samba-e72a1e20557f212af03d32152f0cc11acee57814.zip
s4-pydsdb: added am_rodc() method on samdb
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/pydsdb.c27
-rw-r--r--source4/scripting/python/samba/samdb.py3
2 files changed, 30 insertions, 0 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index 5ba69d7388..7f2e71550c 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -534,6 +534,30 @@ static PyObject *py_dsdb_get_partitions_dn(PyObject *self, PyObject *args)
}
+/*
+ call into samdb_rodc()
+ */
+static PyObject *py_dsdb_am_rodc(PyObject *self, PyObject *args)
+{
+ PyObject *py_ldb;
+ struct ldb_context *ldb;
+ int ret;
+ bool am_rodc;
+
+ if (!PyArg_ParseTuple(args, "O", &py_ldb))
+ return NULL;
+
+ PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
+ ret = samdb_rodc(ldb, &am_rodc);
+ if (samdb_rodc(ldb, &am_rodc) != LDB_SUCCESS) {
+ PyErr_SetString(PyExc_RuntimeError, ldb_errstring(ldb));
+ return NULL;
+ }
+
+ return PyBool_FromLong(am_rodc);
+}
+
static PyMethodDef py_dsdb_methods[] = {
{ "_samdb_server_site_name", (PyCFunction)py_samdb_server_site_name,
@@ -573,6 +597,9 @@ static PyMethodDef py_dsdb_methods[] = {
{ "_dsdb_set_am_rodc",
(PyCFunction)py_dsdb_set_am_rodc, METH_VARARGS,
NULL },
+ { "_am_rodc",
+ (PyCFunction)py_dsdb_am_rodc, 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,
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index c43c65da93..bbc52a9ebd 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -64,6 +64,9 @@ class SamDB(samba.Ldb):
super(SamDB, self).connect(url=url, flags=flags,
options=options)
+ def am_rodc(self):
+ return dsdb._am_rodc(self)
+
def domain_dn(self):
# find the DNs for the domain
res = self.search(base="",