Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid non-blocking behaviour when using STDIN #416

Merged

Conversation

dlangille
Copy link
Contributor

While on BSD systems, tcprewrite likely sets O_NDELAY which is
proper for most posix systems as this is the newer flag and they
likely treat both similarly. However BSD and unix derivatives should
likely utilize FIONBIO due to known issues with reading from tty
with a 0 byte read returning -1 opposed to 0.

Reference comment 1: https://stackoverflow.com/questions/1150635/unix-nonblocking-i-o-o-nonblock-vs-fionbio

on behalf of Cisco Talos

While on BSD systems, tcprewrite likely sets `O_NDELAY` which is 
proper for most posix systems as this is the newer flag and they 
likely treat both similarly. However BSD and unix derivatives should 
likely utilize `FIONBIO` due to known issues with reading from tty 
with a 0 byte read returning -1 opposed to 0.

Reference comment 1: https://stackoverflow.com/questions/1150635/unix-nonblocking-i-o-o-nonblock-vs-fionbio

on behalf of Cisco Talos
@fklassen fklassen self-assigned this Aug 28, 2017
@fklassen
Copy link
Member

Thanks for the PR. I'll review and schedule for next release.

fklassen added a commit that referenced this pull request Jan 21, 2018
@fklassen fklassen changed the base branch from master to Enhancement_#416_non-blocking_STDIN January 21, 2018 21:22
@fklassen fklassen merged commit 2a6e8cf into appneta:Enhancement_#416_non-blocking_STDIN Jan 21, 2018
fklassen added a commit that referenced this pull request Jan 22, 2018
fklassen added a commit that referenced this pull request Jan 22, 2018
fklassen added a commit that referenced this pull request Oct 19, 2018
* Enhancement_#493_codacy_fixes: (26 commits)
  Enhancement #493 - fixes for Codacy identified issues
  Bug #486 Enforce max snaplen rather than doing realloc
  Bug #486 CVE-2018-17974 realloc memory if packet size increases
  Bug #484 CVE-2018-17582 Check for corrupt PCAP files
  4.3 - revert travis updates from merge
  Remove dead code
  resolve possible null pointer dereference
  travis-ci: add autogen package
  Bug #461 build warnings (#462)
  #412 fix gcc 6.3 compiler warning
  #421 fix ms to ns conversion
  Bug #423 remove commented code
  Bug #423 Remove limit for tcpprep -S
  Bug #398 Rewrite of tcpdump.c (#457)
  Bug #402 memset dlt radiotap get 80211 (#454)
  #404 fix check_list return values (#453)
  #406 fix zero-length IP headers
  #416 apply STDIN restore to all programs
  #416 fix compile issue introduced by downstream PR
  #416 update CHANGELOG [ci skip]
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants