docs: Add man pages for modules
[slow/pam_wrapper.git] / doc / pam_wrapper.1.txt
1 pam_wrapper(1)
2 ==============
3 :revdate: 2015-11-04
4
5 NAME
6 ----
7
8 pam_wrapper - A preloadable wrapper to test PAM applications and PAM Modules
9
10 SYNOPSIS
11 --------
12
13 LD_PRELOAD=libpam_wrapper.so PAM_WRAPPER=1 PAM_WRAPPER_CONFDIR=/path_to_config *./myapplication*
14
15 DESCRIPTION
16 -----------
17
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.
24
25 ENVIRONMENT VARIABLES
26 ---------------------
27
28 pam_wrapper is activated and controlled by environment variables. You can set
29 the following variables:
30
31 *PAM_WRAPPER*::
32
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.
36
37 *PAM_WRAPPER_CONFDIR*::
38
39 The directory to read PAM service files from.
40
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.
43
44 *PAM_WRAPPER_DEBUGLEVEL*::
45
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
48 debug symbols.
49
50 - 0 = ERROR
51 - 1 = WARNING
52 - 2 = DEBUG
53 - 3 = TRACE
54
55 *PAM_WRAPPER_KEEP_DIR*::
56
57 If this option is set to 1, then pam_wrapper won't delete its temporary
58 directories. Mostly useful for pam_wrapper development.
59
60 EXAMPLE
61 -------
62
63 A service file for pam_wrapper should look like this:
64
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 --------------------------------------
71
72 The name of the file should represent the service name used by your PAM
73 application.
74
75 LD_PRELOAD=./libpam_wrapper.so PAM_WRAPPER=1 PAM_WRAPPER_SERVICE_DIR=pam_services/ ./my_pam_app
76
77 PAM_MATRIX
78 ----------
79
80 We offer a module to make testing of PAM applications easier. You find more
81 information in the pam_matrix(8) manpage.