[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    getauusernam(3) manual page Table of Contents

Name

getauusernam, getauuserent, setauuser, endauuser - get audit_user entry

Synopsis

cc [ flag ... ] file ... -lbsm -lsocket -lnsl -lintl [ library ... ]

#include <sys/param.h>
#include <bsm/libbsm.h>

struct au_user_ent *getauusernam(const char *name);

struct au_user_ent *getauuserent(void);

void setauuser(void);

void endauuser(void);

struct au_user_ent *getauusernam_r(au_user_ent * u, const char *name);

struct au_user_ent *getauuserent_r(au_user_ent *u);

Availability

The functionality described in this man page is available only if the Basic Security Module (BSM) has been enabled. See bsmconv(1M) for more information.

MT-Level

MT-Safe with exceptions.

The functions getauusernam() and getauuserent() are not MT-safe. However, the functions getauusernam_r() and getauuserent_r() provide the same functionality with an MT-Safe interfaces.

Description

getauuserent() , getauusernam() , getauuserent_r() , and getauusernam_r() each return an audit_user entry.

getauusernam() and getauusernam_r() searche for an audit_user entry with a given login name name.

getauuserent() and getauuserent_r() enumerate audit_user entries: successive calls to these functions will return either successive audit_user entries or NULL .

setauuser() ‘‘rewinds’’ to the beginning of the enumeration of audit_user entries. Calls to getauusernam() and getauusernam_r() may leave the enumeration in an indeterminate state, so setauuser() should be called before the first getauuserent() or getauuserent_r() .

endauuser() may be called to indicate that audit_user processing is complete; the system may then close any open audit_user file, deallocate storage, and so forth.

The two functions getauuserent_r() and getauusernam_r() both take an argument u , which is a pointer to an au_user_ent. This is the pointer that is returned on successful function calls.

The internal representation of an audit_user entry is an au_user_ent structure defined in <bsm/libbsm.h> with the following members:


    char    *au_name;
    au_mask_t    au_always;
    au_mask_t    au_never;

Return Values

getauusernam() returns a pointer to a struct au_user_ent if it successfully locates the requested entry; otherwise it returns NULL .

getauuserent() returns a pointer to a struct au_user_ent if it successfully enumerates an entry; otherwise it returns NULL . indicating the end of the enumeration.

Files

/etc/security/audit_user
Stores per-user audit event mask
/etc/passwd
Stores user-id to username mappings

See Also

bsmconv(1M) , getpwnam(3C) , audit_user(4) , passwd(4)

Notes

All information for the functions getauuserent() and getauusernam() is contained in a static area, so it must be copied if it is to be saved.


Table of Contents