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