From eeb25cf548457b9c5a880252d2807be99f5e31d6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 21 Dec 2008 04:36:16 +0100 Subject: Fix more introduced regressions in new bindings. --- source4/scripting/python/pyglue.c | 18 +++++------------- source4/scripting/python/samba/provision.py | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index 2d0af630c1..55eb618426 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -29,6 +29,7 @@ #include "libcli/util/pyerrors.h" #include "librpc/gen_ndr/py_misc.h" #include "librpc/gen_ndr/py_security.h" +#include "libcli/security/security.h" #include "auth/pyauth.h" /* FIXME: These should be in a header file somewhere, once we finish moving @@ -146,12 +147,7 @@ static PyObject *py_samdb_set_domain_sid(PyLdbObject *self, PyObject *args) PyErr_LDB_OR_RAISE(py_ldb, ldb); - if (!dom_sid_Check(py_sid)) { - PyErr_SetString(PyExc_TypeError, "expected SID"); - return NULL; - } - - sid = py_talloc_get_ptr(py_sid); + sid = dom_sid_parse_talloc(NULL, PyString_AsString(py_sid)); ret = samdb_set_domain_sid(ldb, sid); if (!ret) { @@ -181,19 +177,15 @@ static PyObject *py_dsdb_set_ntds_invocation_id(PyObject *self, PyObject *args) { PyObject *py_ldb, *py_guid; bool ret; - struct GUID *guid; + 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); - if (!GUID_Check(py_guid)) { - PyErr_SetString(PyExc_TypeError, "Expected GUID"); - return NULL; - } - guid = py_talloc_get_ptr(py_guid); + GUID_from_string(PyString_AsString(py_guid), &guid); - ret = samdb_set_ntds_invocation_id(ldb, guid); + ret = samdb_set_ntds_invocation_id(ldb, &guid); if (!ret) { PyErr_SetString(PyExc_RuntimeError, "set_ntds_invocation_id failed"); return NULL; diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 0819a0c8bf..1da4e885f5 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -752,7 +752,7 @@ def setup_samdb(path, setup_path, session_info, credentials, lp, return samdb message("Pre-loading the Samba 4 and AD schema") - samdb.set_domain_sid(domainsid) + samdb.set_domain_sid(str(domainsid)) if serverrole == "domain controller": samdb.set_invocation_id(invocationid) -- cgit