Skip to content

Commit 241b61c

Browse files
committed
gh-1070: Build 6613 considers profile directory read-only under certain conditions
1 parent bdb61f3 commit 241b61c

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

far/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
--------------------------------------------------------------------------------
2+
drkns 2026-02-04 20:37:59+00:00 - build 6642
3+
4+
1. gh-1070: Build 6613 considers profile directory read-only under certain conditions.
5+
16
--------------------------------------------------------------------------------
27
drkns 2026-02-03 00:20:49+00:00 - build 6641
38

far/platform.fs.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5858
#include "common.hpp"
5959
#include "common/algorithm.hpp"
6060
#include "common/scope_exit.hpp"
61+
#include "common/uuid.hpp"
6162

6263
// External:
6364

@@ -2572,7 +2573,11 @@ WARNING_POP()
25722573

25732574
bool can_create_file_in(string_view const DirectoryName)
25742575
{
2575-
return create_file(DirectoryName, FILE_ADD_FILE, file_share_all, nullptr, OPEN_EXISTING)? true : false;
2576+
return
2577+
// without a temporary file, see https://devblogs.microsoft.com/oldnewthing/20251203-00/?p=111836
2578+
create_file(DirectoryName, FILE_ADD_FILE, file_share_all, nullptr, OPEN_EXISTING) ||
2579+
// just in case, with a temporary file, for non-trivial setups like gh-1070
2580+
create_file(path::join(DirectoryName, ::uuid::str(uuid::generate())), GENERIC_WRITE, file_share_all, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE);
25762581
}
25772582

25782583
bool CreateSymbolicLinkInternal(string_view const Object, string_view const Target, DWORD Flags)

far/vbuild.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6641
1+
6642

0 commit comments

Comments
 (0)