[SSSD] [PATCH] Immediately return a krb5 change password request when offline

Sumit Bose sbose at redhat.com
Mon Nov 30 12:39:45 UTC 2009


Hi,

before the ccache file patch the offline check was the first thing done
in the krb5 provider. I think for a change password request it still
makes sense to return immediately when offline.

bye,
Sumit
-------------- next part --------------
From 5d440e595bc8d38ca479445847ed503cbf4b8d84 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Mon, 30 Nov 2009 13:32:56 +0100
Subject: [PATCH] Immediately return a krb5 change password request when offline

---
 server/providers/krb5/krb5_auth.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/server/providers/krb5/krb5_auth.c b/server/providers/krb5/krb5_auth.c
index d5c2503..8848a51 100644
--- a/server/providers/krb5/krb5_auth.c
+++ b/server/providers/krb5/krb5_auth.c
@@ -801,6 +801,13 @@ void krb5_pam_handler(struct be_req *be_req)
         goto done;
     }
 
+    if (be_is_offline(be_req->be_ctx) && pd->cmd == SSS_PAM_CHAUTHTOK) {
+        DEBUG(9, ("Password changes are not possible while offline.\n"));
+        pam_status = PAM_AUTHINFO_UNAVAIL;
+        dp_err = DP_ERR_OFFLINE;
+        goto done;
+    }
+
     attrs = talloc_array(be_req, const char *, 4);
     if (attrs == NULL) {
         goto done;
-- 
1.6.5.2



More information about the sssd-devel mailing list