pam_wrapper (1) - Linux Man Pages
pam_wrapper: A preloadable wrapper to test PAM applications and PAM Modules
pam_wrapper - A preloadable wrapper to test PAM applications and PAM Modules
This tool allows you to either test your PAM application or module. For testing PAM applications we have written a simple PAM module called pam_matrix (see below). If you plan to test a PAM module you can use the pamtest library we have implemented. It simplifies testing of modules. You can be combine it with the cmocka unit testing framework or you can use the provided Python bindings to write tests for your module in Python.
pam_wrapper is activated and controlled by environment variables. You can set the following variables:
- If you load the pam_wrapper and enable it with setting PAM_WRAPPER=1 all PAM calls will be wrapped so you are able to specify a directory with the service files pam_wrapper should be using.
- The directory to read PAM service files from.
If you want to use pam_matrix (see below) or want to test your own PAM module you need to specify the absolute path to your module in the service files.
If you need to see what is going on in pam_wrapper itself or try to find a bug, you can enable logging support in pam_wrapper if you built it with debug symbols.
- • 0 = ERROR
- • 1 = WARNING
- • 2 = DEBUG
- • 3 = TRACE
- If this option is set to 1, then pam_wrapper won't delete its temporary directories. Mostly useful for pam_wrapper development.
A service file for pam_wrapper should look like this:
auth required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb account required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb password required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb session required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb
The name of the file should represent the service name used by your PAM application.
We offer a module to make testing of PAM applications easier. You find more information in the pam_matrix(8) manpage.