Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Change --check_fuzzer_help to --no_check_fuzzer_help (#3063)
Browse files Browse the repository at this point in the history
Because `--check_fuzzer_help` is a positive flag (defaults to `True`), there is no way to change it to `False`, because specifying it on the command line sets it to `True`. Change the flag to a negative one instead, named `--no_check_fuzzer_help`.
  • Loading branch information
Porges authored Apr 26, 2023
1 parent c24ea52 commit 001c5a2
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions src/cli/onefuzz/templates/libfuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def _create_tasks(
ensemble_sync_delay: Optional[int] = None,
colocate_all_tasks: bool = False,
colocate_secondary_tasks: bool = True,
check_fuzzer_help: bool = True,
check_fuzzer_help: bool = False,
no_check_fuzzer_help: bool = False,
expect_crash_on_failure: bool = False,
minimized_stack_depth: Optional[int] = None,
module_allowlist: Optional[str] = None,
Expand All @@ -75,6 +76,13 @@ def _create_tasks(
analyzer_env: Optional[Dict[str, str]] = None,
tools: Optional[Container] = None,
) -> None:
if check_fuzzer_help:
self.logger.warning(
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
)
check_fuzzer_help = not no_check_fuzzer_help
del no_check_fuzzer_help

target_options = target_options or []

regression_containers = [
Expand Down Expand Up @@ -348,7 +356,8 @@ def basic(
ensemble_sync_delay: Optional[int] = None,
colocate_all_tasks: bool = False,
colocate_secondary_tasks: bool = True,
check_fuzzer_help: bool = True,
check_fuzzer_help: bool = False,
no_check_fuzzer_help: bool = False,
expect_crash_on_failure: bool = False,
minimized_stack_depth: Optional[int] = None,
module_allowlist: Optional[File] = None,
Expand All @@ -367,6 +376,13 @@ def basic(
syncing inputs during ensemble fuzzing (0 to disable).
"""

if check_fuzzer_help:
self.logger.warning(
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
)
check_fuzzer_help = not no_check_fuzzer_help
del no_check_fuzzer_help

# verify containers exist
if existing_inputs:
self.onefuzz.containers.get(existing_inputs)
Expand Down Expand Up @@ -512,12 +528,19 @@ def merge(
notification_config: Optional[NotificationConfig] = None,
debug: Optional[List[TaskDebugFlag]] = None,
preserve_existing_outputs: bool = False,
check_fuzzer_help: bool = True,
check_fuzzer_help: bool = False,
no_check_fuzzer_help: bool = False,
extra_container: Optional[Container] = None,
) -> Optional[Job]:
"""
libfuzzer merge task
"""
if check_fuzzer_help:
self.logger.warning(
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
)
check_fuzzer_help = not no_check_fuzzer_help
del no_check_fuzzer_help

# verify containers exist
if existing_inputs:
Expand Down Expand Up @@ -870,13 +893,20 @@ def qemu_user(
colocate_all_tasks: bool = False,
crash_report_timeout: Optional[int] = 1,
check_retry_count: Optional[int] = 300,
check_fuzzer_help: bool = True,
check_fuzzer_help: bool = False,
no_check_fuzzer_help: bool = False,
extra_container: Optional[Container] = None,
crashes: Optional[Container] = None,
) -> Optional[Job]:
"""
libfuzzer tasks, wrapped via qemu-user (PREVIEW FEATURE)
"""
if check_fuzzer_help:
self.logger.warning(
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
)
check_fuzzer_help = not no_check_fuzzer_help
del no_check_fuzzer_help

self.logger.warning(
"qemu_user jobs are a preview feature and may change in the future"
Expand Down

0 comments on commit 001c5a2

Please sign in to comment.