is there a way to change location of /etc/pam.d directory, or is it hardcoded into PAM? can't it be changed with some environment variable for specific client programs?
for example:
PAM_CONFIG_ROOT=/tmp/pam_test_configs pam_client_app
or it can't be done for some reason I don't see now?
The
pam(8)
manual page says explicitly that it considers/etc/pam.conf
but only if/etc/pam.d/
doesn't exist. No mention whatsoever of alternative places. The definite guide is here.Either arrange for your modules to be called only by you, or use a virtual machine set up for testing.
I looked into the Linux PAM sources. /etc/pam.conf, /etc/pam.d are hardcoded there. :(