But PAM should work in this manner. I use other programs with pam that read the shadow file. I will take a look at mod_auth_pam's code and try to compare it to your code and see what the difference is.