]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test/dbus-daemon: Mark max-connections-per-user as unimplemented on Windows
authorSimon McVittie <smcv@collabora.com>
Thu, 29 Nov 2018 14:24:00 +0000 (14:24 +0000)
committerSimon McVittie <smcv@collabora.com>
Thu, 29 Nov 2018 14:24:52 +0000 (14:24 +0000)
The implementation of the max-connections-per-user limit works in terms
of Unix uids, so it doesn't apply on Windows.

This is not a problem in practice, because it only makes sense to limit
connections per user if you have multiple users, and we don't support
the well-known system bus on Windows.

Signed-off-by: Simon McVittie <smcv@collabora.com>
test/dbus-daemon.c

index 146f3113ef91f472a08ed756388d95b7bceccf7d..20935ffb19f88e91feea17136b4996ee69b9b6d4 100644 (file)
@@ -660,6 +660,11 @@ test_canonical_path_uae (Fixture *f,
   dbus_clear_message (&m);
 }
 
+static Config max_connections_per_user_config = {
+    NULL, 1, "valid-config-files/max-connections-per-user.conf",
+    TEST_USER_ME, SPECIFY_ADDRESS
+};
+
 static void
 test_max_connections (Fixture *f,
     gconstpointer context)
@@ -667,10 +672,27 @@ test_max_connections (Fixture *f,
   DBusError error = DBUS_ERROR_INIT;
   DBusConnection *third_conn;
   DBusConnection *failing_conn;
+#ifdef DBUS_WIN
+  const Config *config = context;
+#endif
 
   if (f->skip)
     return;
 
+#ifdef DBUS_WIN
+  if (config == &max_connections_per_user_config)
+    {
+      /* <limit name="max_connections_per_user"/> is currently only
+       * implemented in terms of Unix uids. It could be implemented for
+       * Windows SIDs too, but there wouldn't be much point, because we
+       * don't support use of a multi-user dbus-daemon on Windows, so
+       * in practice all connections have the same SID. */
+      g_test_skip ("Maximum connections per Windows SID are not "
+                   "implemented");
+      return;
+    }
+#endif
+
   /* We have two connections already */
   g_assert (f->left_conn != NULL);
   g_assert (f->right_conn != NULL);
@@ -2021,11 +2043,6 @@ static Config max_completed_connections_config = {
     TEST_USER_ME, SPECIFY_ADDRESS
 };
 
-static Config max_connections_per_user_config = {
-    NULL, 1, "valid-config-files/max-connections-per-user.conf",
-    TEST_USER_ME, SPECIFY_ADDRESS
-};
-
 static Config max_replies_per_connection_config = {
     NULL, 1, "valid-config-files/max-replies-per-connection.conf",
     TEST_USER_ME, SPECIFY_ADDRESS