Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
86deb111
Unverified
Commit
86deb111
authored
May 01, 2021
by
Christian Brauner
Committed by
GitHub
May 01, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3818 from evverx/disable-logs-on-oss-fuzz
oss-fuzz: always turn off logging on OSS-Fuzz
parents
122413ad
a390325f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
configure.ac
configure.ac
+4
-0
log.c
src/lxc/log.c
+2
-2
No files found.
configure.ac
View file @
86deb111
...
@@ -488,7 +488,11 @@ if test "x$enable_fuzzers" = "xyes"; then
...
@@ -488,7 +488,11 @@ if test "x$enable_fuzzers" = "xyes"; then
if test "x$LIB_FUZZING_ENGINE" = x; then
if test "x$LIB_FUZZING_ENGINE" = x; then
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION \
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION \
-DRUN_ON_OSS_FUZZ=0 \
-fsanitize=fuzzer-no-link])
-fsanitize=fuzzer-no-link])
else
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
-DRUN_ON_OSS_FUZZ=1])
fi
fi
else
else
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[-flto=thin])
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[-flto=thin])
...
...
src/lxc/log.c
View file @
86deb111
...
@@ -508,7 +508,7 @@ static int build_dir(const char *name)
...
@@ -508,7 +508,7 @@ static int build_dir(const char *name)
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
ret
=
lxc_unpriv
(
mkdir
(
n
,
0755
));
ret
=
lxc_unpriv
(
mkdir
(
n
,
0755
));
#else
#else
if
(
is_in_comm
(
"fuzz-lxc-"
)
>
0
)
if
(
RUN_ON_OSS_FUZZ
||
is_in_comm
(
"fuzz-lxc-"
)
>
0
)
ret
=
errno
=
EEXIST
;
ret
=
errno
=
EEXIST
;
else
else
ret
=
lxc_unpriv
(
mkdir
(
n
,
0755
));
ret
=
lxc_unpriv
(
mkdir
(
n
,
0755
));
...
@@ -529,7 +529,7 @@ static int log_open(const char *name)
...
@@ -529,7 +529,7 @@ static int log_open(const char *name)
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
fd
=
lxc_unpriv
(
open
(
name
,
O_CREAT
|
O_WRONLY
|
O_APPEND
|
O_CLOEXEC
,
0660
));
fd
=
lxc_unpriv
(
open
(
name
,
O_CREAT
|
O_WRONLY
|
O_APPEND
|
O_CLOEXEC
,
0660
));
#else
#else
if
(
is_in_comm
(
"fuzz-lxc-"
)
<=
0
)
if
(
!
RUN_ON_OSS_FUZZ
&&
is_in_comm
(
"fuzz-lxc-"
)
<=
0
)
fd
=
lxc_unpriv
(
open
(
name
,
O_CREAT
|
O_WRONLY
|
O_APPEND
|
O_CLOEXEC
,
0660
));
fd
=
lxc_unpriv
(
open
(
name
,
O_CREAT
|
O_WRONLY
|
O_APPEND
|
O_CLOEXEC
,
0660
));
#endif
/* !FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
#endif
/* !FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
if
(
fd
<
0
)
if
(
fd
<
0
)
...
...
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