Unverified Commit 86deb111 by Christian Brauner Committed by GitHub

Merge pull request #3818 from evverx/disable-logs-on-oss-fuzz

oss-fuzz: always turn off logging on OSS-Fuzz
parents 122413ad a390325f
......@@ -488,7 +488,11 @@ if test "x$enable_fuzzers" = "xyes"; then
if test "x$LIB_FUZZING_ENGINE" = x; then
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION \
-DRUN_ON_OSS_FUZZ=0 \
-fsanitize=fuzzer-no-link])
else
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
-DRUN_ON_OSS_FUZZ=1])
fi
else
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[-flto=thin])
......
......@@ -508,7 +508,7 @@ static int build_dir(const char *name)
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
ret = lxc_unpriv(mkdir(n, 0755));
#else
if (is_in_comm("fuzz-lxc-") > 0)
if (RUN_ON_OSS_FUZZ || is_in_comm("fuzz-lxc-") > 0)
ret = errno = EEXIST;
else
ret = lxc_unpriv(mkdir(n, 0755));
......@@ -529,7 +529,7 @@ static int log_open(const char *name)
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
fd = lxc_unpriv(open(name, O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, 0660));
#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));
#endif /* !FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
if (fd < 0)
......
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