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

socket-util: fix getpeergroups() assert(fd) #8080

Merged
merged 1 commit into from Feb 3, 2018

Conversation

vcaputo
Copy link
Member

@vcaputo vcaputo commented Feb 3, 2018

Don't assert on zero-value fds.

Don't assert on zero-value fds.
@yuwata yuwata added util-lib good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed labels Feb 3, 2018
@yuwata
Copy link
Member

yuwata commented Feb 3, 2018

lgtm.

@yuwata yuwata merged commit 75f4077 into systemd:master Feb 3, 2018
aughr pushed a commit to aughr/systemd that referenced this pull request Apr 10, 2018
@vcaputo vcaputo deleted the getpeergroupassert branch April 13, 2020 15:21
afayaz-feral pushed a commit to FeralInteractive/gamemode that referenced this pull request May 26, 2020
When there are not valid standard file descriptors then strange things
can happen. When new file descriptors are opened, they will take the
place of the former standard file descriptors and when e.g. somebody
calls printf() they will write to some file descriptor that is not
prepared for it. This would already happen during PLOG_MSG() in
gamemoded.

Actually this also causes a SIGABRT when calling gamemoded like this:

```bash
gamemoded -d
```

This is due to a bug [1] in systemd that causes an assertion to be
triggered. This shows that file descriptor zero is in this case being
replaced by a UNIX domain socket representing the connection to the
D-Bus session bus.

Therefore instead of just closing the standard file descriptors, replace
them by appropriate file descriptors refering to /dev/null.

[1]: systemd/systemd#8080
eumpf0 pushed a commit to eumpf0/systemd that referenced this pull request Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed util-lib
Development

Successfully merging this pull request may close these issues.

None yet

2 participants