mirror of https://github.com/docker/cli.git
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 <github@gone.nl>
This commit is contained in:
parent
eda78e9cdc
commit
a21a5f4243
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue