PAM_WRAPPER(1) | PAM_WRAPPER(1) |
pam_wrapper - A preloadable wrapper to test PAM applications and PAM Modules
LD_PRELOAD=libpam_wrapper.so PAM_WRAPPER=1 PAM_WRAPPER_SERVICE_DIR=/path_to_config ./myapplication
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:
PAM_WRAPPER
PAM_WRAPPER_SERVICE_DIR
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.
PAM_WRAPPER_DEBUGLEVEL
PAM_WRAPPER_USE_SYSLOG
PAM_WRAPPER_KEEP_DIR
PAM_WRAPPER_DISABLE_DEEPBIND
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.
LD_PRELOAD=./libpam_wrapper.so PAM_WRAPPER=1 PAM_WRAPPER_SERVICE_DIR=./pam_services ./my_pam_app
We offer a module to make testing of PAM applications easier. You find more information in the pam_matrix(8) manpage.
The Samba Team
2020-01-31 |