xref: /freebsd/contrib/openpam/doc/man/pam_getenvlist.3 (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1.\" Generated from pam_getenvlist.c by gendoc.pl
2.\" $Id: pam_getenvlist.c 648 2013-03-05 17:54:27Z des $
3.Dd September 12, 2014
4.Dt PAM_GETENVLIST 3
5.Os
6.Sh NAME
7.Nm pam_getenvlist
8.Nd returns a list of all the PAM environment variables
9.Sh LIBRARY
10.Lb libpam
11.Sh SYNOPSIS
12.In sys/types.h
13.In security/pam_appl.h
14.Ft "char **"
15.Fn pam_getenvlist "pam_handle_t *pamh"
16.Sh DESCRIPTION
17The
18.Fn pam_getenvlist
19function returns a copy of the given PAM context's
20environment list as a pointer to an array of strings.
21The last element in the array is
22.Dv NULL .
23The pointer is suitable for assignment to
24.Va environ .
25.Pp
26The array and the strings it lists are allocated using
27.Xr malloc 3 ,
28and
29should be released using
30.Xr free 3
31after use:
32.Pp
33.Bd -literal
34    char **envlist, **env;
35
36    envlist = environ;
37    environ = pam_getenvlist(pamh);
38    /* do something nifty */
39    for (env = environ; *env != NULL; env++)
40        free(*env);
41    free(environ);
42    environ = envlist;
43.Ed
44.Sh RETURN VALUES
45The
46.Fn pam_getenvlist
47function returns
48.Dv NULL
49on failure.
50.Sh SEE ALSO
51.Xr free 3 ,
52.Xr malloc 3 ,
53.Xr pam 3 ,
54.Xr pam_getenv 3 ,
55.Xr pam_putenv 3 ,
56.Xr pam_setenv 3 ,
57.Xr environ 7
58.Sh STANDARDS
59.Rs
60.%T "X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules"
61.%D "June 1997"
62.Re
63.Sh AUTHORS
64The
65.Fn pam_getenvlist
66function and this manual page were
67developed for the
68.Fx
69Project by ThinkSec AS and Network Associates Laboratories, the
70Security Research Division of Network Associates, Inc.\& under
71DARPA/SPAWAR contract N66001-01-C-8035
72.Pq Dq CBOSS ,
73as part of the DARPA CHATS research program.
74.Pp
75The OpenPAM library is maintained by
76.An Dag-Erling Sm\(/orgrav Aq des@des.no .
77