diff options
author | Anatoliy Atanasov <anatoliy.atanasov@postpath.com> | 2010-05-10 13:52:27 +0300 |
---|---|---|
committer | Anatoliy Atanasov <anatoliy.atanasov@postpath.com> | 2010-05-10 17:24:02 +0300 |
commit | c3cbb846d0bfbaa11fd255bada7fa5fe502d4d96 (patch) | |
tree | cd051fb134290c4553a5949e25907aba8759885d /source4/dsdb | |
parent | 83736066a3f94eaadb422016c9f22cb18bec2cd7 (diff) | |
download | samba-c3cbb846d0bfbaa11fd255bada7fa5fe502d4d96.tar.gz samba-c3cbb846d0bfbaa11fd255bada7fa5fe502d4d96.tar.bz2 samba-c3cbb846d0bfbaa11fd255bada7fa5fe502d4d96.zip |
s4-rodc: Fix provision warnings by creating ntds objectGUID in provision
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/pydsdb.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index 45f8b6e1ca..c92eec2aaf 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -309,6 +309,26 @@ static PyObject *py_samdb_ntds_objectGUID(PyObject *self, PyObject *args) return result; } +static PyObject *py_dsdb_set_ntds_objectGUID(PyObject *self, PyObject *args) +{ + PyObject *py_ldb, *py_guid; + bool ret; + struct GUID guid; + struct ldb_context *ldb; + if (!PyArg_ParseTuple(args, "OO", &py_ldb, &py_guid)) + return NULL; + + PyErr_LDB_OR_RAISE(py_ldb, ldb); + GUID_from_string(PyString_AsString(py_guid), &guid); + + ret = samdb_set_ntds_objectGUID(ldb, &guid); + if (!ret) { + PyErr_SetString(PyExc_RuntimeError, "set_ntds_objectGUID failed"); + return NULL; + } + Py_RETURN_NONE; +} + static PyObject *py_dsdb_set_global_schema(PyObject *self, PyObject *args) { PyObject *py_ldb; @@ -399,6 +419,9 @@ static PyMethodDef py_dsdb_methods[] = { NULL }, { "samdb_ntds_objectGUID", (PyCFunction)py_samdb_ntds_objectGUID, METH_VARARGS, "get the NTDS objectGUID as a string"}, + { "dsdb_set_ntds_objectGUID", + (PyCFunction)py_dsdb_set_ntds_objectGUID, METH_VARARGS, + NULL }, { "dsdb_set_global_schema", (PyCFunction)py_dsdb_set_global_schema, METH_VARARGS, NULL }, { "dsdb_load_partition_usn", (PyCFunction)py_dsdb_load_partition_usn, |