exclude windows from protected dirs checking

This commit is contained in:
Dmitriy Ryajov 2022-09-19 23:19:38 -06:00
parent a045aa4ef1
commit bb387650ab
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 10 additions and 7 deletions

View File

@ -22,12 +22,16 @@ const
# we're forbidding this dirs from being
# touched directly, but subdirectories
# can still be touched/created
ProtectedPaths* = [
"/",
"/usr",
"/etc",
"/home",
"/Users"]
ProtectedPaths* =
when doslikeFileSystem:
[]
else:
[
"/",
"/usr",
"/etc",
"/home",
"/Users"]
type
FSDatastore* = ref object of Datastore
@ -50,7 +54,6 @@ template path*(self: FSDatastore, key: Key): string =
self.root / segments.joinPath()
template checkProtected*(path: string): bool =
echo "PATH ", path
path in ProtectedPaths
template validDepth*(self: FSDatastore, key: Key): bool =