summaryrefslogtreecommitdiffstats
path: root/back/cmd/authfs/sessdir.go
diff options
context:
space:
mode:
Diffstat (limited to 'back/cmd/authfs/sessdir.go')
-rw-r--r--back/cmd/authfs/sessdir.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/back/cmd/authfs/sessdir.go b/back/cmd/authfs/sessdir.go
index 22d8202..dbfb477 100644
--- a/back/cmd/authfs/sessdir.go
+++ b/back/cmd/authfs/sessdir.go
@@ -40,7 +40,14 @@ func (dir *SessionsDir) Get(id auth.SessId) (*Session, bool) {
dir.mu.Lock()
defer dir.mu.Unlock()
sess, ok := dir.sessions[id]
- return sess, ok
+ if !ok {
+ return nil, false
+ }
+ if !sess.IsActive() {
+ delete(dir.sessions, id)
+ return nil, false
+ }
+ return sess, true
}
// Owner returns the owner of the given session if it exists, or false if it doesn't.