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>
Upstream-commit: c269ad26e8
Component: cli
This commit is contained in:
Tycho Andersen
2017-06-28 15:22:04 -06:00
parent d034f04bc4
commit f4b9a413f3

View File

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