diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-12-11 10:12:36 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-12-11 10:12:36 -0500 |
commit | 1cad8659b9e199209d0a4d8ba3b65e254d6e2871 (patch) | |
tree | cfa50927c4510f48381303d937833abbac42782e | |
parent | bcdfe04b5da1a1bf289abeaca34cf9497452a77a (diff) |
Prevent setuid applications from setting the driver path.
Also support LIBGL_DRIVERS_PATH if set, but only if EAGLE_DRIVER_PATH
isn't set.
-rw-r--r-- | eagle.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -111,7 +111,12 @@ eglLoadDriver(EGLDisplay display, const char *driverName) const char *path; int i; - path = getenv("EAGLE_DRIVER_PATH"); + /* Don't allow setuid applications to override the driver path. */ + if (geteuid() == getuid()) { + path = getenv("EAGLE_DRIVER_PATH"); + if (path == NULL) + getenv("LIBGL_DRIVERS_PATH"); + } if (path == NULL) path = driDriverPath; |