From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8I0BISG9+mFBVQEAgWs5BA (envelope-from ) for ; Wed, 02 Feb 2022 18:19:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MAegGSG9+mGS9wAAG6o9tA (envelope-from ) for ; Wed, 02 Feb 2022 18:19:29 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E72E13A9AD for ; Wed, 2 Feb 2022 18:19:28 +0100 (CET) Received: from localhost ([::1]:39456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFJI0-00042a-3b for larch@yhetil.org; Wed, 02 Feb 2022 12:19:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFHLb-0004f6-Bo for guix-patches@gnu.org; Wed, 02 Feb 2022 10:15:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFHLb-0002RE-0n for guix-patches@gnu.org; Wed, 02 Feb 2022 10:15:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nFHLa-000599-Fz for guix-patches@gnu.org; Wed, 02 Feb 2022 10:15:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53721] [PATCH] lint: Perform fuzzy search on package names for CVE checker. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Feb 2022 15:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53721 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 53721@debbugs.gnu.org Received: via spool by 53721-submit@debbugs.gnu.org id=B53721.164381484819694 (code B ref 53721); Wed, 02 Feb 2022 15:15:02 +0000 Received: (at 53721) by debbugs.gnu.org; 2 Feb 2022 15:14:08 +0000 Received: from localhost ([127.0.0.1]:53080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFHKh-00057a-Sq for submit@debbugs.gnu.org; Wed, 02 Feb 2022 10:14:08 -0500 Received: from flashner.co.il ([178.62.234.194]:43788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFHKf-00056x-Sj for 53721@debbugs.gnu.org; Wed, 02 Feb 2022 10:14:06 -0500 Received: from localhost (unknown [31.210.177.79]) by flashner.co.il (Postfix) with ESMTPSA id 5BD7A404A9; Wed, 2 Feb 2022 15:13:59 +0000 (UTC) Date: Wed, 2 Feb 2022 17:13:25 +0200 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Maxime Devos , 53721@debbugs.gnu.org References: <839345988529640bb54feea0fa830f25bd5bb608.1643811188.git.efraim@flashner.co.il> <47b10d97f63c470b29087ec389d02c71dce038fc.camel@telenet.be> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="R6KOyuqS7ZzVGDrO" Content-Disposition: inline In-Reply-To: <47b10d97f63c470b29087ec389d02c71dce038fc.camel@telenet.be> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643822369; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=H/WabQiJkCzTz0NPYhASdZNaNGW4fKFFUm5SrE+bNh4=; b=LwJqkbhaHNvhLnw9Vxw28zJ7SqiTMl8acsuMNEkzpvylGV3iVKagjco6UnKQRmC0hvPTbM rGNRdTyQ8XEvLTe5OU+1KXJwtOl1YXK/nSi5BzqKN2790A5YC/mKcC1tqUx8vAkderUncp BPPEzm0sErmoubvE1fp7Zh1Z6deQzK1Fbcql6pgxQT/CAlBPx776sd73tuF64QHUX+u99/ EZFQjcMEfXEKpe/gyje5BQ3QuCuasf/mvCyvzBK64NVKvNZhofZkS6KA/mxzJpZPu4uD44 rbvWrJNjWY2gmk3c7hlGXOxgrUGwngFV1Otn5G9+RmPiP9vIJdKCh2cMN0aFZg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643822369; a=rsa-sha256; cv=none; b=Tg5P7LEca60X8Ygv9mTdYGA1cAJOdGOZEb//3sg5DEt/ENAbsGxViV2u7qInHxU4i8R7Mo xFVmmgiumwVJZranhe7i0uRdP0ov1Qa6o5HSzKqTVveucYkP8ReAikmsTF2IR4umJxo6tl fNExdsreyeSF0wZZgyXg0VvY4ufdayh5Ya9BVWEAi5IBu5DU1cpRVNuxfZiRKMp19MJ6zG JHqp8m3i7p6OX7m2UzVbO+A5ttqqCWn+SX0IqxJ4EHs1H7D7v0CSIxvu10gYZRmWirMMwV 0JFGi+uh6b2INwrJgGGigiiRAOCqgRg8OhBkGHK5TDLhQQXSWi8cm8tbw8o+kg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.73 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E72E13A9AD X-Spam-Score: -4.73 X-Migadu-Scanner: scn1.migadu.com X-TUID: PWZIYdKLQhz+ --R6KOyuqS7ZzVGDrO Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 02, 2022 at 03:54:38PM +0100, Maxime Devos wrote: > Efraim Flashner schreef op wo 02-02-2022 om 16:15 [+0200]: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (false-if-exception > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (first > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (filter str= ing? > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (map (lambda (prefix) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (when (string-prefix? prefix pkg-name) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (string-drop pkg-name (string-length prefix)))) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '("java-= " "perl-" "python-" "python2-" "ruby-"))))) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pkg-name))) >=20 > When can an exception happen here? I tossed in 'glibc' since I know that always has CVEs listed against it, you can't take first from an empty list. > Also, the following seems simpler and equivalent: >=20 > (any (lambda (prefix) > (and (string-prefix? prefix) > (string-drop pkg-name (string-length prefix)))) > '("java-" "perl-" "python-" "python2-" "ruby-")) That is much nicer. > It would be nice to test the code for guessing the CPE name of a > package in a few unit tests. Definitely. Also I should check if we should try dropping any of the other prefixes. rust might work, go probably needs some actual transformation to happen. > Greetings, > Maxime --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --R6KOyuqS7ZzVGDrO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmH6n5MACgkQQarn3Mo9 g1Fp9w//Ss6y5xdpRRGjGT+hD7SKiOREM5vLKpKuNMua0+GRkEguJMKO7aAmlpX3 oRXmrNWennndK/O3eoXKII4rOil0WNDQYkqvMzSwpaPGq3w3VXtYR48LD7I03/4r pLHmBEAZ1c/uRi968Rd4KqdEj8MpJecYNohSAPRR3SMncHiGd6KgiOSdSayGaeJd decUQEACFmG+MzZ46BMRo0IBsoft4hYVMsGV9n9e2c8I1Al6zLrSJf3FEML6H6gu O6ooP6u8v3qnIhxykPgtx3mwpwnpXn5cQP9Ocg8cTgaFdnRNW3uTZySqHy68EU5A nwjZNjrDpTVn6SO2bGN3DiOKhzZxNW+SsuUJsuRU7kuR9O/vkSFGbeQctGVMl7CB yfwPecSAxyplp3DiWImMsfZ42Zj09mKyrtv1juS/8a16ueB9++bkHocmrb47jttA fs6Fy3q1ZIa6G2QPSyy5p8RXvAzvcdunw1l4lf0IA5vwYA+BUia5YjHhsiPNjisD 4WEQK7I+zqONOAYFz7mZ/Q9tWF2UxJZ+lkV750AfrYCE1n9HRAjxJvdd3M6c8D2s wxarBD4a8NrDjA9UnqhfRdh9uT0vKnlZvRGmFh8/UO90uV2GyIGoOryJlYQ+yblN sTtrn3hoNMiEgpOvWoXFoDll5mReHUNg8UDd0GrweL7iw/uhqDI= =/aKL -----END PGP SIGNATURE----- --R6KOyuqS7ZzVGDrO--