FreeBSD/sys/security/audit/bsm_token.c
/*
 * Collects audit information for the current process and creates a subject
 * token from it.
 */
Collects audit information for the current process and creates a subject
token from it.
Collects audit information for the current process and creates a subject token from it .
token_t *
au_to_me(void)
{
	auditinfo_t auinfo;
	auditinfo_addr_t aia;
	if (getaudit_addr(&aia, sizeof(aia)) != 0) {
		if (errno == ENOSYS) {
			if (getaudit(&auinfo) != 0)
				return (NULL);
			return (au_to_subject32(auinfo.ai_auid, geteuid(),
				getegid(), getuid(), getgid(), getpid(),
				auinfo.ai_asid, &auinfo.ai_termid));
		} else {
			return (NULL);
		}
	}
	return (au_to_subject32_ex(aia.ai_auid, geteuid(), getegid(), getuid(),
		getgid(), getpid(), aia.ai_asid, &aia.ai_termid));
}
token_t * au_to_me ( void ) { auditinfo_t auinfo ; auditinfo_addr_t aia ; if ( getaudit_addr ( & aia , sizeof ( aia ) ) != 0 ) { if ( errno == ENOSYS ) { if ( getaudit ( & auinfo ) != 0 ) return ( NULL ) ; return ( au_to_subject32 ( auinfo . ai_auid , geteuid ( ) , getegid ( ) , getuid ( ) , getgid ( ) , getpid ( ) , auinfo . ai_asid , & auinfo . ai_termid ) ) ; } else { return ( NULL ) ; } } return ( au_to_subject32_ex ( aia . ai_auid , geteuid ( ) , getegid ( ) , getuid ( ) , getgid ( ) , getpid ( ) , aia . ai_asid , & aia . ai_termid ) ) ; }
Collects audit information for the current process and creates a subject
 token from it.
Collects audit information for the current process and creates a subject token from it .
/*
	 * Try to use getaudit_addr(2) first.  If this kernel does not support
	 * it, then fall back on to getaudit(2).
	 */ /* getaudit_addr(2) failed for some other reason. */