0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-12-05 02:06:57 +00:00
Lakka-LibreELEC/packages/wayland/compositor/sway/patches/sway-100.02-allow-running-as-root.patch
Rudi Heitbaum f3bd0106ab sway: update to 1.8
Co-authored-by: SupervisedThinking <supervisedthinking@gmail.com>
2022-12-25 21:35:25 +00:00

38 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();