'\" t .\" Title: pam_get_items .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 2015-11-04 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "PAM_GET_ITEMS" "8" "2015\-11\-04" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pam_get_items \- A PAM test module to retrieve module\-specific PAM items .SH "SYNOPSIS" .sp pam_get_items\&.so .SH "DESCRIPTION" .sp PAM modules store data in PAM \fIitems\fR\&. These items are only accessible from module context, not application context as they might include private data (PAM_AUTHTOK normally contains the password)\&. But when testing PAM modules, it\(cqs often nice to make sure a PAM module under test sets items for the next module the way it\(cqs supposed to\&. The pam_get_items module makes this possible by exporting all PAM items as environment variables using pam_putenv\&. The environment variable name is the same as the constant name of the PAM item\&. .SH "OPTIONS" .sp None .SH "MODULE TYPES PROVIDED" .sp All module types (\fBaccount\fR, \fBauth\fR, \fBpassword\fR and \fBsession\fR) are provided\&. .SH "EXAMPLE" .sp Consider an example that tests that pam_unix puts the password it reads onto PAM stack\&. The test service file would contain: .sp .if n \{\ .RS 4 .\} .nf auth required pam_unix\&.so auth required pam_get_items\&.so .fi .if n \{\ .RE .\} .sp Then the test would run the PAM conversation and afterwards call: .sp .if n \{\ .RS 4 .\} .nf pam_getenv(pamh, "PAM_AUTHTOK"); .fi .if n \{\ .RE .\} .sp To retrieve the password\&.