PAM_WRAPPER(1)
π PAM_WRAPPER π
okay so bestie, welcome to pam_wrapper(1) β the preloadable wrapper to test PAM applications and PAM Modules. yes, the one. she's iconic, she's a preloadable library, and she's about to make your testing era so much easier. π
β¨ SYNOPSIS β¨
LD_PRELOAD=libpam_wrapper.so PAM_WRAPPER=1
PAM_WRAPPER_SERVICE_DIR=/path_to_config ./myapplication
that's it. that's the whole vibe check. two lines and you're in. π¦
πΈ DESCRIPTION πΈ
so this tool lets you test either your PAM application or your PAM module. pick your fighter, both are valid. π
if you're testing a PAM application, we wrote a little something something called pam_matrix for you (more on her below, she's further down the page, keep scrolling babe).
if you're testing a PAM module, you can use the pamtest library we implemented β it simplifies testing of modules, lowkey a lifesaver. and the best part? you can combine it with the cmocka unit testing framework, or you can use the provided Python bindings to write tests for your module in Python. write your tests in Python, bestie. main character energy. πβ¨
π ENVIRONMENT VARIABLES π
pam_wrapper is activated and controlled by environment variables β that's the whole control panel, no config file drama. you can set the following variables:
PAM_WRAPPERβ if you load thepam_wrapperand enable it with settingPAM_WRAPPER=1, all PAM calls will be wrapped so you are able to specify a directory with the service filespam_wrappershould be using. no1, no wrapping. periodt.PAM_WRAPPER_SERVICE_DIRβ the directory to read PAM service files from. that's her whole job. π
if you want to use pam_matrix (see below, she's coming) or want to test your own PAM module, you need to specify the absolute path to your module in the service files. absolute. not relative. we said what we said.
PAM_WRAPPER_DEBUGLEVELβ if you need to see what is going on inpam_wrapperitself or try to find a bug, you can enable logging support inpam_wrapperif you built it with debug symbols. (that caveat is load-bearing, don't @ me.) the levels are:0= ERROR1= WARNING2= DEBUG3= TRACE
PAM_WRAPPER_USE_SYSLOGβ by default pam logs will go to thepam_wrapperDEBUG log level and will not be sent to the syslog. if you want to log to the syslog too, you can set this variable to1. yes, "to the syslog to" β that's the original phrasing, we're keeping it, she's quirky. π«ΆPAM_WRAPPER_KEEP_DIRβ if this option is set to1, thenpam_wrapperwon't delete its temporary directories. mostly useful forpam_wrapperdevelopment. your temp dirs, your choice. πPAM_WRAPPER_DISABLE_DEEPBINDβ this allows you to disable deep binding inpam_wrapper. useful for running valgrind tools or sanitizers like (address, undefined, thread). so if valgrind is being dramatic, this is your girl. π₯
π EXAMPLE π
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
copy that exactly, character for character. every line. auth, account, password, session. all four. no skipping the "boring" ones, bestie, they're all doing work. β¨
the name of the file should represent the service name used by your PAM application. so name it like it means it. π
and then:
LD_PRELOAD=./libpam_wrapper.so PAM_WRAPPER=1
PAM_WRAPPER_SERVICE_DIR=./pam_services ./my_pam_app
boom. running. slay. π
π§ PAM_MATRIX π§
we offer a module to make testing of PAM applications easier. you find more information in the pam_matrix(8) manpage. go read her next, she's got lore. π
π AUTHOR π
The Samba Team β Author. legends, honestly. not me being obsessed with the people who wrote the thing. π₯Ή
and that's the whole page, no cap. every variable, every value, every caveat β all of it, untouched, just with better vibes. π
okay bye bestie, go write some tests. this was pam_wrapper manual page PAM_WRAPPER(1), dated 2020-01-31, brought to you by the PAM_WRAPPER(1) source. mwah. ππβ¨
π¦ where this page comes from
- arch rolling: pam_wrapper 1.1.8-2 Β· GPL-3.0-or-later
- centos-stream 10: pam_wrapper 1.1.4-14.el10 Β· GPL-3.0-or-later
- centos-stream 9: pam_wrapper 1.1.4-2.el9 Β· GPLv3+
- centos-stream 9: pam_wrapper 1.1.4-2.el9 Β· GPLv3+
- debian bookworm: libpam-wrapper 1.1.4-1+b2 Β· GPL-3.0-or-later
- debian trixie: libpam-wrapper 1.1.7-1+b1 Β· GPL-3.0-or-later
- fedora 43: pam_wrapper 1.1.8-2.fc43 Β· GPL-3.0-or-later
- fedora 43: pam_wrapper 1.1.8-2.fc43 Β· GPL-3.0-or-later
- fedora 44: pam_wrapper 1.1.8-3.fc44 Β· GPL-3.0-or-later
- fedora 44: pam_wrapper 1.1.8-3.fc44 Β· GPL-3.0-or-later
- nixos 26.05: libpam-wrapper 1.1.5
- nixpkgs unstable: libpam-wrapper 1.1.5
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- opensuse-leap 16.0: pam_wrapper 1.1.7-160000.2.2 Β· GPL-3.0-or-later
- ubuntu jammy: libpam-wrapper 1.1.4-1build1 Β· GPL-3.0-or-later
- ubuntu noble: libpam-wrapper 1.1.5-1build3 Β· GPL-3.0-or-later
- ubuntu questing: libpam-wrapper 1.1.7-1build1
- ubuntu resolute: libpam-wrapper 1.1.8-1build1 Β· GPL-3.0-or-later
- ubuntu stonking: libpam-wrapper 1.1.8-1build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms