aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2022-01-11 11:08:44 +0100
committerLibravatar Simon Ser <contact@emersion.fr>2022-01-16 19:26:57 +0100
commit67d3d952b6cd328ffd053ad4f52dc1687e28a56b (patch)
treef1d8214fbd5d5a239f135cd6726a3d28f1f15996
parentmeson: check: false on run_command (diff)
downloadsway-67d3d952b6cd328ffd053ad4f52dc1687e28a56b.tar.gz
sway-67d3d952b6cd328ffd053ad4f52dc1687e28a56b.tar.zst
sway-67d3d952b6cd328ffd053ad4f52dc1687e28a56b.zip
Print deprecation notice when running SUID
SUID privilege drop is needed for the "builtin"-backend of libseat, which copied our old "direct" backend behavior for the sake of compatibility and ease of transition. libseat now has a better alternative in the form of seatd-launch. It uses the normal seatd daemon and libseat backend and takes care of SUID for us. Add a soft deprecation warning to highlight our future intent of removing this code. The deprecation cycle is needed to avoid surprises when sway no longer drops privileges. (cherry picked from commit e1db1f8218998c428e8b087dda6660449ef2891a)
-rw-r--r--sway/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/main.c b/sway/main.c
index 6c71048b..b6f8a8bf 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -153,6 +153,9 @@ static void log_kernel(void) {
153 153
154static bool drop_permissions(void) { 154static bool drop_permissions(void) {
155 if (getuid() != geteuid() || getgid() != getegid()) { 155 if (getuid() != geteuid() || getgid() != getegid()) {
156 sway_log(SWAY_ERROR, "!!! DEPRECATION WARNING: "
157 "SUID privilege drop will be removed in a future release, please migrate to seatd-launch");
158
156 // Set the gid and uid in the correct order. 159 // Set the gid and uid in the correct order.
157 if (setgid(getgid()) != 0) { 160 if (setgid(getgid()) != 0) {
158 sway_log(SWAY_ERROR, "Unable to drop root group, refusing to start"); 161 sway_log(SWAY_ERROR, "Unable to drop root group, refusing to start");