The method_getpasswd Interface

char *method_getpasswd (void *handlep, char *user);

The handlep parameter is a handle to the load module opened with the method_open interface. The user parameter points to the requested user.

method_getpasswd provides the encrypted password string for a user account. The crypt subroutine is used to create this string and encrypt the user-supplied password for comparison.

method_getpasswd is called when method_authenticate would have been called, but is undefined. The result of this call is compared to the result of a call to the crypt subroutine using the response to the password prompt. See the description of the method_authenticate interface for a description of the response parameter.

method_getpasswd returns a pointer to an encrypted password on success. On failure a NULL pointer is returned and the global variable errno is set to indicate the error. A value of ENOSYS is used when the module cannot return an encrypted password. A value of EPERM is used when the caller does not have the required permissions to retrieve the encrypted password. A value of ENOENT is used when the requested user does not exist.