summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-02-18 07:15:52 +0000
committerMartin Pool <mbp@samba.org>2003-02-18 07:15:52 +0000
commit185d858dd2161a42cc35d318415844561531f4a4 (patch)
tree3a3aec6f9b08cfcb68c1c6ff8e85135bc80e0ba3 /source3/python
parent188c5195ede9825f30845f4aab549390ac67887e (diff)
downloadsamba-185d858dd2161a42cc35d318415844561531f4a4.tar.gz
samba-185d858dd2161a42cc35d318415844561531f4a4.tar.bz2
samba-185d858dd2161a42cc35d318415844561531f4a4.zip
Check return code of string_to_sid. (Merge from HEAD)
(This used to be commit 606bb47f241d2916d039b38f48b50474a3e0dadc)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_lsa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/python/py_lsa.c b/source3/python/py_lsa.c
index 31706af684..22db29665a 100644
--- a/source3/python/py_lsa.c
+++ b/source3/python/py_lsa.c
@@ -235,7 +235,10 @@ static PyObject *lsa_lookup_sids(PyObject *self, PyObject *args,
for (i = 0; i < num_sids; i++) {
PyObject *obj = PyList_GetItem(py_sids, i);
- string_to_sid(&sids[i], PyString_AsString(obj));
+ if (!string_to_sid(&sids[i], PyString_AsString(obj))) {
+ PyErr_SetString(PyExc_ValueError, "string_to_sid failed");
+ return NULL;
+ }
}
} else {
@@ -245,7 +248,10 @@ static PyObject *lsa_lookup_sids(PyObject *self, PyObject *args,
num_sids = 1;
sids = (DOM_SID *)talloc(hnd->mem_ctx, sizeof(DOM_SID));
- string_to_sid(&sids[0], PyString_AsString(py_sids));
+ if (!string_to_sid(&sids[0], PyString_AsString(py_sids))) {
+ PyErr_SetString(PyExc_ValueError, "string_to_sid failed");
+ return NULL;
+ }
}
ntstatus = cli_lsa_lookup_sids(hnd->cli, hnd->mem_ctx, &hnd->pol,