diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-07-29 16:17:06 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-07-29 16:17:06 +0200 |
commit | fa2b196da12642d3560f5766eef09ffca7c31f7b (patch) | |
tree | 174bc9de5114d52ec267f41c144d758f78cd3d23 /src/login/logind-dbus.c | |
parent | bad1837c18b63130e698b4e7542a72f33644229d (diff) |
logind: add LockSessions() call to lock all local sessions at once
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r-- | src/login/logind-dbus.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index a2ead8609b..86ca654518 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -98,6 +98,7 @@ " <method name=\"UnlockSession\">\n" \ " <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \ " </method>\n" \ + " <method name=\"LockSessions\"/>\n" \ " <method name=\"KillSession\">\n" \ " <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \ " <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \ @@ -1745,6 +1746,18 @@ static DBusHandlerResult manager_message_handler( if (!reply) goto oom; + } else if (dbus_message_is_method_call(message, "org.freedesktop.login1.Manager", "LockSessions")) { + Session *session; + Iterator i; + + HASHMAP_FOREACH(session, m->sessions, i) + if (session_send_lock(session, true) < 0) + goto oom; + + reply = dbus_message_new_method_return(message); + if (!reply) + goto oom; + } else if (dbus_message_is_method_call(message, "org.freedesktop.login1.Manager", "KillSession")) { const char *swho; int32_t signo; |