Fix file mode check in pipeOperations

PiperOrigin-RevId: 263203441
This commit is contained in:
Fabricio Voznika 2019-08-13 13:32:18 -07:00 committed by gVisor bot
parent 072d941e32
commit 0e907c4298
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ func (p *pipeOperations) init() error {
log.Warningf("pipe: cannot stat fd %d: %v", p.file.FD(), err)
return syscall.EINVAL
}
if s.Mode&syscall.S_IFIFO != syscall.S_IFIFO {
if (s.Mode & syscall.S_IFMT) != syscall.S_IFIFO {
log.Warningf("pipe: cannot load fd %d as pipe, file type: %o", p.file.FD(), s.Mode)
return syscall.EINVAL
}