-
Notifications
You must be signed in to change notification settings - Fork 18
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
catatoinit: close fds >= 3 #14
Conversation
6ba3b11
to
733c5b3
Compare
733c5b3
to
0b81b8b
Compare
047ac8e
to
c4563e1
Compare
c4563e1
to
1ecdb97
Compare
lgtm |
@cyphar are you fine with this change? |
catatonit.c
Outdated
@@ -361,6 +439,8 @@ int main(int argc, char **argv) | |||
bail("self-check that pid1 (%d) was spawned failed: %m", pid1); | |||
debug("pid1 (%d) spawned: %s", pid1, argv[0]); | |||
|
|||
close_fds_ge_than(3, sfd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We obviously shouldn't bail here, but some kind of debug output if closing failed wouldn't hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is already a warn for each close()
that fails in the fallback code. Should we add another warn here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If close_range() is supported you wouldn't get any indication the close failed right? It could just be a debug message so you don't get duplicate warnings.
EDIT: Actually maybe the warning for each fd should be a debug message, and a warning from calling this just to make the warnings consistent.
Sorry, for some reason I didn't see this -- I think GitHub has given up on showing me new notifications from smaller repos. 😬 EDIT: Oh, for some reason my watch notifications for this repo weren't set to "everything". Sorry about that... |
1ecdb97
to
326e481
Compare
no worries! Thanks for the review. I've added a check for I've tested both build modes on Fedora 34, where |
close any additional fd that was already leaked into the child process. Closes: openSUSE#12 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
326e481
to
9c60e7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Ah I just noticed an embarrassing bug while testing this -- catatonit doesn't set the |
close any additional fd that was already leaked into the child
process.
Closes: #12
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com