From bb387650abd6b31f52f5761792d987c3eb977dc1 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 19 Sep 2022 23:19:38 -0600 Subject: [PATCH] exclude windows from protected dirs checking --- datastore/fsds.nim | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/datastore/fsds.nim b/datastore/fsds.nim index d1d9c4b..0324ad9 100644 --- a/datastore/fsds.nim +++ b/datastore/fsds.nim @@ -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 =