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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh: Clean up libssh connection on terminating signals #18632

Merged
merged 1 commit into from Apr 17, 2023

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Apr 13, 2023

When receiving SIGTERM or SIGINT, give libssh a chance to clean up the connection. In particular, that will close a running ProxyCommand process when logging out of Cockpit.

Fixes #18310
https://bugzilla.redhat.com/show_bug.cgi?id=2185785


I tested this with the simplified reproducer in https://bugzilla.redhat.com/show_bug.cgi?id=2185785#c4 . This should also obsolete the known issue cockpit-project/bots#4635 , i.e. TestIPA.testQualifiedUsers should now pass without a naughty skip. Update: I checked all test runs, and they all passed properly. 馃憤

When receiving SIGTERM or SIGINT, give libssh a chance to clean up the
connection. In particular, that will close a running `ProxyCommand`
process when logging out of Cockpit.

Fixes cockpit-project#18310
https://bugzilla.redhat.com/show_bug.cgi?id=2185785
@martinpitt
Copy link
Member Author

Aha, RHEL 8's glib cannot handle SIGPIPE -- well, that's fine. Fixed.

Copy link
Member

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

馃憤 looks fine, thanks

@allisonkarlitskaya allisonkarlitskaya merged commit a6fc6be into cockpit-project:main Apr 17, 2023
48 checks passed
@martinpitt martinpitt deleted the c-ssh-cleanup branch April 17, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cockpit-ssh leaks sss_ssh_knownhostsproxy and memory on SIGTERM
2 participants