From 700096b078f6e16f2c5c967ea140f0b93e799986 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sat, 14 Mar 2026 11:23:50 -0400 Subject: authfs: rewrite with Harvey-OS/ninep, implement Rattach --- back/cmd/authfs/root.go | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'back/cmd/authfs/root.go') diff --git a/back/cmd/authfs/root.go b/back/cmd/authfs/root.go index 70ca643..5d56045 100644 --- a/back/cmd/authfs/root.go +++ b/back/cmd/authfs/root.go @@ -1,21 +1,31 @@ package main -const rootQid = p9p.Qid{ - Type: QTDIR, - Version: 0x0, - Path: 0x1, +import ( + p9 "github.com/Harvey-OS/ninep/protocol" + + "git.samanthony.xyz/buth/back/qver" +) + +type RootDir struct { + *qver.Version } -// Root is the root Dir which contains /users and /sessions. -type Root struct { - path string +func NewRootDir() *RootDir { + return &RootDir{qver.New()} } -func (r Root) Qid() p9p.Qid { return rootQid } +func (r *RootDir) Close() { + r.Version.Close() +} -func (r Root) Stat() (p9p.Dir, error) { - return p9p.Dir{ - Qid: rootQid, - Mode: DMDIR | DMREAD, - +func (r *RootDir) Qid() (p9.QID, error) { + ver, err := r.Version.Get() + if err != nil { + return p9.QID{}, err + } + return p9.QID{ + Type: p9.QTDIR, + Version: ver, + Path: rootQidPath, + }, nil } -- cgit v1.2.3