pam-hooks - PAM module to execute login/logout actions

Yesterday I've finally published a PAM module I wrote a while ago to implement an apparently trivial need which I haven't found implemented elsewhere. What I wanted to do was simply to be able to execute hook scripts upon an user is entering or leaving a PAM session. Actually, my use case is to clean the home directory of a user upon its GDM logout (and to be sure also just after he logs in) as such a user is a "dummy" one, reused by several people in a stripped down kiosk-like environment.

When I did my googling about this I was able to find only Enrique Ocaña's PAM preprofile which can force script execution at authentication time, but nothing for the logout. So I wrote my own toy module, generalizing a bit the API so that invoked scripts are informed about whether a login or logout is in process.

The result is pam-hooks. It is not in Debian since I do not know how many people can be interested in such a thing; in case you are just let me know.

Dear lazyweb, comments, code auditing, and pointers to similar stuff I've overlooked are really welcome.