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