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

Keep CAP_SYS_PTRACE with suid binary #1043

Merged
merged 2 commits into from
Jan 12, 2017
Merged

Conversation

Hummer12007
Copy link
Contributor

This fixes sway when run with suid binary. (suid does not work with filecaps in an intuitive manner, so breakage occurs).

Note: suid binary will not require CAP_SYS_PTRACE.

if (suid) {
// Drop every cap except CAP_SYS_PTRACE
cap_t caps = cap_init();
cap_value_t keep = CAP_SYS_PTRACE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we also want that TTY one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was required because a suid binary would not gain all caps as effective, and besides, all the privileged stuff is dealt with in a child process of wlc (forked in wlc_init, so it keeps everything), so it isn't.

@ddevault ddevault merged commit 307e8af into swaywm:master Jan 12, 2017
@ddevault ddevault mentioned this pull request Feb 21, 2017
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants