freebsd_network: Avoid using kernel thread structures in priv_check.

We can just use geteuid() here which does the exact same thing.
May help with testing #17337.
This commit is contained in:
Augustin Cavalier
2021-10-23 13:16:36 -04:00
parent 994794f2d4
commit 91337da63b
+1 -3
View File
@@ -4,8 +4,6 @@
*/
#include <thread.h>
#include <sys/param.h>
#include <sys/priv.h>
@@ -20,7 +18,7 @@ priv_check(struct thread *thread, int privilegeLevel)
// Note: The thread parameter is ignored intentionally (cf. the comment in
// pcpu.h). Currently calling this function is only valid for the current
// thread.
if (thread_get_current_thread()->team->effective_uid == 0)
if (geteuid() == 0)
return ENOERR;
return EPERM;