aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/mobius/transaction_handlers.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/mobius/transaction_handlers.go b/internal/mobius/transaction_handlers.go
index 259ac02..33af941 100644
--- a/internal/mobius/transaction_handlers.go
+++ b/internal/mobius/transaction_handlers.go
@@ -568,11 +568,19 @@ func HandleNewFolder(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotl
subPath = path.Join("/", subPath, string(pathItem.Name))
}
}
- newFolderPath := path.Join(cc.FileRoot(), subPath, folderName)
- newFolderPath, err := txtDecoder.String(newFolderPath)
+
+ // Decode only client-provided path components from Mac Roman to UTF-8.
+ // The FileRoot is already a UTF-8 filesystem path and must not be decoded.
+ subPath, err := txtDecoder.String(subPath)
if err != nil {
return res
}
+ folderName, err = txtDecoder.String(folderName)
+ if err != nil {
+ return res
+ }
+
+ newFolderPath := path.Join(cc.FileRoot(), subPath, folderName)
// TODO: check path and folder Name lengths