From a6e29f23f09ba5b6b6d362f7683ae8088bc0ba85 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 16 Mar 2012 09:16:23 +1100 Subject: s3-passdb: Change pdb_sid_to_id() to return struct unixid This will make it easier to consistantly pass a struct unixid all the way up and down the idmap stack, and allow ID_TYPE_BOTH to be handled correctly. Andrew Bartlett Signed-off-by: Michael Adam --- source3/winbindd/idmap_passdb.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'source3/winbindd/idmap_passdb.c') diff --git a/source3/winbindd/idmap_passdb.c b/source3/winbindd/idmap_passdb.c index 4c26c5c466..e547e9bf7c 100644 --- a/source3/winbindd/idmap_passdb.c +++ b/source3/winbindd/idmap_passdb.c @@ -76,31 +76,8 @@ static NTSTATUS idmap_pdb_sids_to_unixids(struct idmap_domain *dom, struct id_ma int i; for (i = 0; ids[i]; i++) { - enum lsa_SidType type; - uid_t uid; - gid_t gid; - - if (pdb_sid_to_id(ids[i]->sid, &uid, &gid, &type)) { - switch (type) { - case SID_NAME_USER: - ids[i]->xid.id = uid; - ids[i]->xid.type = ID_TYPE_UID; - ids[i]->status = ID_MAPPED; - break; - - case SID_NAME_DOM_GRP: - case SID_NAME_ALIAS: - case SID_NAME_WKN_GRP: - ids[i]->xid.id = gid; - ids[i]->xid.type = ID_TYPE_GID; - ids[i]->status = ID_MAPPED; - break; - - default: /* ?? */ - /* make sure it is marked as unmapped */ - ids[i]->status = ID_UNKNOWN; - break; - } + if (pdb_sid_to_id(ids[i]->sid, &ids[i]->xid)) { + ids[i]->status = ID_MAPPED; } else { /* Query Failed */ ids[i]->status = ID_UNMAPPED; -- cgit