On November 20, 2006 11:38:30 AM -0800 Frank Cusack <fcusack@fcusack.com> wrote:
On November 19, 2006 11:59:50 PM -0800 Frank Cusack <fcusack@fcusack.com> wrote:
On November 19, 2006 8:58:54 PM -0800 Frank Cusack <fcusack@fcusack.com> wrote:
I just added auth caching with pam, and I'm getting this error:
dovecot: [ID 107833 mail.error] auth(default): file passdb.c: line 178 (passdb_init): assertion failed: (passdb->passdb->default_pass_scheme != NULL || passdb->passdb->cache_key == NULL)
Looked into the source and I see that pam doesn't actually implement any caching.
Here is my first go at fixing it. It almost works.
- cache is initialized correctly
- user password is cached correctly until ttl expires
Once the ttl expires, dovecot attempts to use the cached password to authenticate. This fails in my environment. Then (after trying PAM with the cached password, even though ttl has expired) dovecot prompts the user for the password, however it never sends the request to PAM.
Some combination of waiting and trying again gets it working again, I haven't quite figure that one out. Might be waiting for the ttl expiry on the second (failed) request.
I think the after-ttl-expiry problems are due to a broken cache implementation, not really a problem with my patch. But maybe I need to do something to clear the cache? I didn't see anything like that in passdb-passwd.c.
-frank