{
    "mode": "man",
    "parameter": "pam_putenv",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/pam_putenv/3/json",
    "generated": "2026-10-04T16:16:10Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "pamputenv - set or change PAM environment variable\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "#include <security/pam_appl.h>",
                    "content": "int pamputenv(pamhandlet *pamh, const char *namevalue);\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "The pamputenv function is used to add or change the value of PAM environment variables as\nassociated with the pamh handle.\n\nThe pamh argument is an authentication handle obtained by a prior call to pamstart(). The\nnamevalue argument is a single NUL terminated string of one of the following forms:\n\nNAME=value of variable\nIn this case the environment variable of the given NAME is set to the indicated value:\nvalue of variable. If this variable is already known, it is overwritten. Otherwise it is\nadded to the PAM environment.\n\nNAME=\nThis function sets the variable to an empty value. It is listed separately to indicate\nthat this is the correct way to achieve such a setting.\n\nNAME\nWithout an '=' the pamputenv() function will delete the corresponding variable from the\nPAM environment.\n\npamputenv() operates on a copy of namevalue, which means in contrast to putenv(3), the\napplication 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                                    05/07/2023                                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"
        }
    ]
}