Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS® UNIX | both |
#include <pwd.h>
int __passwd(const char *username, const char *oldpass, const char *newpass);
int __passwd_applid(const char *username, const char *oldpass,
const char *newpass, const char *applid);
The __passwd() function verifies or changes the username password or the password phrase. The username is a NULL-terminated character string of 1 to 8 bytes. The oldpass is the current password or password phrase for user username, and is a NULL-terminated character string of a password or a password phrase. When newpass is NULL, then oldpass represents the password or password phrase to be verified, and no password or password phrase change is performed. Otherwise, newpass is a NULL-terminated character string of a password or a password phrase. Other installation-dependent restrictions on passwords or password phrases may apply, both in terms of length and content. Length restrictions may be imposed by the security product.
The __passwd_applid() function is equivalent to __passwd() with the added feature that it also allows the application identifier (APPLID) to be supplied that will be passed on to the security product to assist with authentication. When applid is NULL or a pointer to NULL, no application identifier will be passed on to the security product.
If the BPX.DAEMON facility class profile is defined, then all modules within the address space must be loaded from a controlled library. This includes all modules in the application and runtime libraries. See also "Checking Which Module is not Defined to Program Control" in z/OS UNIX System Services Planning.
If successful, __passwd() returns 0. When newpass is NULL, the password or the password phrase has been verified. When newpass is not NULL, the new password or password phrase has been set.
If a user specifies password for oldpass and new password phrase for newpass or password phrase for oldpass and new password for newpass, then __passwd() returns -1 and sets errno to EMVSPASSWORD and the current password or password phrase is not changed.
For more information, refer to the z/OS UNIX System Services Messages and Codes , z/OS UNIX System Services Programming: Assembler Callable Services Reference