summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-02-18 01:09:19 +0000
committerMartin Pool <mbp@samba.org>2003-02-18 01:09:19 +0000
commit5511347b8d5a974d5cd0536eded92c4b77c1091d (patch)
treecaf68b84519307d7fe8d8651389ad0c01e95445d /source3
parent335fbbfbc957dea02c37152ec690cdcf54040ae1 (diff)
downloadsamba-5511347b8d5a974d5cd0536eded92c4b77c1091d.tar.gz
samba-5511347b8d5a974d5cd0536eded92c4b77c1091d.tar.bz2
samba-5511347b8d5a974d5cd0536eded92c4b77c1091d.zip
Check return code from string_to_sid.
(This used to be commit fe449328b226a33ad1c64e087fe63e79f90ab4ac)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/wb_client.c9
-rw-r--r--source3/python/py_lsa.c10
2 files changed, 14 insertions, 5 deletions
diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c
index 9ac1515d7d..62c9686960 100644
--- a/source3/nsswitch/wb_client.c
+++ b/source3/nsswitch/wb_client.c
@@ -56,7 +56,8 @@ BOOL winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid,
if ((result = winbindd_request(WINBINDD_LOOKUPNAME, &request,
&response)) == NSS_STATUS_SUCCESS) {
- string_to_sid(sid, response.data.sid.sid);
+ if (!string_to_sid(sid, response.data.sid.sid))
+ return False;
*name_type = (enum SID_NAME_USE)response.data.sid.type;
}
@@ -158,7 +159,8 @@ BOOL winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
/* Copy out result */
if (result == NSS_STATUS_SUCCESS) {
- string_to_sid(sid, response.data.sid.sid);
+ if (!string_to_sid(sid, response.data.sid.sid))
+ return False;
} else {
sid_copy(sid, &global_sid_NULL);
}
@@ -224,7 +226,8 @@ BOOL winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
/* Copy out result */
if (result == NSS_STATUS_SUCCESS) {
- string_to_sid(sid, response.data.sid.sid);
+ if (!string_to_sid(sid, response.data.sid.sid))
+ return False;
} else {
sid_copy(sid, &global_sid_NULL);
}
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,