summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-03-21 13:37:16 +0100
committerJule Anger <janger@samba.org>2023-03-30 15:10:10 +0000
commit1e6eeb8efb21a836c08d203d379817598d6ea447 (patch)
tree454653b505bf3412d0dd7efd3672ba8e307601f8
parentbac09f85daa6f610347fd467c27d1b5197b3a662 (diff)
downloadsamba-1e6eeb8efb21a836c08d203d379817598d6ea447.tar.gz
idmap_hash: fix comments about the algorithm
Only support ~ 50k users per domain. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15319 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 0f96c4b419a59ea884e68a460910e5c8a45bfcec)
-rw-r--r--source3/winbindd/idmap_hash/idmap_hash.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c
index ec85119b063..99341bc6fab 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -60,13 +60,16 @@ static uint32_t hash_domain_sid(const struct dom_sid *sid)
}
/*********************************************************************
- Hash a Relative ID to a 20 bit number
+ Hash a Relative ID to a 19 bit number
********************************************************************/
static uint32_t hash_rid(uint32_t rid)
{
- /* 20 bits for the rid which allows us to support
- the first 100K users/groups in a domain */
+ /*
+ * 19 bits for the rid which allows us to support
+ * the first 50K users/groups in a domain
+ *
+ */
return (rid & 0x0007FFFF);
}
@@ -79,8 +82,13 @@ static uint32_t combine_hashes(uint32_t h_domain,
{
uint32_t return_id = 0;
- /* shift the hash_domain 19 bits to the left and OR with the
- hash_rid */
+ /*
+ * shift the hash_domain 19 bits to the left and OR with the
+ * hash_rid
+ *
+ * This will generate a 31 bit number out of
+ * 12 bit domain and 19 bit rid.
+ */
return_id = ((h_domain<<19) | h_rid);