mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 03:35:27 +00:00
fix: #1274 spawned nuclei child process hangs reading stdin
Next and final attempt at fixing the stdin parsing issue when spawing as child from nodejs
This commit is contained in:
parent
1851e37aef
commit
c9943c0b2a
@ -66,15 +66,14 @@ func ParseOptions(options *types.Options) {
|
||||
|
||||
// hasStdin returns true if we have stdin input
|
||||
func hasStdin() bool {
|
||||
stat, err := os.Stdin.Stat()
|
||||
fi, err := os.Stdin.Stat()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
isPipedFromChrDev := (stat.Mode() & os.ModeCharDevice) == 0
|
||||
isPipedFromFIFO := (stat.Mode() & os.ModeNamedPipe) != 0
|
||||
|
||||
return isPipedFromChrDev || isPipedFromFIFO
|
||||
if fi.Mode()&os.ModeNamedPipe == 0 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// validateOptions validates the configuration options passed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user