Skip to content

Commit

Permalink
Merge pull request #299 from soraxas/feat/more-generic-cache
Browse files Browse the repository at this point in the history
Remove checking for parent / grandparent process
  • Loading branch information
quexten authored Nov 1, 2024
2 parents 51940fa + cffa650 commit 490dfae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cli/agent/systemauth/systemauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ func (s *SessionStore) CreateSession(pid int, parentpid int, grandparentpid int,

func (s *SessionStore) verifySession(ctx sockets.CallingContext, sessionType SessionType) bool {
for _, session := range s.Store {
if session.ParentPid == ctx.ParentProcessPid && session.GrandParentPid == ctx.GrandParentProcessPid && session.sessionType == sessionType {
if session.Expires.After(time.Now()) {
return true
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()) {
return true
}
}
}
}
Expand Down

0 comments on commit 490dfae

Please sign in to comment.