History log of /sssd-io/src/responder/common/cache_req/cache_req.c
Revision Date Author Comments Expand
2af80640f18966d65cf82106059ce3c060df93bf 11-Dec-2017 amitkuma <amitkuma@redhat.com>

cache: Check for max_id/min_id in cache_req The cache_req code doesn't check the min_id/max_id boundaries for requests by ID. Extending the .lookup_fn function in each plugin that searches by ID for a check that returns non-zero if the entry is out of the range and 0 if not. Resolves: https://pagure.io/SSSD/sssd/issue/3569 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>

f2a5e29f063f9d623c1336d76f4b2bc500c1a5e2 06-Dec-2017 Jakub Hrozek <jhrozek@redhat.com>

CACHE_REQ: Use the domain-locator request to only search domains where the entry was found Uses the internal cache_req interface around the getAccountDomain to only search the domain returned by the cache_req_locate_domain_recv() request. If that request returns that no domain matched, all domains (belonging to the currently processed main domain) are skipped by setting the per-type negative cache. if a domain is reported as containing an object, all domains except that one are marked with the negative cache entries. Resolves: https://pagure.io/SSSD/sssd/issue/3468 Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>

52e675ec4b160720515c81ae8c0e5a95feb50c57 06-Nov-2017 Sumit Bose <sbose@redhat.com>

CACHE_REQ: Add cache_req_data_set_bypass_dp() Similar to cache_req_data_set_bypass_cache() cache_req_data_set_bypass_dp() can be used to control how the cache_req framework performs the lookup. If cache_req_data_set_bypass_dp() is used with 'true' only a cache lookup is performed and no request is send to the backend even if no entry was found. Related to https://pagure.io/SSSD/sssd/issue/2478 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

0f44eefe2ce75a0814c8688495477f6c57f3d39a 26-Oct-2017 Fabiano Fidêncio <fidencio@redhat.com>

CACHE_REQ: Copy the cr_domain list for each request Let's copy the cr_domain list for each request as this list may be free'd due to a refresh domains request. Resolves: https://pagure.io/SSSD/sssd/issue/3551 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>

c33fa33065b1211dba5ea2909bac62843a72e8b5 25-Sep-2017 AmitKumar <amitkuma@redhat.com>

Print a warning when enumeration is requested but disabled Add an explanatory message to be logged once, at the start-up, mentioning that in case enumeration is not enabled, getent passwd won't return all users by design. The debug level chosen to show the message is SSS_LOG_NOTICE. Resolves: https://pagure.io/SSSD/sssd/issue/2301 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

382a972a80ac571cdbf70d88571f6de49fe1cd23 27-Jul-2017 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>

CACHE_REQ: Pull sessionRecording attrs from initgr After entires are retrieved by cache_req for user info requests (except initgr), overlay them with sessionRecording attribute retrieved from an initgr request made additionally for each entry. Do not do additional initgr requests with selective session recording enabled, if we don't have any group names to match against in session recording configuration. Only do user name matches instead. Reviewed-by: Pavel Březina <pbrezina@redhat.com>

cb89693cf5ccdedf69fa304c6d43d618a7bc18b2 27-Jul-2017 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>

CACHE_REQ: Propagate num_results to cache_req_state The num_results field in struct cache_req_state was only set in case of well-known objects, set it also for the regular results for uniformity, and for later use by session recording code. Reviewed-by: Pavel Březina <pbrezina@redhat.com>

1a89fc33d1b9b1070c7ab83fb0314e538ac46736 17-May-2017 Fabiano Fidêncio <fidencio@redhat.com>

CACHE_REQ: Ensure the domains are updated for "filter" related calls As contacting the infopipe responder on a "filter" related call may lead to the situation where the cr_domains' list is not populated yet (as the domains and subdomains lists from the data provider are not processed yet), let's explicitly call sss_dp_get_domains() for those cases and avoid returning a wrong result to the caller. This situation may happen only because the schedule_get_domains_task(), that's called when the infopipe responder is initialized, may take some time to run/finish. While I'm not exactly sure whether it's the best solution to avoid the "race", it seems to be sane enough to avoid the issues. Resolves: https://pagure.io/SSSD/sssd/issue/3387 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>

dae798231fc2c575f213785768bc24ed765ba243 26-Apr-2017 Fabiano Fidêncio <fidencio@redhat.com>

CACHE_REQ: Allow configurationless shortname lookups Configurationless shortnames lookups must be allowed when a domains' resolution order is present and the (head) domain is not enforcing the usage of fully-qualified-names. With this patch SSSD does not require any kind of changes from client side for taking advantage of shortname lookups. Related: https://pagure.io/SSSD/sssd/issue/3001 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>

cee85e8fb9534ec997e5388fce59f392cf029573 30-Mar-2017 Jakub Hrozek <jhrozek@redhat.com>

