Merge pull request #2912 from hashicorp/issue-2624

Adds guard in session ACL check in case session is not found.
pull/2114/merge
James Phillips 2017-04-13 20:10:19 -07:00 committed by GitHub
commit da304f94ae
1 changed files with 3 additions and 0 deletions

View File

@ -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) {