[PATCH 4/4] rpc: Check client limits in more places

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2033879
Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/rpc/virnetserver.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 2ec4b9a6c947..bf0fda04ee89 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -370,6 +370,13 @@ virNetServerNew(const char *name,
     g_autoptr(virNetServer) srv = NULL;
     g_autofree char *jobName = g_strdup_printf("rpc-%s", name);
 
+    if (max_clients < max_anonymous_clients) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("The overall maximum number of clients must not be less "
+                         "than the number of clients waiting for authentication"));
+        return NULL;
+    }
+
     if (virNetServerInitialize() < 0)
         return NULL;
 
@@ -449,6 +456,12 @@ virNetServerNewPostExecRestart(virJSONValue *object,
                            _("Malformed max_anonymous_clients data in JSON document"));
             return NULL;
         }
+        if (max_clients < max_anonymous_clients) {
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("The overall maximum number of clients must not be less "
+                             "than the number of clients waiting for authentication"));
+            return NULL;
+        }
     } else {
         max_anonymous_clients = max_clients;
     }
-- 
2.39.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux