mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-10 17:43:13 +00:00
exclude windows from protected dirs checking
This commit is contained in:
parent
a045aa4ef1
commit
bb387650ab
@ -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 =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user