lookup_unix.go 529 B

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