summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-12-11 10:12:36 -0500
committerKristian Høgsberg <krh@redhat.com>2008-12-11 10:12:36 -0500
commit1cad8659b9e199209d0a4d8ba3b65e254d6e2871 (patch)
treecfa50927c4510f48381303d937833abbac42782e
parentbcdfe04b5da1a1bf289abeaca34cf9497452a77a (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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/eagle.c b/eagle.c
index 565047a..a5bc179 100644
--- a/eagle.c
+++ b/eagle.c
@@ -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;