Checks the validity of a user account.
Security Library (libc.a)
The ckuseracct subroutine checks the validity of the user account specified by the Name parameter. The Mode parameter gives the mode of the account usage, and the TTY parameter defines the terminal being used for the access. The ckuseracct subroutine checks for the following conditions:
The Mode parameter specifies other mode-specific checks.
Item | Description |
---|---|
Name | Specifies the login name of the user whose account is to be validated. |
Mode | Specifies the manner of usage. Valid values as defined in
the login.h file are listed below. The Mode parameter
must be one of these or 0:
|
TTY | Specifies the terminal of the originating activity. If this parameter is a null pointer or a null string, no TTY origin checking is done. |
Item | Description |
---|---|
Files Accessed: |
Mode | File |
---|---|
r | /etc/passwd |
r | /etc/security/user |
If the account is valid for the specified usage, the ckuseracct subroutine returns a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to the appropriate error code.
The ckuseracct subroutine fails if one or more of the following are true:
Item | Description |
---|---|
ENOENT | The user specified in the Name parameter does not have an account. |
ESTALE | The user's account is expired. |
EACCES | The specified terminal does not have access to the specified account. |
EACCES | The Mode parameter is S_SU, and the current process is not permitted to use the su command to access the specified user. |
EACCES | Access to the account is not permitted in the specified Mode. |
EINVAL | The Mode parameter is not one of S_LOGIN, S_SU, S_DAEMON, S_RLOGIN. |