Skip to content
BSD syscall#356

svc · unix #356

setaudit

Legacy 32-bit setter for the calling process's audit information.

Prototype

int setaudit(struct auditinfo *auditinfo);

Returns: int

Arguments

NameTypeDirDescription
auditinfostruct auditinfo-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard356
xnu-1699.24.8macOS 10.7 Lion356
xnu-1486.2.11356
xnu-1504.15.3356
xnu-1504.3.12356
xnu-1504.7.4356
xnu-1504.9.17356
xnu-1504.9.26356
xnu-1504.9.37356
xnu-1699.22.73356
xnu-1699.22.81356
xnu-1699.24.23356
xnu-1699.26.8356
xnu-1699.32.7356

Notes

Counterpart of getaudit(2); writes a struct auditinfo into the calling thread. Requires the audit_control privilege because changing the auid or asid alters how every subsequent audit record is attributed. Superseded by setaudit_addr(2); kept for binary compatibility with pre-Leopard tooling.

Detection

Emits AUE_SETAUDIT; any successful call rewriting auid from a process other than login/sshd/sudo is a strong tampering indicator.

Related APIs

setaudit_addrgetauditsetauidaudit_session_join