summaryrefslogtreecommitdiff
path: root/bus/containers.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2017-06-02 14:51:54 +0100
committerSimon McVittie <smcv@collabora.com>2017-12-11 15:50:02 +0000
commit88b3c319281d988d70253b17d59f7ba687042006 (patch)
tree36da83dda6d7e532f94b248cef28341400349f5d /bus/containers.c
parent39262d0a2913fc8ee951beb3d0241720abf651c0 (diff)
downloaddbus-88b3c319281d988d70253b17d59f7ba687042006.tar.gz
driver: Add a stub implementation of the Containers1 interface
For now, this is considered to be a privileged operation, because the resource-limiting isn't wired up yet. It only contains the bare minimum of API. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354
Diffstat (limited to 'bus/containers.c')
-rw-r--r--bus/containers.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/bus/containers.c b/bus/containers.c
new file mode 100644
index 00000000..e8935490
--- /dev/null
+++ b/bus/containers.c
@@ -0,0 +1,55 @@
+/* containers.c - restricted bus servers for containers
+ *
+ * Copyright © 2017 Collabora Ltd.
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <config.h>
+#include "containers.h"
+
+#ifdef DBUS_ENABLE_CONTAINERS
+
+#ifndef DBUS_UNIX
+# error DBUS_ENABLE_CONTAINERS requires DBUS_UNIX
+#endif
+
+dbus_bool_t
+bus_containers_handle_add_server (DBusConnection *connection,
+ BusTransaction *transaction,
+ DBusMessage *message,
+ DBusError *error)
+{
+ dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED, "Not yet implemented");
+ return FALSE;
+}
+
+dbus_bool_t
+bus_containers_supported_arguments_getter (BusContext *context,
+ DBusMessageIter *var_iter)
+{
+ DBusMessageIter arr_iter;
+
+ /* There are none so far */
+ return dbus_message_iter_open_container (var_iter, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_STRING_AS_STRING,
+ &arr_iter) &&
+ dbus_message_iter_close_container (var_iter, &arr_iter);
+}
+
+#endif /* DBUS_ENABLE_CONTAINERS */