s3:winbindd: use wb_sids2xids instead of wb_sid2gid in winbindd_sid_to_gid
commit3e7f04b70f89d528aacfdc420b635d8aff0f4af6
authorMichael Adam <obnox@samba.org>
Sat, 17 Nov 2012 12:10:26 +0000 (17 13:10 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 3 Dec 2012 07:48:22 +0000 (3 08:48 +0100)
tree274fcc0e55cb047149fa95a66c8b888ecf3ec06b
parent7637c93472492f1bfd7bf46b8f855ef4818c75a9
s3:winbindd: use wb_sids2xids instead of wb_sid2gid in winbindd_sid_to_gid

The main purpose of the change is to hand the sid into the
idmap backend and handle responsiblity for handling the
sid-type correctly to the idmap backend instead of failing
directly when the sid is not of group type.

Hence backends like rid who are sid-type agnostic, can
return gids also for sids of other types. This is an important
fix to make sid_to_gid behave the consistently with and without
the presence of cache entries.

We need to additionally filter the result for id type GID
or more general (BOTH) to keep the behaviour.

This is a step towards using only one codepath to id_mapping.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/winbindd/winbindd_sid_to_gid.c