/usr/share/doc/pam-devel/html
NameSizeModeActions
adg-author.html30980644editdlrm
adg-copyright.html36240644editdlrm
adg-example.html36760644editdlrm
adg-files.html22390644editdlrm
adg-glossary.html32860644editdlrm
adg-interface-by-app-expected.html624720644editdlrm
adg-interface-of-app-expected.html84570644editdlrm
adg-interface-programming-notes.html26140644editdlrm
adg-interface.html50190644editdlrm
adg-introduction-description.html33730644editdlrm
adg-introduction-synopsis.html26830644editdlrm
adg-introduction.html20640644editdlrm
adg-libpam-functions.html134490644editdlrm
adg-libpam_misc.html34210644editdlrm
adg-overview.html83570644editdlrm
adg-porting.html43060644editdlrm
adg-security-conv-function.html23460644editdlrm
adg-security-library-calls.html32030644editdlrm
adg-security-resources.html29030644editdlrm
adg-security-service-name.html45350644editdlrm
adg-security-user-identity.html55120644editdlrm
adg-security.html38240644editdlrm
adg-see-also.html22140644editdlrm
Linux-PAM_ADG.html86130644editdlrm
Linux-PAM_MWG.html88030644editdlrm
mwg-author.html30750644editdlrm
mwg-copyright.html36030644editdlrm
mwg-example.html20050644editdlrm
mwg-expected-by-module-item.html464570644editdlrm
mwg-expected-by-module-other.html83520644editdlrm
mwg-expected-by-module.html41170644editdlrm
mwg-expected-of-module-acct.html61870644editdlrm
mwg-expected-of-module-auth.html109680644editdlrm
mwg-expected-of-module-chauthtok.html79770644editdlrm
mwg-expected-of-module-overview.html64370644editdlrm
mwg-expected-of-module-session.html71260644editdlrm
mwg-expected-of-module.html43740644editdlrm
mwg-introduction-description.html39710644editdlrm
mwg-introduction-synopsis.html20280644editdlrm
mwg-introduction.html20320644editdlrm
mwg-see-also.html22310644editdlrm
mwg-see-options.html29960644editdlrm
mwg-see-programming-libs.html30150644editdlrm
mwg-see-programming-sec.html91410644editdlrm
mwg-see-programming-syslog.html47410644editdlrm
mwg-see-programming.html30780644editdlrm
Edit: /usr/share/doc/pam-devel/html/mwg-expected-of-module-chauthtok.html (7977B)
3.5. Authentication token management

3.5. Authentication token management

To be correctly initialized, PAM_SM_PASSWORD must be #define'd prior to including <security/pam_modules.h>. This will ensure that the prototypes for static modules are properly declared.

3.5.1. Service function to alter authentication token

#define PAM_SM_PASSWORD
#include <security/pam_modules.h>
int pam_sm_chauthtok(pamh,  
 flags,  
 argc,  
 argv); 
pam_handle_t *pamh;
int flags;
int argc;
const char **argv;
 

3.5.1.1. DESCRIPTION

The pam_sm_chauthtok function is the service module's implementation of the pam_chauthtok(3) interface.

This function is used to (re-)set the authentication token of the user.

Valid flags, which may be logically OR'd with PAM_SILENT, are:

PAM_SILENT

Do not emit any messages.

PAM_CHANGE_EXPIRED_AUTHTOK

This argument indicates to the module that the user's authentication token (password) should only be changed if it has expired. This flag is optional and must be combined with one of the following two flags. Note, however, the following two options are mutually exclusive.

PAM_PRELIM_CHECK

This indicates that the modules are being probed as to their ready status for altering the user's authentication token. If the module requires access to another system over some network it should attempt to verify it can connect to this system on receiving this flag. If a module cannot establish it is ready to update the user's authentication token it should return PAM_TRY_AGAIN, this information will be passed back to the application.

If the control value sufficient is used in the password stack, the PAM_PRELIM_CHECK section of the modules following that control value is not always executed.

PAM_UPDATE_AUTHTOK

This informs the module that this is the call it should change the authorization tokens. If the flag is logically OR'd with PAM_CHANGE_EXPIRED_AUTHTOK, the token is only changed if it has actually expired.

The PAM library calls this function twice in succession. The first time with PAM_PRELIM_CHECK and then, if the module does not return PAM_TRY_AGAIN, subsequently with PAM_UPDATE_AUTHTOK. It is only on the second call that the authorization token is (possibly) changed.

3.5.1.2. RETURN VALUES

PAM_AUTHTOK_ERR

The module was unable to obtain the new authentication token.

PAM_AUTHTOK_RECOVERY_ERR

The module was unable to obtain the old authentication token.

PAM_AUTHTOK_LOCK_BUSY

Cannot change the authentication token since it is currently locked.

PAM_AUTHTOK_DISABLE_AGING

Authentication token aging has been disabled.

PAM_PERM_DENIED

Permission denied.

PAM_TRY_AGAIN

Preliminary check was unsuccessful. Signals an immediate return to the application is desired.

PAM_SUCCESS

The authentication token was successfully updated.

PAM_USER_UNKNOWN

User unknown to password service.