perms: session tools (s/{sid}/t/) are owner-only (0700)

Prevents agents from accessing other sessions' tools.
This commit is contained in:
Levi Neely 2026-05-19 15:56:26 +02:00
parent 57e341f907
commit c6da56b1d8
1 changed files with 3 additions and 3 deletions

View File

@ -1637,7 +1637,7 @@ func (s *Server) makeStat(path string) plan9.Dir {
if strings.HasPrefix(path, "/s/") {
parts := strings.SplitN(strings.TrimPrefix(path, "/s/"), "/", 3)
if (len(parts) == 2 && parts[1] == "t") || (len(parts) == 3 && parts[1] == "t") {
mode = plan9.DMDIR | 0777
mode = plan9.DMDIR | 0700
} else {
mode = plan9.DMDIR | 0555
}
@ -1677,9 +1677,9 @@ func (s *Server) makeStat(path string) plan9.Dir {
} else if strings.HasPrefix(path, "/s/") {
parts := strings.SplitN(strings.TrimPrefix(path, "/s/"), "/", 3)
if len(parts) == 3 && parts[1] == "t" && parts[2] == "idx" {
mode = 0444
mode = 0400
} else if len(parts) == 3 && parts[1] == "t" {
mode = 0777
mode = 0700
} else {
mode = 0444
}