From 181ce4a6b6876f16f356e37d7c626aaa2ae93135 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 17 Sep 2020 12:30:16 +0200 Subject: [PATCH] Actually create runtime path if needed This checked if the path was readable and only then tried creating it, which... isn't right. Fixes #7335. --- src/env.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/env.cpp b/src/env.cpp index 15bc174b1..339274cb2 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -1421,8 +1421,7 @@ wcstring env_get_runtime_path() { // Check that the path is actually usable. Technically this is guaranteed by the fdo spec but in // practice it is not always the case: see #1828 and #2222. - int mode = R_OK | W_OK | X_OK; - if (dir != nullptr && access(dir, mode) == 0 && check_runtime_path(dir) == 0) { + if (dir != nullptr && check_runtime_path(dir) == 0) { result = str2wcstring(dir); } else { // Don't rely on $USER being set, as setup_user() has not yet been called.