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

Allow running as root when not using setuid bit #6516

Closed
wants to merge 1 commit into from
Closed

Allow running as root when not using setuid bit #6516

wants to merge 1 commit into from

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Sep 13, 2021

For debugging (bypass DRM_AUTH), recovery (single user mode) and in some embedded scenarios (root shell instead of sudo/doas) it maybe desirable to run the compositor (and everything else within) as root. Currently, this is not supported to prevent foot-shooting when using builtin server in libseat.

$ sudo sway -c /dev/null
00:00:00.090 [sway/main.c:166] Unable to drop root (we shouldn't be able to restore it after setuid), refusing to start

Similar to #5669 but setuid vs. root is detected automatically. This makes Sway behave like wlroots compositors that don't drop priveleges (e.g., river, phoc, gamescope). Alternatively, drop_permissions() can be removed in favor of seatd-launch(1).

@emersion
Copy link
Member

Yeah, now that we have seatd-launch I think it would make sense to just drop all of that suid logic. @kennylevinsen thoughts?

@kennylevinsen
Copy link
Member

kennylevinsen commented Sep 13, 2021

My main worry would be users SUID'ing sway right now to use the direct/built-in backend, who would experience the change as having sway keep running as full root without as much as a warning. Principle of least surprise and all that.

If we're comfortable with just warning about it in the release notes, then I'd suggest killing it. Maybe wait a little for 0.6.1 rollout though.

@emersion
Copy link
Member

Hm right, the transition period is a bit dangerous indeed. Maybe a gradual migration would be better? e.g. error out if we're suid root for a release or two, then drop the logic completely?

@emersion emersion added the enhancement New feature or incremental improvement label Dec 21, 2021
@Hjdskes
Copy link

Hjdskes commented Jan 15, 2022

Linking this related commit here for posterity: e1db1f8 (from #6756)

@emersion
Copy link
Member

emersion commented Jun 3, 2022

Superseded by #7044

@emersion emersion closed this Jun 3, 2022
@jbeich jbeich deleted the allow-root branch June 3, 2022 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or incremental improvement
Development

Successfully merging this pull request may close these issues.

4 participants