ONNX
security
malware-detection
Vigil / source /pkg /compactscan /preflight_open_unix.go
turentomer's picture
Publish self-contained Vigil distribution
d2507b5 verified
Raw
History Blame Contribute Delete
352 Bytes
//go:build unix
package compactscan
import (
"os"
"syscall"
)
// O_NONBLOCK prevents an attacker racing a validated regular member into a
// FIFO or device from hanging preflight while the descriptor is opened.
func openPreflightFile(root *os.Root, name string) (*os.File, error) {
return root.OpenFile(name, os.O_RDONLY|syscall.O_NONBLOCK, 0)
}