Skip to content

Commit 001c5a2

Browse files
authored
Change --check_fuzzer_help to --no_check_fuzzer_help (microsoft#3063)
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`.
1 parent c24ea52 commit 001c5a2

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

src/cli/onefuzz/templates/libfuzzer.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def _create_tasks(
6565
ensemble_sync_delay: Optional[int] = None,
6666
colocate_all_tasks: bool = False,
6767
colocate_secondary_tasks: bool = True,
68-
check_fuzzer_help: bool = True,
68+
check_fuzzer_help: bool = False,
69+
no_check_fuzzer_help: bool = False,
6970
expect_crash_on_failure: bool = False,
7071
minimized_stack_depth: Optional[int] = None,
7172
module_allowlist: Optional[str] = None,
@@ -75,6 +76,13 @@ def _create_tasks(
7576
analyzer_env: Optional[Dict[str, str]] = None,
7677
tools: Optional[Container] = None,
7778
) -> None:
79+
if check_fuzzer_help:
80+
self.logger.warning(
81+
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
82+
)
83+
check_fuzzer_help = not no_check_fuzzer_help
84+
del no_check_fuzzer_help
85+
7886
target_options = target_options or []
7987

8088
regression_containers = [
@@ -348,7 +356,8 @@ def basic(
348356
ensemble_sync_delay: Optional[int] = None,
349357
colocate_all_tasks: bool = False,
350358
colocate_secondary_tasks: bool = True,
351-
check_fuzzer_help: bool = True,
359+
check_fuzzer_help: bool = False,
360+
no_check_fuzzer_help: bool = False,
352361
expect_crash_on_failure: bool = False,
353362
minimized_stack_depth: Optional[int] = None,
354363
module_allowlist: Optional[File] = None,
@@ -367,6 +376,13 @@ def basic(
367376
syncing inputs during ensemble fuzzing (0 to disable).
368377
"""
369378

379+
if check_fuzzer_help:
380+
self.logger.warning(
381+
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
382+
)
383+
check_fuzzer_help = not no_check_fuzzer_help
384+
del no_check_fuzzer_help
385+
370386
# verify containers exist
371387
if existing_inputs:
372388
self.onefuzz.containers.get(existing_inputs)
@@ -512,12 +528,19 @@ def merge(
512528
notification_config: Optional[NotificationConfig] = None,
513529
debug: Optional[List[TaskDebugFlag]] = None,
514530
preserve_existing_outputs: bool = False,
515-
check_fuzzer_help: bool = True,
531+
check_fuzzer_help: bool = False,
532+
no_check_fuzzer_help: bool = False,
516533
extra_container: Optional[Container] = None,
517534
) -> Optional[Job]:
518535
"""
519536
libfuzzer merge task
520537
"""
538+
if check_fuzzer_help:
539+
self.logger.warning(
540+
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
541+
)
542+
check_fuzzer_help = not no_check_fuzzer_help
543+
del no_check_fuzzer_help
521544

522545
# verify containers exist
523546
if existing_inputs:
@@ -870,13 +893,20 @@ def qemu_user(
870893
colocate_all_tasks: bool = False,
871894
crash_report_timeout: Optional[int] = 1,
872895
check_retry_count: Optional[int] = 300,
873-
check_fuzzer_help: bool = True,
896+
check_fuzzer_help: bool = False,
897+
no_check_fuzzer_help: bool = False,
874898
extra_container: Optional[Container] = None,
875899
crashes: Optional[Container] = None,
876900
) -> Optional[Job]:
877901
"""
878902
libfuzzer tasks, wrapped via qemu-user (PREVIEW FEATURE)
879903
"""
904+
if check_fuzzer_help:
905+
self.logger.warning(
906+
"--check_fuzzer_help is the default and does not need to be set; this parameter will be removed in a future version"
907+
)
908+
check_fuzzer_help = not no_check_fuzzer_help
909+
del no_check_fuzzer_help
880910

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

0 commit comments

Comments
 (0)