enh: selfMFASetupPassword: add more messages for the user

This commit is contained in:
Stéphane Lesimple 2021-12-27 15:36:25 +00:00 committed by Stéphane Lesimple
parent 0f90dfef2d
commit f8f193b298

View file

@ -45,8 +45,8 @@ if ($fnret->value->{'password'} ne 'set') {
# ok, we need to set the password to a temporary valid one, but as people don't read,
# tell them what we'll do and expect them to say 'y'
if (!$yes) {
osh_info "As you currently don't have any password set, we'll setup a temporary one that you'll be asked to change right away.";
osh_info "Enter 'y' to proceed, anything else to abort.";
osh_info "As you currently don't have any password set,\nwe'll setup a temporary one that you'll be asked to change right away.";
osh_info "\nEnter 'y' to proceed, anything else to abort.\nNote that what you type will NOT be echoed on the terminal.";
chomp(my $ans = <STDIN>);
if ($ans ne 'y') {
osh_exit(R('OK_NO_CHANGE', msg => "Aborted per user request"));
@ -64,6 +64,8 @@ if ($fnret->value->{'password'} ne 'set') {
osh_info "On the prompt for your current UNIX password, enter this: " . $fnret->value->{'password'};
}
osh_info "Changing your MFA password.";
while (1) {
# BSD doesn't attach our caller tty correctly when using OVH::Bastion::execute, so using system() here