From 0cc365139bdff7a772f5160894859ff5224e27f2 Mon Sep 17 00:00:00 2001 From: Chick3nman Date: Wed, 27 Mar 2019 06:53:34 -0500 Subject: [PATCH] Added sanity check to confirm --machine-readable and --status-json do not run at the same time. Fixed typo in existing sanity check. --- src/terminal.c | 1 - src/user_options.c | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index cafccd235..eebc7e545 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -889,7 +889,6 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx) } - void status_display_status_json (hashcat_ctx_t *hashcat_ctx) { hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t)); diff --git a/src/user_options.c b/src/user_options.c index 4d45f9e85..62e6457fc 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -913,12 +913,22 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return -1; } } - + + if (user_options->machine_readable == true) + { + if (user_options->status_json == true) + { + event_log_error (hashcat_ctx, "The --status-json flag can not be used with --machine-readable."); + + return -1; + } + } + if (user_options->remove_timer_chgd == true) { if (user_options->remove == false) { - event_log_error (hashcat_ctx, "The --remove-timer requires --remove."); + event_log_error (hashcat_ctx, "The --remove-timer flag requires --remove."); return -1; } @@ -1110,7 +1120,7 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return -1; } } - + if (user_options->stdin_timeout_abort_chgd == true) { if (user_options->attack_mode != ATTACK_MODE_STRAIGHT)