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