-
Notifications
You must be signed in to change notification settings - Fork 26
pam/go/exec: Code cleanup #822
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #822 +/- ##
==========================================
- Coverage 83.43% 79.02% -4.42%
==========================================
Files 83 103 +20
Lines 8689 10430 +1741
Branches 74 75 +1
==========================================
+ Hits 7250 8242 +992
- Misses 1111 1724 +613
- Partials 328 464 +136 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e663ed8
to
6e21c34
Compare
adombeck
reviewed
Mar 12, 2025
adombeck
reviewed
Mar 12, 2025
adombeck
reviewed
Mar 12, 2025
adombeck
approved these changes
Mar 12, 2025
We may end up modifying it while calling `g_debug` so make sure we're actually using the real errno on return.
We can safely call g_connection_close multiple times on a valid connection, while we already have code handling the connection disposal in action_module_data_cleanup(). As per this, there's no need to do the connection cleanup when the wait-child thread is done, nor there's risk that we're accessing to a disposed connection pointer, because at the point the wait-child thread is running, the action-thread is waiting for it. Just before disposing the connection.
Since the pointer is shared through different threads it's safer to always read and set it atomically, even if there are no races here but the API makes it more explicit.
Also no need to set the exit code in such cases, as it's just a system failure from the PAM side.
When the child receives signals should ignore them and just return a generic PAM system error, but still we need to check that they're properly handled
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
It's nice to increase coverage... :)
adombeck
approved these changes
Mar 14, 2025
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some random cleanups on the exec module, see commits for datails
UDENG-6256