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 authored and gyuho committed Sep 4, 2016
1 parent 09a239f commit 5c44cdf
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 5c44cdf

Please sign in to comment.