* System calls to get and set process audit information. */ ARGSUSED */
| 646 | */ |
| 647 | /* ARGSUSED */ |
| 648 | int |
| 649 | sys_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 */ |
| 673 | int |
nothing calls this directly
no test coverage detected