| //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) | |
| } | |