From ac7f3c75aaa8077fe93e231f39b9e2ab96063076 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20M=C3=BCller?= Date: Sat, 9 Jul 2022 09:17:29 +0000 Subject: [PATCH] Fireinfo: Amend upstream patches for fixing #12896 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit https://bugzilla.ipfire.org/show_bug.cgi?id=12896#c16 Signed-off-by: Peter Müller --- lfs/fireinfo | 9 ++++- .../fireinfo-2.2.0-python-3.8.patch | 0 ...ystem-blacklist-jetways-product-uuid.patch | 28 ++++++++++++++ ...ignore-when-the-serial-number-is-ssn.patch | 37 +++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) rename src/patches/{ => fireinfo}/fireinfo-2.2.0-python-3.8.patch (100%) create mode 100644 src/patches/fireinfo/fireinfo-system-blacklist-jetways-product-uuid.patch create mode 100644 src/patches/fireinfo/fireinfo-system-ignore-when-the-serial-number-is-ssn.patch diff --git a/lfs/fireinfo b/lfs/fireinfo index 5c2b19c815..8b38885d60 100644 --- a/lfs/fireinfo +++ b/lfs/fireinfo @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2018 IPFire Team # +# Copyright (C) 2007-2022 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -70,7 +70,12 @@ $(subst %,%_BLAKE2,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo-2.2.0-python-3.8.patch + + # Apply upstream patches + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo/fireinfo-2.2.0-python-3.8.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo/fireinfo-system-blacklist-jetways-product-uuid.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo/fireinfo-system-ignore-when-the-serial-number-is-ssn.patch + cd $(DIR_APP) && [ -x "configure" ] || sh ./autogen.sh cd $(DIR_APP) && ./configure --prefix=/usr cd $(DIR_APP) && make $(MAKETUNING) diff --git a/src/patches/fireinfo-2.2.0-python-3.8.patch b/src/patches/fireinfo/fireinfo-2.2.0-python-3.8.patch similarity index 100% rename from src/patches/fireinfo-2.2.0-python-3.8.patch rename to src/patches/fireinfo/fireinfo-2.2.0-python-3.8.patch diff --git a/src/patches/fireinfo/fireinfo-system-blacklist-jetways-product-uuid.patch b/src/patches/fireinfo/fireinfo-system-blacklist-jetways-product-uuid.patch new file mode 100644 index 0000000000..f604d84330 --- /dev/null +++ b/src/patches/fireinfo/fireinfo-system-blacklist-jetways-product-uuid.patch @@ -0,0 +1,28 @@ +From 33be9aa38d65dace9a61247f41ac3627a6750cce Mon Sep 17 00:00:00 2001 +From: Michael Tremer +Date: Fri, 8 Jul 2022 08:30:55 +0000 +Subject: [PATCH] system: Blacklist Jetway's product UUID + +Fixes: #12896 +Signed-off-by: Michael Tremer +--- + src/fireinfo/system.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py +index 4c0b0a3..c9c81b1 100644 +--- a/src/fireinfo/system.py ++++ b/src/fireinfo/system.py +@@ -51,6 +51,9 @@ INVALID_ID_STRINGS = ( + "03000200-0400-0500-0006-000700080009", + "11111111-1111-1111-1111-111111111111", + "0000000", "00000000", ++ ++ # Jetway gives all systems the same product UUID ++ "3b903780-4f79-1018-816e-aeb2724778a7", + ) + + INVALID_ID_STRINGS_EXACT_MATCH = ( +-- +2.30.2 + diff --git a/src/patches/fireinfo/fireinfo-system-ignore-when-the-serial-number-is-ssn.patch b/src/patches/fireinfo/fireinfo-system-ignore-when-the-serial-number-is-ssn.patch new file mode 100644 index 0000000000..611bc98ce4 --- /dev/null +++ b/src/patches/fireinfo/fireinfo-system-ignore-when-the-serial-number-is-ssn.patch @@ -0,0 +1,37 @@ +From 4d74466456c0824663e10881f9deabcd1f4d32c3 Mon Sep 17 00:00:00 2001 +From: Michael Tremer +Date: Fri, 8 Jul 2022 08:31:25 +0000 +Subject: [PATCH] system: Ignore when the serial number is "SSN" + +Signed-off-by: Michael Tremer +--- + src/fireinfo/system.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py +index c9c81b1..9edc345 100644 +--- a/src/fireinfo/system.py ++++ b/src/fireinfo/system.py +@@ -44,7 +44,7 @@ INVALID_ID_STRINGS = ( + "EVAL", + "Not Applicable", + "None", "empty", +- "Serial", "System Serial Number", ++ "Serial", "System Serial Number", "SSN", + "XXXXX", + "01010101-0101-0101-0101-010101010101", + "00020003-0004-0005-0006-000700080009", +@@ -272,7 +272,9 @@ class System(object, metaclass=Singleton): + if not ids: + root_disk_serial = self.root_disk_serial + if root_disk_serial and not root_disk_serial.startswith("QM000"): +- ids.append(root_disk_serial) ++ # Skip any invalid IDs ++ if not root_disk_serial in INVALID_ID_STRINGS: ++ ids.append(root_disk_serial) + + # As last resort, we use the UUID from pakfire. + if not ids: +-- +2.30.2 + -- 2.39.5