summaryrefslogtreecommitdiffstats
path: root/back/cmd/authfs/root.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-03-14 11:23:50 -0400
committerSam Anthony <sam@samanthony.xyz>2026-03-14 11:23:50 -0400
commit700096b078f6e16f2c5c967ea140f0b93e799986 (patch)
treee1d9965e9bf09ebe01a96d8faa6d2bc027e6984c /back/cmd/authfs/root.go
parent7d622695ae19e518fded6aa5fbf001dae4652211 (diff)
downloadbuth-harveyos.zip
authfs: rewrite with Harvey-OS/ninep, implement Rattachharveyos
Diffstat (limited to 'back/cmd/authfs/root.go')
-rw-r--r--back/cmd/authfs/root.go36
1 files changed, 23 insertions, 13 deletions
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
}