aboutsummaryrefslogtreecommitdiff
path: root/libseat/backend
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-08-29 22:58:00 +0200
committerKenny Levinsen <kl@kl.wtf>2020-08-29 23:01:56 +0200
commit1ae6c3b3ddf0ce2a2e1817eb9c74e0c03153df58 (patch)
tree2ba9ed06def6028b647a8e9142abfa5ec7c3c64a /libseat/backend
parent52fe75d5a404c390a1941b7f6cc3c18fb146ec3e (diff)
libseat: Check euid before using builtin
Diffstat (limited to 'libseat/backend')
-rw-r--r--libseat/backend/seatd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libseat/backend/seatd.c b/libseat/backend/seatd.c
index 5bb478e..afeab7f 100644
--- a/libseat/backend/seatd.c
+++ b/libseat/backend/seatd.c
@@ -575,6 +575,11 @@ static struct libseat *builtin_open_seat(struct libseat_seat_listener *listener,
return NULL;
}
+ if (geteuid() != 0) {
+ log_debug("Built-in seatd instance requires root privileges");
+ return NULL;
+ }
+
pid_t pid = fork();
if (pid == -1) {
log_errorf("Could not fork: %s", strerror(errno));