mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 21:21:39 +02:00
libGL: Fall back to DEFAULT_DRIVER_DIR properly.
After commit 6fd82f6fbd, we would
overwrite the libPath default value with NULL if libGL was running
non-setuid and none of the env vars were set.
Thanks to Magnus Kessler <Magnus.Kessler@gmx.net> for spotting it.
This commit is contained in:
parent
eecb3ab7c6
commit
03db9c8acb
1 changed files with 2 additions and 1 deletions
|
|
@ -145,13 +145,14 @@ static void *OpenDriver(const char *driverName)
|
|||
/* Attempt to make sure libGL symbols will be visible to the driver */
|
||||
glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL);
|
||||
|
||||
libPaths = DEFAULT_DRIVER_DIR;
|
||||
if (geteuid() == getuid()) {
|
||||
/* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
|
||||
libPaths = getenv("LIBGL_DRIVERS_PATH");
|
||||
if (!libPaths)
|
||||
libPaths = getenv("LIBGL_DRIVERS_DIR"); /* deprecated */
|
||||
}
|
||||
if (libPaths == NULL)
|
||||
libPaths = DEFAULT_DRIVER_DIR;
|
||||
|
||||
handle = NULL;
|
||||
for (p = libPaths; *p; p = next) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue