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

Function audit_pipe_preselect

freebsd/security/audit/audit_pipe.c:430–453  ·  view source on GitHub ↗

* Determine whether there exists a pipe interested in a record with specific * properties. */

Source from the content-addressed store, hash-verified

428 * properties.
429 */
430int
431audit_pipe_preselect(au_id_t auid, au_event_t event, au_class_t class,
432 int sorf, int trail_preselect)
433{
434 struct audit_pipe *ap;
435
436 /* Lockless read to avoid acquiring the global lock if not needed. */
437 if (TAILQ_EMPTY(&audit_pipe_list))
438 return (0);
439
440 AUDIT_PIPE_LIST_RLOCK();
441 TAILQ_FOREACH(ap, &audit_pipe_list, ap_list) {
442 AUDIT_PIPE_LOCK(ap);
443 if (audit_pipe_preselect_check(ap, auid, event, class, sorf,
444 trail_preselect)) {
445 AUDIT_PIPE_UNLOCK(ap);
446 AUDIT_PIPE_LIST_RUNLOCK();
447 return (1);
448 }
449 AUDIT_PIPE_UNLOCK(ap);
450 }
451 AUDIT_PIPE_LIST_RUNLOCK();
452 return (0);
453}
454
455/*
456 * Append individual record to a queue -- allocate queue-local buffer, and

Callers 3

audit_commitFunction · 0.70
audit_syscall_enterFunction · 0.70
audit_proc_coredumpFunction · 0.70

Calls 1

Tested by

no test coverage detected