newpass Subroutine
Purpose
Generates a new password for a user.
Library
Security Library (libc.a)
Syntax
#include <usersec.h>
#include <userpw.h>
struct userpw *Password;
Description
The newpass subroutine generates a new password for the user specified by the Password parameter. This subroutine displays a dialogue to enter and confirm the user's new password.
Passwords can contain almost any legal value for a character but cannot contain (National Language Support (NLS) code points. Passwords cannot have more than the value specified by MAX_PASS.
If a password is successfully generated, a pointer to a buffer containing the new password is returned and the last update time is reset.
Parameters
Item | Description |
---|---|
Password | Specifies a user password structure. This structure is defined
in the userpw.h file and contains the following members:
|
Security
Item | Description |
---|---|
Policy: Authentication | To change a password, the invoker must be properly authenticated. |
Return Values
If a new password is successfully generated, a pointer to the new encrypted password is returned. If an error occurs, a null pointer is returned and the errno global variable is set to indicate the error.
Error Codes
The newpass subroutine fails if one or more of the following are true:
Item | Description |
---|---|
EINVAL | The structure passed to the newpass subroutine is invalid. |
ESAD | Security authentication is denied for the invoker. |
EPERM | The user is unable to change the password of a user with the PW_ADMCHG bit set, and the real user ID of the process is not the root user. |
ENOENT | The user is not properly defined in the database. |
Implementation Specifics
This subroutine is part of Base Operating System (BOS) Runtime.