login: print a big warning when using --password

Task command lines are world readable via /proc/pid/cmdline, so this isn't
safe.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
This commit is contained in:
Tycho Andersen 2017-06-28 15:22:04 -06:00
parent 92a2a1d539
commit c269ad26e8
1 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,10 @@ func runLogin(dockerCli command.Cli, opts loginOptions) error {
ctx := context.Background() ctx := context.Background()
clnt := dockerCli.Client() clnt := dockerCli.Client()
if opts.password != "" {
fmt.Fprintln(dockerCli.Err(), "WARNING! Using --password via the CLI is insecure.")
}
var ( var (
serverAddress string serverAddress string
authServer = command.ElectAuthServer(ctx, dockerCli) authServer = command.ElectAuthServer(ctx, dockerCli)