URL: https://github.com/SSSD/sssd/pull/154 Title: #154: Confront caches first
fidencio commented: """ @jhrozek, pushed a new version.
Here's the diff in order to make your review easier:
``` diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h index 6e54b72..c05b1ce 100644 --- a/src/confdb/confdb.h +++ b/src/confdb/confdb.h @@ -88,7 +88,7 @@ #define CONFDB_RESPONDER_LOCAL_NEG_TIMEOUT "local_negative_timeout" #define CONFDB_RESPONDER_IDLE_TIMEOUT "responder_idle_timeout" #define CONFDB_RESPONDER_IDLE_DEFAULT_TIMEOUT 300 -#define CONFDB_RESPONDER_CONFRONT_CACHES_FIRST "confront_caches_first" +#define CONFDB_RESPONDER_CACHE_FIRST "cache_first"
/* NSS */ #define CONFDB_NSS_CONF_ENTRY "config/nss" diff --git a/src/config/SSSDConfig/__init__.py.in b/src/config/SSSDConfig/__init__.py.in index 0cb8ef3..03a1a43 100644 --- a/src/config/SSSDConfig/__init__.py.in +++ b/src/config/SSSDConfig/__init__.py.in @@ -51,7 +51,7 @@ option_strings = { 'fd_limit' : _('The number of file descriptors that may be opened by this responder'), 'client_idle_timeout' : _('Idle time before automatic disconnection of a client'), 'responder_idle_timeout' : _('Idle time before automatic shutdown of the responder'), - 'confront_caches_first': _('Always query all the caches before querying the Data Providers'), + 'cache_first': _('Always query all the caches before querying the Data Providers'),
# [sssd] 'services' : _('SSSD Services to start'), diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py index b6d3a18..457a6f0 100755 --- a/src/config/SSSDConfigTest.py +++ b/src/config/SSSDConfigTest.py @@ -309,7 +309,7 @@ class SSSDConfigTestSSSDService(unittest.TestCase): 'fd_limit', 'client_idle_timeout', 'responder_idle_timeout', - 'confront_caches_first', + 'cache_first', 'description', 'certificate_verification', 'override_space', diff --git a/src/config/cfg_rules.ini b/src/config/cfg_rules.ini index 78e62b3..c287328 100644 --- a/src/config/cfg_rules.ini +++ b/src/config/cfg_rules.ini @@ -59,7 +59,7 @@ option = fd_limit option = client_idle_timeout option = description option = responder_idle_timeout -option = confront_caches_first +option = cache_first
# Name service option = user_attributes @@ -98,7 +98,7 @@ option = fd_limit option = client_idle_timeout option = description option = responder_idle_timeout -option = confront_caches_first +option = cache_first
# Authentication service option = offline_credentials_expiration @@ -133,7 +133,7 @@ option = fd_limit option = client_idle_timeout option = description option = responder_idle_timeout -option = confront_caches_first +option = cache_first
# sudo service option = sudo_timed @@ -155,7 +155,7 @@ option = fd_limit option = client_idle_timeout option = description option = responder_idle_timeout -option = confront_caches_first +option = cache_first
# autofs service option = autofs_negative_timeout @@ -176,7 +176,7 @@ option = fd_limit option = client_idle_timeout option = description option = responder_idle_timeout -option = confront_caches_first +option = cache_first
# ssh service option = ssh_hash_known_hosts @@ -199,7 +199,7 @@ option = fd_limit option = client_idle_timeout option = description option = responder_idle_timeout -option = confront_caches_first +option = cache_first
# PAC responder option = allowed_uids @@ -221,7 +221,7 @@ option = fd_limit option = client_idle_timeout option = description option = responder_idle_timeout -option = confront_caches_first +option = cache_first
# InfoPipe responder option = allowed_uids diff --git a/src/config/etc/sssd.api.conf b/src/config/etc/sssd.api.conf index a786483..08cecf0 100644 --- a/src/config/etc/sssd.api.conf +++ b/src/config/etc/sssd.api.conf @@ -14,7 +14,7 @@ reconnection_retries = int, None, false fd_limit = int, None, false client_idle_timeout = int, None, false responder_idle_timeout = int, None, false -confront_caches_first = int, None, false +cache_first = int, None, false description = str, None, false
[sssd] diff --git a/src/man/sssd.conf.5.xml b/src/man/sssd.conf.5.xml index 429d896..e179964 100644 --- a/src/man/sssd.conf.5.xml +++ b/src/man/sssd.conf.5.xml @@ -663,7 +663,7 @@ </listitem> </varlistentry> <varlistentry> - <term>confront_caches_first</term> + <term>cache_first</term> <listitem> <para> This option specifies whether the responder should diff --git a/src/responder/common/cache_req/cache_req.c b/src/responder/common/cache_req/cache_req.c index efbce5e..aca150d 100644 --- a/src/responder/common/cache_req/cache_req.c +++ b/src/responder/common/cache_req/cache_req.c @@ -118,7 +118,7 @@ cache_req_create(TALLOC_CTX *mem_ctx, return NULL; }
- cr->confront_caches_first = rctx->confront_caches_first; + cr->cache_first = rctx->cache_first; cr->bypass_cache = cr->plugin->bypass_cache || cr->data->bypass_cache;
return cr; @@ -580,7 +580,7 @@ static bool cache_req_search_schema(struct cache_req *cr, if (!first_iteration) { return false; } - } else if (cr->confront_caches_first == false) { + } else if (!cr->cache_first) { /* We will search cache and on cache-miss * contact domain provider sequentially. */ bypass_cache = false; @@ -829,8 +829,8 @@ static errno_t cache_req_search_domains(struct tevent_req *req,
CACHE_REQ_DEBUG(SSSDBG_TRACE_FUNC, state->cr, "Search will %s the cache and %s the data provider\n", - bypass_cache ? "bypass" : "confront", - bypass_dp ? "bypass" : "confront"); + bypass_cache ? "bypass" : "check", + bypass_dp ? "bypass" : "check");
subreq = cache_req_search_domains_send(state, state->ev, state->cr, domain, check_next, bypass_cache, bypass_dp); diff --git a/src/responder/common/cache_req/cache_req_private.h b/src/responder/common/cache_req/cache_req_private.h index b5e2dcf..2d3c187 100644 --- a/src/responder/common/cache_req/cache_req_private.h +++ b/src/responder/common/cache_req/cache_req_private.h @@ -40,7 +40,7 @@ struct cache_req {
/* Domain related informations. */ struct sss_domain_info *domain; - bool confront_caches_first; + bool cache_first; bool bypass_cache;
/* Debug information */ diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h index a22de7d..4d1048a 100644 --- a/src/responder/common/responder.h +++ b/src/responder/common/responder.h @@ -138,7 +138,7 @@ struct resp_ctx { bool shutting_down; bool socket_activated; bool dbus_activated; - bool confront_caches_first; + bool cache_first; };
struct cli_creds; diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index 006853b..76f4360 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -1102,11 +1102,11 @@ int sss_process_init(TALLOC_CTX *mem_ctx, }
ret = confdb_get_bool(rctx->cdb, rctx->confdb_service_path, - CONFDB_RESPONDER_CONFRONT_CACHES_FIRST, - false, &rctx->confront_caches_first); + CONFDB_RESPONDER_CACHE_FIRST, + false, &rctx->cache_first); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - "Cannot get "confront_caches_option".\n" + "Cannot get "cache_first_option".\n" "Querying the caches first before querying the " "Data Providers will not be enforced [%d]: %s.\n", ret, sss_strerror(ret));
``` """
See the full comment at https://github.com/SSSD/sssd/pull/154#issuecomment-286349367