diff src/auth/auth-request.h @ 3171:8a3b57385eca HEAD

Added state variable for auth_request and several assertions to make sure the state is always valid. Fixed assert crash when a user having cached passdb entry expired tried to authenticate.
author Timo Sirainen <tss@iki.fi>
date Sat, 05 Mar 2005 13:48:13 +0200
parents e6a487d80288
children 16ea551957ed
line wrap: on
line diff
--- a/src/auth/auth-request.h	Sat Mar 05 12:25:09 2005 +0200
+++ b/src/auth/auth-request.h	Sat Mar 05 13:48:13 2005 +0200
@@ -8,10 +8,19 @@
 
 struct auth_client_connection;
 
+enum auth_request_state {
+	AUTH_REQUEST_STATE_NEW,
+	AUTH_REQUEST_STATE_PASSDB,
+	AUTH_REQUEST_STATE_MECH_CONTINUE,
+	AUTH_REQUEST_STATE_FINISHED,
+	AUTH_REQUEST_STATE_USERDB
+};
+
 struct auth_request {
 	int refcount;
 
 	pool_t pool;
+        enum auth_request_state state;
 	char *user;
 	char *mech_password; /* set if verify_plain() is called */
 	char *passdb_password; /* set after password lookup if successful */
@@ -40,7 +49,6 @@
 
 	unsigned int successful:1;
 	unsigned int internal_failure:1;
-	unsigned int finished:1;
 	unsigned int delayed_failure:1;
 	unsigned int accept_input:1;
 	unsigned int no_failure_delay:1;