From a21a5f42433267052441cdb7ebe7604dfcc7f159 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 19 Oct 2024 12:10:46 +0200 Subject: [PATCH] cli/command: PromptUserForCredentials: always trim password we don't support empty passwords; when prompting the user for a password, we already trim the result, but we didn't do the same for a password that's passed through stdin or through the `-p` / `--password` flag. Signed-off-by: Sebastiaan van Stijn --- cli/command/registry.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/command/registry.go b/cli/command/registry.go index 7749f9601a..d5e10c191d 100644 --- a/cli/command/registry.go +++ b/cli/command/registry.go @@ -155,6 +155,7 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword } } + argPassword = strings.TrimSpace(argPassword) if argPassword == "" { restoreInput, err := DisableInputEcho(cli.In()) if err != nil {