]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Disable the Containers interface
authorSimon McVittie <smcv@collabora.com>
Fri, 10 Dec 2021 14:31:45 +0000 (14:31 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 10 Dec 2021 16:48:51 +0000 (16:48 +0000)
We've had a request for a 1.14.x stable-branch, but the Containers
interface is only partially implemented, not yet described in the
D-Bus Specification, and not ready to be part of our API guarantees.

Signed-off-by: Simon McVittie <smcv@collabora.com>
14 files changed:
CMakeLists.txt
README.cmake
bus/containers.c
bus/driver.c
bus/session.conf.in
bus/system.conf.in
cmake/config.h.cmake
configure.ac
dbus/dbus-shared.h
doc/dbus-daemon.1.xml.in
test/containers.c
test/data/valid-config-files/limit-containers.conf.in
test/data/valid-config-files/tmp-session.conf.in
test/dbus-daemon.c

index c9b3784b0fd0422e0de2efaaf1a93ad34d1f7573..994f71972ff7df112e3de678b6e4fbd374ce0924 100644 (file)
@@ -138,7 +138,6 @@ endif()
 option(DBUS_DISABLE_ASSERT "Disable assertion checking" OFF)
 
 option(DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF)
-option(DBUS_ENABLE_CONTAINERS "enable restricted servers for app-containers" OFF)
 option(ENABLE_TRADITIONAL_ACTIVATION "Enable traditional activation (without using systemd)" ON)
 
 if(DBUS_LINUX)
index a9e4feb7fa03803addf7ebf5d82a78a23067ce9a..a1cfc96a73113f12e795f12d44a72fd530adf40d 100644 (file)
@@ -149,9 +149,6 @@ ENABLE_QT_HELP:STRING=AUTO
 // enable bus daemon usage statistics
 DBUS_ENABLE_STATS:BOOL=OFF
 
-// enable restricted servers for app containers
-DBUS_ENABLE_CONTAINERS:BOOL=OFF
-
 // build with systemd at_console support
 ENABLE_SYSTEMD:STRING=AUTO
 
index 213ce3c9381f051c34e47a8ac04f0939b8ffccc8..8abeca1f40d54ad300ab9acf3cb2882cf5878dd1 100644 (file)
@@ -27,6 +27,8 @@
 
 #ifdef DBUS_ENABLE_CONTAINERS
 
+#error This feature is not ready for production use
+
 #ifndef DBUS_UNIX
 # error DBUS_ENABLE_CONTAINERS requires DBUS_UNIX
 #endif
index 6f5451a10fc853be7afcf7c1b169622c0be0e048..ef1b957f6ad6ac9e3ec7c120c2e15363b693eaeb 100644 (file)
@@ -1975,7 +1975,9 @@ bus_driver_fill_connection_credentials (DBusCredentials *credentials,
   dbus_pid_t pid = DBUS_PID_UNSET;
   const char *windows_sid = NULL;
   const char *linux_security_label = NULL;
+#ifdef DBUS_ENABLE_CONTAINERS
   const char *path;
+#endif
 
   if (credentials == NULL && conn != NULL)
     credentials = _dbus_connection_get_credentials (conn);
@@ -2030,6 +2032,7 @@ bus_driver_fill_connection_credentials (DBusCredentials *credentials,
         return FALSE;
     }
 
+#ifdef DBUS_ENABLE_CONTAINERS
   /* This has to come from the connection, not the credentials */
   if (conn != NULL &&
       bus_containers_connection_is_contained (conn, &path, NULL, NULL))
@@ -2039,6 +2042,7 @@ bus_driver_fill_connection_credentials (DBusCredentials *credentials,
                                       path))
         return FALSE;
     }
+#endif
 
   return TRUE;
 }
index ace073c95d9aa72f2142742bbdeb1799718fbf76..affa7f1d95dd96a435ed5cda136b7d4041911479 100644 (file)
   <limit name="max_names_per_connection">50000</limit>
   <limit name="max_match_rules_per_connection">50000</limit>
   <limit name="max_replies_per_connection">50000</limit>
-  <limit name="max_containers">10000</limit>
-  <limit name="max_containers_per_user">10000</limit>
-  <limit name="max_container_metadata_bytes">1000000000</limit>
-  <!-- This is relatively low so that app-containers (which we do not fully
-       trust) do not cause DoS. -->
-  <limit name="max_connections_per_container">16</limit>
 
 </busconfig>
index 7c79a1aea3f17a6aced440bcdc5d85d616cf5ec8..d2f3244b192064dfd1e5317a7328685bfb9de7ba 100644 (file)
   <!-- <limit name="max_names_per_connection">512</limit> -->
   <!-- <limit name="max_match_rules_per_connection">512</limit> -->
   <!-- <limit name="max_replies_per_connection">128</limit> -->
-  <!-- <limit name="max_containers">512</limit> -->
-  <!-- <limit name="max_containers_per_user">16</limit> -->
-  <!-- <limit name="max_container_metadata_bytes">4096</limit> -->
-  <!-- <limit name="max_connections_per_container">8</limit> -->
 
   <!-- Config files are placed here that among other things, punch 
        holes in the above policy for specific services. -->
index a3258789bdf24eccf0b1034b5b807484a20fec1c..34592372d80e8ba7f51855948230e64a17d4077f 100644 (file)
@@ -38,7 +38,6 @@
 #cmakedefine DBUS_RUNSTATEDIR "@DBUS_RUNSTATEDIR@"
 
 #cmakedefine DBUS_ENABLE_STATS
