diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-03-14 17:06:34 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-03-14 17:06:34 -0400 |
| commit | a7de24661c55a026dd208c8a62c50d6682d39859 (patch) | |
| tree | 25b9abd8952f7f00db80cf4ac5271913773a8e81 /back/cmd/authfs/sessdir.go | |
| parent | b57a199eb44dff5af3bdb7866b818544e1d270ee (diff) | |
| download | buth-a7de24661c55a026dd208c8a62c50d6682d39859.zip | |
authfs: implement Rwalk, Rcreate
Diffstat (limited to 'back/cmd/authfs/sessdir.go')
| -rw-r--r-- | back/cmd/authfs/sessdir.go | 9 |
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. |