s3:idmap_autorid: force mapping type to ID_TYPE_BOTH for sid->unixid mapping
commita1411a884c5361bb8b090695236724cd25857269
authorMichael Adam <obnox@samba.org>
Mon, 15 Oct 2012 14:34:02 +0000 (15 16:34 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 3 Dec 2012 07:48:28 +0000 (3 08:48 +0100)
tree683cb0bdf5cf4ca2c0dfc43c8d0bbfe913214343
parent55607f0f334ca5d72f35eb6b259db5283b35e86a
s3:idmap_autorid: 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 autorid 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 autorid backend always create sid->id mappings of type both.

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