From nobody Sun Feb 8 07:08:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1557748356; cv=none; d=zoho.com; s=zohoarc; b=bR0VuaAaOT1g6kAixzIYYzwgGt3srEybJBZr1v9VLnMetAKdR/0SIZkaK7TYmHHrMtPBTA1Kwi22zpJtw/lDEd2W7+kk9T7eqWNdD1BLX+1OtzJv8oT3O7zuyd1EVk903YzB/b6VSZKEpmYZfCf9xP5/IAyltpZmgG96duWDKCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557748356; 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:ARC-Authentication-Results; bh=TxfME8SyvENHD9EBt9+ShhFq6N1wufqDqnLyonc0BjI=; b=dxLe9Oo/qwGrAnM7tcqqCF8N+SoZaU1c1Dk7sUXoUcwnJwOxo75azVyD+7TrEcwnU1aahL/tyZMhDLCQiz9kkrm7AicFKJDbpVKkpZwvuxRY/fxZ0OZ58o0Glw7cUJJ9cEWVI3Rf0oZSge9CQ4W1fdHW9Jbgyv5YnzCBy3ednFs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557748356476201.7774379307151; Mon, 13 May 2019 04:52:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D11263086211; Mon, 13 May 2019 11:52:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D34D6B8E3; Mon, 13 May 2019 11:52:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5D31D18089FB; Mon, 13 May 2019 11:52:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4DBqMIG031041 for ; Mon, 13 May 2019 07:52:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2B35E196A8; Mon, 13 May 2019 11:52:22 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.22.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97C6F6A482; Mon, 13 May 2019 11:52:21 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 13 May 2019 12:52:03 +0100 Message-Id: <20190513115206.1088-7-berrange@redhat.com> In-Reply-To: <20190513115206.1088-1-berrange@redhat.com> References: <20190513115206.1088-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [security-notice PATCH 6/9] scripts: optimize tag to branch mapping X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 13 May 2019 11:52:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The tags have a well defined naming scheme, letting us identify the branch by simply stripping the last digit and appending '-maint'. This eliminates the need to run a query per branch. Reviewed-by: J=C3=A1n Tomko --- scripts/report-vulnerable-tags.pl | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/scripts/report-vulnerable-tags.pl b/scripts/report-vulnerable-= tags.pl index 59859b1..43f344a 100644 --- a/scripts/report-vulnerable-tags.pl +++ b/scripts/report-vulnerable-tags.pl @@ -174,34 +174,31 @@ if (defined $broken) { add_broken_tag("master", $tag); } =20 + for my $branch (get_branches($broken)) { + add_branch($branch); + } + # Now we need slower work to find branches for # few remaining tags for my $tag (get_tags("--contains", $broken)) { - next if exists $tags{$tag}; =20 - my @tagbranches =3D get_branches($tag); - if (int(@tagbranches) =3D=3D 0) { - if ($tag eq "v2.1.0") { - @tagbranches =3D ("master") - } else { - print "Tag $tag doesn't appear in any branch\n"; - next; - } + # Hack as tag was mistakenly not on master branch + if ($tag eq "v2.1.0") { + $branches{"master"}->{"brokentags"}->{$tag} =3D 1; + next; } =20 - if (int(@tagbranches) > 1) { - print "Tag $tag appears in multiple branches\n"; + die "malformed tag $tag" unless $tag =3D~ /(v.*)\.(\d+)$/; + my $branch =3D "$1-maint"; + + if (!exists $branches{$branch}) { + print "Tag $tag mapped to branch $branch which doesn't exist\n"; + next; } - my $branch =3D $tagbranches[0]; =20 - add_branch($branch); add_broken_tag($branch, $tag); } - - for my $branch (get_branches($broken)) { - add_branch($branch); - } } =20 if (defined $fixed) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list