mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
logind: split up inhibit acquire policy
This commit is contained in:
parent
178cc7700c
commit
b14eda963c
2
TODO
2
TODO
@ -24,8 +24,6 @@ Bugfixes:
|
|||||||
|
|
||||||
F18:
|
F18:
|
||||||
|
|
||||||
* refuse automount triggers when automount is queued for stop, much like we refuse socket triggers when sockets are queued for stop
|
|
||||||
|
|
||||||
* logind: different policy actions for idle, suspend, shutdown blockers: allow idle blockers by default, don't allow suspend blockers by default
|
* logind: different policy actions for idle, suspend, shutdown blockers: allow idle blockers by default, don't allow suspend blockers by default
|
||||||
|
|
||||||
* selinux: merge systemd selinux access controls (dwalsh)
|
* selinux: merge systemd selinux access controls (dwalsh)
|
||||||
|
@ -1850,7 +1850,8 @@ static void socket_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
|
|||||||
if (w->socket_accept) {
|
if (w->socket_accept) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
||||||
if ((cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK)) < 0) {
|
cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK);
|
||||||
|
if (cfd < 0) {
|
||||||
|
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
@ -723,9 +723,10 @@ static int bus_manager_inhibit(Manager *m, DBusConnection *connection, DBusMessa
|
|||||||
}
|
}
|
||||||
|
|
||||||
r = verify_polkit(connection, message,
|
r = verify_polkit(connection, message,
|
||||||
m == INHIBIT_BLOCK ?
|
w == INHIBIT_SHUTDOWN ? (mm == INHIBIT_BLOCK ? "org.freedesktop.login1.inhibit-block-shutdown" : "org.freedesktop.login1.inhibit-delay-shutdown") :
|
||||||
"org.freedesktop.login1.inhibit-block" :
|
w == INHIBIT_SLEEP ? (mm == INHIBIT_BLOCK ? "org.freedesktop.login1.inhibit-block-sleep" : "org.freedesktop.login1.inhibit-delay-sleep") :
|
||||||
"org.freedesktop.login1.inhibit-delay", false, NULL, error);
|
(mm == INHIBIT_BLOCK ? "org.freedesktop.login1.inhibit-block-idle" : "org.freedesktop.login1.inhibit-delay-idle"),
|
||||||
|
false, NULL, error);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
<vendor>The systemd Project</vendor>
|
<vendor>The systemd Project</vendor>
|
||||||
<vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
|
<vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
|
||||||
|
|
||||||
<action id="org.freedesktop.login1.inhibit-block">
|
<action id="org.freedesktop.login1.inhibit-block-shutdown">
|
||||||
<_description>Allow applications to inhibit system shutdown and suspend</_description>
|
<_description>Allow applications to inhibit system shutdown</_description>
|
||||||
<_message>Authentication is required to allow an application to inhibit system shutdown or suspend.</_message>
|
<_message>Authentication is required to allow an application to inhibit system shutdown.</_message>
|
||||||
<defaults>
|
<defaults>
|
||||||
<allow_any>auth_admin_keep</allow_any>
|
<allow_any>auth_admin_keep</allow_any>
|
||||||
<allow_inactive>yes</allow_inactive>
|
<allow_inactive>yes</allow_inactive>
|
||||||
@ -26,9 +26,49 @@
|
|||||||
</defaults>
|
</defaults>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action id="org.freedesktop.login1.inhibit-delay">
|
<action id="org.freedesktop.login1.inhibit-block-sleep">
|
||||||
<_description>Allow applications to delay system shutdown and suspend</_description>
|
<_description>Allow applications to inhibit system sleep</_description>
|
||||||
<_message>Authentication is required to allow an application to delay system shutdown or suspend.</_message>
|
<_message>Authentication is required to allow an application to inhibit system sleep.</_message>
|
||||||
|
<defaults>
|
||||||
|
<allow_any>auth_admin_keep</allow_any>
|
||||||
|
<allow_inactive>yes</allow_inactive>
|
||||||
|
<allow_active>yes</allow_active>
|
||||||
|
</defaults>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action id="org.freedesktop.login1.inhibit-block-idle">
|
||||||
|
<_description>Allow applications to inhibit automatic system suspend</_description>
|
||||||
|
<_message>Authentication is required to allow an application to inhibit automatic system suspend.</_message>
|
||||||
|
<defaults>
|
||||||
|
<allow_any>yes</allow_any>
|
||||||
|
<allow_inactive>yes</allow_inactive>
|
||||||
|
<allow_active>yes</allow_active>
|
||||||
|
</defaults>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action id="org.freedesktop.login1.inhibit-delay-shutdown">
|
||||||
|
<_description>Allow applications to delay system shutdown</_description>
|
||||||
|
<_message>Authentication is required to allow an application to delay system shutdown.</_message>
|
||||||
|
<defaults>
|
||||||
|
<allow_any>yes</allow_any>
|
||||||
|
<allow_inactive>yes</allow_inactive>
|
||||||
|
<allow_active>yes</allow_active>
|
||||||
|
</defaults>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action id="org.freedesktop.login1.inhibit-delay-sleep">
|
||||||
|
<_description>Allow applications to delay system sleep</_description>
|
||||||
|
<_message>Authentication is required to allow an application to delay system sleep.</_message>
|
||||||
|
<defaults>
|
||||||
|
<allow_any>yes</allow_any>
|
||||||
|
<allow_inactive>yes</allow_inactive>
|
||||||
|
<allow_active>yes</allow_active>
|
||||||
|
</defaults>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action id="org.freedesktop.login1.inhibit-delay-idle">
|
||||||
|
<_description>Allow applications to delay automatic system suspend</_description>
|
||||||
|
<_message>Authentication is required to allow an application to delay automatic system suspend.</_message>
|
||||||
<defaults>
|
<defaults>
|
||||||
<allow_any>yes</allow_any>
|
<allow_any>yes</allow_any>
|
||||||
<allow_inactive>yes</allow_inactive>
|
<allow_inactive>yes</allow_inactive>
|
||||||
|
Loading…
Reference in New Issue
Block a user