s3:idmap_rid: force mapping type to ID_TYPE_BOTH for sid->unixid mapping
commitfe08853b59f78fd054f4a6491695fc7214875d44
authorMichael Adam <obnox@samba.org>
Mon, 15 Oct 2012 14:32:25 +0000 (15 16:32 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 3 Dec 2012 12:01:33 +0000 (3 13:01 +0100)
treed43cf20bff5e4a70d28f01e0ad7e5d08b8c27d53
parent1529443c7be7467fd2f12a960e57839699dc2a6a
s3:idmap_rid: force mapping type to ID_TYPE_BOTH for sid->unixid mapping

This is to remove problems with the same unix-id being used both
as a uid and a gid.

The rid backend will map a given number to the same SID, no matter whether this
is a uid or a gid. This will prime the idmap cache with mappings.
The sid-to-u/gid mapping, when not going through the cache, instead checks for
the type of the sid and only allows unix ids of the corresponding type.
Hence the rid backend will give different results, depending on whether the
cache is filled or not.

This patch lets the rid backend always create sid->id mappings of type both.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 55607f0f334ca5d72f35eb6b259db5283b35e86a)
source3/winbindd/idmap_rid.c