Skip to content

Commit

Permalink
(GTK/NCURSES): Better error dialog for network interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aoshiken committed Aug 24, 2017
1 parent edbf839 commit 82b5a99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/gtk-callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,11 @@ void gtk_c_attackparams_ok_click( GtkWidget *button, gpointer userdata )

if ( attack_filter_all_params( params_ctx->params_list, params_ctx->nparams, &field ) < 0 )
{
gtk_i_modaldialog( GTK_MESSAGE_ERROR, "Attack parameters", "Bad data on field '%s'!!", params_ctx->helper->attack_def->param[field].desc );
if ( params_ctx->helper->attack_def->param[field].type == FIELD_ENABLED_IFACE )
gtk_i_modaldialog( GTK_MESSAGE_ERROR, "Attack parameters", "Nonexistant or disabled network interface on field '%s'!!\n\nHave you enabled that interface?",
params_ctx->helper->attack_def->param[field].desc );
else
gtk_i_modaldialog( GTK_MESSAGE_ERROR, "Attack parameters", "Bad data on field '%s'!!", params_ctx->helper->attack_def->param[field].desc );
}
else
{
Expand Down
7 changes: 4 additions & 3 deletions src/ncurses-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,10 @@ void ncurses_i_attack_screen( struct term_node *node, u_int8_t mode, WINDOW *att
ret = attack_filter_all_params( attack_param, attack_def[j].nparams, &field );
if ( ret == -1) /* Error on data...*/
{
ncurses_i_error_window(1,
"Bad data on field '%s'!!",
attack_param[field].desc);
if ( attack_param[field].type == FIELD_ENABLED_IFACE )
ncurses_i_error_window( 1, "Nonexistant or disabled network interface on field '%s'!!", attack_param[field].desc );
else
ncurses_i_error_window( 1, "Bad data on field '%s'!!", attack_param[field].desc );
}
} while(ret==-1);

Expand Down

0 comments on commit 82b5a99

Please sign in to comment.