distribution/packages/wayland/compositor/sway/patches/sway-100.02-allow-running-as-root.patch

37 lines
808 B
Diff

--- a/sway/main.c
+++ b/sway/main.c
@@ -151,7 +151,8 @@
}
static bool detect_suid(void) {
- if (geteuid() != 0 && getegid() != 0) {
+ if (geteuid() == 0 && getegid() == 0) {
+ sway_log(SWAY_INFO, "Running sway as root user");
return false;
}
@@ -309,11 +310,6 @@
}
}
- // 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) {
@@ -363,6 +359,11 @@
return 0;
}
+ // SUID operation is deprecated, so block it for now.
+ if (detect_suid()) {
+ exit(EXIT_FAILURE);
+ }
+
detect_proprietary(allow_unsupported_gpu);
increase_nofile_limit();