commit 67a61a4c20d983e067db6f8cb3d12f4c4c5cf3cc
parent 1796a15e227dac66761bdc47bf9a5096b391febe
Author: Matsuda Kenji <info@mtkn.jp>
Date: Wed, 20 Dec 2023 08:37:48 +0900
update cmds
Diffstat:
3 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/cmd/numfs/main.go b/cmd/numfs/main.go
@@ -57,6 +57,18 @@ L:
return cwd, nil
}
+// This function assumes that group and uid both exist and
+// the leader of group has the same name as group itself.
+func (fsys *numFS) IsGroupLeader(group, uid string) bool {
+ return group == uid
+}
+
+// This function assumes that group and uid both exists and
+// only the member of group has the same name as group itself.
+func (fsys *numFS) IsGroupMember(group, uid string) bool {
+ return group == uid
+}
+
type numFile struct {
fs *numFS
id int
diff --git a/cmd/semfs/fs.go b/cmd/semfs/fs.go
@@ -39,6 +39,18 @@ func (fsys *semFS) OpenFile(name string, omode lib9p.OpenMode) (lib9p.File, erro
}
}
+// This function assumes that group and uid both exist and
+// the leader of group has the same name as group itself.
+func (fsys *semFS) IsGroupLeader(group, uid string) bool {
+ return group == uid
+}
+
+// This function assumes that group and uid both exists and
+// only the member of group has the same name as group itself.
+func (fsys *semFS) IsGroupMember(group, uid string) bool {
+ return group == uid
+}
+
func (fsys *semFS) Create(name string, uid string, mode lib9p.OpenMode, perm lib9p.FileMode) (lib9p.File, error) {
for _, f := range fsys.semfiles {
if f.name == name {
diff --git a/iofs/fs.go b/iofs/fs.go
@@ -41,3 +41,15 @@ func (fsys *FS) OpenFile(name string, omode lib9p.OpenMode) (lib9p.File, error)
path: name,
}, nil
}
+
+// This function assumes that group and uid both exist and
+// the leader of group has the same name as group itself.
+func (fsys *FS) IsGroupLeader(group, uid string) bool {
+ return group == uid
+}
+
+// This function assumes that group and uid both exists and
+// only the member of group has the same name as group itself.
+func (fsys *FS) IsGroupMember(group, uid string) bool {
+ return group == uid
+}
+\ No newline at end of file