AUDIT\_NAME\_TO\_ACTION(3) Linux Audit API AUDIT\_NAME\_TO\_ACTION(3)

# [NAME](#NAME)

audit\_name\_to\_action, audit\_action\_to\_name - Convert the action name to the numeric action value to each other

# [SYNOPSIS](#SYNOPSIS)

```
#include <libaudit.h>
```

```
int audit_name_to_action(const char *action);
```

```
const char *audit_action_to_name(int action);
```

# [DESCRIPTION](#DESCRIPTION)

**audit\_name\_to\_action**() converts the action name ("never", "possible", "always") to the numeric action value (AUDIT\_NEVER, AUDIT\_POSSIBLE, AUDIT\_ALWAYS). *action* is the action name.

**audit\_action\_to\_name**() converts the numeric action value (AUDIT\_NEVER, AUDIT\_POSSIBLE, AUDIT\_ALWAYS) to the action name ("never", "possible", "always"). *action* is the numeric action value

# [RETURN VALUE](#RETURN_VALUE)

**audit\_name\_to\_action**() returns -1 if an error occurs; otherwise, the return value is the numeric action value.

**audit\_action\_to\_name**() returns NULL if an error occurs; otherwise, the return value is the action name.

# [AUTHOR](#AUTHOR)

Steve Grubb

Mar 2022 Red Hat

---

Document: audit_name_to_action(3) from audit 4.2.1-r2 (Chainguard OS)
Source: https://github.com/linux-audit/audit-userspace
