Skip to content

Prevent Remoted from exiting when a client closes a connection prematurely#4390

Merged
vikman90 merged 1 commit into3.11from
3816-remoted-accept
Jan 9, 2020
Merged

Prevent Remoted from exiting when a client closes a connection prematurely#4390
vikman90 merged 1 commit into3.11from
3816-remoted-accept

Conversation

@vikman90
Copy link
Copy Markdown
Member

@vikman90 vikman90 commented Dec 23, 2019

Related issue
#3816

Description

Remoted may exit abruptly if a client (an agent) closes a connection before Remoted accepts it. This PR aims to let Remoted:

  • Report a debugging message on this condition.
  • Report a non-critical error on any other accept() call error.

Logs/Alerts example

2019/12/23 05:18:54 ossec-remoted[3961] secure.c:172 at HandleSecure(): DEBUG: (1242): Couldn't accept TCP connections: Software caused connection abort (103)

Tests

  • Compilation on Linux.
  • Scan Build on Linux.

@vikman90 vikman90 added type/bug Something isn't working module/remote labels Dec 23, 2019
@vikman90 vikman90 requested a review from snaow December 23, 2019 13:24
@vikman90 vikman90 self-assigned this Dec 23, 2019
@vikman90
Copy link
Copy Markdown
Member Author

Scan Build

No reports for file secure.c.

@chemamartinez chemamartinez self-requested a review January 9, 2020 12:01
Copy link
Copy Markdown
Contributor

@chemamartinez chemamartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vikman90 vikman90 merged commit 5a6f81a into 3.11 Jan 9, 2020
@vikman90 vikman90 deleted the 3816-remoted-accept branch January 9, 2020 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module/remote type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants