diff options
Diffstat (limited to 'src/gbm')
-rw-r--r-- | src/gbm/backends/dri/gbm_dri.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 347bc997f4a..47e62f3caca 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -211,9 +211,19 @@ dri_load_driver(struct gbm_dri_device *dri) char *get_extensions_name; search_paths = NULL; + /* don't allow setuid apps to use LIBGL_DRIVERS_PATH or GBM_DRIVERS_PATH */ if (geteuid() == getuid()) { - /* don't allow setuid apps to use GBM_DRIVERS_PATH */ + /* Read GBM_DRIVERS_PATH first for compatibility, but LIBGL_DRIVERS_PATH + * is recommended over GBM_DRIVERS_PATH. + */ search_paths = getenv("GBM_DRIVERS_PATH"); + + /* Read LIBGL_DRIVERS_PATH if GBM_DRIVERS_PATH was not set. + * LIBGL_DRIVERS_PATH is recommended over GBM_DRIVERS_PATH. + */ + if (search_paths == NULL) { + search_paths = getenv("LIBGL_DRIVERS_PATH"); + } } if (search_paths == NULL) search_paths = DEFAULT_DRIVER_DIR; |