weston-launch has two supported use cases now: either launch from
and VT login as a regular user (running within that session) or
from an init script (systemd or such) with the -u option to create
a session for the specified user. Running from within X or ssh is
not possible. It's still possible to run weston as root from X or ssh
but that's strictly a development/debug/test feature.
https://bugs.freedesktop.org/show_bug.cgi?id=69727
if (wl->tty < 0)
error(1, errno, "failed to open tty");
+ if (fstat(wl->tty, &buf) == -1 ||
+ major(buf.st_rdev) != TTY_MAJOR || minor(buf.st_rdev) == 0)
+ error(1, 0, "weston-launch must be run from a virtual terminal");
+
if (tty) {
if (fstat(wl->tty, &buf) < 0)
error(1, errno, "stat %s failed", tty);