summaryrefslogtreecommitdiffstats
path: root/dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus.c')
-rw-r--r--dbus.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/dbus.c b/dbus.c
index a80c012dc..e48aa1a02 100644
--- a/dbus.c
+++ b/dbus.c
@@ -605,6 +605,20 @@ cdbus_process(session_t *ps, DBusMessage *msg) {
"org.freedesktop.DBus.Introspectable", "Introspect")) {
success = cdbus_process_introspect(ps, msg);
}
+ else if (dbus_message_is_method_call(msg,
+ "org.freedesktop.DBus.Peer", "Ping")) {
+ cdbus_reply(ps, msg, NULL, NULL);
+ success = true;
+ }
+ else if (dbus_message_is_method_call(msg,
+ "org.freedesktop.DBus.Peer", "GetMachineId")) {
+ char *uuid = dbus_get_local_machine_id();
+ if (uuid) {
+ cdbus_reply_string(ps, msg, uuid);
+ dbus_free(uuid);
+ success = true;
+ }
+ }
else if (dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameAcquired")
|| dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameLost")) {
success = true;
@@ -1028,6 +1042,12 @@ cdbus_process_introspect(session_t *ps, DBusMessage *msg) {
" <arg name='data' direction='out' type='s' />\n"
" </method>\n"
" </interface>\n"
+ " <interface name='org.freedesktop.DBus.Peer'>\n"
+ " <method name='Ping' />\n"
+ " <method name='GetMachineId'>\n"
+ " <arg name='machine_uuid' direction='out' type='s' />\n"
+ " </method>\n"
+ " </interface>\n"
" <interface name='" CDBUS_INTERFACE_NAME "'>\n"
" <signal name='win_added'>\n"
" <arg name='wid' type='" CDBUS_TYPE_WINDOW_STR "'/>\n"