HP-UX Reference (11i v2 07/12) - 3 Library Functions A-M (vol 6)

g
getprpwent(3) getprpwent(3)
NAME
getprpwent(), getprpwuid(), getprpwnam(), getprpwaid(), setprpwent(), endprpwent(), putprpwnam - mani-
pulate protected password database entries (for trusted systems only).
SYNOPSIS
#include <sys/types.h>
#include <hpsecurity.h>
#include <prot.h>
struct pr_passwd *getprpwent(void);
struct pr_passwd *getprpwuid(uid_t uid);
struct pr_passwd *getprpwnam(const char *name);
struct pr_passwd *getprpwaid(aid_t aid)
void setprpwent(void);
void endprpwent(void);
int putprpwnam(const char *name, struct pr_passwd *pr);
DESCRIPTION
getprpwent() , getprpwuid() , getprpwaid() , and getprpwnam() each returns a pointer to a
pr_passwd structure containing the broken-out fields of a line in the protected password database. Each
line in the database contains a pr_passwd structure, declared in the <prot.h> header file:
struct pr_field {
/* Identity: */
char fd_name[9]; /* uses 8 character maximum(and NULL) from utmp */
uid_t fd_uid; /* uid associated with name above */
char fd_encrypt[xxx]; /* encrypted password */
char fd_owner[9]; /* if a pseudo-user, the user accountable */
char fd_boot_auth; /* boot authorization */
mask_t fd_auditcntl; /* reserved */
mask_t audit_reserve1; /* reserved */
mask_t fd_auditdisp; /* reserved */
mask_t audit_reserve2; /* reserved */
aid_t fd_pw_audid; /* audit ID */
int fd_pw_audflg; /* audit flag */
/* Password maintenance parameters: */
time_t fd_min; /* minimum time between password changes */
int fd_maxlen; /* maximum length of password */
time_t fd_expire; /* expiration time duration in secs */
time_t fd_lifetime; /* account death duration in seconds */
time_t fd_schange; /* last successful change in secs past 1/1/70 */
time_t fd_uchange; /* last unsuccessful change */
time_t fd_acct_expire; /* absolute account lifetime in seconds */
time_t fd_max_llogin; /* max time allowed between logins */
time_t fd_pw_expire_warning; /* password expiration warning */
uid_t fd_pswduser; /* who can change this user’s password */
char fd_pick_pwd; /* can user pick his own passwords? */
char fd_gen_pwd; /* can user get passwords generated for him? */
char fd_restrict; /* should generated passwords be restricted? */
char fd_nullpw; /* is user allowed to have a NULL password? */
uid_t fd_pwchanger; /* who last changed user’s password */
long fd_pw_admin_num; /* password generation verifier */
char fd_gen_chars; /* can have password of random ASCII? */
char fd_gen_letters; /* can have password of random letters? */
char fd_tod[AUTH_TOD_SIZE]; /* times when user may login */
/* Login parameters: */
time_t fd_slogin; /* last successful login */
time_t fd_ulogin; /* last unsuccessful login */
char fd_suctty[14]; /* tty of last successful login */
HP-UX 11i Version 2: December 2007 Update 1 Hewlett-Packard Company 523