setauduser.3 (2010 09)
s
setauduser(3) setauduser(3)
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 Univer-
sal 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 sup-
ports.
[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.
SEE ALSO
getaudid(2), setaudid(2), sysconf(2), getauduser(3), audit(5), privileges(5).
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1