#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()
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 setpwaent() rewinds the password adjunct file to allow repeated searches. Calling endpwaent() closes the password adjunct file when processing is complete.
Because read access is required on /etc/security/passwd.adjunct, getpwaent() and getpwanam() will fail unless the calling process has effective UID of root.
All information is contained in a static area, so it must be copied if it is to be saved.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97