xnu-4903.241.1/bsd/security/audit/audit_pipe.c
/*
 * Set the per-pipe mask for a specific auid.  Add a new entry if needed;
 * otherwise, update the current entry.
 */
Set the per-pipe mask for a specific auid.  Add a new entry if needed;
otherwise, update the current entry.
Set the per - pipe mask for a specific auid . Add a new entry if needed ; otherwise update the current entry .
static void
audit_pipe_preselect_set(struct audit_pipe *ap, au_id_t auid, au_mask_t mask)
{
	struct audit_pipe_preselect *app, *app_new;
	app_new = malloc(sizeof(*app_new), M_AUDIT_PIPE_PRESELECT, M_WAITOK);
	AUDIT_PIPE_LOCK(ap);
	app = audit_pipe_preselect_find(ap, auid);
	if (app == NULL) {
		app = app_new;
		app_new = NULL;
		app->app_auid = auid;
		TAILQ_INSERT_TAIL(&ap->ap_preselect_list, app, app_list);
	}
	app->app_mask = mask;
	AUDIT_PIPE_UNLOCK(ap);
	if (app_new != NULL)
		free(app_new, M_AUDIT_PIPE_PRESELECT);
}
static void audit_pipe_preselect_set ( struct audit_pipe * ap , au_id_t auid , au_mask_t mask ) { struct audit_pipe_preselect * app , * app_new ; app_new = malloc ( sizeof ( * app_new ) , M_AUDIT_PIPE_PRESELECT , M_WAITOK ) ; AUDIT_PIPE_LOCK ( ap ) ; app = audit_pipe_preselect_find ( ap , auid ) ; if ( app == NULL ) { app = app_new ; app_new = NULL ; app -> app_auid = auid ; TAILQ_INSERT_TAIL ( & ap -> ap_preselect_list , app , app_list ) ; } app -> app_mask = mask ; AUDIT_PIPE_UNLOCK ( ap ) ; if ( app_new != NULL ) free ( app_new , M_AUDIT_PIPE_PRESELECT ) ; }
Set the per-pipe mask for a specific auid.
Set the per - pipe mask for a specific auid .
/*
	 * Pessimistically assume that the auid doesn't already have a mask
	 * set, and allocate.  We will free it if it is unneeded.
	 */