Imported Upstream version 2.4.3
[platform/upstream/audit.git] / docs / audit_log_user_command.3
1 .TH "AUDIT_LOG_USER_COMMAND" "3" "Feb 2007" "Red Hat" "Linux Audit API"
2 .SH NAME
3 audit_log_user_command \- log a user command
4 .SH SYNOPSIS
5 .B #include <libaudit.h>
6 .sp
7 .B int audit_log_user_command(int audit_fd, int type, const char *command, const char *tty, int result);
8
9 .SH DESCRIPTION
10 This function will log a command to the audit system using a predefined message format. It encodes the command as the audit system expects for untrusted strings. This function should be used by all apps need to record commands. The function parameters are as follows:
11
12 .nf
13 audit_fd - The fd returned by audit_open
14 type - type of message, ex: AUDIT_USYS_CONFIG, AUDIT_USER_LOGIN
15 command - the command being logged
16 tty - The tty of the user, if NULL will attempt to figure out
17 result - 1 is "success" and 0 is "failed"
18 .fi
19
20 .SH "RETURN VALUE"
21
22 It returns the sequence number which is > 0 on success or <= 0 on error.
23
24 .SH "ERRORS"
25
26 This function returns \-1 on failure. Examine errno for more info.
27
28 .SH "SEE ALSO"
29
30 .BR audit_log_user_message (3),
31 .BR audit_log_user_comm_message (3),
32 .BR audit_log_acct_message (3),
33 .BR audit_log_user_avc_message (3),
34 .BR audit_log_semanage_message (3).
35
36 .SH AUTHOR
37 Steve Grubb