uid_t
auth_token_get_uid(auth_token_t auth)
{
- return auth ? auth->auditInfo.euid : (uid_t)-2;
+ assert(auth); // marked non-null
+ return auth->auditInfo.euid;
}
pid_t
auth_token_get_pid(auth_token_t auth)
{
- return auth ? auth->auditInfo.pid : -1;
+ assert(auth); // marked non-null
+ return auth->auditInfo.pid;
}
session_t
bool auth_token_is_creator(auth_token_t auth, process_t proc)
{
+ assert(proc); // marked non-null
__block bool creator = false;
- if (proc) {
- dispatch_sync(auth->dispatch_queue, ^{
- if (auth->creator == proc) {
- creator = true;
- }
- });
- }
+ dispatch_sync(auth->dispatch_queue, ^{
+ if (auth->creator == proc) {
+ creator = true;
+ }
+ });
return creator;
}