MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sys_getaudit

Function sys_getaudit

freebsd/security/audit/audit_syscalls.c:648–670  ·  view source on GitHub ↗

* System calls to get and set process audit information. */ ARGSUSED */

Source from the content-addressed store, hash-verified

646 */
647/* ARGSUSED */
648int
649sys_getaudit(struct thread *td, struct getaudit_args *uap)
650{
651 struct auditinfo ai;
652 struct ucred *cred;
653 int error;
654
655 cred = td->td_ucred;
656 if (jailed(cred))
657 return (ENOSYS);
658 error = priv_check(td, PRIV_AUDIT_GETAUDIT);
659 if (error)
660 return (error);
661 if (cred->cr_audit.ai_termid.at_type == AU_IPv6)
662 return (E2BIG);
663 bzero(&ai, sizeof(ai));
664 ai.ai_auid = cred->cr_audit.ai_auid;
665 ai.ai_mask = cred->cr_audit.ai_mask;
666 ai.ai_asid = cred->cr_audit.ai_asid;
667 ai.ai_termid.machine = cred->cr_audit.ai_termid.at_addr[0];
668 ai.ai_termid.port = cred->cr_audit.ai_termid.at_port;
669 return (copyout(&ai, uap->auditinfo, sizeof(ai)));
670}
671
672/* ARGSUSED */
673int

Callers

nothing calls this directly

Calls 4

jailedFunction · 0.85
bzeroFunction · 0.85
priv_checkFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected