ClientAliveCountMax and PAM Authentication - SSH

This is a discussion on ClientAliveCountMax and PAM Authentication - SSH ; If we ClientAliveCountMax openssh sshd shuts down the session by
calling _exit() in cleanup_exit(). This abrupt form of quitting the
program doesn’t call our pam module clean up that is keeping track of
the session count. I can hack cleanup_exit() ...

ClientAliveCountMax and PAM Authentication

If we ClientAliveCountMax openssh sshd shuts down the session by
calling _exit() in cleanup_exit(). This abrupt form of quitting the
program doesn’t call our pam module clean up that is keeping track of
the session count. I can hack cleanup_exit() to call our cleanup
routines, but before I do that I was wondering if anyone has more
savvy way of doing this that is inline with the openssh architecture.
Thanks for your help.