diff options
-rw-r--r-- | source3/winbindd/idmap_autorid.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c index ce55af97b6..d0a7b675e3 100644 --- a/source3/winbindd/idmap_autorid.c +++ b/source3/winbindd/idmap_autorid.c @@ -351,12 +351,15 @@ static NTSTATUS idmap_autorid_sid_to_id(struct autorid_global_config *global, struct id_map *map) { uint32_t rid; + uint32_t reduced_rid; + uint32_t range_start; sid_peek_rid(map->sid, &rid); - map->xid.id = global->minvalue + - (global->rangesize * range->rangenum) + rid - - (global->rangesize * range->domain_range_index); + reduced_rid = rid % global->rangesize; + range_start = global->minvalue + range->rangenum * global->rangesize; + + map->xid.id = reduced_rid + range_start; map->xid.type = ID_TYPE_BOTH; /* We **really** should have some way of validating |