{
    "mode": "man",
    "parameter": "PAM_GETENVLIST",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/PAM_GETENVLIST/3/json",
    "generated": "2026-06-12T14:55:43Z",
    "synopsis": "#include <security/pamappl.h>\nchar pamgetenvlist(pamhandlet *pamh);",
    "sections": {
        "NAME": {
            "content": "pamgetenvlist - getting the PAM environment\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "#include <security/pamappl.h>\n\nchar pamgetenvlist(pamhandlet *pamh);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The pamgetenvlist function returns a complete copy of the PAM environment as associated with\nthe handle pamh. The PAM environment variables represent the contents of the regular\nenvironment variables of the authenticated user when service is granted.\n\nThe format of the memory is a malloc()'d array of char pointers, the last element of which is\nset to NULL. Each of the non-NULL entries in this array point to a NUL terminated and\nmalloc()'d char string of the form: \"name=value\".\n\nIt should be noted that this memory will never be free()'d by libpam. Once obtained by a call\nto pamgetenvlist, it is the responsibility of the calling application to free() this memory.\n\nIt is by design, and not a coincidence, that the format and contents of the returned array\nmatches that required for the third argument of the execle(3) function call.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "The pamgetenvlist function returns NULL on failure.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pamstart(3), pamgetenv(3), pamputenv(3), pam(7)\n\n\n\nLinux-PAM Manual                             06/08/2020                            PAMGETENVLIST(3)",
            "subsections": []
        }
    },
    "summary": "pamgetenvlist - getting the PAM environment",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "pamstart",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamstart/3/json"
        },
        {
            "name": "pamgetenv",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamgetenv/3/json"
        },
        {
            "name": "pamputenv",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamputenv/3/json"
        },
        {
            "name": "pam",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pam/7/json"
        }
    ]
}