I just went and got the Eudora poppassd program that was recently mentioned
on this list, because that's something I've been looking for, too.
I've made some changes to it, for it to handle locked accounts and to record
failed login attempts (context diff included below). What I'd like to know,
is how to make it check the previous password dictionary? Do I have to go
through each entry in the pwdict structure and compare crypts?
Here's the context diff:
# diff -c osf-poppassd.c osf-poppassd.c.orig
*** osf-poppassd.c Thu Aug 15 09:38:04 1996
--- osf-poppassd.c.orig Thu Aug 15 09:23:04 1996
***************
*** 6,14 ****
*
* Modified by Tarjei T. Jensen
*
- * Modified further by Michael Matthews (to handle locked accounts and
- * recording of failed login attempts)
- *
* Tested with Digital Unix 3.2C and Qualcomm's Eudora
*
* Some of the original Solaris comments:
--- 6,11 ----
***************
*** 148,170 ****
exit(1);
}
- if (pr_pwd->ufld.fd_lock) {
- WriteToClient("500 This account is locked. Please call the administrators.\n");
- exit(1);
- };
-
if (!chkPass (pr_pwd, oldpass))
{
WriteToClient ("500 Old password is incorrect.");
- pr_pwd->ufld.fd_nlogins++;
- pr_pwd->ufld.fd_ulogin = time(NULL);
- pr_pwd->uflg.fg_nlogins = 1;
- pr_pwd->uflg.fg_unsuctty = 1;
- pr_pwd->uflg.fg_ulogin = 1;
- strcpy(pr_pwd->ufld.fd_unsuctty,"poppassd");
- if (!putprpwnam(user,pr_pwd)) {
- syslog(LOG_ERR,"error saving incorrect pwchange info:
%s",errno);
- };
exit(1);
}
--- 145,153 ----
---
Mike Matthews, Mike_Matthews_at_sgate.com (NeXTmail accepted)
PGP public key available on request
Received on Thu Aug 15 1996 - 16:21:39 NZST