From d89c1426d563d929efebdb49ca8615bb45dfb694 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 26 May 2023 08:40:47 +0530 Subject: [PATCH] Dont use non-writeable locations containing kitty.conf as the config dir --- tools/utils/paths.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/utils/paths.go b/tools/utils/paths.go index b7a834110..d4695a61b 100644 --- a/tools/utils/paths.go +++ b/tools/utils/paths.go @@ -102,8 +102,10 @@ func ConfigDirForName(name string) (config_dir string) { if loc != "" { q := filepath.Join(loc, "kitty") if _, err := os.Stat(filepath.Join(q, name)); err == nil { - config_dir = q - return + if unix.Access(q, unix.W_OK) == nil { + config_dir = q + return + } } } }