2017-03-02 11:50:37 +08:00
|
|
|
// +build !windows
|
2017-02-25 12:06:51 +08:00
|
|
|
|
|
|
|
package sftp
|
|
|
|
|
2017-03-02 11:51:32 +08:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"syscall"
|
|
|
|
)
|
2017-02-25 12:06:51 +08:00
|
|
|
|
|
|
|
func fakeFileInfoSys() interface{} {
|
|
|
|
return &syscall.Stat_t{Uid: 65534, Gid: 65534}
|
|
|
|
}
|
2017-03-02 11:51:32 +08:00
|
|
|
|
|
|
|
func testOsSys(sys interface{}) error {
|
|
|
|
fstat := sys.(*FileStat)
|
|
|
|
if fstat.UID != uint32(65534) {
|
2019-08-30 23:04:37 +08:00
|
|
|
return errors.New("Uid failed to match")
|
2017-03-02 11:51:32 +08:00
|
|
|
}
|
|
|
|
if fstat.GID != uint32(65534) {
|
2019-08-30 23:04:37 +08:00
|
|
|
return errors.New("Gid failed to match")
|
2017-03-02 11:51:32 +08:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|