mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 14:45: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
|
// hasStdin returns true if we have stdin input
|
||||||
func hasStdin() bool {
|
func hasStdin() bool {
|
||||||
stat, err := os.Stdin.Stat()
|
fi, err := os.Stdin.Stat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if fi.Mode()&os.ModeNamedPipe == 0 {
|
||||||
isPipedFromChrDev := (stat.Mode() & os.ModeCharDevice) == 0
|
return false
|
||||||
isPipedFromFIFO := (stat.Mode() & os.ModeNamedPipe) != 0
|
}
|
||||||
|
return true
|
||||||
return isPipedFromChrDev || isPipedFromFIFO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// validateOptions validates the configuration options passed
|
// validateOptions validates the configuration options passed
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user