Explain portable storage path policy

This commit is contained in:
vorotamoroz committed 2026-07-12 11:07:22 +00:00
1 parent 72e936e226
commit 62a1aeaf46
1 file changed
+2
+2
View File
@@ -10,6 +10,8 @@ export function validateStoragePath(storagePath: string, allowRoot: boolean = tr
throw new Error("The storage root is not a valid entry path"); throw new Error("The storage root is not a valid entry path");
} }
// LiveSync normally rejects ':' in portable filenames before paths reach storage. A leading letter and colon
// therefore represents drive-qualified input or a leaked non-storage namespace, not a supported physical path.
if (storagePath.startsWith("/") || storagePath.startsWith("\\") || /^[A-Za-z]:/.test(storagePath)) { if (storagePath.startsWith("/") || storagePath.startsWith("\\") || /^[A-Za-z]:/.test(storagePath)) {
throw new Error(`Storage paths must be relative to the configured root: ${storagePath}`); throw new Error(`Storage paths must be relative to the configured root: ${storagePath}`);
} }