URL: https://github.com/SSSD/sssd/pull/413 Author: sumit-bose Title: #413: mmap_cache: add SID and type to struct sss_mc_rec Action: opened
PR body: """ This patchset updates the memory cache by adding some new members to struct sss_mc_rec. One is the addition of a hash value for SID based lookup which will be added in later patches.
The other is a new record type and a member indicating the type. The new type is a link record which links an alias name, e.g. an UPN, to the original record of the related user or group object.
Besides aliases this link record will be used in case in-sensitive setups. E.g. if getpwnam() returns the name of an AD users as Administrator@ad.domain bit some applications or users use administrator@ad.domain for lookups the memory cache is currently never used because there is no entry with the hash of 'administrator@ad.domain'. With this patch the original data record is created as before with the hash for 'Administrator@ad.domain' and a link record is create with the hash of 'administrator@ad.domain'. Now both lookups can be handled by the memory cache. If now another application uses ADMINISTRATOR@AD.DOMAIN for lookups the first request will go to the NSS responder but upcoming requests can use the memory cache as well because a link record for ADMINISTRATOR@AD.DOMAIN is created.
The last patch in this series adds some additional data to the user and group lookup requests, the short name, the domain name, the short domain name and the SID. Those are needed to be able to support SID based lookups in the memory cache and allow applications to not depend on the name format returned by getpw{nam|uid}. Upcoming patches for libsss_nss_idmap will make those additional values available to applications I added them already here to keep the memory cache related changes in one PR. Application which will benefit here are the interfaces SSSD provides e.g. to Samba related applications like SSSD's version of libwbclient but also IPA plugins like extdom and slapi-nis. """
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/413/head:pr413 git checkout pr413
URL: https://github.com/SSSD/sssd/pull/413 Title: #413: mmap_cache: add SID and type to struct sss_mc_rec
pbrezina commented: """ ```c /* - * 40 seem a good compromise for slot size - * 4 blocks are enough for the average passwd entry of 42 bytes - * passwd records have 84 bytes of overhead, 160 - 82 = 78 bytes - * 3 blocks can contain a very minimal entry, 120 - 82 = 38 bytes + * 48 seem a good compromise for slot size + * 4 blocks are more than two times the average passwd entry of 42 bytes + * passwd records have 84 bytes of overhead, 192 - 82 = 110 bytes + * 3 blocks can contain a typical entry, 144 - 82 = 62 bytes * * 3 blocks are enough for groups w/o users (private user groups) - * group records have 68 bytes of overhead, 120 - 66 = 54 bytes + * group records have 68 bytes of overhead, 144 - 66 = 78 bytes */ #define MC_SLOT_SIZE 40 ``` You have changed it to `48` in comment but the constant is still `40`.
There are also some questions raised inside the code, it would be better to resolve them. But I will let someone who understands memory cache better to review this patch set. """
See the full comment at https://github.com/SSSD/sssd/pull/413#issuecomment-337856845
URL: https://github.com/SSSD/sssd/pull/413 Title: #413: mmap_cache: add SID and type to struct sss_mc_rec
lslebodn commented: """ Memory cache is critical part of client code and it is a nice tradition to write integration tests together with new features there. """
See the full comment at https://github.com/SSSD/sssd/pull/413#issuecomment-338185362
URL: https://github.com/SSSD/sssd/pull/413 Title: #413: mmap_cache: add SID and type to struct sss_mc_rec
Label: +Changes requested
URL: https://github.com/SSSD/sssd/pull/413 Title: #413: mmap_cache: add SID and type to struct sss_mc_rec
sumit-bose commented: """ I will come up with a new design later. """
See the full comment at https://github.com/SSSD/sssd/pull/413#issuecomment-430281776
URL: https://github.com/SSSD/sssd/pull/413 Author: sumit-bose Title: #413: mmap_cache: add SID and type to struct sss_mc_rec Action: closed
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/413/head:pr413 git checkout pr413
sssd-devel@lists.fedorahosted.org