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

Function audit_pipe_open

freebsd/security/audit/audit_pipe.c:671–685  ·  view source on GitHub ↗

* Audit pipe open method. Explicit privilege check isn't used as this * allows file permissions on the special device to be used to grant audit * review access. Those file permissions should be managed carefully. */

Source from the content-addressed store, hash-verified

669 * review access. Those file permissions should be managed carefully.
670 */
671static int
672audit_pipe_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
673{
674 struct audit_pipe *ap;
675 int error;
676
677 ap = audit_pipe_alloc();
678 if (ap == NULL)
679 return (ENOMEM);
680 fsetown(td->td_proc->p_pid, &ap->ap_sigio);
681 error = devfs_set_cdevpriv(ap, audit_pipe_dtor);
682 if (error != 0)
683 audit_pipe_dtor(ap);
684 return (error);
685}
686
687/*
688 * Audit pipe ioctl() routine. Handle file descriptor and audit pipe layer

Callers

nothing calls this directly

Calls 3

audit_pipe_allocFunction · 0.85
fsetownFunction · 0.85
audit_pipe_dtorFunction · 0.85

Tested by

no test coverage detected