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