summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Reichl <preichl@redhat.com>2015-07-29 03:57:46 -0400
committerJakub Hrozek <jhrozek@redhat.com>2015-07-31 10:16:59 +0200
commit4b1a46396caf656095e5f5e90d43996bdeaba0f3 (patch)
tree066b22a5e887fa99d5b88e3794c97c8dfc1ddc2a
parent4de84af23db74e13e867985c9093f394c9fa8d51 (diff)
downloadsssd-4b1a46396caf656095e5f5e90d43996bdeaba0f3.tar.gz
sssd-4b1a46396caf656095e5f5e90d43996bdeaba0f3.tar.xz
sssd-4b1a46396caf656095e5f5e90d43996bdeaba0f3.zip
SDAP: rename SDAP_CACHE_PURGE_TIMEOUT
Enum member SDAP_CACHE_PURGE_TIMEOUT has counter-intuitive name as it's used to access 'ldap_purge_cache_timeout' option. SDAP_CACHE_PURGE_TIMEOUT is more fitting name. Reviewed-by: Petr Cech <pcech@redhat.com>
-rw-r--r--src/providers/ldap/ldap_id_cleanup.c2
-rw-r--r--src/providers/ldap/ldap_id_enum.c4
-rw-r--r--src/providers/ldap/sdap.c2
-rw-r--r--src/providers/ldap/sdap.h2
-rw-r--r--src/providers/ldap/sdap_async_enum.c2
-rw-r--r--src/tests/cmocka/test_sdap.c14
6 files changed, 13 insertions, 13 deletions
diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
index 171c9b0ae..be9496a2e 100644
--- a/src/providers/ldap/ldap_id_cleanup.c
+++ b/src/providers/ldap/ldap_id_cleanup.c
@@ -59,7 +59,7 @@ errno_t ldap_setup_cleanup(struct sdap_id_ctx *id_ctx,
struct ldap_id_cleanup_ctx *cleanup_ctx = NULL;
char *name = NULL;
- period = dp_opt_get_int(id_ctx->opts->basic, SDAP_CACHE_PURGE_TIMEOUT);
+ period = dp_opt_get_int(id_ctx->opts->basic, SDAP_PURGE_CACHE_TIMEOUT);
if (period == 0) {
/* Cleanup has been explicitly disabled, so we won't
* create any cleanup tasks. */
diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c
index bc1b020c4..8832eb558 100644
--- a/src/providers/ldap/ldap_id_enum.c
+++ b/src/providers/ldap/ldap_id_enum.c
@@ -67,13 +67,13 @@ errno_t ldap_setup_enumeration(struct be_ctx *be_ctx,
first_delay = 0;
}
- cleanup = dp_opt_get_int(opts->basic, SDAP_CACHE_PURGE_TIMEOUT);
+ cleanup = dp_opt_get_int(opts->basic, SDAP_PURGE_CACHE_TIMEOUT);
if (cleanup == 0) {
/* We need to cleanup the cache once in a while when enumerating, otherwise
* enumeration would only download deltas since the previous lastUSN and would
* not detect removed entries
*/
- ret = dp_opt_set_int(opts->basic, SDAP_CACHE_PURGE_TIMEOUT,
+ ret = dp_opt_set_int(opts->basic, SDAP_PURGE_CACHE_TIMEOUT,
LDAP_ENUM_PURGE_TIMEOUT);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE,
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 051e3c1d2..97bc14b87 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -248,7 +248,7 @@ static void sdap_inherit_basic_options(char **inherit_opt_list,
struct dp_option *subdom_opts)
{
int inherit_options[] = {
- SDAP_CACHE_PURGE_TIMEOUT,
+ SDAP_PURGE_CACHE_TIMEOUT,
SDAP_AD_USE_TOKENGROUPS,
SDAP_OPTS_BASIC /* sentinel */
};
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index 444502bf7..b3321be48 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -176,7 +176,7 @@ enum sdap_basic_opt {
SDAP_OFFLINE_TIMEOUT,
SDAP_FORCE_UPPER_CASE_REALM,
SDAP_ENUM_REFRESH_TIMEOUT,
- SDAP_CACHE_PURGE_TIMEOUT,
+ SDAP_PURGE_CACHE_TIMEOUT,
SDAP_TLS_CACERT,
SDAP_TLS_CACERTDIR,
SDAP_TLS_CERT,
diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c
index f22276c3c..2d3821542 100644
--- a/src/providers/ldap/sdap_async_enum.c
+++ b/src/providers/ldap/sdap_async_enum.c
@@ -102,7 +102,7 @@ sdap_dom_enum_ex_send(TALLOC_CTX *memctx,
state->svc_conn = svc_conn;
sdom->last_enum = tevent_timeval_current();
- t = dp_opt_get_int(ctx->opts->basic, SDAP_CACHE_PURGE_TIMEOUT);
+ t = dp_opt_get_int(ctx->opts->basic, SDAP_PURGE_CACHE_TIMEOUT);
if ((sdom->last_purge.tv_sec + t) < sdom->last_enum.tv_sec) {
state->purge = true;
}
diff --git a/src/tests/cmocka/test_sdap.c b/src/tests/cmocka/test_sdap.c
index cb3265f2c..75fc34504 100644
--- a/src/tests/cmocka/test_sdap.c
+++ b/src/tests/cmocka/test_sdap.c
@@ -841,7 +841,7 @@ static int test_sdap_inherit_option_setup(void **state)
discard_const("test_princ");
ret = dp_opt_set_int(test_ctx->parent_sdap_opts->basic,
- SDAP_CACHE_PURGE_TIMEOUT, 123);
+ SDAP_PURGE_CACHE_TIMEOUT, 123);
assert_int_equal(ret, EOK);
*state = test_ctx;
@@ -865,7 +865,7 @@ static void test_sdap_inherit_option_null(void **state)
int val;
val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
- SDAP_CACHE_PURGE_TIMEOUT);
+ SDAP_PURGE_CACHE_TIMEOUT);
assert_int_equal(val, 0);
sdap_inherit_options(NULL,
@@ -873,7 +873,7 @@ static void test_sdap_inherit_option_null(void **state)
test_ctx->child_sdap_opts);
val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
- SDAP_CACHE_PURGE_TIMEOUT);
+ SDAP_PURGE_CACHE_TIMEOUT);
assert_int_equal(val, 0);
}
@@ -885,7 +885,7 @@ static void test_sdap_inherit_option_notset(void **state)
const char *inherit_options[] = { "ldap_use_tokengroups", NULL };
val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
- SDAP_CACHE_PURGE_TIMEOUT);
+ SDAP_PURGE_CACHE_TIMEOUT);
assert_int_equal(val, 0);
/* parent has nondefault, but it's not supposed to be inherited */
@@ -894,7 +894,7 @@ static void test_sdap_inherit_option_notset(void **state)
test_ctx->child_sdap_opts);
val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
- SDAP_CACHE_PURGE_TIMEOUT);
+ SDAP_PURGE_CACHE_TIMEOUT);
assert_int_equal(val, 0);
}
@@ -906,7 +906,7 @@ static void test_sdap_inherit_option_basic(void **state)
const char *inherit_options[] = { "ldap_purge_cache_timeout", NULL };
val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
- SDAP_CACHE_PURGE_TIMEOUT);
+ SDAP_PURGE_CACHE_TIMEOUT);
assert_int_equal(val, 0);
/* parent has nondefault, but it's not supposed to be inherited */
@@ -915,7 +915,7 @@ static void test_sdap_inherit_option_basic(void **state)
test_ctx->child_sdap_opts);
val = dp_opt_get_int(test_ctx->child_sdap_opts->basic,
- SDAP_CACHE_PURGE_TIMEOUT);
+ SDAP_PURGE_CACHE_TIMEOUT);
assert_int_equal(val, 123);
}