From nobody Mon May 13 11:07:54 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=weirdnatto.in 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 1649769048505475.08833341076195; Tue, 12 Apr 2022 06:10:48 -0700 (PDT) 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-607-1uDAdFW1MJq6QYO_bZgtqA-1; Tue, 12 Apr 2022 09:10:46 -0400 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 9FBD8811E9B; Tue, 12 Apr 2022 13:10:43 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43983145F941; Tue, 12 Apr 2022 13:10:41 +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 2E50F194036A; Tue, 12 Apr 2022 13:10:39 +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 69CF11940365 for ; Tue, 12 Apr 2022 13:10:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 54AC6416369; Tue, 12 Apr 2022 13:10:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 50FB3401DAC for ; Tue, 12 Apr 2022 13:10:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 3C8341014A63 for ; Tue, 12 Apr 2022 13:10:38 +0000 (UTC) Received: from mail.weirdnatto.in (140.238.230.155 [140.238.230.155]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-374-grv8BjXWPNq_7QJm1PtD9A-1; Tue, 12 Apr 2022 09:10:36 -0400 X-MC-Unique: 1uDAdFW1MJq6QYO_bZgtqA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: grv8BjXWPNq_7QJm1PtD9A-1 From: Amneesh Singh To: libvir-list@redhat.com Subject: [PATCH] virDomainGraphicsListenDefParseXML: validate attribute 'network' for listen type 'network' Date: Tue, 12 Apr 2022 18:40:24 +0530 Message-Id: <20220412131024.100841-1-natto@weirdnatto.in> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 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: , Cc: Amneesh Singh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1649769050596100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Related: https://gitlab.com/libvirt/libvirt/-/issues/93 Signed-off-by: Amneesh Singh --- src/conf/domain_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index bd28840..f1651e3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12268,6 +12268,13 @@ virDomainGraphicsListenDefParseXML(virDomainGraphi= csListenDef *def, goto error; } def->network =3D g_steal_pointer(&network); + } else { + if (def->type =3D=3D VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("'network' attribute is required for listen " + "type 'network'")); + goto error; + } } =20 if (socketPath && socketPath[0]) { --=20 2.35.1