diff options
author | Garming Sam <garming@catalyst.net.nz> | 2014-11-25 14:45:26 +1300 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2014-12-03 04:21:09 +0100 |
commit | 7979c6cc50eaa792e5094866878c63df36e715c3 (patch) | |
tree | 114195414f6efaa628aaeb4e8c21f07199a02a0e /source3/winbindd/idmap_passdb.c | |
parent | 3b90bfb1089e6a4b7e05e7ed62bb642521f57917 (diff) | |
download | samba-7979c6cc50eaa792e5094866878c63df36e715c3.tar.gz |
idmap: unify passdb *id_to_sid methods
Instead of passing down gid or uid, a pointer to a unixid is now sent
down. This acts as an in-out variable so that the idmap functions can
correctly receive ID_TYPE_BOTH, filling in cache details correctly
rather than forcing the cache to store ID_TYPE_UID or ID_TYPE_GID.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10720
Change-Id: I11409a0f498e61a3c0a6ae606dd7af1135e6b066
Pair-programmed-with: Andrew Bartlett <abarlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/winbindd/idmap_passdb.c')
-rw-r--r-- | source3/winbindd/idmap_passdb.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/source3/winbindd/idmap_passdb.c b/source3/winbindd/idmap_passdb.c index e547e9bf7cf..cf8ad7446ce 100644 --- a/source3/winbindd/idmap_passdb.c +++ b/source3/winbindd/idmap_passdb.c @@ -44,23 +44,11 @@ static NTSTATUS idmap_pdb_unixids_to_sids(struct idmap_domain *dom, struct id_ma int i; for (i = 0; ids[i]; i++) { - /* unmapped by default */ ids[i]->status = ID_UNMAPPED; - switch (ids[i]->xid.type) { - case ID_TYPE_UID: - if (pdb_uid_to_sid((uid_t)ids[i]->xid.id, ids[i]->sid)) { - ids[i]->status = ID_MAPPED; - } - break; - case ID_TYPE_GID: - if (pdb_gid_to_sid((gid_t)ids[i]->xid.id, ids[i]->sid)) { - ids[i]->status = ID_MAPPED; - } - break; - default: /* ?? */ - ids[i]->status = ID_UNKNOWN; + if (pdb_id_to_sid(&ids[i]->xid, ids[i]->sid)) { + ids[i]->status = ID_MAPPED; } } |