[Dovecot] POP3 notice if password expired

Vaidas Pilkauskas vaidas.pilkauskas at sc.vu.lt
Tue Jun 13 19:03:28 EEST 2006


> On Sun, Jun 11, 2006 at 03:52:24PM +0300, Timo Sirainen wrote:
> > 
> > See if this patch works:
> > 
> > http://dovecot.org/list/dovecot-cvs/2006-June/005697.html
> 

> The problem is that dovecot should handle PAM_NEW_AUTHTOK_REQD not
> PAM_ACCT_EXPIRED in auth/passdb_pam.c function pam_verify_plain_child
> 
> I changed PAM_CCT_EXPIRED to PAM_NEW_AUTHTOK_REQD and got another
> problem:
> 
> -ERR Temporary authentication failure.
> 
> Log:
> dovecot: Jun 12 09:17:13 Info: auth(default): client in: AUTH   1
> PLAIN   service=POP3    secured lip=127.0.0.1   rip=127.0.0.1
> resp=<hidden>
> dovecot: Jun 12 09:17:13 Info: auth(default): pam(liucijus,127.0.0.1):
> pam_acct_mgmt() failed: Authentication token is no longer valid; new one
> required.
> dovecot: Jun 12 09:17:13 Error: child 12085 (auth) killed with signal 11
> 

Found what caused problem. Patches attached. 
-------------- next part --------------
--- cvs/dovecot/src/auth/auth-request.c	2006-06-11 15:51:36.000000000 +0300
+++ modified/dovecot/src/auth/auth-request.c	2006-06-13 18:44:11.000000000 +0300
@@ -318,7 +318,9 @@
 			}
 		}
 	} else if (*result == PASSDB_RESULT_PASS_EXPIRED) {
-		auth_stream_reply_add(request->extra_fields, "reason",
+	        if (request->extra_fields == NULL)
+		        request->extra_fields = auth_stream_reply_init(request);
+	        auth_stream_reply_add(request->extra_fields, "reason",
 				      "Password expired");
 	} else if (request->passdb->next != NULL &&
 		   *result != PASSDB_RESULT_USER_DISABLED) {
-------------- next part --------------
--- cvs/dovecot/src/auth/passdb-pam.c	2006-06-12 00:55:40.000000000 +0300
+++ modified/dovecot/src/auth/passdb-pam.c	2006-06-13 18:17:03.000000000 +0300
@@ -273,6 +273,7 @@
 			case PAM_USER_UNKNOWN:
 				result = PASSDB_RESULT_USER_UNKNOWN;
 				break;
+			case PAM_NEW_AUTHTOK_REQD:
 			case PAM_ACCT_EXPIRED:
 				result = PASSDB_RESULT_PASS_EXPIRED;
 				break;


More information about the dovecot mailing list