--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->
LONG PamAcctMgmt(
struct PamHandle * handle,
ULONG flags );
Run the "account" stack: may this user use this service now, from here. Call after PamAuthenticate().
LONG PamAuthenticate(
struct PamHandle * handle,
ULONG flags );
Run the service's "auth" stack: establish that the user is who they claim to be. The modules obtain the user name and the password through the conversation unless both are already set.
flags - PAM_SILENT, PAM_DISALLOW_NULL_AUTHTOK.
PAM_SUCCESS or a failure code; PAM_AUTH_ERR for a wrong password or unknown user, PAM_MAXTRIES when locked out.
Nothing about the calling task changes; see PamSetCred().
LONG PamChAuthTok(
struct PamHandle * handle,
ULONG flags );
Change the user's password: the "password" stack is run twice, with PAM_PRELIM_CHECK (may it be changed, is the old one right) and then with PAM_UPDATE_AUTHTOK, which replays the modules of the first pass. Applications may not pass either flag themselves. A token that was used to authenticate on the same handle is taken as the old password; the new one is asked for twice when the conversation is interactive.
LONG PamCloseSession(
struct PamHandle * handle,
ULONG flags );
Run the "session" stack's close functions.
LONG PamConverse(
struct PamHandle * handle,
LONG nmsg,
const struct pam_message ** msgs,
struct pam_response ** resp );
Module side: put messages and questions to the person through the transaction's conversation. On PAM_SUCCESS *resp is an array of nmsg responses; free it with FreeVec() after wiping, or let PamGetAuthTok()/PamGetUser() do the work for the usual cases.
LONG PamEnd(
struct PamHandle * handle,
LONG status );
Finish a transaction. Module data is released (with its cleanup functions, which receive status) and the tokens are wiped.
PAM_SUCCESS.
LONG PamFailDelay(
struct PamHandle * handle,
ULONG usec );
Ask for a delay before PamAuthenticate() returns a failure. The largest request wins. The delay is applied only to interactive transactions; a network service gets its refusal at once.
LONG PamGetAuthTok(
struct PamHandle * handle,
ULONG item,
CONST_STRPTR * tok,
CONST_STRPTR prompt );
Module side: the token (PAM_AUTHTOK or PAM_OLDAUTHTOK), asking for it unechoed through the conversation if it is not set yet. In the update pass of PamChAuthTok() a new PAM_AUTHTOK is asked for twice and PAM_AUTHTOK_ERR returned if the two differ.
LONG PamGetData(
struct PamHandle * handle,
CONST_STRPTR name,
APTR * data );
Module side: retrieve data stored with PamSetData().
PAM_SUCCESS or PAM_NO_MODULE_DATA.
LONG PamGetItem(
struct PamHandle * handle,
ULONG item,
APTR * value );
Read an item. The pointer returned belongs to the transaction.
PAM_SUCCESS, PAM_BAD_ITEM.
LONG PamGetUser(
struct PamHandle * handle,
CONST_STRPTR * user,
CONST_STRPTR prompt );
Module side: the user name, asking through the conversation if it is not set yet (prompt, else PAM_USER_PROMPT, else "login: ").
void PamLog(
struct PamHandle * handle,
LONG level,
CONST_STRPTR text );
Module side: record a message. It is posted to log.resource (provider "pam.library", the service as sub-component) together with the user, when the resource is present, and to the debug output.
level - PAM_LOG_ERROR, PAM_LOG_WARNING, PAM_LOG_INFO, PAM_LOG_DEBUG. text - the message; control characters are replaced.
LONG PamOpenSession(
struct PamHandle * handle,
ULONG flags );
Run the "session" stack's open functions (records, variables, assigns, profile).
LONG PamSetCred(
struct PamHandle * handle,
LONG flags );
Establish (PAM_ESTABLISH_CRED) or drop (PAM_DELETE_CRED) the credentials of the authenticated user on the task of PAM_AROS_TASK. With security.library this changes the task's owner. Call after a successful PamAuthenticate().
LONG PamSetData(
struct PamHandle * handle,
CONST_STRPTR name,
APTR data,
PamDataCleanup cleanup );
Module side: attach private data to the transaction under a name. Replacing data calls the old cleanup with PAM_SUCCESS; PamEnd() calls it with the final status.
LONG PamSetItem(
struct PamHandle * handle,
ULONG item,
APTR value );
Set an item of the transaction. String items are copied.
PAM_SUCCESS, PAM_BAD_ITEM, PAM_BUF_ERR.
struct PamHandle * PamStartA(
CONST_STRPTR service,
CONST_STRPTR user,
struct Hook * conv,
struct TagItem * tags );
struct PamHandle * PamStart(
CONST_STRPTR service,
CONST_STRPTR user,
struct Hook * conv,
TAG tag, ... );
Begin an authentication transaction for a service. The service name selects the file SYS:Security/PAM/<service> that lists the modules to run; without one, "other" is used, and without that a built-in default that depends on whether security.library is present and configured.
service - name of the service ("login", "envoy", "sshd", ...).
user - the user name, or NULL to let the modules ask.
conv - conversation hook, or NULL for one of the library's own
(see <libraries/pam.h>).
tags - PAMT_#? tags.
The handle, or NULL.
CONST_STRPTR PamStrError(
struct PamHandle * handle,
LONG code );
Text for a result code. handle may be NULL.