{
    "content": [
        {
            "type": "text",
            "text": "# pam_get_item (man)\n\n## NAME\n\npamgetitem - getting PAM information\n\n## SYNOPSIS\n\n#include <security/pammodules.h>\nint pamgetitem(const pamhandlet *pamh, int itemtype, const void item);\n\n## DESCRIPTION\n\nThe pamgetitem function allows applications and PAM service modules to access and retrieve\nPAM information of itemtype. Upon successful return, item contains a pointer to the value of\nthe corresponding item. Note, this is a pointer to the actual data and should not be\nfree()'ed or over-written! The following values are supported for itemtype:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **RETURN VALUES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "pam_get_item",
        "section": "",
        "mode": "man",
        "summary": "pamgetitem - getting PAM information",
        "synopsis": "#include <security/pammodules.h>\nint pamgetitem(const pamhandlet *pamh, int itemtype, const void item);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "pamsetitem",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/pamsetitem/3/json"
            },
            {
                "name": "pamstrerror",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/pamstrerror/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 84,
                "subsections": []
            },
            {
                "name": "RETURN VALUES",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pamgetitem - getting PAM information\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "#include <security/pammodules.h>\n\nint pamgetitem(const pamhandlet *pamh, int itemtype, const void item);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The pamgetitem function allows applications and PAM service modules to access and retrieve\nPAM information of itemtype. Upon successful return, item contains a pointer to the value of\nthe corresponding item. Note, this is a pointer to the actual data and should not be\nfree()'ed or over-written! The following values are supported for itemtype:\n\nPAMSERVICE\nThe service name (which identifies that PAM stack that the PAM functions will use to\nauthenticate the program).\n\nPAMUSER\nThe username of the entity under whose identity service will be given. That is, following\nauthentication, PAMUSER identifies the local entity that gets to use the service. Note,\nthis value can be mapped from something (eg., \"anonymous\") to something else (eg.\n\"guest119\") by any module in the PAM stack. As such an application should consult the\nvalue of PAMUSER after each call to a PAM function.\n\nPAMUSERPROMPT\nThe string used when prompting for a user's name. The default value for this string is a\nlocalized version of \"login: \".\n\nPAMTTY\nThe terminal name: prefixed by /dev/ if it is a device file; for graphical, X-based,\napplications the value for this item should be the $DISPLAY variable.\n\nPAMRUSER\nThe requesting user name: local name for a locally requesting user or a remote user name\nfor a remote requesting user.\n\nGenerally an application or module will attempt to supply the value that is most strongly\nauthenticated (a local account before a remote one. The level of trust in this value is\nembodied in the actual authentication stack associated with the application, so it is\nultimately at the discretion of the system administrator.\n\nPAMRUSER@PAMRHOST should always identify the requesting user. In some cases, PAMRUSER\nmay be NULL. In such situations, it is unclear who the requesting entity is.\n\nPAMRHOST\nThe requesting hostname (the hostname of the machine from which the PAMRUSER entity is\nrequesting service). That is PAMRUSER@PAMRHOST does identify the requesting user. In\nsome applications, PAMRHOST may be NULL. In such situations, it is unclear where the\nauthentication request is originating from.\n\nPAMAUTHTOK\nThe authentication token (often a password). This token should be ignored by all module\nfunctions besides pamsmauthenticate(3) and pamsmchauthtok(3). In the former function\nit is used to pass the most recent authentication token from one stacked module to\nanother. In the latter function the token is used for another purpose. It contains the\ncurrently active authentication token.\n\nPAMOLDAUTHTOK\nThe old authentication token. This token should be ignored by all module functions except\npamsmchauthtok(3).\n\nPAMCONV\nThe pamconv structure. See pamconv(3).\n\nThe following additional items are specific to Linux-PAM and should not be used in portable\napplications:\n\nPAMFAILDELAY\nA function pointer to redirect centrally managed failure delays. See pamfaildelay(3).\n\nPAMXDISPLAY\nThe name of the X display. For graphical, X-based applications the value for this item\nshould be the $DISPLAY variable. This value may be used independently of PAMTTY for\npassing the name of the display.\n\nPAMXAUTHDATA\nA pointer to a structure containing the X authentication data required to make a\nconnection to the display specified by PAMXDISPLAY, if such information is necessary.\nSee pamxauthdata(3).\n\nPAMAUTHTOKTYPE\nThe default action is for the module to use the following prompts when requesting\npasswords: \"New UNIX password: \" and \"Retype UNIX password: \". The example word UNIX can\nbe replaced with this item, by default it is empty. This item is used by\npamgetauthtok(3).\n\nIf a service module wishes to obtain the name of the user, it should not use this function,\nbut instead perform a call to pamgetuser(3).\n\nOnly a service module is privileged to read the authentication tokens, PAMAUTHTOK and\nPAMOLDAUTHTOK.\n",
                "subsections": []
            },
            "RETURN VALUES": {
                "content": "PAMBADITEM\nThe application attempted to set an undefined or inaccessible item.\n\nPAMBUFERR\nMemory buffer error.\n\nPAMPERMDENIED\nThe value of item was NULL.\n\nPAMSUCCESS\nData was successful updated.\n\nPAMSYSTEMERR\nThe pamhandlet passed as first argument was invalid.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "pamsetitem(3), pamstrerror(3)\n\n\n\nLinux-PAM Manual                             06/08/2020                              PAMGETITEM(3)",
                "subsections": []
            }
        }
    }
}