Source file
src/os/user/lookup_plan9.go
1
2
3
4
5 package user
6
7 import (
8 "fmt"
9 "os"
10 "syscall"
11 )
12
13
14
15
16 const (
17 userFile = "/dev/user"
18 )
19
20 func init() {
21 userImplemented = false
22 groupImplemented = false
23 groupListImplemented = false
24 }
25
26 func current() (*User, error) {
27 ubytes, err := os.ReadFile(userFile)
28 if err != nil {
29 return nil, fmt.Errorf("user: %s", err)
30 }
31
32 uname := string(ubytes)
33
34 u := &User{
35 Uid: uname,
36 Gid: uname,
37 Username: uname,
38 Name: uname,
39 HomeDir: os.Getenv("home"),
40 }
41
42 return u, nil
43 }
44
45 func lookupUser(username string) (*User, error) {
46 return nil, syscall.EPLAN9
47 }
48
49 func lookupUserId(uid string) (*User, error) {
50 return nil, syscall.EPLAN9
51 }
52
53 func lookupGroup(groupname string) (*Group, error) {
54 return nil, syscall.EPLAN9
55 }
56
57 func lookupGroupId(string) (*Group, error) {
58 return nil, syscall.EPLAN9
59 }
60
61 func listGroups(*User) ([]string, error) {
62 return nil, syscall.EPLAN9
63 }
64
View as plain text