chiark / gitweb /
logind: refuse operations if the target unit is masked or unavailable
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Apr 2018 11:15:00 +0000 (13:15 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
commit797ec1bf0caeea2b72de01f8082bba2d785a20e4
tree3a736498c8016b2cd0539d0b10e2cd8d6b82acf9
parentcdb74e6e80ce1f932e43a201cce0f9438373b0b7
logind: refuse operations if the target unit is masked or unavailable

If hibernate.target is masked, and systemctl hibernate is invoked, havoc ensues.
logind starts the hibernation operation, but then doesn't go through with it;
gnome-shell segfaults. Let's be nice to the user and refuse doing anything in
that case.

$ sudo systemctl mask hibernate.target
$ busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CanHibernate
s "no"
$ sudo systemctl hibernate
Failed to hibernate system via logind: Access denied
Failed to start hibernate.target: Unit hibernate.target is masked.

https://bugzilla.redhat.com/show_bug.cgi?id=1468003#c4
src/login/logind-action.c
src/login/logind-action.h
src/login/logind-dbus.c