1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

logind: add LockSessions() call to lock all local sessions at once

This commit is contained in:
Lennart Poettering 2012-07-29 16:17:06 +02:00
parent bad1837c18
commit fa2b196da1

View File

@ -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;