aboutsummaryrefslogtreecommitdiff
path: root/backend/session
diff options
context:
space:
mode:
authorn3rdopolis <bluescreenavenger@gmail.com>2017-12-02 10:50:00 -0500
committerGitHub <noreply@github.com>2017-12-02 10:50:00 -0500
commita8d8a63fe0b437a6a4d37fd03a0e8b4e178e22c7 (patch)
tree5dee4522a32702c95fb30a027e5347b76819ee84 /backend/session
parent779cccf8b421b99031884f4d2886e788ac77a6eb (diff)
Attempt to fix #454
With logind, only seat0 can use TTYs
Diffstat (limited to 'backend/session')
-rw-r--r--backend/session/logind.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/backend/session/logind.c b/backend/session/logind.c
index daff75b6..e42b85f8 100644
--- a/backend/session/logind.c
+++ b/backend/session/logind.c
@@ -347,19 +347,22 @@ static struct wlr_session *logind_session_create(struct wl_display *disp) {
goto error;
}
- ret = sd_session_get_vt(session->id, &session->base.vtnr);
- if (ret < 0) {
- wlr_log(L_ERROR, "Session not running in virtual terminal");
- goto error;
- }
-
char *seat;
ret = sd_session_get_seat(session->id, &seat);
if (ret < 0) {
wlr_log(L_ERROR, "Failed to get seat id: %s", strerror(-ret));
goto error;
}
+
snprintf(session->base.seat, sizeof(session->base.seat), "%s", seat);
+ if (seat == "seat0")
+ {
+ ret = sd_session_get_vt(session->id, &session->base.vtnr);
+ if (ret < 0) {
+ wlr_log(L_ERROR, "Session not running in virtual terminal");
+ goto error;
+ }
+ }
free(seat);
ret = sd_bus_default_system(&session->bus);