Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
SYSDB: Removing of sysdb_try_to_find_expected_dn() #85
Currently in order to match multiple LDAP search results we
This patch removes sysdb_try_to_find_expected_dn() and add new
I pushed new version. Let me update the situation:
There are three commits:
The patch  is refactor which is requested by https://fedorahosted.org/sssd/ticket/3230.
The patch  extends function create_multidom_test_ctx(). We need different search bases so there is array of params instead of one set of params.
The patch  adds tests for . The core of  is new function sdap_search_initgr_user_in_batch() which calls sdap_object_in_domain() internally. We can see three tests in :
The tests a), b) works how expected. The test c) doesn't work. I am afraid we have bug on
What do you think about it, @jhrozek? Or anybody else?
I think sdap_object_in_domain() and sdap_domain_get_by_dn() are working as expected, only the debug message in the code-block you cited should be corrected to some thing like "The original DN of the group cannot be related to any search base".
sdap_object_in_domain() assumes by default that the given object belongs to the given group which can be seen in the handling of the missing DN. So it makes sense that if the DN cannot be matched to any search bases to assume the same, i.e. 'return true;'.
When test_user_is_from_another_domain() is run there is only one domain, "domain.test.com", available in opts->sdom when sdap_domain_get_by_dn() is called. The search base does not match to the DN of the object from "another_domain.test.com" and NULL is returned. If you setup the test so that there is at least "another_domain.test.com" in the opt->sdom list as well sdap_domain_get_by_dn() can return the domain and in sdap_object_in_domain() false can be returned because the domains are not the same.
I pushed new version of the patch set. I addressed @sumit-bose notes, I hope in right manner.
I found out that function
If @sumit-bose agrees the use-case he brought up in one of the previous comments is covered, then I think the patches can be pushed. I tested the following cases:
All these cases were working as expected. Therefore I'm adding the accepted label and if Sumit agrees, I'll push the patch later.