CACHE_REQ: Domain type selection in cache_req Related to: https://pagure.io/SSSD/sssd/issue/3310 Adds a new enumeration cache_req_dom_type. It is a tri-state that allows the caller to select which domains can be contacted - either only POSIX, only application domains or any type. Not all plugins of cache_req have the new parameter added -- only those that are usable/useful in a non-POSIX environment. For example, it makes no sense to allow the selection for calls by ID because those are inherently POSIX-specific. Also, services or netgroups are supported only coming from POSIX domains. At the moment, the patch should not change any behaviour as all calls default to contacting POSIX domains only. Reviewed-by: Pavel Březina <pbrezina@redhat.com>

cache_req.c cache_req.h cache_req_private.h plugins/cache_req_enum_groups.c plugins/cache_req_enum_svc.c plugins/cache_req_enum_users.c plugins/cache_req_group_by_filter.c plugins/cache_req_group_by_id.c plugins/cache_req_group_by_name.c plugins/cache_req_host_by_name.c plugins/cache_req_initgroups_by_name.c plugins/cache_req_netgroup_by_name.c plugins/cache_req_object_by_id.c plugins/cache_req_object_by_name.c plugins/cache_req_object_by_sid.c plugins/cache_req_svc_by_name.c plugins/cache_req_svc_by_port.c plugins/cache_req_user_by_cert.c plugins/cache_req_user_by_filter.c plugins/cache_req_user_by_id.c plugins/cache_req_user_by_name.c /sssd-io/src/responder/ifp/ifp_groups.c /sssd-io/src/responder/ifp/ifp_users.c /sssd-io/src/responder/ifp/ifpsrv_cmd.c /sssd-io/src/responder/nss/nss_enum.c /sssd-io/src/responder/nss/nss_get_object.c /sssd-io/src/responder/pam/pamsrv_cmd.c /sssd-io/src/responder/sudo/sudosrv_get_sudorules.c /sssd-io/src/tests/cmocka/test_responder_cache_req.c
66c8e92eb5a4985bb7f64c349a53b08030a000cf 29-Mar-2017 Fabiano Fidêncio <fidencio@redhat.com>

