From a753e0075e854f57689b2b6efa00a447149df8b9 Mon Sep 17 00:00:00 2001 From: rafjaf Date: Sun, 20 Jul 2025 17:04:41 +0200 Subject: macOS: Fix Unicode normalization issues in forward & reverse mode This commit resolves https://github.com/rfjakob/gocryptfs/issues/850 by addressing Unicode normalization mismatches on macOS between NFC (used by CLI tools) and NFD (used by GUI apps). The solution is inspired by Cryptomator's approach ( https://github.com/cryptomator/cryptomator/issues/264 ). Forward mode on MacOS now enforces NFC for storage but presents NFD as recommended by https://developer.apple.com/library/archive/qa/qa1173/_index.html . See https://github.com/rfjakob/gocryptfs/pull/949 for more info. --- internal/fusefrontend/node_open_create.go | 1 + 1 file changed, 1 insertion(+) (limited to 'internal/fusefrontend/node_open_create.go') diff --git a/internal/fusefrontend/node_open_create.go b/internal/fusefrontend/node_open_create.go index 9598559..24f3e21 100644 --- a/internal/fusefrontend/node_open_create.go +++ b/internal/fusefrontend/node_open_create.go @@ -58,6 +58,7 @@ func (n *Node) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFl // // Symlink-safe through the use of Openat(). func (n *Node) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (inode *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno) { + name = normalizeFilename(name) // Always store as NFC dirfd, cName, errno := n.prepareAtSyscall(name) if errno != 0 { return -- cgit v1.2.3