forge
Explore
Log in

Don't you dare go Hollow

Disallow quit when locked by default

Browse files at this commit

bc4b973514f1f71d08a91e3538b0b5f12c70342dIvan MolodetskikhParent: c87a029
Security-wise, I still consider quit when locked to be within our model,
because a niri crash has the same effect as quitting. Disallowing quit
just makes it harder to imagine this scenario and take precautions.

However, upon further consideration, it's probably bad that a random
person can walk up to your PC and terminate all running applications
(even if they get a locked display manager afterwards). Other desktop
environments seem to hide the Log Out action on the lock screen too.
docs/wiki/Security-Model.mdmodified+4 -1
@@ -53,8 +53,11 @@ When the session is locked via [ext-session-lock](https://wayland.app/protocols/
53 Only a very small set of safe actions is allowed.53 Only a very small set of safe actions is allowed.
54 In particular, spawning will not work, with the exception of binds explicitly configured with `allow-when-locked=true`.54 In particular, spawning will not work, with the exception of binds explicitly configured with `allow-when-locked=true`.
55 55
56+<sup>Until: next release</sup>
56 Importantly, the **quit** action is allowed—you can always quit niri, even when on a lock screen.57 Importantly, the **quit** action is allowed—you can always quit niri, even when on a lock screen.
57-Therefore, you must ensure that quitting niri does not drop you into an unprotected TTY commandline.58+
59+Be careful if you allow the **quit** action, or if your lock screen has a way to exit niri.
60+You must ensure that quitting niri does not drop you into an unprotected TTY commandline.
58 Usually, a display manager, like GDM, will do this for you: when niri exits (via the quit bind or if it crashes), it'll put you back into a safe password prompt.61 Usually, a display manager, like GDM, will do this for you: when niri exits (via the quit bind or if it crashes), it'll put you back into a safe password prompt.
59 62
60 Other than quitting, the only way to exit a lock screen is for the lock screen client to tell niri to unlock the session.63 Other than quitting, the only way to exit a lock screen is for the lock screen client to tell niri to unlock the session.
src/input/mod.rsmodified+1 -2
@@ -4799,8 +4799,7 @@ fn should_reset_pointer_inactivity_timer<I: InputBackend>(event: &InputEvent<I>)
4799 fn allowed_when_locked(action: &Action) -> bool {4799 fn allowed_when_locked(action: &Action) -> bool {
4800 matches!(4800 matches!(
4801 action,4801 action,
4802- Action::Quit(_)4802+ Action::ChangeVt(_)
4803- | Action::ChangeVt(_)
4804 | Action::Suspend4803 | Action::Suspend
4805 | Action::PowerOffMonitors4804 | Action::PowerOffMonitors
4806 | Action::PowerOnMonitors4805 | Action::PowerOnMonitors