chiark / gitweb /
dbus: add some more safety checks before accepting data from bus clients
[elogind.git] / src / shared / dbus-common.h
index 9ae35df9c515376edc38756604f9d4f39e485b17..394ab4cb60787b68112de5658fd704790abc5d6f 100644 (file)
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foodbuscommonhfoo
-#define foodbuscommonhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -205,4 +204,18 @@ DBusHandlerResult bus_exit_idle_filter(DBusConnection *bus, DBusMessage *m, void
 
 pid_t bus_get_unix_process_id(DBusConnection *connection, const char *name, DBusError *error);
 
-#endif
+bool bus_error_is_no_service(const DBusError *error);
+int bus_method_call_with_reply(DBusConnection *bus,
+                               const char *destination,
+                               const char *path,
+                               const char *interface,
+                               const char *method,
+                               DBusMessage **return_reply,
+                               DBusError *return_error,
+                               int first_arg_type, ...);
+
+const char *bus_message_get_sender_with_fallback(DBusMessage *m);
+
+void bus_message_unrefp(DBusMessage **reply);
+
+#define _cleanup_dbus_message_unref_ __attribute__((cleanup(bus_message_unrefp)))