summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-08-18 15:07:06 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-19 16:35:01 +1000
commit1c1f4e27a89946f4fd551358bc25fe04ad621ea4 (patch)
tree5fd1e4f5cb7a96b9e24afccb7108996b5a597226 /source3/passdb
parent590ed81c4868c030ee84870fd8cdaca4fad20520 (diff)
downloadsamba-1c1f4e27a89946f4fd551358bc25fe04ad621ea4.tar.gz
samba-1c1f4e27a89946f4fd551358bc25fe04ad621ea4.tar.bz2
samba-1c1f4e27a89946f4fd551358bc25fe04ad621ea4.zip
s3-passdb: Return list of sids from python wrapper enum_group_members
Instead of returning rids as the C api does, return sids, so it is similar to enum_aliasmem and can be used easily in s3_upgrade. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/py_passdb.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/passdb/py_passdb.c b/source3/passdb/py_passdb.c
index 81eb59d40d..c4f0508c08 100644
--- a/source3/passdb/py_passdb.c
+++ b/source3/passdb/py_passdb.c
@@ -1864,7 +1864,8 @@ static PyObject *py_pdb_enum_group_members(pytalloc_Object *self, PyObject *args
struct dom_sid *group_sid;
uint32_t *member_rids;
size_t num_members;
- PyObject *py_rid_list;
+ PyObject *py_sid_list;
+ struct dom_sid *domain_sid, *member_sid;
int i;
if (!PyArg_ParseTuple(args, "O!:enum_group_members", dom_sid_Type, &py_group_sid)) {
@@ -1890,20 +1891,23 @@ static PyObject *py_pdb_enum_group_members(pytalloc_Object *self, PyObject *args
return NULL;
}
- py_rid_list = PyList_New(0);
- if (py_rid_list == NULL) {
+ py_sid_list = PyList_New(0);
+ if (py_sid_list == NULL) {
PyErr_NoMemory();
talloc_free(tframe);
return NULL;
}
+ domain_sid = get_global_sam_sid();
+
for(i=0; i<num_members; i++) {
- PyList_Append(py_rid_list, PyInt_FromLong(member_rids[i]));
+ member_sid = dom_sid_add_rid(tframe, domain_sid, member_rids[i]);
+ PyList_Append(py_sid_list, pytalloc_steal(dom_sid_Type, member_sid));
}
talloc_free(tframe);
- return py_rid_list;
+ return py_sid_list;
}