Merge pull request #299 from soraxas/feat/more-generic-cache
Remove checking for parent / grandparent process
This commit is contained in:
commit
490dfae155
|
@ -55,12 +55,15 @@ func (s *SessionStore) CreateSession(pid int, parentpid int, grandparentpid int,
|
||||||
|
|
||||||
func (s *SessionStore) verifySession(ctx sockets.CallingContext, sessionType SessionType) bool {
|
func (s *SessionStore) verifySession(ctx sockets.CallingContext, sessionType SessionType) bool {
|
||||||
for _, session := range s.Store {
|
for _, session := range s.Store {
|
||||||
if session.ParentPid == ctx.ParentProcessPid && session.GrandParentPid == ctx.GrandParentProcessPid && session.sessionType == sessionType {
|
if session.sessionType == sessionType {
|
||||||
|
// only check for ancestor if the session is not a ssh session
|
||||||
|
if sessionType == SSHKey || (session.ParentPid == ctx.ParentProcessPid && session.GrandParentPid == ctx.GrandParentProcessPid) {
|
||||||
if session.Expires.After(time.Now()) {
|
if session.Expires.After(time.Now()) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue