Skip to content

Commit

Permalink
etcdctl/ctlv3: don't crash when we should prompt for pw.
Browse files Browse the repository at this point in the history
 when 'etcdctl --user name get blah' is invoked to
 prompt for password, don't panic.

 addresses the segfault part of #6343
  • Loading branch information
glycerine committed Sep 3, 2016
1 parent 0d07154 commit cccbf30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etcdctl/ctlv3/command/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func authCfgFromCmd(cmd *cobra.Command) *authCfg {
var cfg authCfg

splitted := strings.SplitN(userFlag, ":", 2)
if len(splitted) == 0 {
if len(splitted) < 2 {
cfg.username = userFlag
cfg.password, err = speakeasy.Ask("Password: ")
if err != nil {
Expand Down

0 comments on commit cccbf30

Please sign in to comment.