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

Consistently use cleanup_fdp() to close fds when the result is ignored #667

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smcv
Copy link
Collaborator

@smcv smcv commented Oct 30, 2024

This avoids leaving dangling references to fds that no longer exist, clarifying ownership.

This commit does not cover the socket pairs used to transfer the pid of a descendant process (see #665 for that) and privilege-separated operations (see #666).

cc @refi64

This avoids leaving dangling references to fds that no longer exist,
clarifying ownership.

This commit does not cover the socket pairs used to transfer the pid
of a descendant process (see containers#665 for that) and privilege-separated
operations (see containers#666).

Signed-off-by: Simon McVittie <[email protected]>
@smcv
Copy link
Collaborator Author

smcv commented Oct 30, 2024

This avoids leaving dangling references to fds that no longer exist

... except actually no it doesn't, because cleanup_fdp() doesn't set *fdp = -1. Maybe it should, or maybe we should have a different helper function.

@smcv smcv marked this pull request as draft October 30, 2024 15:07
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.

1 participant