NAME
setauduser — start auditing the current process as owned by a given user
SYNOPSIS
#include <sys/audit.h>
int setauduser(const char *user, const char *stime);
DESCRIPTION
setauduser()
sets
audit tag
which uniquely identifies
the user for the current process.
The
user
argument points to the name of the login user associated
with the current process, and must not exceed the longest
user name that HP-UX supports.
sysconf(_SC_LOGIN_NAME_MAX)
can be used to dynamically get the longest user name that
HP-UX supports.
The
stime
argument points to time of authentication in the format
YYYYMMDDhhmm, Coordinated Universal Time (UTC). If
stime
is a null pointer, the UTC of the current time is used.
Programs using this routine must be compiled with
-lsec.
Security Restrictions
This call requires the user to be superuser or to possess the
SELFAUDIT
privilege.
See
privileges(5)
for details.
RETURN VALUE
setauduser()
returns the following values:
- n
Successful completion.
n
is the length of
audit tag
accepted by the kernel.
- -1
Failure.
errno
is set to indicate the error.
ERRORS
If
setauduser
fails,
errno
is set to one of the following values:
- EINVAL
user
is NULL, or the length of
user
exceeds the longest user name that HP-UX supports.
- EINVAL
The length of
stime
is not equal to
MAX_TIME_LEN
bytes.
See
<sys/audit.h>.
- EPERM
The caller is not a superuser or a privileged process.
AUTHOR
setauduser()
was developed by HP.