Import OpenPAM Resedacea.
[dragonfly.git] / contrib / openpam / doc / man / pam_getenvlist.3
1 .\" Generated from pam_getenvlist.c by gendoc.pl
2 .\" $OpenPAM: pam_getenvlist.c 938 2017-04-30 21:34:42Z des $
3 .Dd April 30, 2017
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
15 The
16 .Fn pam_getenvlist
17 function returns a copy of the given PAM context's
18 environment list as a pointer to an array of strings.
19 The last element in the array is
20 .Dv NULL .
21 The pointer is suitable for assignment to
22 .Va environ .
23 .Pp
24 The array and the strings it lists are allocated using
25 .Xr malloc 3 ,
26 and
27 should be released using
28 .Xr free 3
29 after 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
43 The
44 .Fn pam_getenvlist
45 function returns
46 .Dv NULL
47 on 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
62 The
63 .Fn pam_getenvlist
64 function and this manual page were
65 developed for the
66 .Fx
67 Project by ThinkSec AS and Network Associates Laboratories, the
68 Security Research Division of Network Associates, Inc.\& under
69 DARPA/SPAWAR contract N66001-01-C-8035
70 .Pq Dq CBOSS ,
71 as part of the DARPA CHATS research program.
72 .Pp
73 The OpenPAM library is maintained by
74 .An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .