GETPWAENT(3) — C LIBRARY FUNCTIONS
NAME
getpwaent, getpwanam, setpwaent, endpwaent, fgetpwaent − get password adjunct file entry
SYNOPSIS
#include <sys/types.h>
#include <sys/label.h>
#include <sys/audit.h>
#include <pwdadj.h>
struct passwd_adjunct ∗getpwaent()
struct passwd_adjunct ∗getpwanam(name)
char ∗name;
struct passwd_adjunct ∗fgetpwaent(f)
FILE ∗f;
void setpwaent()
void endpwaent()
DESCRIPTION
Both getpwaent() and getpwanam() return a pointer to an object with the following structure containing the broken-out fields of a line in the password adjunct file. Each line in the file contains a passwd_adjunct structure, declared in the <pwdadj.h> header file:
struct passwd_adjunct {
char ∗pwa_name;
char ∗pwa_passwd;
blabel_t pwa_minimum;
blabel_t pwa_maximum;
blabel_t pwa_def;
audit_state_t pwa_au_always;
audit_state_t pwa_au_never;
int pwa_version;
};
When first called, getpwaent() returns a pointer to a passwd_adjunct structure describing data from the first line in the file. Thereafter, it returns a pointer to a passwd_adjunct structure describing data from the next line in the file. So successive calls can be used to search the entire file.
getpwanam() searches from the beginning of the file until it finds a login name matching name, then returns a pointer to the particular structure in which it was found.
Calling getpwaent() rewinds the password adjunct file to allow repeated searches. Calling endpwaent() closes the password adjunct file when processing is complete.
DIAGNOSTICS
A NULL pointer is returned on end-of-file or error.
SEE ALSO
getpwent(3), getgrent(3), passwd.adjunct(5), ypserv(8)
BUGS
All information is contained in a static area, so it must be copied if it is to be saved.
Sun Release 4.0 — Last change: 14 December 1987