Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
metadata-collect-agent
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
nexedi
metadata-collect-agent
Commits
980183ee
Commit
980183ee
authored
Nov 08, 2021
by
Ophélie Gagnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the segmentation fault in uefi.main.pyx too. (And not only in command-line.main.pyx.)
parent
51c5f587
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
scan-filesystem/cython/main.pyx
scan-filesystem/cython/main.pyx
+5
-5
scan-filesystem/cython/uefi.main.pyx
scan-filesystem/cython/uefi.main.pyx
+17
-6
No files found.
scan-filesystem/cython/main.pyx
View file @
980183ee
...
...
@@ -247,8 +247,8 @@ cdef int start(const char *path) nogil:
cdef
pid_t
child_pid
=
-
1
# DEBUG
child_pid
=
fork
()
# DEBUG
cdef
int
err
cdef
char
ip_address
[
100
]
cdef
FILE
*
address_path
=
fopen
(
"/sys/class/net/ens3/address"
,
"r"
)
#
cdef char ip_address[100]
#
cdef FILE *address_path = fopen("/sys/class/net/ens3/address", "r")
if
child_pid
==
0
:
# CHILD
err
=
execlp
(
"/sbin/fluent-bit"
,
program_name
,
arg1
,
arg2
,
arg3
,
arg4
,
0
)
fprintf
(
stderr
,
"ERROR with execlp() in CHILD: %d
\
n
"
,
err
)
...
...
@@ -311,9 +311,9 @@ cdef int start(const char *path) nogil:
fprintf
(
stderr
,
"WRITE_NOTE STAGE
\
n
\
n
"
)
# DEBUG
fscanf
(
address_path
,
"%s"
,
ip_address
)
fclose
(
address_path
)
fprintf
(
result
,
'{"mac_address": "%s"}
\
n
'
,
ip_address
)
#
fscanf(address_path, "%s", ip_address)
#
fclose(address_path)
#
fprintf(result, '{"mac_address": "%s"}\n', ip_address)
node
.
write_node
(
result
)
fprintf
(
result
,
'{}
\
n
'
)
fprintf
(
result
,
'fluentbit_end
\
n
'
)
...
...
scan-filesystem/cython/uefi.main.pyx
View file @
980183ee
...
...
@@ -247,7 +247,7 @@ cdef int start(const char *path) nogil:
cdef
pid_t
child_pid
=
-
1
# DEBUG
child_pid
=
fork
()
# DEBUG
cdef
int
err
cdef
char
ip_address
[
100
]
#
cdef char ip_address[100]
#cdef FILE *address_path = fopen("/sys/class/net/ens3/address", "r")
if
child_pid
==
0
:
# CHILD
err
=
execlp
(
"/sbin/fluent-bit"
,
program_name
,
arg1
,
arg2
,
arg3
,
arg4
,
0
)
...
...
@@ -276,6 +276,8 @@ cdef int start(const char *path) nogil:
p_dev
=
p_stat
.
st_data
.
st_dev
dev_whitelist
.
append
(
p_dev
)
fprintf
(
stderr
,
"test 001
\
n
"
)
# DEBUG
fflush
(
stderr
)
# DEBUG
realpath
(
path
,
resolved_path
)
fprintf
(
stderr
,
resolved_path
)
# DEBUG
fprintf
(
stderr
,
"
\
n
"
)
# DEBUG
...
...
@@ -284,9 +286,18 @@ cdef int start(const char *path) nogil:
if
node
is
NULL
:
return
-
1
fprintf
(
stderr
,
"test 002
\
n
"
)
# DEBUG
fflush
(
stderr
)
# DEBUG
active_node
=
activate
(
consume
node
)
fprintf
(
stderr
,
'test 003
\
n
'
)
# DEBUG
fflush
(
stderr
)
# DEBUG
active_node
.
build_node
(
NULL
,
consume
dev_whitelist
,
consume
ignore_paths
)
fprintf
(
stderr
,
'test 004
\
n
'
)
# DEBUG
fflush
(
stderr
)
# DEBUG
scheduler
.
finish
()
fprintf
(
stderr
,
'test 005
\
n
'
)
# DEBUG
fflush
(
stderr
)
# DEBUG
node
=
consume
active_node
#""" # DEBUG
...
...
@@ -298,11 +309,11 @@ cdef int start(const char *path) nogil:
fprintf
(
stderr
,
'Log opened successfully.
\
n
'
)
# DEBUG
fprintf
(
stderr
,
'WRITE_NOTE STAGE
\
n
\
n
'
)
# DEBUG
fprintf
(
stderr
,
"WRITE_NOTE STAGE
\
n
\
n
"
)
# DEBUG
#fscanf(address_path, "%s", ip_address)
# ADDRESS
#fclose(address_path)
# ADDRESS
#fprintf(result, '{"mac_address": "%s"}\n', ip_address)
# ADDRESS
#fscanf(address_path, "%s", ip_address)
#fclose(address_path)
#fprintf(result, '{"mac_address": "%s"}\n', ip_address)
node
.
write_node
(
result
)
fprintf
(
result
,
'{}
\
n
'
)
fprintf
(
result
,
'fluentbit_end
\
n
'
)
...
...
@@ -320,7 +331,7 @@ cdef int start(const char *path) nogil:
return
0
cdef
public
int
main
()
nogil
:
return
start
(
<
char
*>
'
/
'
)
return
start
(
<
char
*>
'
.
'
)
#def python_main():
# start(<char*>'.')
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