]>
Commit | Line | Data |
---|---|---|
9b12e4fe JC |
1 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris |
2 | ||
3 | package user | |
4 | ||
5 | import ( | |
6 | "io" | |
7 | "os" | |
8 | ) | |
9 | ||
10 | // Unix-specific path to the passwd and group formatted files. | |
11 | const ( | |
12 | unixPasswdPath = "/etc/passwd" | |
13 | unixGroupPath = "/etc/group" | |
14 | ) | |
15 | ||
16 | func GetPasswdPath() (string, error) { | |
17 | return unixPasswdPath, nil | |
18 | } | |
19 | ||
20 | func GetPasswd() (io.ReadCloser, error) { | |
21 | return os.Open(unixPasswdPath) | |
22 | } | |
23 | ||
24 | func GetGroupPath() (string, error) { | |
25 | return unixGroupPath, nil | |
26 | } | |
27 | ||
28 | func GetGroup() (io.ReadCloser, error) { | |
29 | return os.Open(unixGroupPath) | |
30 | } |