summaryrefslogtreecommitdiff
path: root/src/responder
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2011-01-04 10:38:40 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-01-06 15:15:54 -0500
commitc5f66b8c471e472b3c6eecf87c93373ecf8d0890 (patch)
treedd7fd8e72eb210055053b086ba4c02fe3dd2eb7d /src/responder
parent5ea3cfbb8272f5e02f8e9683c0028b3e1a3c9045 (diff)
downloadsssd-c5f66b8c471e472b3c6eecf87c93373ecf8d0890.tar.gz
sssd-c5f66b8c471e472b3c6eecf87c93373ecf8d0890.tar.bz2
sssd-c5f66b8c471e472b3c6eecf87c93373ecf8d0890.zip
Remove unused enumeration cache timeout checks
The existence of the getent_ctx is used to track the enumeration cache timeout.
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/nss/nsssrv.h2
-rw-r--r--src/responder/nss/nsssrv_cmd.c32
-rw-r--r--src/responder/nss/nsssrv_private.h1
3 files changed, 2 insertions, 33 deletions
diff --git a/src/responder/nss/nsssrv.h b/src/responder/nss/nsssrv.h
index 0b7265b7..062d937f 100644
--- a/src/responder/nss/nsssrv.h
+++ b/src/responder/nss/nsssrv.h
@@ -49,8 +49,6 @@ struct nss_ctx {
int cache_refresh_percent;
int enum_cache_timeout;
- time_t last_user_enum;
- time_t last_group_enum;
struct getent_ctx *pctx;
struct getent_ctx *gctx;
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index c9c7920f..2153d649 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -981,8 +981,6 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx,
struct setent_ctx *state;
struct sss_domain_info *dom;
struct setent_step_ctx *step_ctx;
- bool enum_cached = false;
- time_t now = time(NULL);
DEBUG(4, ("Received setpwent request\n"));
nctx = talloc_get_type(client->rctx->pvt_ctx, struct nss_ctx);
@@ -1000,13 +998,6 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx,
state->nctx = nctx;
state->client = client;
- /* do not query backends if we have a recent enumeration */
- if (nctx->enum_cache_timeout) {
- if (nctx->last_user_enum + nctx->enum_cache_timeout > now) {
- enum_cached = true;
- }
- }
-
state->dctx = talloc_zero(state, struct nss_dom_ctx);
if (!state->dctx) {
ret = ENOMEM;
@@ -1080,7 +1071,6 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx,
step_ctx->nctx = state->nctx;
step_ctx->getent_ctx = state->getent_ctx;
step_ctx->rctx = client->rctx;
- step_ctx->enum_cached = enum_cached;
step_ctx->returned_to_mainloop = false;
ret = nss_cmd_setpwent_step(step_ctx);
@@ -1134,11 +1124,7 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx)
if (dom != dctx->domain) {
/* make sure we reset the check_provider flag when we check
* a new domain */
- if (step_ctx->enum_cached) {
- dctx->check_provider = false;
- } else {
- dctx->check_provider = NEED_CHECK_PROVIDER(dom->provider);
- }
+ dctx->check_provider = NEED_CHECK_PROVIDER(dom->provider);
}
/* make sure to update the dctx if we changed domain */
@@ -2250,8 +2236,6 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx,
struct setent_ctx *state;
struct sss_domain_info *dom;
struct setent_step_ctx *step_ctx;
- bool enum_cached = false;
- time_t now = time(NULL);
DEBUG(4, ("Received setgrent request\n"));
nctx = talloc_get_type(client->rctx->pvt_ctx, struct nss_ctx);
@@ -2269,13 +2253,6 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx,
state->nctx = nctx;
state->client = client;
- /* do not query backends if we have a recent enumeration */
- if (nctx->enum_cache_timeout) {
- if (nctx->last_user_enum + nctx->enum_cache_timeout > now) {
- enum_cached = true;
- }
- }
-
state->dctx = talloc_zero(state, struct nss_dom_ctx);
if (!state->dctx) {
ret = ENOMEM;
@@ -2349,7 +2326,6 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx,
step_ctx->nctx = state->nctx;
step_ctx->getent_ctx = state->getent_ctx;
step_ctx->rctx = client->rctx;
- step_ctx->enum_cached = enum_cached;
step_ctx->returned_to_mainloop = false;
ret = nss_cmd_setgrent_step(step_ctx);
@@ -2403,11 +2379,7 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx)
if (dom != dctx->domain) {
/* make sure we reset the check_provider flag when we check
* a new domain */
- if (step_ctx->enum_cached) {
- dctx->check_provider = false;
- } else {
- dctx->check_provider = NEED_CHECK_PROVIDER(dom->provider);
- }
+ dctx->check_provider = NEED_CHECK_PROVIDER(dom->provider);
}
/* make sure to update the dctx if we changed domain */
diff --git a/src/responder/nss/nsssrv_private.h b/src/responder/nss/nsssrv_private.h
index 3eaaa9b7..52c4ace3 100644
--- a/src/responder/nss/nsssrv_private.h
+++ b/src/responder/nss/nsssrv_private.h
@@ -84,7 +84,6 @@ struct setent_step_ctx {
struct nss_dom_ctx *dctx;
struct getent_ctx *getent_ctx;
struct resp_ctx *rctx;
- bool enum_cached;
bool check_next;
bool returned_to_mainloop;