]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/login/logind-dbus.c
logind: return "no" if sleep operation is disabled
authorMike Yuan <me@yhndnzj.com>
Tue, 31 Oct 2023 13:08:19 +0000 (21:08 +0800)
committerMike Yuan <me@yhndnzj.com>
Thu, 16 Nov 2023 09:49:33 +0000 (17:49 +0800)
commit51eeeb7bde2db84d2892eef4a8bf93896feeb985
treec6dee29c7bae4a75d6a91d6d349f7f39765f430e
parent15b5bb626256ed7ed32f537e06f6150bef0fe462
logind: return "no" if sleep operation is disabled

According to org.freedesktop.login1:

> If "na" is returned, the operation is not available because
> hardware, kernel, or drivers do not support it. If "yes" is
> returned, the operation is supported and the user may execute
> the operation without further authentication. If "no" is returned,
> the operation is available but the user is not allowed to execute
> the operation.

Therefore, we should return "no" if sleep is explicitly disabled,
otherwise we return "na".
src/login/logind-dbus.c