Commit 7a1e3ed7 authored by Xavier Thompson's avatar Xavier Thompson

Use current directory as starting path instead of '/'

parent f61f42ca
...@@ -252,6 +252,7 @@ cdef int start(string path) nogil: ...@@ -252,6 +252,7 @@ cdef int start(string path) nogil:
ignore_paths.append(b'/srv/slapgrid') ignore_paths.append(b'/srv/slapgrid')
dev_whitelist_paths = cyplist[string]() dev_whitelist_paths = cyplist[string]()
dev_whitelist_paths.append(b'.')
dev_whitelist_paths.append(b'/') dev_whitelist_paths.append(b'/')
dev_whitelist_paths.append(b'/boot') dev_whitelist_paths.append(b'/boot')
...@@ -285,7 +286,7 @@ cdef int start(string path) nogil: ...@@ -285,7 +286,7 @@ cdef int start(string path) nogil:
return 0 return 0
cdef public int main() nogil: cdef public int main() nogil:
return start(<char*>'/') return start(<char*>'.')
def python_main(): def python_main():
start(<char*>'/') start(<char*>'.')
...@@ -131,14 +131,14 @@ def main(): ...@@ -131,14 +131,14 @@ def main():
ignored_dirs = ["/opt/slapgrid", "/srv/slapgrid"] ignored_dirs = ["/opt/slapgrid", "/srv/slapgrid"]
dev_whitelist = list() dev_whitelist = list()
for path in ["/", "/boot"]: for path in [".", "/", "/boot"]:
try: try:
dev_whitelist.append( dev_whitelist.append(
os.stat(path, follow_symlinks=False).st_dev) os.stat(path, follow_symlinks=False).st_dev)
except FileNotFoundError: except FileNotFoundError:
pass pass
tree = construct_fs_tree(path="/", dev_whitelist=dev_whitelist, ignored_dirs=ignored_dirs) tree = construct_fs_tree(path=".", dev_whitelist=dev_whitelist, ignored_dirs=ignored_dirs)
with open('result.json', 'w') as fp: with open('result.json', 'w') as fp:
json.dump(tree, fp, indent=2, separators=(',', ': ')) json.dump(tree, fp, indent=2, separators=(',', ': '))
......
...@@ -194,7 +194,7 @@ fn main() -> Result<()> { ...@@ -194,7 +194,7 @@ fn main() -> Result<()> {
.map(PathBuf::from) .map(PathBuf::from)
.collect(); .collect();
let disk_partitions = ["/", "/boot"]; let disk_partitions = [".", "/", "/boot"];
let dev_whitelist = disk_partitions let dev_whitelist = disk_partitions
.iter() .iter()
...@@ -206,7 +206,7 @@ fn main() -> Result<()> { ...@@ -206,7 +206,7 @@ fn main() -> Result<()> {
let tree = construct_fs_tree( let tree = construct_fs_tree(
None, None,
&PathBuf::from("/"), &PathBuf::from("."),
&dev_whitelist, &dev_whitelist,
&ignored_dirs, &ignored_dirs,
)?; )?;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment