From nobody Fri May 17 08:39:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672675206; cv=none; d=zohomail.com; s=zohoarc; b=MbRXazWoq86GZlxUSAoKK4xvoW7IgNovNQei/ytUECov3e7PX5yylxYlC6EpxyyUd4af1Mx1LJzKsW+UeVBGOCWPkHtvp1DNwBa/1aYf1FH3S1VXlhuPDz6pVk3sfPeTeLD8IlX/MX4bn+to4KKG7WgCLncn2/uZ3t7lLJxV4z0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672675206; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=R9+SSpwg1XMqdb9o4JqZv9OjwEyMuWVEnLmZECA8j1g=; b=gCpfu5lSoaKqEs6pQ8bK2Ml2TgJXVhS/1sbJdmdAT1jVYO5dg0+rJkANyaUFLwTlbiJetjahx3p9CtrH/gz3cXhVB9ZzPnliI0cQzAzWvSNjV4PZVMhpPYN8WShpWKY2hVWm2pXVws6Z/peqe7uWFQgExI7m/1P7O/6IXsC81pk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1672675206252427.2228101634654; Mon, 2 Jan 2023 08:00:06 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-9-obWJemgXOxqOBJ_ThoR6wQ-1; Mon, 02 Jan 2023 10:59:38 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C13886C16B; Mon, 2 Jan 2023 15:59:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CCA140C2005; Mon, 2 Jan 2023 15:59:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 27B2F1946589; Mon, 2 Jan 2023 15:59:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8FD7E1946589 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 65AD1492D8B; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5DB3A49BB6A for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 410A91818E48 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-589-IBbfAOcpMIqdrIRhvCqOag-1; Mon, 02 Jan 2023 10:59:32 -0500 Received: by mail-ed1-f72.google.com with SMTP id w18-20020a05640234d200b0048cc3aa4993so2658259edc.7 for ; Mon, 02 Jan 2023 07:59:32 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id r9-20020a1709061ba900b0084cd08e5cb5sm893487ejg.159.2023.01.02.07.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 07:59:31 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 015D7C5DF280 for ; Mon, 2 Jan 2023 16:59:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672675202; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=R9+SSpwg1XMqdb9o4JqZv9OjwEyMuWVEnLmZECA8j1g=; b=YfTMqNLVNiQNdablA/nswFbndRmdAxXm1jNGT6wgawaY/Pu4XFnQnTvfow+vtGnANtzw1R 57B9ZYsbdRCvOCR+y7eNlbqQhnS0IF7pVqpOKGn5S6i95nCj/yIlTlAlrUr/ZukdJkWVIH Td9LEV6KPe1mxzALWFKncJqUVXgU8m4= X-MC-Unique: obWJemgXOxqOBJ_ThoR6wQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: IBbfAOcpMIqdrIRhvCqOag-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R9+SSpwg1XMqdb9o4JqZv9OjwEyMuWVEnLmZECA8j1g=; b=Os3ikuArqmUYOtE4M4+Xr7Tag50SiBugiJ0/PxG7YbTvqD7pAutxT1Kr9z3gYIfw4O FmibAD2EYJcYI6zo74zvWl0Gsqd4zgdxE5gHlRaeVi8RSoim+QS92IO05bz52Fg9uE/j 8EhDFtf0tdczfXWTHq+N3daTdwm0TEgTPtZDjy1kOBu48CuO7XYxt8rOfQVsAr2vN/PL 8k796HCWmHGq8FYNUTKGanNZ3nmdhEAH3u3YsQVBb0HOHVCReDWup8hd61r9g5Q9AOJo TIjIjBy4TznnZkJRPchIVB+BkcsRmpExPpdWo8yYdB8OPpbT8Hb+ORIK3mARaNS1pYM+ bDBA== X-Gm-Message-State: AFqh2kqANUXLNSqzRDACo8DmhL7mQwm6giDbCzeakv642iAoPuFXrG/g n82PCpmqGeCKAvDlzu6tJM9rzNicMSbxolh4h6UQkgNujTHxuDEKYnlmM9UsAmX9Hxs404vCPRp F10xVZRkiM5P9jtp/bhsMCwM3HVvpdql/I5XDbxIcX53yfZlJGK/QAQcfqkC37nhbdW42JUc= X-Received: by 2002:a17:906:c44:b0:7c1:700:9c4b with SMTP id t4-20020a1709060c4400b007c107009c4bmr34729082ejf.75.1672675171756; Mon, 02 Jan 2023 07:59:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXsx/Ho3GeqMO4vcIxX6Z1fBnvcIn+7W99SX5CSLx0WHc746MFPr6YJOkN1ZmcLuJ4snX0Embw== X-Received: by 2002:a17:906:c44:b0:7c1:700:9c4b with SMTP id t4-20020a1709060c4400b007c107009c4bmr34729072ejf.75.1672675171547; Mon, 02 Jan 2023 07:59:31 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 1/4] Fix test case to actually test something Date: Mon, 2 Jan 2023 16:59:21 +0100 Message-Id: <05291589a548163e235bc8d7d6b1751e7db07548.1672675104.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672675207510100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- .../input-data-client-auth-pending-failure.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/virnetdaemondata/input-data-client-auth-pending-failure.= json b/tests/virnetdaemondata/input-data-client-auth-pending-failure.json index 9c33d92e0824..da47fc7de63f 100644 --- a/tests/virnetdaemondata/input-data-client-auth-pending-failure.json +++ b/tests/virnetdaemondata/input-data-client-auth-pending-failure.json @@ -22,7 +22,7 @@ "isClient": false } ] - }, + } ], "clients": [ { @@ -38,7 +38,7 @@ "isClient": true }, "privateData": 1729 - }, + } ] } } --=20 2.39.0 From nobody Fri May 17 08:39:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672675213; cv=none; d=zohomail.com; s=zohoarc; b=e/xwxFN5feOWnKwKWKO267hmdCs231dFNpddZhzY/xXDsQcyvTQ5D1kNFfOVzDDMtaBEwUiLSitW9mhK0xD2NL04STUsWmTGO+cf9P0EcQF+X1M/v0RCT1/HEgE5Vq8J37KPFKjDoGhj/ttf1FXb66PvaGYWQfy54lX6ODS2IiM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672675213; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=97srWFE8yKi3aHFae9CuP/FMuYf/hSphT8JTld7Awh8=; b=XFP8pQYMRY7fg2/h4DsJyYaeIfk0KRbRGDOKmosrk91h8r2oxuAGbMnntd/tSNKDU+/pN5cH0IBn7pD7GNooo3Yw1uGshX5Yil3dKkJnZPxYFuMvr1nNwoPSNhq0HfiBKwWJ5becAnjliNLOv/ExBF+YBJlmpzJh9RZ0+U56z0I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1672675213577717.2013023772907; Mon, 2 Jan 2023 08:00:13 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-cpvd61UXMVijMuJuEpu58g-1; Mon, 02 Jan 2023 10:59:40 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1529A858F0E; Mon, 2 Jan 2023 15:59:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0105C140EBF5; Mon, 2 Jan 2023 15:59:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A8AA11946A45; Mon, 2 Jan 2023 15:59:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E13C6194658C for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D1D2D40147D; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CABB7492D8B for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B13261818E4B for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-180-dwISjAFvPjeYLYN2BwQ8pA-1; Mon, 02 Jan 2023 10:59:33 -0500 Received: by mail-ed1-f72.google.com with SMTP id h18-20020a05640250d200b004758e655ebeso18181231edb.11 for ; Mon, 02 Jan 2023 07:59:32 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id xa21-20020a170907b9d500b0072a881b21d8sm13089319ejc.119.2023.01.02.07.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 07:59:31 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 0E6BAC5DF281 for ; Mon, 2 Jan 2023 16:59:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672675211; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=97srWFE8yKi3aHFae9CuP/FMuYf/hSphT8JTld7Awh8=; b=dTuy454giBIG7JubvmB6LzVmZgUz+wsAg02KBhixN1QrLmX8/beFG8oDmAKI55jS1ZT2XU MwPVR88uYmCuPQkzJFQzvDfagZ83CGoDdEBqGSsLjswjJdMSn0MHEmGSkJeKj1k6YofB4p JuDzR/aMtbpWbb+H4VsuSckZ09RVtvw= X-MC-Unique: cpvd61UXMVijMuJuEpu58g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: dwISjAFvPjeYLYN2BwQ8pA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=97srWFE8yKi3aHFae9CuP/FMuYf/hSphT8JTld7Awh8=; b=GCRyMbTFrEiF3Vetq8R1mC4cI5TuILOhx0YfRCpVvMAmzAScch8VB1O2RE9mc7c7GS TwP194Vp0aALU8p/RR/vqfj3VrkAF08gzeiQd4uUZ4h1iHcIJFWrFvspGRYWJU1PI4on I4FJpitOrouWU95/jU6NFpHZZ7GYUCJ9DzlP9w/m7tzmiAibng/vQ8/7v5oZKfSU5vSm Qr1wtbgoddl5/ZwjImAKWZftXprA2ShWpyEUq/iTIdslJSRNUanDJ9RgXBDBFT23I61Y ULi89Mk6wjl7DvwfIPWGjB35R8tfL2B/uo1oojHexSGtu/aIL5dS5Ux0+JtprB8J8iDN 8nXw== X-Gm-Message-State: AFqh2koyj8r+A3rUxmEfylbGHA4kaGSMr+y1/sDSnwIPZh81Ibvej/wp PEqhbqHHQhvAFVyRHfK0vZCfkpse+qFqSp9HU3N4YmfA7oR5NihJKsQ4ksYg/mHLP57v19lm03o fq+Sl6zh8s/LGVdU4+cEpKseYCdva8SZPOEgT/4HvWJRGmZ0Aga4z40E2BXSOZ6SE75fv3oU= X-Received: by 2002:a17:907:6d98:b0:7c1:12b0:7d5d with SMTP id sb24-20020a1709076d9800b007c112b07d5dmr45755053ejc.4.1672675172119; Mon, 02 Jan 2023 07:59:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXuSnwnDt0CbzZH7LZEn0PFWRRPUdTZZJ2jIVvdBLtZaYtQWtwrDZZ9noZ23U9BqRGoF8b6s0A== X-Received: by 2002:a17:907:6d98:b0:7c1:12b0:7d5d with SMTP id sb24-20020a1709076d9800b007c112b07d5dmr45755038ejc.4.1672675171815; Mon, 02 Jan 2023 07:59:31 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 2/4] tests: Check error message in virnetdaemontest Date: Mon, 2 Jan 2023 16:59:22 +0100 Message-Id: <254bc7940f26511fb4642fe24be26000c0aff105.1672675104.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672675215581100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This way we actually check for the proper error, not any error like invalid= JSON format. Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- .../output-data-anon-clients.err | 1 + ...utput-data-client-auth-pending-failure.err | 1 + tests/virnetdaemontest.c | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 tests/virnetdaemondata/output-data-anon-clients.err create mode 100644 tests/virnetdaemondata/output-data-client-auth-pending-= failure.err diff --git a/tests/virnetdaemondata/output-data-anon-clients.err b/tests/vi= rnetdaemondata/output-data-anon-clients.err new file mode 100644 index 000000000000..6d75757bd5e0 --- /dev/null +++ b/tests/virnetdaemondata/output-data-anon-clients.err @@ -0,0 +1 @@ +internal error: Server testServer1 was not created diff --git a/tests/virnetdaemondata/output-data-client-auth-pending-failure= .err b/tests/virnetdaemondata/output-data-client-auth-pending-failure.err new file mode 100644 index 000000000000..d76079f0c94b --- /dev/null +++ b/tests/virnetdaemondata/output-data-client-auth-pending-failure.err @@ -0,0 +1 @@ +internal error: Invalid auth_pending and auth combination in JSON state do= cument diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 2a8bc0ec9343..47d0923bdd93 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -303,8 +303,8 @@ static int testExecRestart(const void *opaque) infile =3D g_strdup_printf("%s/virnetdaemondata/input-data-%s.json", a= bs_srcdir, data->jsonfile); =20 - outfile =3D g_strdup_printf("%s/virnetdaemondata/output-data-%s.json", - abs_srcdir, data->jsonfile); + outfile =3D g_strdup_printf("%s/virnetdaemondata/output-data-%s.%s", + abs_srcdir, data->jsonfile, data->pass ? "js= on" : "err"); =20 if (virFileReadAll(infile, 8192, &injsonstr) < 0) goto cleanup; @@ -331,6 +331,9 @@ static int testExecRestart(const void *opaque) if (!(outjson =3D virNetDaemonPreExecRestart(dmn))) goto cleanup; =20 + if (!data->pass) + goto cleanup; + if (!(outjsonstr =3D virJSONValueToString(outjson, true))) goto cleanup; =20 @@ -340,15 +343,15 @@ static int testExecRestart(const void *opaque) ret =3D 0; cleanup: if (ret < 0) { - if (!data->pass) { - VIR_TEST_DEBUG("Got expected error: %s", - virGetLastErrorMessage()); + if (injson && !data->pass) { + ret =3D virTestCompareToFile(virGetLastErrorMessage(), outfile= ); + if (ret < 0) + VIR_TEST_DEBUG("Test failed with different error message"); virResetLastError(); - ret =3D 0; } } else if (!data->pass) { - VIR_TEST_DEBUG("Test should have failed"); - ret =3D -1; + VIR_TEST_DEBUG("Test should have failed"); + ret =3D -1; } virObjectUnref(dmn); VIR_FORCE_CLOSE(fdserver[0]); --=20 2.39.0 From nobody Fri May 17 08:39:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672675188; cv=none; d=zohomail.com; s=zohoarc; b=VlsshPWf6XLVJtxlx6Ns8Zs0ztu0SsIXFjMjJyUUFC5rJLbj7iI/ZPJ867uJklDVYJip5yYJ4jJzht9hZuUbs7yDndpoAEiw6YyoqmUAAnfZl05/+NoOg5ZUX/gb8062CXJZoS8bGODnyX57G2ZZPcMQnf4jtTXc796oAV2+P4A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672675188; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=53p8OeZFy8p7iODRaQh0g+bI62PdW5rxmIpDp/Z77KM=; b=aBWvI0zmE2WOeLw64/jVDvoGYTodpcjqc1XZyuX0i6HwXf/a9YP43AwDP0a8QEXEbF0RQyf1+dM21dsuiDw0VOcnheIamVvfiFjgcdlxdwvDfPF46TvF+zkYV6bQCb7NJQnwcL/Qzm4ctDk4CctRlQuwuFRKL910oc+FjdI9nUg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1672675188043567.120393197015; Mon, 2 Jan 2023 07:59:48 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-173-ZqS6ioRgNMq335UoxpjeOA-1; Mon, 02 Jan 2023 10:59:39 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B4723811F21; Mon, 2 Jan 2023 15:59:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84C4F1121314; Mon, 2 Jan 2023 15:59:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 69D1F1946588; Mon, 2 Jan 2023 15:59:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DB72A1946589 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CB28B2166B2A; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C431D2166B29 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A04F31C05ACE for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-665-KLn-VBFtMVKx1riHM06wvg-1; Mon, 02 Jan 2023 10:59:33 -0500 Received: by mail-ed1-f70.google.com with SMTP id v8-20020a056402348800b0048db0688c80so1925778edc.15 for ; Mon, 02 Jan 2023 07:59:33 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id b23-20020a17090630d700b008490dcae01asm12617090ejb.214.2023.01.02.07.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 07:59:31 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 1A9F8C5DF282 for ; Mon, 2 Jan 2023 16:59:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672675187; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=53p8OeZFy8p7iODRaQh0g+bI62PdW5rxmIpDp/Z77KM=; b=V5rrbx8SbqLxOG8mKEmwURznCbWrzwev3FD+aH1jK0tvwZvKN2YTeO4SUb0FaLCcJQfQE2 1PMxalrmlagfC2njcwWabH4oJ0eBcs/gFioKoBPgYETqlPF/pRQzRrTaxyh4bU15H7ni2l dKSf5A2OpScmHyJTpnqiNZeMwI6V5iw= X-MC-Unique: ZqS6ioRgNMq335UoxpjeOA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: KLn-VBFtMVKx1riHM06wvg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=53p8OeZFy8p7iODRaQh0g+bI62PdW5rxmIpDp/Z77KM=; b=2hot/aXoOglvlnzBX/WfZtQQANRwLmSUn2H2uhFe+aH79x1zNAeIE9xfHCfC51lz1z UUHjZ+4BlnKvjjjf3dlPA+de7no+8sBToVG2ywO5+wHWFnyQyHEJta87nq7vxWfIhjqN kAT5gfXaWIP/3K9pCwHQ+fJicHToI79zw+bLyaCokrBpilV/Y72uMJ5xuZpyvPNEqotT 7R20fTmOVqDxXxiD/a4F2nknUKeNfEpyVgznv5hDw5Z/8d35FY/if9qafz6LGVFghkCm oPMHe5Y9ly+yOAzSPbtLMMd1t2lyhPYr+1B0d1LnbdHDXbxjgc/yzzu4szlAZh7a48kK Eg3g== X-Gm-Message-State: AFqh2krlAiPYzU67Txb8AL6YOYeuLyxrw8jwNEhGipCb39Vb0mJOzyO1 iS1r/fFw14nc5zwu1rjUc2KhycvIwqLcObe5wWcfirdGixJlwIapORfayqiwnN1vKmvnslBO2re MrD3rThwgYFf0UWPCToLdl/QFYa0RAZuLTJUm+8VbIt0ohGIGSvN1sExz2xtz7ol0CvQbryU= X-Received: by 2002:a17:906:158c:b0:7c4:f752:e959 with SMTP id k12-20020a170906158c00b007c4f752e959mr33500442ejd.33.1672675172238; Mon, 02 Jan 2023 07:59:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtdaz4Wz2wuLl4pvMm7NmQg5R6obGoArFNpCwl2PVp6hXnZXc9DDExNWUPw8w/bb8uexuc/9Q== X-Received: by 2002:a17:906:158c:b0:7c4:f752:e959 with SMTP id k12-20020a170906158c00b007c4f752e959mr33500437ejd.33.1672675172029; Mon, 02 Jan 2023 07:59:32 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 3/4] rpc: Fix error message in virNetServerSetClientLimits Date: Mon, 2 Jan 2023 16:59:23 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672675189430100001 Content-Type: text/plain; charset="utf-8"; x-default="true" That way it actually fits with what the condition checks for. Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- src/rpc/virnetserver.c | 6 ++-- ...nput-data-invalid-max-clients-failure.json | 31 +++++++++++++++++++ ...utput-data-invalid-max-clients-failure.err | 1 + tests/virnetdaemontest.c | 1 + 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 tests/virnetdaemondata/input-data-invalid-max-clients-f= ailure.json create mode 100644 tests/virnetdaemondata/output-data-invalid-max-clients-= failure.err diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 17ab61b88245..2ec4b9a6c947 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -1114,9 +1114,9 @@ virNetServerSetClientLimits(virNetServer *srv, =20 if (max < max_unauth) { virReportError(VIR_ERR_INVALID_ARG, "%s", - _("The overall maximum number of clients must be " - "greater than the maximum number of clients waiti= ng " - "for authentication")); + _("The overall maximum number of clients waiting " + "for authentication must not be less than the ove= rall " + "maximum number of clients")); return -1; } =20 diff --git a/tests/virnetdaemondata/input-data-invalid-max-clients-failure.= json b/tests/virnetdaemondata/input-data-invalid-max-clients-failure.json new file mode 100644 index 000000000000..9bd55929943b --- /dev/null +++ b/tests/virnetdaemondata/input-data-invalid-max-clients-failure.json @@ -0,0 +1,31 @@ +{ + "servers": { + "testServer0": { + "min_workers": 10, + "max_workers": 50, + "priority_workers": 5, + "max_clients": 5, + "max_anonymous_clients": 10, + "keepaliveInterval": 120, + "keepaliveCount": 5, + "next_client_id": 5, + "services": [ + { + "auth": 0, + "readonly": true, + "nrequests_client_max": 2, + "socks": [ + { + "fd": 100, + "errfd": -1, + "pid": 0, + "isClient": false + } + ] + } + ], + "clients": [ + ] + } + } +} diff --git a/tests/virnetdaemondata/output-data-invalid-max-clients-failure= .err b/tests/virnetdaemondata/output-data-invalid-max-clients-failure.err new file mode 100644 index 000000000000..00c2cee42c8c --- /dev/null +++ b/tests/virnetdaemondata/output-data-invalid-max-clients-failure.err @@ -0,0 +1 @@ +internal error: The overall maximum number of clients must not be less tha= n the number of clients waiting for authentication diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 47d0923bdd93..110ec748f8b6 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -413,6 +413,7 @@ mymain(void) EXEC_RESTART_TEST_FAIL("anon-clients", 2); EXEC_RESTART_TEST("client-auth-pending", 1); EXEC_RESTART_TEST_FAIL("client-auth-pending-failure", 1); + EXEC_RESTART_TEST_FAIL("invalid-max-clients-failure", 1); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.39.0 From nobody Fri May 17 08:39:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1672675180; cv=none; d=zohomail.com; s=zohoarc; b=G9qzmzcLc9jDAAyICEZ9nHdaQp5P+USVMwTpf6oHgzdZUi79PEhyEfBG/bwWxFatz5Y1dF/zr+Ompan56nu15kvg89HLO17Y0edi1LT8wVFtXrADl8iuZWsYwLXsTfZBarVqGj3FSaGbtXC3H8SeGllc7CokLY9S6VsZbTbvwg8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672675180; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=10KQT9ExGUZKlGS6wGhKjTkV+PYt08I1av/vChYFAD8=; b=QGOWM/n6J7hX18Z7UEre4DZDkrEn9gjt+q6hKmL2GkY37JSRvLXxDkDaImCAyIhOgnK/ehE87DwJMsHhWRdtvH8cSUVxMt6dUA++kGiTWEO2Ysk9HIRnDyPtwnCh/HOTcfsnQJH4I2usEC0QDYaNOS2gBZ07/By4cRiK4T8dlco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1672675180951774.6615928857049; Mon, 2 Jan 2023 07:59:40 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-653-_dIrX2AvOuG3Cxh52ZhUug-1; Mon, 02 Jan 2023 10:59:38 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CC0A86C16F; Mon, 2 Jan 2023 15:59:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7562F39D7C; Mon, 2 Jan 2023 15:59:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4076119465B7; Mon, 2 Jan 2023 15:59:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C58311946587 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B6E93492B08; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ADF7D492B07 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93C112A59571 for ; Mon, 2 Jan 2023 15:59:34 +0000 (UTC) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-324-t5t956hkMSyPjDiAH_h9bg-1; Mon, 02 Jan 2023 10:59:33 -0500 Received: by mail-ed1-f69.google.com with SMTP id h18-20020a05640250d200b004758e655ebeso18181234edb.11 for ; Mon, 02 Jan 2023 07:59:33 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id h13-20020a0564020e0d00b0046b00a9eeb5sm12745674edh.49.2023.01.02.07.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 07:59:31 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 26815C5DF283 for ; Mon, 2 Jan 2023 16:59:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672675179; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=10KQT9ExGUZKlGS6wGhKjTkV+PYt08I1av/vChYFAD8=; b=IvcIEK2lJzDUVW2ggHFinmTo1SOBXFP+XwEcdoN1EuWjlE4GPp16T/0Xhp7hGlg0RgcHON P+m2uNiCwk5AduMhrk6kGsbucGcfuELxarJL8YBnH5+56S8KibU0LdS6cjBsoM3yKn/NGM XZA+iK4TJldiFBdaDaTdcPi4i/aiwuo= X-MC-Unique: _dIrX2AvOuG3Cxh52ZhUug-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: t5t956hkMSyPjDiAH_h9bg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=10KQT9ExGUZKlGS6wGhKjTkV+PYt08I1av/vChYFAD8=; b=6/jO08cV9bnvJMYPoOdaA63O1txz36OecjcJrfKiUjIJ2xuxjsKYhiXU0tvOnLzhtR HZMJq6pbnzwuusSY4DdLX7MJ3Z1npdRosOOqHsYnGP+OxnEDez2h5MbQkaNe4+MHSIfH 3M+1N4tobNa2o0Gew6y1iUUOxjbrlRqRq25a1JNPB8hxMywwPgtluhKsBRkAIyw69BqD f/q2SNYh98xd/491JNbhorFX16bnaJS5tDzQqjIo/ItvW5Y0DM/0XdNk0SSOq7/6O75W HAveeUIUIX1SwCwvo4wxCwtkp5hpRc0K5SqBH26jCeOpzgoYwCwlUL48ykH7JRjjgyD+ TtdQ== X-Gm-Message-State: AFqh2kp/eSRucmKe2/k0IIubIVorCruAReiLqdL+aFNA/0xiV9F81vMM 8vE24MrrQdDKvLgzW1BVqjsxbSHdpiUpP36rV6REpGvSo+d8qmimlH9zi8LhGgvvyorEg0PN/hn AuYgiiltFAL6Hhv3TQUU09bySardqt27a9taKQ342on0N+6uRNpquXI4R/57IkL7+PGk2YSs= X-Received: by 2002:a17:907:cbc9:b0:7ad:b6d8:c9d0 with SMTP id vk9-20020a170907cbc900b007adb6d8c9d0mr36774408ejc.53.1672675172490; Mon, 02 Jan 2023 07:59:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtndhanJGMJ2ReRTXpc4quDCnez1M5IIymihrRgrId2mYA91vX3tgBFNRtbDZD73VFqN3iPmw== X-Received: by 2002:a17:907:cbc9:b0:7ad:b6d8:c9d0 with SMTP id vk9-20020a170907cbc900b007adb6d8c9d0mr36774399ejc.53.1672675172259; Mon, 02 Jan 2023 07:59:32 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 4/4] rpc: Check client limits in more places Date: Mon, 2 Jan 2023 16:59:24 +0100 Message-Id: <6e97520d0c0323624faa9e859d7defc3aab1af2a.1672675104.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672675181391100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2033879 Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- 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 =3D NULL; g_autofree char *jobName =3D g_strdup_printf("rpc-%s", name); =20 + if (max_clients < max_anonymous_clients) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("The overall maximum number of clients must not b= e less " + "than the number of clients waiting for authentic= ation")); + return NULL; + } + if (virNetServerInitialize() < 0) return NULL; =20 @@ -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 n= ot be less " + "than the number of clients waiting for authe= ntication")); + return NULL; + } } else { max_anonymous_clients =3D max_clients; } --=20 2.39.0