Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
scan-filesystem
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
scan-filesystem
Commits
7a1e3ed7
Commit
7a1e3ed7
authored
Oct 20, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use current directory as starting path instead of '/'
parent
f61f42ca
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
cython/main.pyx
cython/main.pyx
+3
-2
python/main.py
python/main.py
+2
-2
rust/src/main.rs
rust/src/main.rs
+2
-2
No files found.
cython/main.pyx
View file @
7a1e3ed7
...
...
@@ -252,6 +252,7 @@ cdef int start(string path) nogil:
ignore_paths
.
append
(
b'/srv/slapgrid'
)
dev_whitelist_paths
=
cyplist
[
string
]()
dev_whitelist_paths
.
append
(
b'.'
)
dev_whitelist_paths
.
append
(
b'/'
)
dev_whitelist_paths
.
append
(
b'/boot'
)
...
...
@@ -285,7 +286,7 @@ cdef int start(string path) nogil:
return
0
cdef
public
int
main
()
nogil
:
return
start
(
<
char
*>
'
/
'
)
return
start
(
<
char
*>
'
.
'
)
def
python_main
():
start
(
<
char
*>
'
/
'
)
start
(
<
char
*>
'
.
'
)
python/main.py
View file @
7a1e3ed7
...
...
@@ -131,14 +131,14 @@ def main():
ignored_dirs
=
[
"/opt/slapgrid"
,
"/srv/slapgrid"
]
dev_whitelist
=
list
()
for
path
in
[
"/"
,
"/boot"
]:
for
path
in
[
"
."
,
"
/"
,
"/boot"
]:
try
:
dev_whitelist
.
append
(
os
.
stat
(
path
,
follow_symlinks
=
False
).
st_dev
)
except
FileNotFoundError
:
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
:
json
.
dump
(
tree
,
fp
,
indent
=
2
,
separators
=
(
','
,
': '
))
...
...
rust/src/main.rs
View file @
7a1e3ed7
...
...
@@ -194,7 +194,7 @@ fn main() -> Result<()> {
.map
(
PathBuf
::
from
)
.collect
();
let
disk_partitions
=
[
"/"
,
"/boot"
];
let
disk_partitions
=
[
"
."
,
"
/"
,
"/boot"
];
let
dev_whitelist
=
disk_partitions
.iter
()
...
...
@@ -206,7 +206,7 @@ fn main() -> Result<()> {
let
tree
=
construct_fs_tree
(
None
,
&
PathBuf
::
from
(
"
/
"
),
&
PathBuf
::
from
(
"
.
"
),
&
dev_whitelist
,
&
ignored_dirs
,
)
?
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment