mirror of https://github.com/pkg/sftp.git
26 lines
432 B
Go
26 lines
432 B
Go
|
// +build !windows,!plan9
|
||
|
|
||
|
package sftp
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
func testFileInfoSysOS(sys interface{}) error {
|
||
|
switch sys := sys.(type) {
|
||
|
case *syscall.Stat_t:
|
||
|
if sys.Uid != 65534 {
|
||
|
return fmt.Errorf("UID failed to match: %d", sys.Uid)
|
||
|
}
|
||
|
if sys.Gid != 65534 {
|
||
|
return fmt.Errorf("GID failed to match: %d", sys.Gid)
|
||
|
}
|
||
|
|
||
|
default:
|
||
|
return fmt.Errorf("unexpected FileInfo.Sys() type: %T", sys)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|