From: Rick W. <rw...@us...> - 2004-06-03 23:47:47
|
Update of /cvsroot/vpopmail/vpopmail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9972 Modified Files: vchkpw.c Log Message: #define MIN_LOGIN_INTERVAL seconds - If set return error if at least seconds has not elapsed since last login attempt. Make this a ./configure option? Index: vchkpw.c =================================================================== RCS file: /cvsroot/vpopmail/vpopmail/vchkpw.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- vchkpw.c 27 Apr 2004 06:53:42 -0000 1.13 +++ vchkpw.c 3 Jun 2004 23:47:38 -0000 1.14 @@ -390,6 +390,9 @@ int apopaccepted = -1; int cramaccepted = -1; char AuthType[15] = "PLAIN"; +#ifdef MIN_LOGIN_INTERVAL + time_t last_time; +#endif /* If thier directory path is empty make them a new one */ if ( vpw->pw_dir == NULL || vpw->pw_dir[0]==0 ) { @@ -524,7 +527,15 @@ * update the authentication time on the account */ #ifdef ENABLE_AUTH_LOGGING +#ifdef MIN_LOGIN_INTERVAL + last_time = vget_lastauth(vpw, TheDomain ); +#endif vset_lastauth(TheUser,TheDomain,IpAddr); +#ifdef MIN_LOGIN_INTERVAL + if(( vget_lastauth(vpw,TheDomain ) - last_time ) < MIN_LOGIN_INTERVAL ) { + vchkpw_exit(1); + } +#endif #endif #ifdef POP_AUTH_OPEN_RELAY |