blob: f2839e3022875830b51bbe110029afdf34c7bd38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
Index: src/loader/loader.c
--- src/loader/loader.c.orig
+++ src/loader/loader.c
@@ -543,7 +543,7 @@ loader_get_driver_for_fd(int fd)
* user's problem, but this allows vc4 simulator to run on an i965 host,
* and may be useful for some touch testing of i915 on an i965 host.
*/
- if (geteuid() == getuid()) {
+ if (issetugid() == 0 && geteuid() == getuid()) {
driver = getenv("MESA_LOADER_DRIVER_OVERRIDE");
if (driver)
return strdup(driver);
@@ -607,7 +607,7 @@ loader_open_driver_lib(const char *driver_name,
const char *search_paths, *next, *end;
search_paths = NULL;
- if (geteuid() == getuid() && search_path_vars) {
+ if (issetugid() == 0 && geteuid() == getuid() && search_path_vars) {
for (int i = 0; search_path_vars[i] != NULL; i++) {
search_paths = getenv(search_path_vars[i]);
if (search_paths)
|