diff options
author | Sumit Bose <sbose@redhat.com> | 2010-01-25 13:45:16 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-02-02 14:41:41 -0500 |
commit | 7ea48433b3bab77813b11c60e1ea82cb9793dc33 (patch) | |
tree | f7012746fd8f727cd80bd2361cb239893004f2b5 /server/responder/pam | |
parent | 245818557767e511d46b566bd1352f4d8fcb3426 (diff) | |
download | sssd-7ea48433b3bab77813b11c60e1ea82cb9793dc33.tar.gz sssd-7ea48433b3bab77813b11c60e1ea82cb9793dc33.tar.bz2 sssd-7ea48433b3bab77813b11c60e1ea82cb9793dc33.zip |
Add offline failed login counter
Diffstat (limited to 'server/responder/pam')
-rw-r--r-- | server/responder/pam/pam_LOCAL_domain.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/server/responder/pam/pam_LOCAL_domain.c b/server/responder/pam/pam_LOCAL_domain.c index 9d3738c5..1a5d76b6 100644 --- a/server/responder/pam/pam_LOCAL_domain.c +++ b/server/responder/pam/pam_LOCAL_domain.c @@ -164,7 +164,7 @@ static void do_successful_login(struct LOCAL_request *lreq) NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); - ret = sysdb_attrs_add_long(lreq->mod_attrs, "failedLoginAttempts", 0L); + ret = sysdb_attrs_add_long(lreq->mod_attrs, SYSDB_FAILED_LOGIN_ATTEMPTS, 0L); NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); @@ -199,16 +199,17 @@ static void do_failed_login(struct LOCAL_request *lreq) lreq->error, ENOMEM, done); ret = sysdb_attrs_add_long(lreq->mod_attrs, - "lastFailedLogin", (long)time(NULL)); + SYSDB_LAST_FAILED_LOGIN, (long)time(NULL)); NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); failedLoginAttempts = ldb_msg_find_attr_as_int(lreq->res->msgs[0], - "failedLoginAttempts", 0); + SYSDB_FAILED_LOGIN_ATTEMPTS, + 0); failedLoginAttempts++; ret = sysdb_attrs_add_long(lreq->mod_attrs, - "failedLoginAttempts", + SYSDB_FAILED_LOGIN_ATTEMPTS, (long)failedLoginAttempts); NEQ_CHECK_OR_JUMP(ret, EOK, ("sysdb_attrs_add_long failed.\n"), lreq->error, ret, done); @@ -436,10 +437,10 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) SYSDB_LAST_LOGIN, "lastPasswordChange", "accountExpires", - "failedLoginAttempts", + SYSDB_FAILED_LOGIN_ATTEMPTS, "passwordHint", "passwordHistory", - "lastFailedLogin", + SYSDB_LAST_FAILED_LOGIN, NULL}; DEBUG(4, ("LOCAL pam handler.\n")); |