summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-10-15 16:32:25 +0200
committerStefan Metzmacher <metze@samba.org>2012-12-03 08:48:27 +0100
commit55607f0f334ca5d72f35eb6b259db5283b35e86a (patch)
treeccdbcfa94af55cb51e51d23632510c04bbe3dae0 /source3/winbindd
parentc408126b47b0ce496a8b2293a8481d439b4234cf (diff)
downloadsamba-55607f0f334ca5d72f35eb6b259db5283b35e86a.tar.gz
samba-55607f0f334ca5d72f35eb6b259db5283b35e86a.tar.bz2
samba-55607f0f334ca5d72f35eb6b259db5283b35e86a.zip
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>
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap_rid.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_rid.c b/source3/winbindd/idmap_rid.c
index 4112fb860a..f10f493496 100644
--- a/source3/winbindd/idmap_rid.c
+++ b/source3/winbindd/idmap_rid.c
@@ -92,6 +92,7 @@ static NTSTATUS idmap_rid_id_to_sid(struct idmap_domain *dom, struct id_map *map
that is a deficiency in the idmap_rid design. */
map->status = ID_MAPPED;
+ map->xid.type = ID_TYPE_BOTH;
return NT_STATUS_OK;
}
@@ -109,6 +110,7 @@ static NTSTATUS idmap_rid_sid_to_id(struct idmap_domain *dom, struct id_map *map
sid_peek_rid(map->sid, &rid);
map->xid.id = rid - ctx->base_rid + dom->low_id;
+ map->xid.type = ID_TYPE_BOTH;
/* apply filters before returning result */