diff options
Diffstat (limited to 'source3/passdb/py_passdb.c')
-rw-r--r-- | source3/passdb/py_passdb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c index 025e82812c..4c8dbcdbd2 100644 --- a/source3/passdb/py_passdb.c +++ b/source3/passdb/py_passdb.c @@ -2664,7 +2664,8 @@ static PyObject *py_pdb_sid_to_id(pytalloc_Object *self, PyObject *args) TALLOC_CTX *tframe; PyObject *py_sid; struct dom_sid *sid; - union unid_t id; + uid_t uid = -1; + gid_t gid = -1; enum lsa_SidType type; if (!PyArg_ParseTuple(args, "O!:sid_to_id", dom_sid_Type, &py_sid)) { @@ -2680,7 +2681,7 @@ static PyObject *py_pdb_sid_to_id(pytalloc_Object *self, PyObject *args) sid = pytalloc_get_ptr(py_sid); - if (!methods->sid_to_id(methods, sid, &id, &type)) { + if (!methods->sid_to_id(methods, sid, &uid, &gid, &type)) { PyErr_Format(py_pdb_error, "Unable to get id for sid"); talloc_free(tframe); return NULL; @@ -2688,7 +2689,7 @@ static PyObject *py_pdb_sid_to_id(pytalloc_Object *self, PyObject *args) talloc_free(tframe); - return Py_BuildValue("(II)", id.uid, type); + return Py_BuildValue("(II)", (uid != -1)?uid:gid, type); } |