On (22/01/15 18:39), Sumit Bose wrote:
Hi,
one of the recent patches related to the changes of the sysdb calls to return ENOENT broke the flow in the lookups by SID. As a result the request always returned if no result was found in the cache instead of asking the backend. With the new flow the ldb_result has to be properly initialized (I remember there was a long discussion about it, but I can't remember the result, so I fixed it in the caller).
The verify this you need just to look up a SID with is currently not in the cache, the easiest way is to use an empty cache:
python -c "import pysss_nss_idmap; print pysss_nss_idmap.getnamebysid('S-1-5-21-3456664713-2053453454-4165325232-500')"
Without the patch only an empty list is return, with the patch the SID is properly looked up by the backend.
bye, Sumit
hmm, I probably did something wrong in my test (sssd + your patch) because it does not work for me.
sh$ id idmapuser01-237231 uid=1663209156(idmapuser01-237231) gid=1663200513(Domain Users) groups=1663200513(Domain Users),1663209158(idmapgroup01-237231) sh$ id idmapuser02-237231 uid=1663209157(idmapuser02-237231) gid=1663200513(Domain Users) groups=1663200513(Domain Users),1663209159(idmapgroup02-237231)
sh$ ldbsearch -H /var/lib/sss/db/cache_ADTEST.ldb -b name=idmapuser01-237231,cn=users,cn=ADTEST,cn=sysdb objectSIDString asq: Unable to register control with rootdse! # record 1 dn: name=idmapuser01-237231,cn=users,cn=ADTEST,cn=sysdb objectSIDString: S-1-5-21-1980617158-3813236253-3438683870-9156
# returned 1 records # 1 entries # 0 referrals
sh$ service sssd stop; rm -f /var/lib/sss/{db,mc}/* Redirecting to /bin/systemctl stop sssd.service sh$ service sssd start Redirecting to /bin/systemctl start sssd.service
sh$ id idmapuser02-237231 uid=1663209157(idmapuser02-237231) gid=1663200513(Domain Users) groups=1663200513(Domain Users),1663209159(idmapgroup02-237231) # sssd_be is connected now sh$ python -c "import pysss_nss_idmap; print pysss_nss_idmap.getnamebysid('S-1-5-21-1980617158-3813236253-3438683870-9156')" {}
LS