kernel/thread: Clarify permissions checking logic.

No functional change intended; but if I missed a case,
it will now be caught by the "return false" instead of
the "return true", which is a better default.
This commit is contained in:
Augustin Cavalier
2019-09-13 22:10:23 -04:00
parent 750b43405a
commit e315daa9c1
+5 -5
View File
@@ -3008,12 +3008,12 @@ thread_check_permissions(const Thread* currentThread, const Thread* thread,
if (thread->team->id == team_get_kernel_team_id())
return false;
if (thread->team != currentThread->team
&& currentThread->team->effective_uid != 0
&& thread->team->real_uid != currentThread->team->real_uid)
return false;
if (thread->team == currentThread->team
|| currentThread->team->effective_uid == 0
|| thread->team->real_uid == currentThread->team->real_uid)
return true;
return true;
return false;
}