mirror of
https://github.com/quexten/goldwarden.git
synced 2024-11-27 11:02:46 +03:00
only check for ancestor if the session is not a ssh session
Signed-off-by: Tin Lai <tin@tinyiu.com>
This commit is contained in:
parent
49ee2cbe29
commit
cffa650124
@ -56,8 +56,11 @@ 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.sessionType == sessionType {
|
if session.sessionType == sessionType {
|
||||||
if session.Expires.After(time.Now()) {
|
// only check for ancestor if the session is not a ssh session
|
||||||
return true
|
if sessionType == SSHKey || (session.ParentPid == ctx.ParentProcessPid && session.GrandParentPid == ctx.GrandParentProcessPid) {
|
||||||
|
if session.Expires.After(time.Now()) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user