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
Copy link
Member

@yuwata yuwata commented Feb 3, 2018

lgtm.

@yuwata yuwata merged commit 75f4077 into systemd:master Feb 3, 2018
3 checks passed
3 checks passed
Fedora Rawhide CI x86_64 rpm build [succeeded]
Details
semaphoreci The build passed on Semaphore.
Details
xenial-amd64 autopkgtest finished (success)
Details
@agaida agaida mentioned this pull request Feb 14, 2018
1 of 2 tasks complete
aughr added a commit to aughr/systemd that referenced this pull request Apr 10, 2018
mgerstner added a commit to mgerstner/gamemode that referenced this pull request Jul 30, 2018
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
@vcaputo vcaputo deleted the vcaputo:getpeergroupassert branch Apr 13, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants