Skip to content

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

Merged
yuwata merged 1 commit intosystemd:masterfrom
vcaputo:getpeergroupassert
Feb 3, 2018
Merged

socket-util: fix getpeergroups() assert(fd)#8080
yuwata merged 1 commit intosystemd:masterfrom
vcaputo:getpeergroupassert

Conversation

@vcaputo
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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.

2 participants