[PATCH 1/1] tools: efivar.py should check GUID when deleting

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/1] tools: efivar.py should check GUID when deleting

Heinrich Schuchardt
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 <[hidden email]>
---
 tools/efivar.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/efivar.py b/tools/efivar.py
index a02b09d46a..29eb90a235 100755
--- a/tools/efivar.py
+++ b/tools/efivar.py
@@ -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)
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/1] tools: efivar.py should check GUID when deleting

Paulo Alcantara
Heinrich Schuchardt <[hidden email]> writes:

> 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 <[hidden email]>
> ---
>  tools/efivar.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Paulo Alcantara (SUSE) <[hidden email]>