[Samba] idmap_hash SID mapping limit

Gustavo De Nardin (spuk) gustavodn at gmail.com
Mon Jun 4 10:27:24 MDT 2012


Hello.

hash_rid() in idmap_hash.c[0] has a comment saying the rid is hashed
to 20 bit for supporting 100K SIDs:
  66 static uint32_t hash_rid(uint32_t rid)
  67 {
  68         /* 20 bits for the rid which allows us to support
  69            the first 100K users/groups in a domain */
  70
  71         return (rid & 0x0007FFFF);

But 0x7FFFF is 19 bit, and also wouldn't 20 bit allow for 1M SIDs
(2^20), not just 100K? Even if it is 19 bit that should support 512K.
I haven't read the whole source and codepath so I guess I can be
easily missing something, but could someone clarify and confirm what
the limit is?

Thanks.


[0]: http://git.samba.org/?p=samba.git;a=blob;f=source3/winbindd/idmap_hash/idmap_hash.c;h=1f36b217ef1ebbb19ffee8e5ba8557a30954ca13;hb=HEAD

-- 
(nil)


More information about the samba mailing list