On 14.02.2017 01:52, Timothy Arceri wrote:
From: Timothy Arceri <timothy.arc...@collabora.com>

 src/util/disk_cache.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 047a016..f26b81d 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -142,6 +142,10 @@ disk_cache_create(void)
    struct stat sb;
    size_t size;

+   /* If running as a users other than the real user disable cache */
+   if (geteuid() != getuid())
+      return NULL;

I've been wondering if this is really the authoritatively correct way to do this. I know this is how the loader does it, for example, but I recently stumbled over code in the X server that has some additional checks and uses extra functions, including optionally a function called issetugid(), in hw/xfree86/common/xf86Init.c.

Any idea about an authoritative source on this? I don't want to cargo-cult something overly complex, but at the same time, the above really does check less (e.g., it doesn't look at gids).


    /* A ralloc context for transient data during this invocation. */
    local = ralloc_context(NULL);
    if (local == NULL)

mesa-dev mailing list

Reply via email to