<p>By default, the main library will look for drivers in the directory where
the drivers are installed to. This variable specifies a list of
colon-separated directories where the main library will look for drivers, in
-addition to the default directory.</p>
+addition to the default directory. This variable is ignored for setuid/setgid
+binaries.</p>
</li>
<p>This variable specifies a full path to an EGL driver and it forces the
specified EGL driver to be loaded. It comes in handy when one wants to test a
-specific driver.</p>
+specific driver. This variable is ignored for setuid/setgid binaries.</p>
</li>
int ret;
p = getenv("EGL_DRIVERS_PATH");
+#if defined(_EGL_PLATFORM_POSIX)
+ if (p && (geteuid() != getuid() || getegid() != getgid())) {
+ _eglLog(_EGL_DEBUG,
+ "ignore EGL_DRIVERS_PATH for setuid/setgid binaries");
+ p = NULL;
+ }
+#endif /* _EGL_PLATFORM_POSIX */
+
if (p) {
ret = snprintf(buffer, sizeof(buffer),
"%s:%s", p, _EGL_DRIVER_SEARCH_DIR);
env = getenv("EGL_DRIVER");
#if defined(_EGL_PLATFORM_POSIX)
- if (env && strchr(env, '/'))
+ if (env && strchr(env, '/')) {
search_path = "";
-#endif
+ if ((geteuid() != getuid() || getegid() != getgid())) {
+ _eglLog(_EGL_DEBUG,
+ "ignore EGL_DRIVER for setuid/setgid binaries");
+ env = NULL;
+ }
+ }
+#endif /* _EGL_PLATFORM_POSIX */
if (!env)
return EGL_FALSE;