getaaent(3) — LIBRARY FUNCTIONS
NAME
getaaent, getaanam, setaaent, endaaent, fgetaaent − gets audit alias entry
SYNOPSIS
#include <aualias.h>
#include <stdio.h>
struct aualias ∗getaaent ()
struct aualias ∗getaanam (name)
char ∗name;
int setaaent ()
void endaaent ()
struct aualias ∗fgetaaent (f)
FILE ∗f;
DESCRIPTION
getaaent and getaanam both return a pointer to an object with the aualias structure containing the fields of a line in the /var/security/audit_aliases file. Each line in the file corresponds to an aualias structure, declared in the <aualias.h> header file:
struct aualias
{
char∗aa_name;
char∗aa_aualias;
};
The fields have the meanings defined in audit_alias(4).
getaaent, when first called, returns a pointer to the first aualias structure in the file. Thereafter, it returns a pointer to the next aualias structure in the file, so successive calls can be used to search the entire file.
getaanam searches from the beginning of the file until an audit alias name matching name is found and returns a pointer to the particular structure in which it was found.
If an end-of-file or an error is encountered on reading, the two preceding functions will return a NULL pointer.
If the audit aliases file is already open, a call to setaaent will have the effect of rewinding the audit aliases file to allow repeated searches. Otherwise, setaaent will open the audit aliases file.
endaaent is called to close the audit aliases file when processing is complete.
fgetaaent returns a pointer to the next aualias structure that matches the format of /var/security/audit_aliases in the stream f.
getaaent, getaanam, and fgetaaent do not expand aliases contained within an alias definition. To convert an alias definition to an audit mask (with further alias expansion), see a_create_mask(3).
Lines in the audit aliases file that are blank or begin with a pound character (#) are ignored.
Except for endaaent, these functions all require super-user privilege.
FILES
/var/security/audit_aliasesaudit aliases file
SEE ALSO
aualiasmgmt(1M), a_create_mask(3A), audit_alias(4)
DIAGNOSTICS
A NULL pointer is returned on EOF or error, except for setaaent which returns -1 on error.
WARNINGS
The above routines use <stdio.h>, which causes them to increase the size of programs more than might be expected if the programs do not otherwise use standard I/O.
All information is contained in a static area, so it must be copied if it is to be saved.
(Security Enhancement)