Skip to content

Commit

Permalink
have a conservative default for keystore overwrite (#11335)
Browse files Browse the repository at this point in the history
  • Loading branch information
jalvz authored Mar 21, 2019
1 parent daefdb5 commit 783aca0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libbeat/cmd/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func genAddKeystoreCmd(settings instance.Settings) *cobra.Command {
func genRemoveKeystoreCmd(settings instance.Settings) *cobra.Command {
return &cobra.Command{
Use: "remove",
Short: "remove secret",
Short: "Remove secret",
Run: cli.RunWith(func(cmd *cobra.Command, args []string) error {
store, err := getKeystore(settings)
if err != nil {
Expand Down Expand Up @@ -136,7 +136,7 @@ func createKeystore(settings instance.Settings, force bool) error {
}

if store.IsPersisted() == true && force == false {
response := terminal.PromptYesNo("A keystore already exists, Overwrite?", true)
response := terminal.PromptYesNo("A keystore already exists, Overwrite?", false)
if response == true {
err := store.Create(true)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion libbeat/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func OwnerHasExclusiveWritePerms(name string) error {
perm := info.Mode().Perm()

if fileUID != 0 && euid != fileUID {
return fmt.Errorf(`config file ("%v") must be owned by the beat user `+
return fmt.Errorf(`config file ("%v") must be owned by the user identifier `+
`(uid=%v) or root`, name, euid)
}

Expand Down
2 changes: 1 addition & 1 deletion libbeat/keystore/file_keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func (k *FileKeystore) checkPermissions(f string) error {
perm := info.Mode().Perm()

if fileUID != 0 && euid != fileUID {
return fmt.Errorf(`config file ("%v") must be owned by the beat user `+
return fmt.Errorf(`config file ("%v") must be owned by the user identifier `+
`(uid=%v) or root`, f, euid)
}

Expand Down

0 comments on commit 783aca0

Please sign in to comment.