pam_sm_authenticate - service provider implementation for pam_authenticate
#include <security/pam_appl.h>
#include <security/pam_modules.h>
int pam_sm_authenticate(
pam_handle_t *pamh,
int flags,
int argc,
const char **argv
);
In response to a call topam_authenticate() , the PAM framework callspam_sm_authenticate() from the modules listed in the PAM configuration. The authentication provider supplies the back-end functionality for this interface function.The function,
pam_sm_authenticate() , is called to verify the identity of the current user. The user is usually required to enter a password or similar authentication token depending upon the authentication scheme configured within the system. The user in question is typically specified by a prior call topam_start() , and is referenced by the authentication handle, pamh.If the user is unknown to the authentication service, the service module should mask this error and continue to prompt the user for a password. It should then return the error, [PAM_USER_UNKNOWN].
Before returning,
pam_sm_authenticate() should callpam_get_item() and retrieve PAM_AUTHTOK. If it has not been set before (that is, the value is NULL),pam_sm_authenticate() should set it to the password entered by the user usingpam_set_item() .An authentication module may save the authentication status (success or reason for failure) as state in the authentication handle using
pam_set_data() . This information is intended for use bypam_setcred() .
- Note:
- Modules should not retry the authentication in the event of a failure. Applications handle authentication retries. To limit the number of retries, modules may maintain an internal retry count and return a [PAM_MAXTRIES] error.
The arguments for
pam_sm_authenticate() are:
- pamh (in)
The PAM authentication handle, obtained from a previous call topam_start() .
- flags (in)
The following flags may be passed in topam_sm_authenticate() :
- PAM_SILENT
The authentication service should not generate any messages.
- PAM_DISALLOW_NULL_AUTHTOK
The authentication service should return [PAM_AUTH_ERR] if the user has a null authentication token.
- argc (in)
The argc argument represents the number of module options defined in the PAM configuration.
- argv (in)
Specifies the module options, which are interpreted and processed by the authentication module. Refer to the specific module manual pages for the various available options. If any unknown option is passed in, the module should log the error and ignore the option.
The following PAM status codes shall be returned:
- [PAM_SUCCESS]
Successful completion.
- [PAM_AUTH_ERR]
The user could not be authenticated.
- [PAM_USER_UNKNOWN]
No account for the present user.
- [PAM_CRED_INSUFFICIENT]
Cannot access authentication data because of insufficient credentials.
- [PAM_AUTHINFO_UNAVAIL]
Cannot retrieve authentication information.
- [PAM_IGNORE]
Ignore underlying authentication module regardless of whether the control flag is required, optional, or sufficient.
- [PAM_CONV_ERR]
Conversation failure.
- [PAM_SERVICE_ERR]
Error in underlying service module.
- [PAM_MAXTRIES]
The module can return this error to limit the number of retries.
- [PAM_PERM_DENIED]
The caller does not possess the required authority.
- [PAM_SYSTEM_ERR]
System error.
- [PAM_BUF_ERR]
Memory buffer error.
[??] Some characters or strings that appear in the printed document are not easily representable using HTML.
Contents | Next section | Index |