From e32cb99dcb9ccb96965b314a3e9257113ad31c81 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 30 Jun 2023 16:27:20 +0100 Subject: [PATCH] util/disk_cache: fix ~/.cache/ permissions XDG Base Dir spec [1] says: > If, when attempting to write a file, the destination directory is > non-existent an attempt should be made to create it with permission > `0700`. If the destination directory exists already the permissions > should not be changed. [1] https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4103 Fixes: 87ab26b2ab35a29d446a ("glsl: Add initial functions to implement an on-disk cache") Signed-off-by: Eric Engestrom Reviewed-by: Alyssa Rosenzweig Part-of: --- src/util/disk_cache_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/disk_cache_os.c b/src/util/disk_cache_os.c index e3596f2b4b0..31586fcec39 100644 --- a/src/util/disk_cache_os.c +++ b/src/util/disk_cache_os.c @@ -124,7 +124,7 @@ mkdir_if_needed(const char *path) } } - int ret = mkdir(path, 0755); + int ret = mkdir(path, 0700); if (ret == 0 || (ret == -1 && errno == EEXIST)) return 0;