diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-11-28 17:25:25 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2013-11-28 17:41:38 +0100 |
commit | c506027af881a9e4210845a7a8a6ec5910aa0f3b (patch) | |
tree | 841c0aa91d455bc7e81f601a7532dcded97e65bf /src/login/logind-dbus.c | |
parent | 92bd5ff3a062c3f9475b9d9d39b9335bfeb7705e (diff) |
logind: require VTs on seat0 and forbid elsewhere
Sessions on seat0 must pass us a vtnr, otherwise, you shouldn't try
attaching it to seat0. For seats without VTs, we do the exact opposite: we
forbid VTs.
There can be odd situations if the session-files contain invalid
combinations. However, we try to keep sessions alive and restore state as
good as possible.
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r-- | src/login/logind-dbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 4239b3788a..9538150e2e 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -514,7 +514,7 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use if (seat) { if (seat_has_vts(seat)) { - if (vtnr > 63) + if (!vtnr || vtnr > 63) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "VT number out of range"); } else { if (vtnr != 0) |