tools: efivar.py should check GUID when deleting
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 9 Jan 2021 01:09:44 +0000 (02:09 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 13 Jan 2021 01:38:00 +0000 (02:38 +0100)
When deleting a variable we must check that the GUID provided by the
user matches the GUID of the variable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
tools/efivar.py

index a02b09d46af8c0c139d069b16d737584f5265b7c..29eb90a235bbd4459a7d1e5d364289b766c8c918 100755 (executable)
@@ -149,7 +149,7 @@ class EfiVariableStore:
         offs = 0
         while offs < len(self.ents):
             var, loffs = self._next_var(offs)
-            if var.name == name and str(var.guid):
+            if var.name == name and str(var.guid) == guid:
                 if var.attrs != attrs:
                     print("err: attributes don't match")
                     exit(1)