summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2015-11-09 12:26:07 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2015-12-15 16:26:39 +0100
commit81f135f9e83031c4a021a3d19009b2bc179c8468 (patch)
treedc4fe850ea2f77121af293f1dc83619fa9c99836 /src/providers
parent00fea5c2aaa0277bea522d2f61de75699ee2ed49 (diff)
downloadsssd-81f135f9e83031c4a021a3d19009b2bc179c8468.tar.gz
sssd-81f135f9e83031c4a021a3d19009b2bc179c8468.tar.xz
sssd-81f135f9e83031c4a021a3d19009b2bc179c8468.zip
SUDO: move offline check to handler
We let sdap_id_op decide if we are offline or not here but we should not get to this code since ptask is disabled and we will not get through sudo handler if offline. This simplyfies the code and make it more similar to other providers. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ldap/sdap_async_sudo.c6
-rw-r--r--src/providers/ldap/sdap_sudo.c5
2 files changed, 5 insertions, 6 deletions
diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c
index b4899cbaa..24ee353fc 100644
--- a/src/providers/ldap/sdap_async_sudo.c
+++ b/src/providers/ldap/sdap_async_sudo.c
@@ -197,12 +197,6 @@ static int sdap_sudo_refresh_retry(struct tevent_req *req)
state = tevent_req_data(req, struct sdap_sudo_refresh_state);
- if (be_is_offline(state->be_ctx)) {
- state->dp_error = DP_ERR_OFFLINE;
- state->error = EAGAIN;
- return EOK;
- }
-
if (state->sdap_op == NULL) {
state->sdap_op = sdap_id_op_create(state, state->sdap_conn_cache);
if (state->sdap_op == NULL) {
diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c
index d9537a877..9286f5090 100644
--- a/src/providers/ldap/sdap_sudo.c
+++ b/src/providers/ldap/sdap_sudo.c
@@ -173,6 +173,11 @@ void sdap_sudo_handler(struct be_req *be_req)
struct sdap_id_ctx *id_ctx = NULL;
int ret = EOK;
+ if (be_is_offline(be_ctx)) {
+ sdap_handler_done(be_req, DP_ERR_OFFLINE, EAGAIN, "Offline");
+ return;
+ }
+
sudo_ctx = talloc_get_type(be_ctx->bet_info[BET_SUDO].pvt_bet_data,
struct sdap_sudo_ctx);
id_ctx = sudo_ctx->id_ctx;