AUDIT\_SET\_LOGINUID\_IMMUTABLE(3) Linux Audit API AUDIT\_SET\_LOGINUID\_IMMUTABLE(3)

# [NAME](#NAME)

audit\_set\_loginuid\_immutable - make loginuid value immutable

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;libaudit.h&gt;**

**int audit\_set\_loginuid\_immutable(int fd);"**

# [DESCRIPTION](#DESCRIPTION)

**audit\_set\_loginuid\_immutable**() locks the loginuid so that it can no longer be changed. The descriptor *fd* must be an open audit netlink socket. This call is equivalent to using **audit\_set\_feature**() to enable and lock the **AUDIT\_FEATURE\_LOGINUID\_IMMUTABLE** bit.

# [RETURN VALUE](#RETURN_VALUE)

The return value is &lt;= 0 on error, otherwise it is the netlink sequence id number.

# [SEE ALSO](#SEE_ALSO)

[**audit\_set\_feature**(3)](/man/os/audit/audit_set_feature.3), [**audit\_open**(3)](/man/os/audit/audit_open.3).

# [AUTHOR](#AUTHOR)

Steve Grubb

July 2025 Red Hat

---

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