PamAuthenticate()
Synopsis
LONG PamAuthenticate(
struct PamHandle * handle,
ULONG flags );
Function
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.
Result
PAM_SUCCESS or a failure code; PAM_AUTH_ERR for a wrong password or
unknown user, PAM_MAXTRIES when locked out.
Notes
Nothing about the calling task changes; see PamSetCred().
PamChAuthTok()
Synopsis
LONG PamChAuthTok(
struct PamHandle * handle,
ULONG flags );
Function
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.
PamConverse()
Synopsis
LONG PamConverse(
struct PamHandle * handle,
LONG nmsg,
const struct pam_message ** msgs,
struct pam_response ** resp );
Function
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.
PamGetAuthTok()
Synopsis
LONG PamGetAuthTok(
struct PamHandle * handle,
ULONG item,
CONST_STRPTR * tok,
CONST_STRPTR prompt );
Function
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.
PamGetItem()
Synopsis
LONG PamGetItem(
struct PamHandle * handle,
ULONG item,
APTR * value );
Function
Read an item. The pointer returned belongs to the transaction.
Result
PAM_SUCCESS, PAM_BAD_ITEM.
PamGetUser()
Synopsis
LONG PamGetUser(
struct PamHandle * handle,
CONST_STRPTR * user,
CONST_STRPTR prompt );
Function
Module side: the user name, asking through the conversation if it
is not set yet (prompt, else PAM_USER_PROMPT, else "login: ").
PamLog()
Synopsis
void PamLog(
struct PamHandle * handle,
LONG level,
CONST_STRPTR text );
Function
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.
PamSetItem()
Synopsis
LONG PamSetItem(
struct PamHandle * handle,
ULONG item,
APTR value );
Function
Set an item of the transaction. String items are copied.
Result
PAM_SUCCESS, PAM_BAD_ITEM, PAM_BUF_ERR.
PamStartA()
Synopsis
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, ... );
Function
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.
Result
The handle, or NULL.