[systemd-commits] 2 commits - TODO src/core src/login

Lennart Poettering lennart at kemper.freedesktop.org
Mon Sep 17 16:17:11 PDT 2012


 TODO                                       |    4 --
 src/core/socket.c                          |    3 +
 src/login/logind-dbus.c                    |    7 ++-
 src/login/org.freedesktop.login1.policy.in |   52 +++++++++++++++++++++++++----
 4 files changed, 53 insertions(+), 13 deletions(-)

New commits:
commit e9ace802cf907d3652e1ef082b39a0cbed4e19a7
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 18 01:17:03 2012 +0200

    Update TODO

diff --git a/TODO b/TODO
index eed8ff9..22d8473 100644
--- a/TODO
+++ b/TODO
@@ -24,7 +24,7 @@ Bugfixes:
 
 F18:
 
-* logind: different policy actions for idle, suspend, shutdown blockers: allow idle blockers by default, don't allow suspend blockers by default
+* https://bugzilla.gnome.org/show_bug.cgi?id=680689
 
 * selinux: merge systemd selinux access controls (dwalsh)
 

commit b14eda963c698aa89fac1d91501d572ec644cc2f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 18 01:16:23 2012 +0200

    logind: split up inhibit acquire policy

diff --git a/TODO b/TODO
index 0a2ced4..eed8ff9 100644
--- a/TODO
+++ b/TODO
@@ -24,8 +24,6 @@ Bugfixes:
 
 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
 
 * selinux: merge systemd selinux access controls (dwalsh)
diff --git a/src/core/socket.c b/src/core/socket.c
index f975a43..f346030 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1850,7 +1850,8 @@ static void socket_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
         if (w->socket_accept) {
                 for (;;) {
 
-                        if ((cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK)) < 0) {
+                        cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK);
+                        if (cfd < 0) {
 
                                 if (errno == EINTR)
                                         continue;
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index af62d87..4f180b0 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -723,9 +723,10 @@ static int bus_manager_inhibit(Manager *m, DBusConnection *connection, DBusMessa
         }
 
         r = verify_polkit(connection, message,
-                          m == INHIBIT_BLOCK ?
-                          "org.freedesktop.login1.inhibit-block" :
-                          "org.freedesktop.login1.inhibit-delay", false, NULL, error);
+                          w == INHIBIT_SHUTDOWN ? (mm == INHIBIT_BLOCK ? "org.freedesktop.login1.inhibit-block-shutdown" : "org.freedesktop.login1.inhibit-delay-shutdown") :
+                          w == INHIBIT_SLEEP    ? (mm == INHIBIT_BLOCK ? "org.freedesktop.login1.inhibit-block-sleep"    : "org.freedesktop.login1.inhibit-delay-sleep") :
+                                                  (mm == INHIBIT_BLOCK ? "org.freedesktop.login1.inhibit-block-idle"     : "org.freedesktop.login1.inhibit-delay-idle"),
+                          false, NULL, error);
         if (r < 0)
                 goto fail;
 
diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy.in
index 92c0a4d..970adbe 100644
--- a/src/login/org.freedesktop.login1.policy.in
+++ b/src/login/org.freedesktop.login1.policy.in
@@ -16,9 +16,9 @@
         <vendor>The systemd Project</vendor>
         <vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
 
-        <action id="org.freedesktop.login1.inhibit-block">
-                <_description>Allow applications to inhibit system shutdown and suspend</_description>
-                <_message>Authentication is required to allow an application to inhibit system shutdown or suspend.</_message>
+        <action id="org.freedesktop.login1.inhibit-block-shutdown">
+                <_description>Allow applications to inhibit system shutdown</_description>
+                <_message>Authentication is required to allow an application to inhibit system shutdown.</_message>
                 <defaults>
                         <allow_any>auth_admin_keep</allow_any>
                         <allow_inactive>yes</allow_inactive>
@@ -26,9 +26,49 @@
                 </defaults>
         </action>
 
-        <action id="org.freedesktop.login1.inhibit-delay">
-                <_description>Allow applications to delay system shutdown and suspend</_description>
-                <_message>Authentication is required to allow an application to delay system shutdown or suspend.</_message>
+        <action id="org.freedesktop.login1.inhibit-block-sleep">
+                <_description>Allow applications to inhibit system sleep</_description>
+                <_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>
                         <allow_any>yes</allow_any>
                         <allow_inactive>yes</allow_inactive>



More information about the systemd-commits mailing list