mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 06:16:08 +00:00
Merge pull request #2912 from hashicorp/issue-2624
Adds guard in session ACL check in case session is not found.
This commit is contained in:
commit
da304f94ae
@ -43,6 +43,9 @@ func (s *Session) Apply(args *structs.SessionRequest, reply *string) error {
|
||||
state := s.srv.fsm.State()
|
||||
_, existing, err := state.SessionGet(nil, args.Session.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Session lookup failed: %v", err)
|
||||
}
|
||||
if existing == nil {
|
||||
return fmt.Errorf("Unknown session %q", args.Session.ID)
|
||||
}
|
||||
if !acl.SessionWrite(existing.Node) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user