From 3c4bc681c3cbf4f9a27cb224a07f0176775fb7c7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 24 Oct 2019 17:40:39 +0100 Subject: [PATCH] refuse to create a new user with empty password --- .../UserAccountService/UserAccountService.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index c51b9eb2b5..aada0be8e6 100755 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -377,7 +377,7 @@ namespace OpenSim.Services.UserAccountService { string firstName; string lastName; - string password; + string password = ""; string email; string rawPrincipalId; string model; @@ -393,7 +393,22 @@ namespace OpenSim.Services.UserAccountService else lastName = cmdparams[3]; if (cmdparams.Length < 5) - password = MainConsole.Instance.Prompt("Password", null, null, false); + { + int retries = 3; + while(--retries >= 0) + { + password = MainConsole.Instance.Prompt("Password", null, null, false); + if(String.IsNullOrWhiteSpace(password)) + MainConsole.Instance.Output(" You must provide a Password"); + else + break; + } + if (String.IsNullOrWhiteSpace(password)) + { + MainConsole.Instance.Output("create user aborted"); + return; + } + } else password = cmdparams[4]; if (cmdparams.Length < 6)