mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2024-12-05 02:06:57 +00:00
f3bd0106ab
Co-authored-by: SupervisedThinking <supervisedthinking@gmail.com>
38 lines
808 B
Diff
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();
|
|
|
|
|