From 7bc9fbd3b447ff60bef06bf81e85c3b934a404a7 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Wed, 9 Nov 2022 16:37:36 -0500 Subject: [PATCH] Make sure testcase has correct permissions (#8920) Fixes #8768 --- infra/cifuzz/fuzz_target.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py index 664765edf..43b7e6f51 100644 --- a/infra/cifuzz/fuzz_target.py +++ b/infra/cifuzz/fuzz_target.py @@ -134,6 +134,11 @@ class FuzzTarget: # pylint: disable=too-many-instance-attributes with open(bug_summary_artifact_path, 'w') as handle: handle.write(crash.stacktrace) + # Set permissions of testcase to be the same as summary so that we're sure + # it can be read by necessary users. + permissions_mode = os.stat(bug_summary_artifact_path) + os.chmod(target_reproducer_path, permissions_mode) + return target_reproducer_path def prune(self): @@ -202,6 +207,7 @@ class FuzzTarget: # pylint: disable=too-many-instance-attributes crash.reproduce_args, batch=batch) if is_reportable or self.config.upload_all_crashes: + logging.info('SAVING CRASH') fuzzer_logs = result.logs testcase_path = self._save_crash(crash) if is_reportable and self.config.minimize_crashes: @@ -209,6 +215,8 @@ class FuzzTarget: # pylint: disable=too-many-instance-attributes # Use is_reportable to decide this even though reportable crashes # are a subset of reproducible ones. self.minimize_testcase(testcase_path) + else: + logging.info('NOT MINIMIZED') else: fuzzer_logs = None testcase_path = None