{
    "mode": "info",
    "parameter": "pam_putenv",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/pam_putenv/json",
    "generated": "2026-07-05T11:43:53Z",
    "synopsis": "#include <security/pamappl.h>\nint pamputenv(pamhandlet *pamh, const char *namevalue);",
    "sections": {
        "NAME": {
            "content": "pamputenv - set or change PAM environment variable\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "#include <security/pamappl.h>\n\nint pamputenv(pamhandlet *pamh, const char *namevalue);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The pamputenv function is used to add or change the value of PAM\nenvironment variables as associated with the pamh handle.\n\nThe pamh argument is an authentication handle obtained by a prior call\nto pamstart(). The namevalue argument is a single NUL terminated\nstring of one of the following forms:\n\nNAME=value of variable\nIn this case the environment variable of the given NAME is set to\nthe indicated value: value of variable. If this variable is already\nknown, it is overwritten. Otherwise it is added to the PAM\nenvironment.\n\nNAME=\nThis function sets the variable to an empty value. It is listed\nseparately to indicate that this is the correct way to achieve such\na setting.\n\nNAME\nWithout an '=' the pamputenv() function will delete the\ncorresponding variable from the PAM environment.\n\npamputenv() operates on a copy of namevalue, which means in contrast\nto putenv(3), the application is responsible for freeing the data.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "PAMPERMDENIED\nArgument namevalue given is a NULL pointer.\n\nPAMBADITEM\nVariable requested (for deletion) is not currently set.\n\nPAMABORT\nThe pamh handle is corrupt.\n\nPAMBUFERR\nMemory buffer error.\n\nPAMSUCCESS\nThe environment variable was successfully updated.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pamstart(3), pamgetenv(3), pamgetenvlist(3), pamstrerror(3), pam(7)\n\nLinux-PAM Manual                  06/08/2020                     PAMPUTENV(3)",
            "subsections": []
        }
    },
    "summary": "pamputenv - set or change PAM environment variable",
    "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": "pamgetenvlist",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamgetenvlist/3/json"
        },
        {
            "name": "pamstrerror",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamstrerror/3/json"
        },
        {
            "name": "pam",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pam/7/json"
        }
    ]
}