logind: Return proper error value when tty or seat doesn't match
If the seat or tty doesn't match we return with r == 0, which looks like success to weston_launcher_connect(), which then fails to fall back to the legacy path. https://bugs.freedesktop.org/show_bug.cgi?id=70876
This commit is contained in:
+7
-1
@@ -837,9 +837,14 @@ weston_logind_connect(struct weston_logind **out,
|
|||||||
|
|
||||||
t = NULL;
|
t = NULL;
|
||||||
r = sd_session_get_seat(wl->sid, &t);
|
r = sd_session_get_seat(wl->sid, &t);
|
||||||
if (r < 0 || strcmp(seat_id, t)) {
|
if (r < 0) {
|
||||||
|
weston_log("logind: failed to get session seat\n");
|
||||||
|
free(t);
|
||||||
|
goto err_session;
|
||||||
|
} else if (strcmp(seat_id, t)) {
|
||||||
weston_log("logind: weston's seat '%s' differs from session-seat '%s'\n",
|
weston_log("logind: weston's seat '%s' differs from session-seat '%s'\n",
|
||||||
seat_id, t);
|
seat_id, t);
|
||||||
|
r = -EINVAL;
|
||||||
free(t);
|
free(t);
|
||||||
goto err_session;
|
goto err_session;
|
||||||
}
|
}
|
||||||
@@ -852,6 +857,7 @@ weston_logind_connect(struct weston_logind **out,
|
|||||||
} else if (tty > 0 && wl->vtnr != (unsigned int )tty) {
|
} else if (tty > 0 && wl->vtnr != (unsigned int )tty) {
|
||||||
weston_log("logind: requested VT --tty=%d differs from real session VT %u\n",
|
weston_log("logind: requested VT --tty=%d differs from real session VT %u\n",
|
||||||
tty, wl->vtnr);
|
tty, wl->vtnr);
|
||||||
|
r = -EINVAL;
|
||||||
goto err_session;
|
goto err_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user