Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Found by: michaelortmann
Patch by: michaelortmann
Fixes:
One-line summary:
Fix more ident lookup bugs
Additional description (if needed):
Please misc/runautotools when testing / merging this PR.
If a socket is set
O_NONBLOCK
andconnect()
returnsEINPROGRESS
, it must be checked forECONNREFUSED
.Here, this was done properly:
eggdrop/src/net.c
Lines 560 to 580 in 2a6a368
But here it was not and a write was committed:
eggdrop/src/dcc.c
Lines 1383 to 1404 in 2a6a368
Additionally
O_NONBLOCK
is POSIX 2001 and old quirk code is removed, see: https://www.gaertner.de/~neitzel/susv3/basedefs/fcntl.h.htmlAdditionally also the proper code mentioned above had an issue, it did
select()
with an arbitrary timeout of 1 sec, when it should be nonblocking.Additionally there was a bug here:
eggdrop/src/dcc.c
Lines 1388 to 1403 in 2a6a368
Were this line
j = 0
ever executed, the gates of tartaros would have opened fordcc[0]
.Test cases demonstrating functionality (if applicable):
Without this fix:
When telnetting to the bot and the user has no identd running, the bot would log like:
With this fix:
Test without identd:
Test wih identd:
Additionally i applied this patch to windrop and it also works under cygwin.