-#cmakedefine DBUS_ENABLE_CONTAINERS
 #cmakedefine ENABLE_TRADITIONAL_ACTIVATION
 
 #define TEST_LISTEN       "@TEST_LISTEN@"
index a806ed8e75d7fcbaad48efed04911969e77d44f5..1b252bbde57d24dcc773cc5f00727573d62af976 100644 (file)
@@ -1710,16 +1710,6 @@ AC_ARG_ENABLE([user-session],
 AM_CONDITIONAL([DBUS_ENABLE_USER_SESSION],
   [test "x$enable_user_session" = xyes])
 
-AC_ARG_ENABLE([containers],
-  [AS_HELP_STRING([--enable-containers],
-    [enable restricted servers for app containers])],
-  [], [enable_containers=no])
-AS_IF([test "x$enable_containers" = xyes && test "x$dbus_unix" != xyes],
-  [AC_MSG_ERROR([Restricted servers for app containers require Unix])])
-AS_IF([test "x$enable_containers" = xyes],
-  [AC_DEFINE([DBUS_ENABLE_CONTAINERS], [1],
-    [Define to enable restricted servers for app containers])])
-
 AC_CONFIG_FILES([
 Doxyfile
 dbus/Version
@@ -1801,7 +1791,6 @@ echo "
         Building assertions:      ${enable_asserts}
         Building checks:          ${enable_checks}
         Building bus stats API:   ${enable_stats}
-        Building container API:   ${enable_containers}
         Building SELinux support: ${have_selinux}
         Building AppArmor support: ${have_apparmor}
         Building inotify support: ${have_inotify}
index 14879ea7b4ab9e9a48e4c745bd1d21c3ee406f7f..d6a3c9893c32870e03642d9c451e8bb554182f06 100644 (file)
@@ -86,8 +86,6 @@ typedef enum
  */
 /** The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS */
 #define DBUS_INTERFACE_DBUS           "org.freedesktop.DBus"
-/** The restricted container interface exported by the dbus-daemon */
-#define DBUS_INTERFACE_CONTAINERS1    "org.freedesktop.DBus.Containers1"
 /** The monitoring interface exported by the dbus-daemon */
 #define DBUS_INTERFACE_MONITORING     "org.freedesktop.DBus.Monitoring"
 
index 80fe945312e3f35caf6a286c0f0d1330998ff473..cb81157798f5c33fc0ee33d4c15fa267a7cd7759 100644 (file)
@@ -840,14 +840,6 @@ Available limit names are:</para>
                                      (number of calls-in-progress)
       "reply_timeout"              : milliseconds (thousandths)
                                      until a method call times out
-      "max_containers"             : max number of restricted servers for use
-                                     in app-containers, in total
-      "max_containers_per_user"    : max number of app-containers per Unix uid
-      "max_container_metadata_bytes": max number of bytes of metadata to store
-                                      for each app-container
-      "max_connections_per_container": max number of (authenticated or
-                                       unauthenticated) connections to each
-                                       app-container
 </literallayout> <!-- .fi -->
 
 
index dcc81c5ce5738f13e7c9fc952ab530f35bb3f3a5..553b60887315a68d3ddb42a7f95747b4412bff36 100644 (file)
@@ -46,6 +46,8 @@
 
 #include "test-utils-glib.h"
 
+#define DBUS_INTERFACE_CONTAINERS1    "org.freedesktop.DBus.Containers1"
+
 typedef struct {
     TestMainContext *ctx;
     gboolean skip;
index 3cc3bb056ebbf4448698d1131fcababb19e46bc7..44dd397953345af88f478f85a8d652f2c8b798df 100644 (file)
@@ -13,9 +13,4 @@
     <!-- Allow anyone to own anything -->
     <allow own="*"/>
   </policy>
-
-  <limit name="max_containers">5</limit>
-  <limit name="max_containers_per_user">3</limit>
-  <limit name="max_container_metadata_bytes">4096</limit>
-  <limit name="max_connections_per_container">3</limit>
 </busconfig>
index 502619dd6f1cccba4f885394974b180e6c2ea30d..d1effae1ecb4a962b3c3448675664ac5e1d3cf03 100644 (file)
   <limit name="max_names_per_connection">50000</limit>
   <limit name="max_match_rules_per_connection">50000</limit>
   <limit name="max_replies_per_connection">50000</limit>
-  <limit name="max_containers">10000</limit>
-  <limit name="max_containers_per_user">10000</limit>
-  <limit name="max_container_metadata_bytes">1000000000</limit>
-  <!-- This is relatively low so that app-containers (which we do not fully
-       trust) do not cause DoS. -->
-  <limit name="max_connections_per_container">16</limit>
-
 </busconfig>
index e57fcfa9cd1acb7fdddb7c05963e845807ba689e..881e0d06173ba2ac3a34edad21b798686f3337c2 100644 (file)
@@ -636,10 +636,6 @@ test_creds (Fixture *f,
           g_assert_not_reached ();
 #endif
         }
-      else if (g_str_has_prefix (name, DBUS_INTERFACE_CONTAINERS1 "."))
-        {
-          g_assert_not_reached ();
-        }
 
       dbus_message_iter_next (&arr_iter);
     }