Bug #4100
closedValidation of y/n answers in setlanip console menu
100%
Description
At the moment the user can answer "yes" to most of the (y/n) questions, but then later code only checks if the answer is "y". Thus you can type in "yes" in some places, have it accepted, but actually the negative action is taken. That is weird and will mess up people who try typing a whole string starting with "y".
You can also type in anything starting with "y" - "yzzzzz", "yrandomstuff" - and it will be accepted but the negative action is taken.
I suggest fix this up - only accept [uppercase|lowercase] "y" "yes" "n" "no". Re-prompt in response to any other user input. Take the action on [y|yes], do not do it on [n|no].
I am never quite sure when I have got to the last question. Sometimes it is nice to have a chance to bail-out at the last moment and then start over answering the questions correctly! So I am also suggesting asking "Do you want to apply these changes? (y/n)" as the last question.
Updated by Phillip Davis almost 10 years ago
Proposed solution https://github.com/pfsense/pfsense/pull/1372
Updated by Phillip Davis almost 10 years ago
Better solution in https://github.com/pfsense/pfsense/pull/1382
Updated by Renato Botelho almost 10 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Merged, thanks!
Updated by Phillip Davis almost 10 years ago
And in the end the committed pull request was: https://github.com/pfsense/pfsense/pull/1385
I will do a change to add a confirming question at the end - maybe get to it tonight.
Updated by Renato Botelho almost 10 years ago
- Status changed from Feedback to Resolved
The question in the end is an enhancement, this ticket can be safely closed.