summaryrefslogtreecommitdiff
path: root/source4/dsdb/pydsdb.c
diff options
context:
space:
mode:
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-05-13 15:07:50 +0300
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-05-17 13:30:27 +0300
commit26d41c23f69b9e3ee327f159c9164917422d45c5 (patch)
treeb2279caf7ab80ded9f48443de0f7f1729401c007 /source4/dsdb/pydsdb.c
parenta15b6664389b05ea0cded46de3abe53034a7edef (diff)
downloadsamba-26d41c23f69b9e3ee327f159c9164917422d45c5.tar.gz
samba-26d41c23f69b9e3ee327f159c9164917422d45c5.tar.bz2
samba-26d41c23f69b9e3ee327f159c9164917422d45c5.zip
s4-rodc: Cache am_rodc flag
Diffstat (limited to 'source4/dsdb/pydsdb.c')
-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 45f8b6e1ca..fd6925d154 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -371,6 +371,25 @@ static PyObject *py_dsdb_load_partition_usn(PyObject *self, PyObject *args)
return result;
}
+static PyObject *py_dsdb_set_am_rodc(PyObject *self, PyObject *args)
+{
+ PyObject *py_ldb;
+ bool ret;
+ struct ldb_context *ldb;
+ int py_val;
+
+ if (!PyArg_ParseTuple(args, "Oi", &py_ldb, &py_val))
+ return NULL;
+
+ PyErr_LDB_OR_RAISE(py_ldb, ldb);
+ ret = samdb_set_am_rodc(ldb, (bool)py_val);
+ if (!ret) {
+ PyErr_SetString(PyExc_RuntimeError, "set_am_rodc failed");
+ return NULL;
+ }
+ Py_RETURN_NONE;
+}
+
static PyMethodDef py_dsdb_methods[] = {
{ "samdb_server_site_name", (PyCFunction)py_samdb_server_site_name,
METH_VARARGS, "Get the server site name as a string"},
@@ -404,6 +423,9 @@ static PyMethodDef py_dsdb_methods[] = {
{ "dsdb_load_partition_usn", (PyCFunction)py_dsdb_load_partition_usn,
METH_VARARGS,
"get uSNHighest and uSNUrgent from the partition @REPLCHANGED"},
+ { "dsdb_set_am_rodc",
+ (PyCFunction)py_dsdb_set_am_rodc, METH_VARARGS,
+ NULL },
{ NULL }
};