[systemd-commits] 2 commits - src/login
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Feb 7 11:12:44 PST 2012
src/login/logind-dbus.c | 45 +++++++++++++++++++++++++++++++---
src/login/org.freedesktop.login1.conf | 4 +++
2 files changed, 46 insertions(+), 3 deletions(-)
New commits:
commit cae5846b2cbb5091267f59f4c7f941ce767a1f8f
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Feb 7 20:12:21 2012 +0100
logind: fix introspection data
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 506601b..a50db63 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -94,12 +94,12 @@
" </method>\n" \
" <method name=\"KillSession\">\n" \
" <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
- " <arg name=\"who\" type=\"s\"/>\n" \
- " <arg name=\"signal\" type=\"s\"/>\n" \
+ " <arg name=\"who\" type=\"s\" direction=\"in\"/>\n" \
+ " <arg name=\"signal\" type=\"s\" direction=\"in\"/>\n" \
" </method>\n" \
" <method name=\"KillUser\">\n" \
" <arg name=\"uid\" type=\"u\" direction=\"in\"/>\n" \
- " <arg name=\"signal\" type=\"s\"/>\n" \
+ " <arg name=\"signal\" type=\"s\" direction=\"in\"/>\n" \
" </method>\n" \
" <method name=\"TerminateSession\">\n" \
" <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
commit 84c3361e129a5ae7a5a408b1562f7f2336b1de3a
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Feb 7 20:12:13 2012 +0100
logind: introduce ActivateSessionOnSeat()
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index fda1b0d..506601b 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -82,6 +82,10 @@
" <method name=\"ActivateSession\">\n" \
" <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
" </method>\n" \
+ " <method name=\"ActivateSessionOnSeat\">\n" \
+ " <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
+ " <arg name=\"seat\" type=\"s\" direction=\"in\"/>\n" \
+ " </method>\n" \
" <method name=\"LockSession\">\n" \
" <arg name=\"id\" type=\"s\" direction=\"in\"/>\n" \
" </method>\n" \
@@ -1043,6 +1047,41 @@ static DBusHandlerResult manager_message_handler(
if (!reply)
goto oom;
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.login1.Manager", "ActivateSessionOnSeat")) {
+ const char *session_name, *seat_name;
+ Session *session;
+ Seat *seat;
+
+ /* Same as ActivateSession() but refuses to work if
+ * the seat doesn't match */
+
+ if (!dbus_message_get_args(
+ message,
+ &error,
+ DBUS_TYPE_STRING, &session_name,
+ DBUS_TYPE_STRING, &seat_name,
+ DBUS_TYPE_INVALID))
+ return bus_send_error_reply(connection, message, &error, -EINVAL);
+
+ session = hashmap_get(m->sessions, session_name);
+ if (!session)
+ return bus_send_error_reply(connection, message, &error, -ENOENT);
+
+ seat = hashmap_get(m->seats, seat_name);
+ if (!seat)
+ return bus_send_error_reply(connection, message, &error, -ENOENT);
+
+ if (session->seat != seat)
+ return bus_send_error_reply(connection, message, &error, -EINVAL);
+
+ r = session_activate(session);
+ if (r < 0)
+ return bus_send_error_reply(connection, message, NULL, r);
+
+ reply = dbus_message_new_method_return(message);
+ if (!reply)
+ goto oom;
+
} else if (dbus_message_is_method_call(message, "org.freedesktop.login1.Manager", "LockSession") ||
dbus_message_is_method_call(message, "org.freedesktop.login1.Manager", "UnlockSession")) {
const char *name;
diff --git a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf
index 17ec605..1774655 100644
--- a/src/login/org.freedesktop.login1.conf
+++ b/src/login/org.freedesktop.login1.conf
@@ -73,6 +73,10 @@
send_member="ActivateSession"/>
<allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
+ send_member="ActivateSessionOnSeat"/>
+
+ <allow send_destination="org.freedesktop.login1"
send_interface="org.freedesktop.login1.Seat"
send_member="ActivateSession"/>
More information about the systemd-commits
mailing list