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/file_dir_ops.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/fusefrontend/file_dir_ops.go') diff --git a/internal/fusefrontend/file_dir_ops.go b/internal/fusefrontend/file_dir_ops.go index b69e7bc..df14410 100644 --- a/internal/fusefrontend/file_dir_ops.go +++ b/internal/fusefrontend/file_dir_ops.go @@ -138,6 +138,8 @@ func (f *File) Readdirent(ctx context.Context) (entry *fuse.DirEntry, errno sysc continue } if f.rootNode.args.PlaintextNames { + // Even in plaintext mode, normalize for macOS display + entry.Name = normalizeFilenameForDisplay(cName) return } if !f.rootNode.args.DeterministicNames && cName == nametransform.DirIVFilename { @@ -171,7 +173,7 @@ func (f *File) Readdirent(ctx context.Context) (entry *fuse.DirEntry, errno sysc } // Override the ciphertext name with the plaintext name but reuse the rest // of the structure - entry.Name = name + entry.Name = normalizeFilenameForDisplay(name) return } } -- cgit v1.2.3