[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 1
passwdexpired Subroutine
Purpose
Checks the user's password to determine if it has expired.
Syntax
passwdexpired (UserName, Message)
char *UserName;
char **Message;
Description
The passwdexpired subroutine checks a user's password to determine if it has expired. The subroutine checks the registry variable in the /etc/security/user file to ascertain where the user is administered. If the registry variable is not defined, the passwdexpired subroutine checks the local, NIS, and DCE databases for the user definition and expiration time.
The passwdexpired subroutine may pass back informational messages, such as how many days remain until password expiration.
Parameters
UserName |
Specifies the user's name whose password is to be checked. |
Message |
Points to a pointer that the passwdexpired subroutine allocates memory for and fills in. This string is suitable for printing and issues messages, such as in how many days the password will expire. |
Return Values
Upon successful completion, the passwdexpired subroutine returns a value of 0. If this subroutine fails, it returns one of the following values:
1 |
Indicates that the password is expired, and the user must change it. |
2 |
Indicates that the password is expired, and only a system administrator may change it. |
-1 |
Indicates that an internal error has occurred, such as a memory allocation (malloc) failure or database corruption. |
Error Codes
The passwdexpired subroutine fails if one or more of the following values is true:
ENOENT |
Indicates that the user could not be found. |
EPERM |
Indicates that the user did not have permission to check password expiration. |
ENOMEM |
Indicates that memory allocation (malloc) failed. |
EINVAL |
Indicates that the parameters are not valid. |
Implementation Specifics
This subroutine is part of Base Operating System (BOS) Runtime.
Related Information
The authenticate subroutine.
The login command.
[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]