{
    "mode": "man",
    "parameter": "PAM_SM_SETCRED",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/PAM_SM_SETCRED/3/json",
    "generated": "2026-06-13T20:05:07Z",
    "synopsis": "#include <security/pammodules.h>\nint pamsmsetcred(pamhandlet *pamh, int flags, int argc, const char argv);",
    "sections": {
        "NAME": {
            "content": "pamsmsetcred - PAM service function to alter credentials\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "#include <security/pammodules.h>\n\nint pamsmsetcred(pamhandlet *pamh, int flags, int argc, const char argv);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The pamsmsetcred function is the service module's implementation of the pamsetcred(3)\ninterface.\n\nThis function performs the task of altering the credentials of the user with respect to the\ncorresponding authorization scheme. Generally, an authentication module may have access to\nmore information about a user than their authentication token. This function is used to make\nsuch information available to the application. It should only be called after the user has\nbeen authenticated but before a session has been established.\n\nValid flags, which may be logically OR'd with PAMSILENT, are:\n\nPAMSILENT\nDo not emit any messages.\n\nPAMESTABLISHCRED\nInitialize the credentials for the user.\n\nPAMDELETECRED\nDelete the credentials associated with the authentication service.\n\nPAMREINITIALIZECRED\nReinitialize the user credentials.\n\nPAMREFRESHCRED\nExtend the lifetime of the user credentials.\n\nThe way the auth stack is navigated in order to evaluate the pamsetcred() function call,\nindependent of the pamsmsetcred() return codes, is exactly the same way that it was\nnavigated when evaluating the pamauthenticate() library call. Typically, if a stack entry\nwas ignored in evaluating pamauthenticate(), it will be ignored when libpam evaluates the\npamsetcred() function call. Otherwise, the return codes from each module specific\npamsmsetcred() call are treated as required.\n",
            "subsections": []
        },
        "RETURN VALUES": {
            "content": "PAMCREDUNAVAIL\nThis module cannot retrieve the user's credentials.\n\nPAMCREDEXPIRED\nThe user's credentials have expired.\n\nPAMCREDERR\nThis module was unable to set the credentials of the user.\n\nPAMSUCCESS\nThe user credential was successfully set.\n\nPAMUSERUNKNOWN\nThe user is not known to this authentication module.\n\nThese, non-PAMSUCCESS, return values will typically lead to the credential stack failing.\nThe first such error will dominate in the return value of pamsetcred().\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pam(3), pamauthenticate(3), pamsetcred(3), pamsmauthenticate(3), pamstrerror(3), PAM(8)\n\n\n\nLinux-PAM Manual                             06/08/2020                            PAMSMSETCRED(3)",
            "subsections": []
        }
    },
    "summary": "pamsmsetcred - PAM service function to alter credentials",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "pam",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pam/3/json"
        },
        {
            "name": "pamauthenticate",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamauthenticate/3/json"
        },
        {
            "name": "pamsetcred",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamsetcred/3/json"
        },
        {
            "name": "pamsmauthenticate",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamsmauthenticate/3/json"
        },
        {
            "name": "pamstrerror",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/pamstrerror/3/json"
        },
        {
            "name": "PAM",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/PAM/8/json"
        }
    ]
}