summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_sudo.c
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/ldap/sdap_sudo.c
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/ldap/sdap_sudo.c')
-rw-r--r--src/providers/ldap/sdap_sudo.c5
1 files changed, 5 insertions, 0 deletions
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;