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