diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-12-21 04:36:16 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-12-21 04:36:16 +0100 |
commit | eeb25cf548457b9c5a880252d2807be99f5e31d6 (patch) | |
tree | 7893b5f8a126269f9926ec06f4cb0fd2bc66ca15 /source4/scripting | |
parent | bfb29e94b1e9cbbbca4dcfbbad171ba10e09ce07 (diff) | |
download | samba-eeb25cf548457b9c5a880252d2807be99f5e31d6.tar.gz samba-eeb25cf548457b9c5a880252d2807be99f5e31d6.tar.bz2 samba-eeb25cf548457b9c5a880252d2807be99f5e31d6.zip |
Fix more introduced regressions in new bindings.
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/pyglue.c | 18 | ||||
-rw-r--r-- | source4/scripting/python/samba/provision.py | 2 |
2 files changed, 6 insertions, 14 deletions
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) |