CACHE_REQ: Make use of domainResolutionOrder domainResolutionOrder has been introduced in the previous commits and allows the admin to set up a specific order which the domains will be resolved during a lookup and with this patch we can take advantage of this. In order to have it working a new structure has been added (struct domain_resolution_order) to the responder context and will be used by the cache_req to perform the lookups based on this list. As the ipaDomainResolutionOrder may be set globally on IPA or per View, SSSD does respect the following precedence order: View > Globally. The way the list is built is quite simple, basically having the domains present on ipaDomainResolutionOrder as the first domains (in that specific order) and then appending the remaining domains to this list. The final result is a completely flat list with all the domains respecting the specified order (it's important to remember that the domains not specified won't follow any specific order, they're just "random" based on the domains list present in the responder context. Related: https://pagure.io/SSSD/sssd/issue/3001 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>

8bb6680637ead03e24a38d15ec5265d11a920a1d 14-Mar-2017 Fabiano Fidêncio <fidencio@redhat.com>

CACHE_REQ: Check the caches first This patch introduces a new configurable option to define whether the responder should query all domains' caches before querying the Data Providers. This new option is called cache_first and, by default, it's disabled, meaning that, for each provider, the responder may contact the cache and the data provider in the same iteration. Co-Author: Pavel Březina <pbrezina@redhat.com> Related: https://pagure.io/SSSD/sssd/issue/3001 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>

9286d0d4143bcb4e36b91022107e307998122bbb 14-Mar-2017 Fabiano Fidêncio <fidencio@redhat.com>

CACHE_REQ: Move cache_req_next_domain() into a new tevent request This change prepares for the upcoming patch, which will have to support more than one iteration over all domains, leaving us with a better control of the whole logic around this iteration. Related: https://pagure.io/SSSD/sssd/issue/3001 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>

7cd226414c7bcdd32f05416df64ebda3ac869bd7 14-Mar-2017 Pavel Březina <pbrezina@redhat.com>

CACHE_REQ: Move result manipulation into a separate module This patch is preparing the field for coming up patches where new lookup logic will be added. Taking this into consideration let's move the result manipulation code into a separate module and focus purely in the lookups logic in the main module. Related: https://pagure.io/sssd/sssd/issue/3001 Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>

828fe7528fbe6971701d16aed87ba12dd91da55f 14-Mar-2017 Pavel Březina <pbrezina@redhat.com>

CACHE_REQ: Make cache_req_{create_and_,}add_result() more generic This patch is preparing the field for coming up patches where this function will be re-used. In order to do so, let's remove the dependency for tevent states on both cache_req_create_and_add_result() and cache_req_add_result(). Related: https://pagure.io/sssd/sssd/issue/3001 Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>

53c31b83e4d06ea4c2813eec2f1e647a613b4a2b 08-Feb-2017 Pavel Březina <pbrezina@redhat.com>

cache_req: add host by name search Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

9492b3b26ac0b1898f836094074a9d8b38916e13 08-Feb-2017 Pavel Březina <pbrezina@redhat.com>

cache_req: add api to create ldb_result from message Some sysdb methods doesn't return ldb_result as output but return ldb_message instead. Changing sysdb to be consistent is too big so I added this helper function that will wrap resulting message into ldb_result. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

ddfd1900b26c66a062457d4fcc1a48bafd3eadf6 08-Feb-2017 Pavel Březina <pbrezina@redhat.com>

cache_req: add ability to not use default domain suffix This will be used in the next plugin "host by name" where it is not desirable to use default domain suffix if set. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

2b5704cd96a085b99d3b0d4f80f4414adc134750 08-Feb-2017 Pavel Březina <pbrezina@redhat.com>

sss_parse_inp_send: provide default_domain as parameter It is not always desirable to consider default_domain from configuration but expect none instead. For example when we search host certificates. This is currently not used in this patch since host lookups parse name directly with sss_parse_name but it will be used in the next patch. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

2d12aae08aff6c17c1edb107a204c54d9acfe08d 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: do not set ncache if dp request fails We will only remember entry in the negative cache if the data provider requests succeeded because only then we can be sure that the entry does not exist. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

817e3ec31bbdb5447f4ffcd3302c558283b90943 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: improve debugging The original debugging was unnecessarily large. I removed request name from all debug messages (keeping the request number). The name is now print only when a new request is created. I also added an explicit message to see what object are we currently looking up. For example: [cache_req_set_plugin] (0x2000): CR #4: Setting "Group by ID" plugin [cache_req_send] (0x0400): CR #4: New request 'Group by ID' [cache_req_select_domains] (0x0400): CR #4: Performing a multi-domain search [cache_req_set_domain] (0x0400): CR #4: Using domain [LDAP.PB] [cache_req_search_send] (0x0400): CR #4: Looking up GID:20001@LDAP.PB [cache_req_search_ncache] (0x0400): CR #4: Checking negative cache for [GID:20001@LDAP.PB] [cache_req_search_ncache] (0x0400): CR #4: [GID:20001@LDAP.PB] is not present in negative cache [cache_req_search_cache] (0x0400): CR #4: Looking up [GID:20001@LDAP.PB] in cache [cache_req_search_send] (0x0400): CR #4: Returning [GID:20001@LDAP.PB] from cache [cache_req_create_and_add_result] (0x0400): CR #4: Found 1 entries in domain LDAP.PB [cache_req_done] (0x0400): CR #4: Finished: Success Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

8f895983e8d24b3edde4f695621f6b9a2fd20923 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: make plug-ins definition const Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

3be2628d8aba6aeb99ac1484da990f1fad8169ec 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add object by id This request returns either user or group object. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

488518dde58724daa13b9216a0f1af6e0ba5401f 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add object by name This request returns either user or group object. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

7be55c7de03da57f43fae3db7e6114eebb117a2e 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: allow to return well known object as result When we are looking name by sid or sid by name we want to be also able to translate well known sid/name into its pair equivalent. This adds the ability to mock cache_req_result if a well known object is found. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

4e2c15e6b7c4015fa787f8c624c2ec10153e99f6 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: allow shallow copy of result For enumeration purpose, we want to limit the number of returned results This is a preparation for changes in NSS responder. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

6b159f14f69134bba8510a6b50ab62493a23a73f 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add support for netgroups Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

0ae7e46a3990c47873fca879a9395e3ce00d9150 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add support for services enumeration Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

c2fc9459c31cb1192ab3c15ce4df1c150e99bf95 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add support for service by port Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

2e13817e64ff1e0e47dc844be501f2d3ab299f34 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add support for service by name Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

12d771585a84a7523a5b7d9cf502d4bcddecb9b9 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add group enumeration Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

a79acee185654d110c0e35ba351368d664e4e53d 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add user enumeration Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

9c98397b6431b6b02bdfdb0540bac6a3eb00b0e3 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add ability to filter domains by enumeration Skip domains without enumeration if a plug-in requires it. This is preparation for enumeration support inside cache_req. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

3df5c41c19ef852021819954a2db1d067844d136 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: add ability to gather result from all domains This is preparation for enumeration support inside cache_req. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

b206e1abb7f6ea373d12537b3338552aed6b656d 19-Dec-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: encapsulate output data into structure In enumeration calls we want to get objects from all domains, not only from the first matched domain. We move the cache search result into a structure that contains combination of domain and ldb_result. This is preparation for enumeration support inside cache_req. Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

0db2f3402b37df221fbf55486769989f82df479a 20-Oct-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: move from switch to plugins, add plugins This patch adds all existing functionality into plugins. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

2749964664a69bbb99d09409c1110095cbfcc664 20-Oct-2016 Pavel Březina <pbrezina@redhat.com>

cache_req: move from switch to plugins; add logic cache_req grown quite big from the original code and it turned out that using switch statements to branch code for different cases makes the code quite hard to read and further extend and any modification to the logic itself is difficult. This patch changes the switch statements to plugins with small functions and separates logic into multiple modules. This gives us better control over the code and improves readability and maintainability while keeping code duplication to minimum. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Petr Cech <pcech@redhat.com>