8 pam_wrapper - A preloadable wrapper to test PAM applications and PAM Modules
13 LD_PRELOAD=libpam_wrapper.so PAM_WRAPPER=1 PAM_WRAPPER_CONFDIR=/path_to_config *./myapplication*
18 This tool allows you to either test your PAM application or module. For testing
19 PAM applications we have written a simple PAM module called pam_matrix
20 (see below). If you plan to test a PAM module you can use the pamtest library
21 we have implemented. It simplifies testing of modules. You can be combine it
22 with the cmocka unit testing framework or you can use the provided Python
23 bindings to write tests for your module in Python.
28 pam_wrapper is activated and controlled by environment variables. You can set
29 the following variables:
33 If you load the pam_wrapper and enable it with setting PAM_WRAPPER=1 all PAM
34 calls will be wrapped so you are able to specify a directory with the service
35 files pam_wrapper should be using.
37 *PAM_WRAPPER_CONFDIR*::
39 The directory to read PAM service files from.
41 If you want to use pam_matrix (see below) or want to test your own PAM module
42 you need to specify the absolute path to your module in the service files.
44 *PAM_WRAPPER_DEBUGLEVEL*::
46 If you need to see what is going on in pam_wrapper itself or try to find a
47 bug, you can enable logging support in pam_wrapper if you built it with
55 *PAM_WRAPPER_KEEP_DIR*::
57 If this option is set to 1, then pam_wrapper won't delete its temporary
58 directories. Mostly useful for pam_wrapper development.
63 A service file for pam_wrapper should look like this:
65 --------------------------------------
66 auth required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb
67 account required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb
68 password required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb
69 session required /usr/lib/pam_wrapper/pam_matrix.so passdb=/path/to/pdb
70 --------------------------------------
72 The name of the file should represent the service name used by your PAM
75 LD_PRELOAD=./libpam_wrapper.so PAM_WRAPPER=1 PAM_WRAPPER_SERVICE_DIR=pam_services/ ./my_pam_app
80 We offer a module to make testing of PAM applications easier. You find more
81 information in the pam_matrix(8) manpage.