request-unix.go 430 B

123456789101112131415161718192021222324
  1. //go:build !windows && !plan9
  2. // +build !windows,!plan9
  3. package sftp
  4. import (
  5. "errors"
  6. "syscall"
  7. )
  8. func fakeFileInfoSys() interface{} {
  9. return &syscall.Stat_t{Uid: 65534, Gid: 65534}
  10. }
  11. func testOsSys(sys interface{}) error {
  12. fstat := sys.(*FileStat)
  13. if fstat.UID != uint32(65534) {
  14. return errors.New("Uid failed to match")
  15. }
  16. if fstat.GID != uint32(65534) {
  17. return errors.New("Gid failed to match")
  18. }
  19. return nil
  20. }