From patchwork Sun Dec 12 09:11:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 4919 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4JBf5v0yjSz3wsh for ; Sun, 12 Dec 2021 09:11:47 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4JBf5t3NVZzdy; Sun, 12 Dec 2021 09:11:46 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4JBf5s71Qbz2yRd; Sun, 12 Dec 2021 09:11:45 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4JBf5r4xYzz2yWd for ; Sun, 12 Dec 2021 09:11:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4JBf5q6nc8zBw for ; Sun, 12 Dec 2021 09:11:43 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1639300304; h=from:from: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; bh=xIuaPOLTopT76Y7pN/E3Sc1AtNJ55MlzZqdCmJ0qs9I=; b=NSqs9ULiuNXGwHyuPB4Z4HvU0R0QSSK9tDzJRBqD/nfP3TcSIXULtljE8n/ZRPxf1Z5X2j hattquUx1eiiRoDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1639300304; h=from:from: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; bh=xIuaPOLTopT76Y7pN/E3Sc1AtNJ55MlzZqdCmJ0qs9I=; b=Ko36pcMBH/wmdPCC+F3EfZYb16HvrwwNRTeor6N0a6eI7TPoHQQ39nOhbzcp8GriicHYwL TaTTZbWeaURUofNbBG2p7YlFPc1vXGr3is/IkjAlM3haUcGfL0KFLXVvjKVKZNB+WTksuq 96vi1JYZZ/zTasHQdGU21xqsVLVf6ean4SmkVubZZE+dKHXGATdyJuETiz2uEa7UxXtTOo DG/epElm012mRIg3kj6kSFWyD3irj98uH7P7fqyZPEKhe36ounlKq3d5Dy2SMdKMqkcKL5 ltlmXH+BiyXPFso9QXxrr7HjyobU+2Frl89dbbM9unffTMCOGFo+PoS/Brdz8Q== To: "IPFire: Location" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] location-importer: Replace "UK" with "GB" Message-ID: <7822de27-5ce9-dfbc-7408-9c5f0ecd7b2e@ipfire.org> Date: Sun, 12 Dec 2021 10:11:43 +0100 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: location-bounces@lists.ipfire.org Sender: "Location" Apparently, LACNIC does not to proper input validation on supplied country codes, so people can use "UK", while they probably mean "GB" instead. Signed-off-by: Peter Müller --- src/python/location-importer.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/location-importer.in b/src/python/location-importer.in index b791b4d..099af55 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -705,6 +705,10 @@ class CLI(object): # ... but keep this list distinct... continue + # When people set country codes to "UK", they actually mean "GB" + if val == "UK": + val = "GB" + inetnum[key].append(val) # Skip empty objects