[Mesa-dev] [PATCH 67/65] glsl: disable on disk shader cache when running as root

Timothy Arceri timothy.arceri at collabora.com
Sat Apr 30 05:32:32 UTC 2016


---
 src/compiler/glsl/cache.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/glsl/cache.c b/src/compiler/glsl/cache.c
index a6a9e47..dd53f4e 100644
--- a/src/compiler/glsl/cache.c
+++ b/src/compiler/glsl/cache.c
@@ -141,6 +141,10 @@ cache_create(void)
    struct stat sb;
    size_t size;
 
+   /* If running as root disable cache */
+   if (geteuid() == 0)
+      return NULL;
+
    /* A ralloc context for transient data during this invocation. */
    local = ralloc_context(NULL);
    if (local == NULL)
-- 
2.5.5



More information about the mesa-dev mailing list