On Thu, 2012-02-02 at 12:47 +0100, Jakub Hrozek wrote:
The attached patch implements a fast in-memory cache for serving sudo requests.
Most of the code was written by Pavel, so I retained the attribution even though I made a couple of fixes and wrote the man page section.
Nack.
You have a memory violation in sudosrv_cache_remove(). You're calling talloc_free(cache_entry), but you're currently in the handler for an event that's a child of cache_entry. You need to decouple the two somehow (either by freeing cache_entry in a tevent_immediate handler after this concludes or by talloc_stealing the timer event onto NULL before freeing cache_entry. Sanity is not guaranteed otherwise!
Otherwise this patch looks good.