aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2025-05-14 12:07:06 +0200
committerSimon Ser <contact@emersion.fr>2025-06-26 22:00:05 +0200
commit4f59eeef054bc18b25e72b2839707115a3265766 (patch)
tree5b267713b85e0850562dc9d0e01c502d37f4abac
parentc2f08075ec00632293bbc63582c7f3ffd75441af (diff)
Remove the temporary SUID warning
A temporary SUID detection that would cause sway to exit was introduced when SUID operation was deprecated, intended to avoid cases where a user would not heed the deprecation notice, continued to use SUID and ended up with sway accidentally running as root. Remove the check, as the three years that have passed is sufficient time for users to discover the deprecation and adapt. We did not care if users intentionally want to run sway as root through SUID, we only wanted to avoid surprise root.
-rw-r--r--sway/main.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/sway/main.c b/sway/main.c
index 69efd6cb..44d07679 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -108,20 +108,6 @@ static void log_kernel(void) {
pclose(f);
}
-static bool detect_suid(void) {
- if (geteuid() != 0 && getegid() != 0) {
- return false;
- }
-
- if (getuid() == geteuid() && getgid() == getegid()) {
- return false;
- }
-
- sway_log(SWAY_ERROR, "SUID operation is no longer supported, refusing to start. "
- "This check will be removed in a future release.");
- return true;
-}
-
static void restore_nofile_limit(void) {
if (original_nofile_rlimit.rlim_cur == 0) {
return;
@@ -292,11 +278,6 @@ int main(int argc, char **argv) {
}
}
- // SUID operation is deprecated, so block it for now.
- if (detect_suid()) {
- exit(EXIT_FAILURE);
- }
-
// Since wayland requires XDG_RUNTIME_DIR to be set, abort with just the
// clear error message (when not running as an IPC client).
if (!getenv("XDG_RUNTIME_DIR") && optind == argc) {