* Determine whether there exists a pipe interested in a record with specific * properties. */
| 428 | * properties. |
| 429 | */ |
| 430 | int |
| 431 | audit_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 |
no test coverage detected