mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
rpc: Check client limits in more places
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2033879 Signed-off-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f007940cb2
commit
35afa1d2d6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user